Class: Openlayer::Resources::Governance::RuleResults
- Inherits:
-
Object
- Object
- Openlayer::Resources::Governance::RuleResults
- Defined in:
- lib/openlayer/resources/governance/rule_results.rb,
sig/openlayer/resources/governance/rule_results.rbs
Instance Method Summary collapse
-
#create_evidence(rule_result_id, description: nil, name: nil, storage_uri: nil, text: nil, url: nil, request_options: {}) ⇒ Openlayer::Models::Governance::RuleResultCreateEvidenceResponse
Some parameter documentations has been truncated, see Models::Governance::RuleResultCreateEvidenceParams for more details.
-
#initialize(client:) ⇒ RuleResults
constructor
private
A new instance of RuleResults.
-
#list(workspace_id, enabled_framework_only: nil, framework_id: nil, include_unframed: nil, page: nil, per_page: nil, project_id: nil, rule_id: nil, scope: nil, search_query: nil, status: nil, type: nil, request_options: {}) ⇒ Openlayer::Models::Governance::RuleResultListResponse
List rule results across a workspace.
-
#list_evidence(rule_result_id, page: nil, per_page: nil, request_options: {}) ⇒ Openlayer::Models::Governance::RuleResultListEvidenceResponse
List the evidence attached to a rule result.
-
#retrieve(rule_result_id, request_options: {}) ⇒ Openlayer::Models::Governance::RuleResultRetrieveResponse
Retrieve a rule result by its id.
-
#update(rule_result_id, assignee_id: nil, blocked_by: nil, blocking: nil, deactivated: nil, deactivated_reason: nil, request_options: {}) ⇒ Openlayer::Models::Governance::RuleResultUpdateResponse
Update a rule result.
Constructor Details
#initialize(client:) ⇒ RuleResults
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 RuleResults.
206 207 208 |
# File 'lib/openlayer/resources/governance/rule_results.rb', line 206 def initialize(client:) @client = client end |
Instance Method Details
#create_evidence(rule_result_id, description: nil, name: nil, storage_uri: nil, text: nil, url: nil, request_options: {}) ⇒ Openlayer::Models::Governance::RuleResultCreateEvidenceResponse
Some parameter documentations has been truncated, see Models::Governance::RuleResultCreateEvidenceParams for more details.
Attach evidence to a rule result, satisfying an evidence rule.
Send the field that matches the rule's evidenceType: storageUri for an
uploaded document, text for a written statement, or url for a link.
For a document, upload the file first with POST /storage/presigned-url and
send the resulting storage URI as storageUri.
Attaching evidence re-evaluates the rule result. If the rule sets
renewalCadenceDays, the renewal window restarts from this evidence.
161 162 163 164 165 166 167 168 169 170 |
# File 'lib/openlayer/resources/governance/rule_results.rb', line 161 def create_evidence(rule_result_id, params = {}) parsed, = Openlayer::Governance::RuleResultCreateEvidenceParams.dump_request(params) @client.request( method: :post, path: ["rule-results/%1$s/evidence", rule_result_id], body: parsed, model: Openlayer::Models::Governance::RuleResultCreateEvidenceResponse, options: ) end |
#list(workspace_id, enabled_framework_only: nil, framework_id: nil, include_unframed: nil, page: nil, per_page: nil, project_id: nil, rule_id: nil, scope: nil, search_query: nil, status: nil, type: nil, request_options: {}) ⇒ Openlayer::Models::Governance::RuleResultListResponse
List rule results across a workspace.
A rule result is the compliance status of one rule for one entity: a project for project-scoped rules, or the workspace itself for workspace-scoped rules. This is the endpoint to poll or export when you want your current compliance state, filtered to a framework, a project, or a status.
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/openlayer/resources/governance/rule_results.rb', line 107 def list(workspace_id, params = {}) parsed, = Openlayer::Governance::RuleResultListParams.dump_request(params) query = Openlayer::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["workspaces/%1$s/rule-results", workspace_id], query: query.transform_keys( enabled_framework_only: "enabledFrameworkOnly", framework_id: "frameworkId", include_unframed: "includeUnframed", per_page: "perPage", project_id: "projectId", rule_id: "ruleId", search_query: "searchQuery" ), model: Openlayer::Models::Governance::RuleResultListResponse, options: ) end |
#list_evidence(rule_result_id, page: nil, per_page: nil, request_options: {}) ⇒ Openlayer::Models::Governance::RuleResultListEvidenceResponse
List the evidence attached to a rule result.
Which field carries the evidence depends on the rule's evidenceType:
storageUri for uploaded documents, text for written statements, and url
for links.
191 192 193 194 195 196 197 198 199 200 201 |
# File 'lib/openlayer/resources/governance/rule_results.rb', line 191 def list_evidence(rule_result_id, params = {}) parsed, = Openlayer::Governance::RuleResultListEvidenceParams.dump_request(params) query = Openlayer::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["rule-results/%1$s/evidence", rule_result_id], query: query.transform_keys(per_page: "perPage"), model: Openlayer::Models::Governance::RuleResultListEvidenceResponse, options: ) end |
#retrieve(rule_result_id, request_options: {}) ⇒ Openlayer::Models::Governance::RuleResultRetrieveResponse
Retrieve a rule result by its id.
Alongside the status, the response carries the evaluation and renewal dates that
explain it: dateLastEvaluated and dateOfNextEvaluation for platform rules,
dateOfLatestEvidence and dateOfRenewal for evidence rules.
22 23 24 25 26 27 28 29 |
# File 'lib/openlayer/resources/governance/rule_results.rb', line 22 def retrieve(rule_result_id, params = {}) @client.request( method: :get, path: ["rule-results/%1$s", rule_result_id], model: Openlayer::Models::Governance::RuleResultRetrieveResponse, options: params[:request_options] ) end |
#update(rule_result_id, assignee_id: nil, blocked_by: nil, blocking: nil, deactivated: nil, deactivated_reason: nil, request_options: {}) ⇒ Openlayer::Models::Governance::RuleResultUpdateResponse
Update a rule result. Only the fields you send are changed.
Use this to assign an owner, or to exclude a single result from compliance
without deactivating the rule everywhere. deactivatedReason is required when
setting deactivated to true.
A result's status is computed by Openlayer and cannot be set directly.
58 59 60 61 62 63 64 65 66 67 |
# File 'lib/openlayer/resources/governance/rule_results.rb', line 58 def update(rule_result_id, params = {}) parsed, = Openlayer::Governance::RuleResultUpdateParams.dump_request(params) @client.request( method: :patch, path: ["rule-results/%1$s", rule_result_id], body: parsed, model: Openlayer::Models::Governance::RuleResultUpdateResponse, options: ) end |