Class: MethodRuby::Resources::ManagedAccounts

Inherits:
Object
  • Object
show all
Defined in:
lib/method_ruby/resources/managed_accounts.rb,
lib/method_ruby/resources/managed_accounts/transactions.rb

Overview

Method-managed accounts

Defined Under Namespace

Classes: Transactions

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ ManagedAccounts

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

Parameters:



68
69
70
71
# File 'lib/method_ruby/resources/managed_accounts.rb', line 68

def initialize(client:)
  @client = client
  @transactions = MethodRuby::Resources::ManagedAccounts::Transactions.new(client: client)
end

Instance Attribute Details

#transactionsMethodRuby::Resources::ManagedAccounts::Transactions (readonly)

Method-managed accounts



9
10
11
# File 'lib/method_ruby/resources/managed_accounts.rb', line 9

def transactions
  @transactions
end

Instance Method Details

#list(method_version:, request_options: {}) ⇒ MethodRuby::Models::ManagedAccountListResponse

Some parameter documentations has been truncated, see Models::ManagedAccountListParams for more details.

Returns all managed accounts for the team.

Parameters:

Returns:

See Also:



53
54
55
56
57
58
59
60
61
62
63
# File 'lib/method_ruby/resources/managed_accounts.rb', line 53

def list(params)
  parsed, options = MethodRuby::ManagedAccountListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "managed_accounts",
    headers: parsed.transform_keys(method_version: "method-version"),
    model: MethodRuby::Models::ManagedAccountListResponse,
    security: {secret_key: true},
    options: options
  )
end

#retrieve(macc_id, method_version:, request_options: {}) ⇒ MethodRuby::Models::ManagedAccountRetrieveResponse

Some parameter documentations has been truncated, see Models::ManagedAccountRetrieveParams for more details.

Returns a single managed account by its identifier.

Parameters:

Returns:

See Also:



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/method_ruby/resources/managed_accounts.rb', line 27

def retrieve(macc_id, params)
  parsed, options = MethodRuby::ManagedAccountRetrieveParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["managed_accounts/%1$s", macc_id],
    headers: parsed.transform_keys(method_version: "method-version"),
    model: MethodRuby::Models::ManagedAccountRetrieveResponse,
    security: {secret_key: true},
    options: options
  )
end