Class: Cerca::Resources::ApprovalRequests
- Inherits:
-
Object
- Object
- Cerca::Resources::ApprovalRequests
- Defined in:
- lib/cerca/resources/approval_requests.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ ApprovalRequests
constructor
private
A new instance of ApprovalRequests.
-
#list(agent_id, cursor: nil, limit: nil, thread_id: nil, request_options: {}) ⇒ Cerca::Internal::ApprovalRequestsCursorPage<Cerca::Models::ApprovalRequest>
Some parameter documentations has been truncated, see Models::ApprovalRequestListParams for more details.
-
#resolve(agent_id, thread_id, approval_id, decision:, grant: nil, request_options: {}) ⇒ Cerca::Models::ApprovalRequest
Create approval.
Constructor Details
#initialize(client:) ⇒ ApprovalRequests
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 ApprovalRequests.
67 68 69 |
# File 'lib/cerca/resources/approval_requests.rb', line 67 def initialize(client:) @client = client end |
Instance Method Details
#list(agent_id, cursor: nil, limit: nil, thread_id: nil, request_options: {}) ⇒ Cerca::Internal::ApprovalRequestsCursorPage<Cerca::Models::ApprovalRequest>
Some parameter documentations has been truncated, see Models::ApprovalRequestListParams for more details.
List approvals
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/cerca/resources/approval_requests.rb', line 26 def list(agent_id, params = {}) parsed, = Cerca::ApprovalRequestListParams.dump_request(params) query = Cerca::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["agents/%1$s/approvals", agent_id], query: query.transform_keys(thread_id: "threadId"), page: Cerca::Internal::ApprovalRequestsCursorPage, model: Cerca::ApprovalRequest, options: ) end |
#resolve(agent_id, thread_id, approval_id, decision:, grant: nil, request_options: {}) ⇒ Cerca::Models::ApprovalRequest
Create approval
53 54 55 56 57 58 59 60 61 62 |
# File 'lib/cerca/resources/approval_requests.rb', line 53 def resolve(agent_id, thread_id, approval_id, params) parsed, = Cerca::ApprovalRequestResolveParams.dump_request(params) @client.request( method: :post, path: ["agents/%1$s/threads/%2$s/approvals/%3$s", agent_id, thread_id, approval_id], body: parsed, model: Cerca::ApprovalRequest, options: ) end |