Class: ModernTreasury::Resources::AccountDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/modern_treasury/resources/account_details.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ AccountDetails

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

Parameters:



143
144
145
# File 'lib/modern_treasury/resources/account_details.rb', line 143

def initialize(client:)
  @client = client
end

Instance Method Details

#create(account_id, accounts_type: , account_number: , account_number_type: nil, request_options: {}) ⇒ ModernTreasury::Models::AccountDetail

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

Create an account detail for an external account.

Parameters:

Returns:

See Also:



26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/modern_treasury/resources/account_details.rb', line 26

def create(, params)
  parsed, options = ModernTreasury::AccountDetailCreateParams.dump_request(params)
  accounts_type =
    parsed.delete(:accounts_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :post,
    path: ["api/%1$s/%2$s/account_details", accounts_type, ],
    body: parsed,
    model: ModernTreasury::AccountDetail,
    options: options
  )
end

#delete(id, accounts_type: , account_id: , request_options: {}) ⇒ nil

Delete a single account detail for an external account.

Parameters:

Returns:

  • (nil)

See Also:



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/modern_treasury/resources/account_details.rb', line 122

def delete(id, params)
  parsed, options = ModernTreasury::AccountDetailDeleteParams.dump_request(params)
  accounts_type =
    parsed.delete(:accounts_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
   =
    parsed.delete(:account_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :delete,
    path: ["api/%1$s/%2$s/account_details/%3$s", accounts_type, , id],
    model: NilClass,
    options: options
  )
end

#list(account_id, accounts_type: , after_cursor: nil, per_page: nil, request_options: {}) ⇒ ModernTreasury::Internal::Page<ModernTreasury::Models::AccountDetail>

Get a list of account details for a single internal or external account.

Parameters:

Returns:

See Also:



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/modern_treasury/resources/account_details.rb', line 91

def list(, params)
  parsed, options = ModernTreasury::AccountDetailListParams.dump_request(params)
  accounts_type =
    parsed.delete(:accounts_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["api/%1$s/%2$s/account_details", accounts_type, ],
    query: parsed,
    page: ModernTreasury::Internal::Page,
    model: ModernTreasury::AccountDetail,
    options: options
  )
end

#retrieve(id, accounts_type: , account_id: , request_options: {}) ⇒ ModernTreasury::Models::AccountDetail

Get a single account detail for a single internal or external account.

Parameters:

Returns:

See Also:



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/modern_treasury/resources/account_details.rb', line 56

def retrieve(id, params)
  parsed, options = ModernTreasury::AccountDetailRetrieveParams.dump_request(params)
  accounts_type =
    parsed.delete(:accounts_type) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
   =
    parsed.delete(:account_id) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["api/%1$s/%2$s/account_details/%3$s", accounts_type, , id],
    model: ModernTreasury::AccountDetail,
    options: options
  )
end