Class: Cerca::Resources::Auth

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Auth

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 Auth.

Parameters:



56
57
58
# File 'lib/cerca/resources/auth.rb', line 56

def initialize(client:)
  @client = client
end

Instance Method Details

#context(request_options: {}) ⇒ Cerca::Models::AuthContextResponse

Retrieve context

Parameters:

Returns:

See Also:



15
16
17
18
19
20
21
22
# File 'lib/cerca/resources/auth.rb', line 15

def context(params = {})
  @client.request(
    method: :get,
    path: "auth/context",
    model: Cerca::AuthContextResponse,
    options: params[:request_options]
  )
end

#list_fleets(cursor: nil, limit: nil, request_options: {}) ⇒ Cerca::Internal::FleetsCursorPage<Cerca::Models::Fleet>

Some parameter documentations has been truncated, see Models::AuthListFleetsParams for more details.

List fleets

Parameters:

  • 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:



40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/cerca/resources/auth.rb', line 40

def list_fleets(params = {})
  parsed, options = Cerca::AuthListFleetsParams.dump_request(params)
  query = Cerca::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "auth/fleets",
    query: query,
    page: Cerca::Internal::FleetsCursorPage,
    model: Cerca::Fleet,
    options: options
  )
end