Class: ModernTreasury::Resources::AccountDetails
- Inherits:
-
Object
- Object
- ModernTreasury::Resources::AccountDetails
- Defined in:
- lib/modern_treasury/resources/account_details.rb
Instance Method Summary collapse
-
#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.
-
#delete(id, accounts_type: , account_id: , request_options: {}) ⇒ nil
Delete a single account detail for an external account.
-
#initialize(client:) ⇒ AccountDetails
constructor
private
A new instance of AccountDetails.
-
#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.
-
#retrieve(id, accounts_type: , account_id: , request_options: {}) ⇒ ModernTreasury::Models::AccountDetail
Get a single account detail for a single internal or external account.
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.
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.
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(account_id, params) parsed, = 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, account_id], body: parsed, model: ModernTreasury::AccountDetail, options: ) end |
#delete(id, accounts_type: , account_id: , request_options: {}) ⇒ nil
Delete a single account detail for an external account.
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, = ModernTreasury::AccountDetailDeleteParams.dump_request(params) accounts_type = parsed.delete(:accounts_type) do raise ArgumentError.new("missing required path argument #{_1}") end account_id = 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, account_id, id], model: NilClass, 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.
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(account_id, params) parsed, = 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, account_id], query: parsed, page: ModernTreasury::Internal::Page, model: ModernTreasury::AccountDetail, 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.
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, = ModernTreasury::AccountDetailRetrieveParams.dump_request(params) accounts_type = parsed.delete(:accounts_type) do raise ArgumentError.new("missing required path argument #{_1}") end account_id = 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, account_id, id], model: ModernTreasury::AccountDetail, options: ) end |