Class: Openlayer::Resources::Governance::Frameworks::Sections

Inherits:
Object
  • Object
show all
Defined in:
lib/openlayer/resources/governance/frameworks/sections.rb,
sig/openlayer/resources/governance/frameworks/sections.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Sections

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Sections.

Parameters:



65
66
67
# File 'lib/openlayer/resources/governance/frameworks/sections.rb', line 65

def initialize(client:)
  @client = client
end

Instance Method Details

#list_rules(section_id, framework_id:, include_results: nil, include_subsection_rules: nil, page: nil, per_page: nil, project_id: nil, status: nil, request_options: {}) ⇒ Openlayer::Models::Governance::Frameworks::SectionListRulesResponse

Some parameter documentations has been truncated, see Models::Governance::Frameworks::SectionListRulesParams for more details.

List the rules mapped to a section of a framework document.

Pass includeSubsectionRules=true to also return the rules mapped to the section's subsections, which is how you get every rule covering a requirement and everything under it.

Parameters:

  • section_id (String) —

    Path param: The framework document section id.

  • framework_id (String) —

    Path param: The framework id.

  • include_results (Boolean) —

    Query param: Whether to include each rule's results inline, in a results array

  • include_subsection_rules (Boolean) —

    Query param: Whether to also include the rules mapped to the section's subsectio

  • page (Integer) —

    Query param: The page to return in a paginated query.

  • per_page (Integer) —

    Query param: Maximum number of items to return per page.

  • project_id (String) —

    Query param: Only include items that apply to this project.

  • status (Symbol, Openlayer::Models::Governance::Frameworks::SectionListRulesParams::Status) —

    Query param: Only include items whose rule result has this compliance status.

  • request_options (Openlayer::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/openlayer/resources/governance/frameworks/sections.rb', line 41

def list_rules(section_id, params)
  parsed, options = Openlayer::Governance::Frameworks::SectionListRulesParams.dump_request(params)
  query = Openlayer::Internal::Util.encode_query_params(parsed)
  framework_id =
    parsed.delete(:framework_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["frameworks/%1$s/sections/%2$s/rules", framework_id, section_id],
    query: query.transform_keys(
      include_results: "includeResults",
      include_subsection_rules: "includeSubsectionRules",
      per_page: "perPage",
      project_id: "projectId"
    ),
    model: Openlayer::Models::Governance::Frameworks::SectionListRulesResponse,
    options: options
  )
end