Class: ModernTreasury::Resources::VirtualAccountSettings

Inherits:
Object
  • Object
show all
Defined in:
lib/modern_treasury/resources/virtual_account_settings.rb,
sig/modern_treasury/resources/virtual_account_settings.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ VirtualAccountSettings

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

Parameters:



76
77
78
# File 'lib/modern_treasury/resources/virtual_account_settings.rb', line 76

def initialize(client:)
  @client = client
end

Instance Method Details

#create(allocation_type:, internal_account_id:, allocation_identifier: nil, allocation_length: nil, allocation_range_end: nil, allocation_range_start: nil, external_id: nil, generated_allocation_identifier_length: nil, request_options: {}) ⇒ ModernTreasury::Models::VirtualAccountSetting

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

Create a virtual account setting.

Parameters:

  • allocation_type (String) —

    The method used to allocate virtual account numbers.

  • internal_account_id (String) —

    The ID of the internal account for the virtual account setting.

  • allocation_identifier (String, nil) —

    The prefix, suffix, or bank-assigned identifier for the virtual account numbers.

  • allocation_length (Integer, nil) —

    The total length of generated virtual account numbers.

  • allocation_range_end (String, nil) —

    The inclusive end of the virtual account number range.

  • allocation_range_start (String, nil) —

    The inclusive start of the virtual account number range.

  • external_id (String, nil) —

    A user-defined identifier for the virtual account setting.

  • generated_allocation_identifier_length (Integer, nil) —

    The length of a generated virtual account setting prefix.

  • request_options (ModernTreasury::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



34
35
36
37
38
39
40
41
42
43
# File 'lib/modern_treasury/resources/virtual_account_settings.rb', line 34

def create(params)
  parsed, options = ModernTreasury::VirtualAccountSettingCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "api/virtual_account_settings",
    body: parsed,
    model: ModernTreasury::VirtualAccountSetting,
    options: options
  )
end

#list(after_cursor: nil, external_id: nil, per_page: nil, request_options: {}) ⇒ ModernTreasury::Internal::Page<ModernTreasury::Models::VirtualAccountSetting>

List virtual account settings.

Parameters:

  • after_cursor (String, nil)
  • external_id (String) —

    A user-defined identifier for the virtual account setting.

  • per_page (Integer)
  • request_options (ModernTreasury::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/modern_treasury/resources/virtual_account_settings.rb', line 60

def list(params = {})
  parsed, options = ModernTreasury::VirtualAccountSettingListParams.dump_request(params)
  query = ModernTreasury::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "api/virtual_account_settings",
    query: query,
    page: ModernTreasury::Internal::Page,
    model: ModernTreasury::VirtualAccountSetting,
    options: options
  )
end