Class: Cadenya::Resources::Accounts
- Inherits:
-
Object
- Object
- Cadenya::Resources::Accounts
- Defined in:
- lib/cadenya/resources/accounts.rb
Instance Method Summary collapse
-
#initialize(core) ⇒ Accounts
constructor
A new instance of Accounts.
-
#retrieve(request_options: nil) ⇒ Object
Retrieves the current account for the token accessing the API.
-
#rotate_challenge_token(request_options: nil) ⇒ Object
Rotates the challenge token for the account.
-
#rotate_webhook_signing_key(request_options: nil) ⇒ Object
Rotates the webhook signing key for the account.
Constructor Details
#initialize(core) ⇒ Accounts
Returns a new instance of Accounts.
8 9 10 |
# File 'lib/cadenya/resources/accounts.rb', line 8 def initialize(core) @core = core end |
Instance Method Details
#retrieve(request_options: nil) ⇒ Object
Retrieves the current account for the token accessing the API
13 14 15 16 17 |
# File 'lib/cadenya/resources/accounts.rb', line 13 def retrieve(request_options: nil) _path = "/v1/account" _data = @core.request(:get, _path, request_options: ) Types::Account.from_json(_data) end |
#rotate_challenge_token(request_options: nil) ⇒ Object
Rotates the challenge token for the account
20 21 22 23 24 |
# File 'lib/cadenya/resources/accounts.rb', line 20 def rotate_challenge_token(request_options: nil) _path = "/v1/account:rotateChallengeToken" _data = @core.request(:post, _path, request_options: ) Types::RotateChallengeTokenResponse.from_json(_data) end |
#rotate_webhook_signing_key(request_options: nil) ⇒ Object
Rotates the webhook signing key for the account
27 28 29 30 31 |
# File 'lib/cadenya/resources/accounts.rb', line 27 def rotate_webhook_signing_key(request_options: nil) _path = "/v1/account:rotateWebhookSigningKey" _data = @core.request(:post, _path, request_options: ) Types::RotateWebhookEventsHmacSecretResponse.from_json(_data) end |