Class: Cerca::Resources::ApprovalGrants

Inherits:
Object
  • Object
show all
Defined in:
lib/cerca/resources/approval_grants.rb

Instance Method Summary collapse

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.

Parameters:



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

Parameters:

Returns:

See Also:



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

Parameters:

  • agent_id (String)
  • thread_id (String)
  • grant_id (String)
  • request_options (Cerca::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



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

Parameters:

  • agent_id (String)
  • cursor (String)

    Opaque pagination cursor returned by a previous request.

  • limit (String)

    Maximum number of items to return. Defaults to 20 and preserves parseInt semanti

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

Returns:

See Also:



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, options = 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: options
  )
end

#list_for_thread(agent_id, thread_id, request_options: {}) ⇒ Array<Cerca::Models::ApprovalGrant>

List approval grants

Parameters:

  • agent_id (String)
  • thread_id (String)
  • request_options (Cerca::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



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