Class: Cadenya::Resources::Profiles
- Inherits:
-
Object
- Object
- Cadenya::Resources::Profiles
- 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
-
#initialize(client:) ⇒ Profiles
constructor
private
A new instance of Profiles.
-
#whoami(request_options: {}) ⇒ Cadenya::Models::Profile
Retrieves the profile of the authenticated caller.
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.
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.
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 |