Class: ModernTreasury::Resources::RoutingDetails
- Inherits:
-
Object
- Object
- ModernTreasury::Resources::RoutingDetails
- Defined in:
- lib/modern_treasury/resources/routing_details.rb
Instance Method Summary collapse
-
#create(account_id, accounts_type: , routing_number: , routing_number_type: , payment_type: nil, request_options: {}) ⇒ ModernTreasury::Models::RoutingDetail
Some parameter documentations has been truncated, see Models::RoutingDetailCreateParams for more details.
-
#delete(id, accounts_type: , account_id: , request_options: {}) ⇒ nil
Delete a routing detail for a single external account.
-
#initialize(client:) ⇒ RoutingDetails
constructor
private
A new instance of RoutingDetails.
-
#list(account_id, accounts_type: , after_cursor: nil, per_page: nil, request_options: {}) ⇒ ModernTreasury::Internal::Page<ModernTreasury::Models::RoutingDetail>
Get a list of routing details for a single internal or external account.
-
#retrieve(id, accounts_type: , account_id: , request_options: {}) ⇒ ModernTreasury::Models::RoutingDetail
Get a single routing detail for a single internal or external account.
Constructor Details
#initialize(client:) ⇒ RoutingDetails
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 RoutingDetails.
145 146 147 |
# File 'lib/modern_treasury/resources/routing_details.rb', line 145 def initialize(client:) @client = client end |
Instance Method Details
#create(account_id, accounts_type: , routing_number: , routing_number_type: , payment_type: nil, request_options: {}) ⇒ ModernTreasury::Models::RoutingDetail
Some parameter documentations has been truncated, see Models::RoutingDetailCreateParams for more details.
Create a routing detail for a single external account.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/modern_treasury/resources/routing_details.rb', line 28 def create(account_id, params) parsed, = ModernTreasury::RoutingDetailCreateParams.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/routing_details", accounts_type, account_id], body: parsed, model: ModernTreasury::RoutingDetail, options: ) end |
#delete(id, accounts_type: , account_id: , request_options: {}) ⇒ nil
Delete a routing detail for a single external account.
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/modern_treasury/resources/routing_details.rb', line 124 def delete(id, params) parsed, = ModernTreasury::RoutingDetailDeleteParams.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/routing_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::RoutingDetail>
Get a list of routing details for a single internal or external account.
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/modern_treasury/resources/routing_details.rb', line 93 def list(account_id, params) parsed, = ModernTreasury::RoutingDetailListParams.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/routing_details", accounts_type, account_id], query: parsed, page: ModernTreasury::Internal::Page, model: ModernTreasury::RoutingDetail, options: ) end |
#retrieve(id, accounts_type: , account_id: , request_options: {}) ⇒ ModernTreasury::Models::RoutingDetail
Get a single routing detail for a single internal or external account.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/modern_treasury/resources/routing_details.rb', line 58 def retrieve(id, params) parsed, = ModernTreasury::RoutingDetailRetrieveParams.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/routing_details/%3$s", accounts_type, account_id, id], model: ModernTreasury::RoutingDetail, options: ) end |