Class: Cadenya::Resources::Account

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

Overview

Manage the authenticated account. Accounts are the top-level organizational unit and contain one or more workspaces.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Account

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

Parameters:



48
49
50
# File 'lib/cadenya/resources/account.rb', line 48

def initialize(client:)
  @client = client
end

Instance Method Details

#retrieve(request_options: {}) ⇒ Cadenya::Models::AccountAPI

Retrieves the current account for the token accessing the API. Useful to check if the credentials are valid.

Parameters:

Returns:

See Also:



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

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

#rotate_webhook_signing_key(request_options: {}) ⇒ Cadenya::Models::RotateWebhookSigningKeyResponse

Rotates the webhook signing key for the account. Returns only the new key.

Parameters:

Returns:

See Also:



36
37
38
39
40
41
42
43
# File 'lib/cadenya/resources/account.rb', line 36

def rotate_webhook_signing_key(params = {})
  @client.request(
    method: :post,
    path: "v1/account/rotate_webhook_signing_key",
    model: Cadenya::RotateWebhookSigningKeyResponse,
    options: params[:request_options]
  )
end