Class: Cadenya::Resources::Account

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

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:



67
68
69
# File 'lib/cadenya/resources/account.rb', line 67

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_challenge_token(request_options: {}) ⇒ Cadenya::Models::RotateChallengeTokenResponse

Rotates the challenge token sent in the X-Cadenya-Challenge-Token header on MCP tools/list requests. Returns only the new token.

Parameters:

Returns:

See Also:



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

def rotate_challenge_token(params = {})
  @client.request(
    method: :post,
    path: "v1/account:rotateChallengeToken",
    model: Cadenya::RotateChallengeTokenResponse,
    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:



55
56
57
58
59
60
61
62
# File 'lib/cadenya/resources/account.rb', line 55

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