Class: ModernTreasury::Resources::Counterparties
- Inherits:
-
Object
- Object
- ModernTreasury::Resources::Counterparties
- Defined in:
- lib/modern_treasury/resources/counterparties.rb
Instance Method Summary collapse
-
#collect_account(id, direction: , custom_redirect: nil, fields: nil, send_email: nil, request_options: {}) ⇒ ModernTreasury::Models::CounterpartyCollectAccountResponse
Some parameter documentations has been truncated, see Models::CounterpartyCollectAccountParams for more details.
-
#create(name: , accounting: nil, accounts: nil, email: nil, external_id: nil, ledger_type: nil, legal_entity: nil, legal_entity_id: nil, metadata: nil, send_remittance_advice: nil, taxpayer_identifier: nil, verification_status: nil, request_options: {}) ⇒ ModernTreasury::Models::Counterparty
Some parameter documentations has been truncated, see Models::CounterpartyCreateParams for more details.
-
#delete(id, request_options: {}) ⇒ nil
Deletes a given counterparty.
-
#initialize(client:) ⇒ Counterparties
constructor
private
A new instance of Counterparties.
-
#list(after_cursor: nil, created_at_lower_bound: nil, created_at_upper_bound: nil, email: nil, external_id: nil, legal_entity_id: nil, metadata: nil, name: nil, per_page: nil, request_options: {}) ⇒ ModernTreasury::Internal::Page<ModernTreasury::Models::Counterparty>
Some parameter documentations has been truncated, see Models::CounterpartyListParams for more details.
-
#retrieve(id, request_options: {}) ⇒ ModernTreasury::Models::Counterparty
Get details on a single counterparty.
-
#update(id, email: nil, legal_entity_id: nil, metadata: nil, name: nil, send_remittance_advice: nil, taxpayer_identifier: nil, request_options: {}) ⇒ ModernTreasury::Models::Counterparty
Some parameter documentations has been truncated, see Models::CounterpartyUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ Counterparties
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 Counterparties.
208 209 210 |
# File 'lib/modern_treasury/resources/counterparties.rb', line 208 def initialize(client:) @client = client end |
Instance Method Details
#collect_account(id, direction: , custom_redirect: nil, fields: nil, send_email: nil, request_options: {}) ⇒ ModernTreasury::Models::CounterpartyCollectAccountResponse
Some parameter documentations has been truncated, see Models::CounterpartyCollectAccountParams for more details.
Send an email requesting account details.
194 195 196 197 198 199 200 201 202 203 |
# File 'lib/modern_treasury/resources/counterparties.rb', line 194 def collect_account(id, params) parsed, = ModernTreasury::CounterpartyCollectAccountParams.dump_request(params) @client.request( method: :post, path: ["api/counterparties/%1$s/collect_account", id], body: parsed, model: ModernTreasury::CounterpartyCollectAccountResponse, options: ) end |
#create(name: , accounting: nil, accounts: nil, email: nil, external_id: nil, ledger_type: nil, legal_entity: nil, legal_entity_id: nil, metadata: nil, send_remittance_advice: nil, taxpayer_identifier: nil, verification_status: nil, request_options: {}) ⇒ ModernTreasury::Models::Counterparty
Some parameter documentations has been truncated, see Models::CounterpartyCreateParams for more details.
Create a new counterparty.
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/modern_treasury/resources/counterparties.rb', line 42 def create(params) parsed, = ModernTreasury::CounterpartyCreateParams.dump_request(params) @client.request( method: :post, path: "api/counterparties", body: parsed, model: ModernTreasury::Counterparty, options: ) end |
#delete(id, request_options: {}) ⇒ nil
Deletes a given counterparty.
163 164 165 166 167 168 169 170 |
# File 'lib/modern_treasury/resources/counterparties.rb', line 163 def delete(id, params = {}) @client.request( method: :delete, path: ["api/counterparties/%1$s", id], model: NilClass, options: params[:request_options] ) end |
#list(after_cursor: nil, created_at_lower_bound: nil, created_at_upper_bound: nil, email: nil, external_id: nil, legal_entity_id: nil, metadata: nil, name: nil, per_page: nil, request_options: {}) ⇒ ModernTreasury::Internal::Page<ModernTreasury::Models::Counterparty>
Some parameter documentations has been truncated, see Models::CounterpartyListParams for more details.
Get a paginated list of all counterparties.
140 141 142 143 144 145 146 147 148 149 150 |
# File 'lib/modern_treasury/resources/counterparties.rb', line 140 def list(params = {}) parsed, = ModernTreasury::CounterpartyListParams.dump_request(params) @client.request( method: :get, path: "api/counterparties", query: parsed, page: ModernTreasury::Internal::Page, model: ModernTreasury::Counterparty, options: ) end |
#retrieve(id, request_options: {}) ⇒ ModernTreasury::Models::Counterparty
Get details on a single counterparty.
64 65 66 67 68 69 70 71 |
# File 'lib/modern_treasury/resources/counterparties.rb', line 64 def retrieve(id, params = {}) @client.request( method: :get, path: ["api/counterparties/%1$s", id], model: ModernTreasury::Counterparty, options: params[:request_options] ) end |
#update(id, email: nil, legal_entity_id: nil, metadata: nil, name: nil, send_remittance_advice: nil, taxpayer_identifier: nil, request_options: {}) ⇒ ModernTreasury::Models::Counterparty
Some parameter documentations has been truncated, see Models::CounterpartyUpdateParams for more details.
Updates a given counterparty with new information.
99 100 101 102 103 104 105 106 107 108 |
# File 'lib/modern_treasury/resources/counterparties.rb', line 99 def update(id, params = {}) parsed, = ModernTreasury::CounterpartyUpdateParams.dump_request(params) @client.request( method: :patch, path: ["api/counterparties/%1$s", id], body: parsed, model: ModernTreasury::Counterparty, options: ) end |