Class: Cadenya::Resources::Profiles

Inherits:
Object
  • Object
show all
Defined in:
lib/cadenya/resources/profiles.rb

Overview

Operations on profiles, the account-level principals (users, API keys, system) that authenticate against the API.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Profiles

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

Parameters:



30
31
32
# File 'lib/cadenya/resources/profiles.rb', line 30

def initialize(client:)
  @client = client
end

Instance Method Details

#whoami(request_options: {}) ⇒ Cadenya::Models::Profile

Retrieves the profile of the authenticated caller. Useful to check which principal a token belongs to.

Parameters:

Returns:

See Also:



18
19
20
21
22
23
24
25
# File 'lib/cadenya/resources/profiles.rb', line 18

def whoami(params = {})
  @client.request(
    method: :get,
    path: "v1/whoami",
    model: Cadenya::Profile,
    options: params[:request_options]
  )
end