Class: Cerca::Resources::ApprovalGrants
- Inherits:
-
Object
- Object
- Cerca::Resources::ApprovalGrants
- Defined in:
- lib/cerca/resources/approval_grants.rb
Instance Method Summary collapse
-
#delete(agent_id, grant_id, request_options: {}) ⇒ Cerca::Models::ApprovalGrantDeleteResponse
Delete approval grant.
-
#delete_for_thread(agent_id, thread_id, grant_id, request_options: {}) ⇒ Cerca::Models::ApprovalGrantDeleteForThreadResponse
Delete approval grant.
-
#initialize(client:) ⇒ ApprovalGrants
constructor
private
A new instance of ApprovalGrants.
-
#list(agent_id, cursor: nil, limit: nil, request_options: {}) ⇒ Cerca::Internal::GrantsCursorPage<Cerca::Models::ApprovalGrant>
Some parameter documentations has been truncated, see Models::ApprovalGrantListParams for more details.
-
#list_for_thread(agent_id, thread_id, request_options: {}) ⇒ Array<Cerca::Models::ApprovalGrant>
List approval grants.
Constructor Details
#initialize(client:) ⇒ ApprovalGrants
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 ApprovalGrants.
101 102 103 |
# File 'lib/cerca/resources/approval_grants.rb', line 101 def initialize(client:) @client = client end |
Instance Method Details
#delete(agent_id, grant_id, request_options: {}) ⇒ Cerca::Models::ApprovalGrantDeleteResponse
Delete approval grant
48 49 50 51 52 53 54 55 |
# File 'lib/cerca/resources/approval_grants.rb', line 48 def delete(agent_id, grant_id, params = {}) @client.request( method: :delete, path: ["agents/%1$s/approval-grants/%2$s", agent_id, grant_id], model: Cerca::Models::ApprovalGrantDeleteResponse, options: params[:request_options] ) end |
#delete_for_thread(agent_id, thread_id, grant_id, request_options: {}) ⇒ Cerca::Models::ApprovalGrantDeleteForThreadResponse
Delete approval grant
69 70 71 72 73 74 75 76 |
# File 'lib/cerca/resources/approval_grants.rb', line 69 def delete_for_thread(agent_id, thread_id, grant_id, params = {}) @client.request( method: :delete, path: ["agents/%1$s/threads/%2$s/approval-grants/%3$s", agent_id, thread_id, grant_id], model: Cerca::Models::ApprovalGrantDeleteForThreadResponse, options: params[:request_options] ) end |
#list(agent_id, cursor: nil, limit: nil, request_options: {}) ⇒ Cerca::Internal::GrantsCursorPage<Cerca::Models::ApprovalGrant>
Some parameter documentations has been truncated, see Models::ApprovalGrantListParams for more details.
List approval grants
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/cerca/resources/approval_grants.rb', line 24 def list(agent_id, params = {}) parsed, = Cerca::ApprovalGrantListParams.dump_request(params) query = Cerca::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["agents/%1$s/approval-grants", agent_id], query: query, page: Cerca::Internal::GrantsCursorPage, model: Cerca::ApprovalGrant, options: ) end |
#list_for_thread(agent_id, thread_id, request_options: {}) ⇒ Array<Cerca::Models::ApprovalGrant>
List approval grants
89 90 91 92 93 94 95 96 |
# File 'lib/cerca/resources/approval_grants.rb', line 89 def list_for_thread(agent_id, thread_id, params = {}) @client.request( method: :get, path: ["agents/%1$s/threads/%2$s/approval-grants", agent_id, thread_id], model: Cerca::Internal::Type::ArrayOf[Cerca::ApprovalGrant], options: params[:request_options] ) end |