Class: ModernTreasury::Resources::RoutingDetails

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

Instance Method Summary collapse

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.

Parameters:



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.

Parameters:

Returns:

See Also:



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(, params)
  parsed, options = 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, ],
    body: parsed,
    model: ModernTreasury::RoutingDetail,
    options: options
  )
end

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

Delete a routing detail for a single external account.

Parameters:

Returns:

  • (nil)

See Also:



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, options = ModernTreasury::RoutingDetailDeleteParams.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/routing_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::RoutingDetail>

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

Parameters:

Returns:

See Also:



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(, params)
  parsed, options = 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, ],
    query: parsed,
    page: ModernTreasury::Internal::Page,
    model: ModernTreasury::RoutingDetail,
    options: 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.

Parameters:

Returns:

See Also:



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, options = ModernTreasury::RoutingDetailRetrieveParams.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/routing_details/%3$s", accounts_type, , id],
    model: ModernTreasury::RoutingDetail,
    options: options
  )
end