Class: Infrawrench::WorkflowApprovalsNamespace
- Inherits:
-
Object
- Object
- Infrawrench::WorkflowApprovalsNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.workflow_approvals
Instance Method Summary collapse
-
#approve(id:, org_id: nil, request_options: nil) ⇒ Hash
Approve a pending workflow approval request.
-
#deny(id:, org_id: nil, request_options: nil) ⇒ Hash
Deny a pending workflow approval request.
-
#initialize(transport) ⇒ WorkflowApprovalsNamespace
constructor
private
A new instance of WorkflowApprovalsNamespace.
-
#list(org_id: nil, status: nil, workflow_id: nil, run_id: nil, request_options: nil) ⇒ Array<Hash>
List workflow approval requests.
Constructor Details
#initialize(transport) ⇒ WorkflowApprovalsNamespace
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 WorkflowApprovalsNamespace.
6631 6632 6633 |
# File 'lib/infrawrench/client.rb', line 6631 def initialize(transport) @transport = transport end |
Instance Method Details
#approve(id:, org_id: nil, request_options: nil) ⇒ Hash
Approve a pending workflow approval request
The suspended run resumes within a few seconds of the decision landing.
Requires permission: workflows:approve.
POST /api/org/orgId/workflow-approvals/id/approve
Raises on 404: Not found
Raises on 409: Conflict
6653 6654 6655 6656 6657 6658 6659 6660 |
# File 'lib/infrawrench/client.rb', line 6653 def approve(id:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/workflow-approvals/{id}/approve", path_params: { "orgId" => org_id, "id" => id }, request_options: ) end |
#deny(id:, org_id: nil, request_options: nil) ⇒ Hash
Deny a pending workflow approval request
Denial fails the waiting infra.waitForApproval(...) call in the run.
Requires permission: workflows:approve.
POST /api/org/orgId/workflow-approvals/id/deny
Raises on 404: Not found
Raises on 409: Conflict
6680 6681 6682 6683 6684 6685 6686 6687 |
# File 'lib/infrawrench/client.rb', line 6680 def deny(id:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/workflow-approvals/{id}/deny", path_params: { "orgId" => org_id, "id" => id }, request_options: ) end |
#list(org_id: nil, status: nil, workflow_id: nil, run_id: nil, request_options: nil) ⇒ Array<Hash>
List workflow approval requests
Approval requests raised by infra.waitForApproval(...) inside workflow
runs, newest first. Filter with status=pending to build an approvals
inbox.
Requires permission: workflows:read.
GET /api/org/orgId/workflow-approvals
Raises on 400: Bad request
6710 6711 6712 6713 6714 6715 6716 6717 6718 |
# File 'lib/infrawrench/client.rb', line 6710 def list(org_id: nil, status: nil, workflow_id: nil, run_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/workflow-approvals", path_params: { "orgId" => org_id }, query: { "status" => status, "workflowId" => workflow_id, "runId" => run_id }, request_options: ) end |