modern_treasury 0.29.2 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/README.md +1 -1
  4. data/lib/modern_treasury/client.rb +4 -0
  5. data/lib/modern_treasury/models/child_legal_entity.rb +3 -207
  6. data/lib/modern_treasury/models/identification.rb +209 -0
  7. data/lib/modern_treasury/models/identification_create_params.rb +231 -0
  8. data/lib/modern_treasury/models/identification_retrieve_params.rb +20 -0
  9. data/lib/modern_treasury/models/identification_update_params.rb +176 -0
  10. data/lib/modern_treasury/models/internal_account_update_params.rb +12 -1
  11. data/lib/modern_treasury/models/legal_entity.rb +3 -207
  12. data/lib/modern_treasury/models/legal_entity_association_create_params.rb +17 -9
  13. data/lib/modern_treasury/models/virtual_account_create_params.rb +9 -1
  14. data/lib/modern_treasury/models.rb +8 -0
  15. data/lib/modern_treasury/resources/identifications.rb +106 -0
  16. data/lib/modern_treasury/resources/internal_accounts.rb +3 -1
  17. data/lib/modern_treasury/resources/legal_entity_associations.rb +5 -3
  18. data/lib/modern_treasury/resources/virtual_accounts.rb +3 -1
  19. data/lib/modern_treasury/version.rb +1 -1
  20. data/lib/modern_treasury.rb +5 -0
  21. data/rbi/modern_treasury/client.rbi +3 -0
  22. data/rbi/modern_treasury/models/child_legal_entity.rbi +3 -652
  23. data/rbi/modern_treasury/models/identification.rbi +346 -0
  24. data/rbi/modern_treasury/models/identification_create_params.rbi +768 -0
  25. data/rbi/modern_treasury/models/identification_retrieve_params.rbi +38 -0
  26. data/rbi/modern_treasury/models/identification_update_params.rbi +632 -0
  27. data/rbi/modern_treasury/models/internal_account_update_params.rbi +17 -0
  28. data/rbi/modern_treasury/models/legal_entity.rbi +3 -647
  29. data/rbi/modern_treasury/models/legal_entity_association_create_params.rbi +26 -8
  30. data/rbi/modern_treasury/models/virtual_account_create_params.rbi +11 -0
  31. data/rbi/modern_treasury/models.rbi +11 -0
  32. data/rbi/modern_treasury/resources/identifications.rbi +94 -0
  33. data/rbi/modern_treasury/resources/internal_accounts.rbi +6 -0
  34. data/rbi/modern_treasury/resources/legal_entity_associations.rbi +6 -3
  35. data/rbi/modern_treasury/resources/virtual_accounts.rbi +3 -0
  36. data/sig/modern_treasury/client.rbs +2 -0
  37. data/sig/modern_treasury/models/child_legal_entity.rbs +4 -282
  38. data/sig/modern_treasury/models/identification.rbs +281 -0
  39. data/sig/modern_treasury/models/identification_create_params.rbs +323 -0
  40. data/sig/modern_treasury/models/identification_retrieve_params.rbs +23 -0
  41. data/sig/modern_treasury/models/identification_update_params.rbs +268 -0
  42. data/sig/modern_treasury/models/internal_account_update_params.rbs +9 -0
  43. data/sig/modern_treasury/models/legal_entity.rbs +4 -282
  44. data/sig/modern_treasury/models/legal_entity_association_create_params.rbs +16 -5
  45. data/sig/modern_treasury/models/virtual_account_create_params.rbs +7 -0
  46. data/sig/modern_treasury/models.rbs +8 -0
  47. data/sig/modern_treasury/resources/identifications.rbs +33 -0
  48. data/sig/modern_treasury/resources/internal_accounts.rbs +1 -0
  49. data/sig/modern_treasury/resources/legal_entity_associations.rbs +2 -1
  50. data/sig/modern_treasury/resources/virtual_accounts.rbs +1 -0
  51. metadata +17 -2
@@ -7,12 +7,6 @@ module ModernTreasury
7
7
  extend ModernTreasury::Internal::Type::RequestParameters::Converter
8
8
  include ModernTreasury::Internal::Type::RequestParameters
9
9
 
10
- # @!attribute child_legal_entity_id
11
- # The ID of the child legal entity.
12
- #
13
- # @return [String]
14
- required :child_legal_entity_id, String
15
-
16
10
  # @!attribute parent_legal_entity_id
17
11
  # The ID of the parent legal entity. This must be a business legal entity.
18
12
  #
@@ -25,6 +19,18 @@ module ModernTreasury
25
19
  required :relationship_types,
26
20
  -> { ModernTreasury::Internal::Type::ArrayOf[enum: ModernTreasury::LegalEntityAssociationCreateParams::RelationshipType] }
27
21
 
22
+ # @!attribute child_legal_entity
23
+ # The child legal entity.
24
+ #
25
+ # @return [ModernTreasury::Models::ChildLegalEntityCreate, nil]
26
+ optional :child_legal_entity, -> { ModernTreasury::ChildLegalEntityCreate }
27
+
28
+ # @!attribute child_legal_entity_id
29
+ # The ID of the child legal entity.
30
+ #
31
+ # @return [String, nil]
32
+ optional :child_legal_entity_id, String
33
+
28
34
  # @!attribute ownership_percentage
29
35
  # The child entity's ownership percentage iff they are a beneficial owner.
30
36
  #
@@ -37,13 +43,15 @@ module ModernTreasury
37
43
  # @return [String, nil]
38
44
  optional :title, String, nil?: true
39
45
 
40
- # @!method initialize(child_legal_entity_id:, parent_legal_entity_id:, relationship_types:, ownership_percentage: nil, title: nil, request_options: {})
41
- # @param child_legal_entity_id [String] The ID of the child legal entity.
42
- #
46
+ # @!method initialize(parent_legal_entity_id:, relationship_types:, child_legal_entity: nil, child_legal_entity_id: nil, ownership_percentage: nil, title: nil, request_options: {})
43
47
  # @param parent_legal_entity_id [String] The ID of the parent legal entity. This must be a business legal entity.
44
48
  #
45
49
  # @param relationship_types [Array<Symbol, ModernTreasury::Models::LegalEntityAssociationCreateParams::RelationshipType>]
46
50
  #
51
+ # @param child_legal_entity [ModernTreasury::Models::ChildLegalEntityCreate] The child legal entity.
52
+ #
53
+ # @param child_legal_entity_id [String] The ID of the child legal entity.
54
+ #
47
55
  # @param ownership_percentage [Integer, nil] The child entity's ownership percentage iff they are a beneficial owner.
48
56
  #
49
57
  # @param title [String, nil] The job title of the child entity at the parent entity.
@@ -62,6 +62,12 @@ module ModernTreasury
62
62
  # @return [ModernTreasury::Models::LedgerAccountCreateRequest, nil]
63
63
  optional :ledger_account, -> { ModernTreasury::LedgerAccountCreateRequest }
64
64
 
65
+ # @!attribute ledger_account_id
66
+ # The ledger account that you'd like to link to the virtual account.
67
+ #
68
+ # @return [String, nil]
69
+ optional :ledger_account_id, String
70
+
65
71
  # @!attribute metadata
66
72
  # Additional data represented as key-value pairs. Both the key and value must be
67
73
  # strings.
@@ -82,7 +88,7 @@ module ModernTreasury
82
88
  # @return [String, nil]
83
89
  optional :virtual_account_setting_id, String
84
90
 
85
- # @!method initialize(internal_account_id:, name:, account_details: nil, counterparty_id: nil, credit_ledger_account_id: nil, debit_ledger_account_id: nil, description: nil, ledger_account: nil, metadata: nil, routing_details: nil, virtual_account_setting_id: nil, request_options: {})
91
+ # @!method initialize(internal_account_id:, name:, account_details: nil, counterparty_id: nil, credit_ledger_account_id: nil, debit_ledger_account_id: nil, description: nil, ledger_account: nil, ledger_account_id: nil, metadata: nil, routing_details: nil, virtual_account_setting_id: nil, request_options: {})
86
92
  # Some parameter documentations has been truncated, see
87
93
  # {ModernTreasury::Models::VirtualAccountCreateParams} for more details.
88
94
  #
@@ -102,6 +108,8 @@ module ModernTreasury
102
108
  #
103
109
  # @param ledger_account [ModernTreasury::Models::LedgerAccountCreateRequest] Specifies a ledger account object that will be created with the virtual account.
104
110
  #
111
+ # @param ledger_account_id [String] The ledger account that you'd like to link to the virtual account.
112
+ #
105
113
  # @param metadata [Hash{Symbol=>String}] Additional data represented as key-value pairs. Both the key and value must be s
106
114
  #
107
115
  # @param routing_details [Array<ModernTreasury::Models::VirtualAccountCreateParams::RoutingDetail>] An array of routing detail objects.
@@ -199,8 +199,16 @@ module ModernTreasury
199
199
 
200
200
  HoldUpdateParams = ModernTreasury::Models::HoldUpdateParams
201
201
 
202
+ Identification = ModernTreasury::Models::Identification
203
+
204
+ IdentificationCreateParams = ModernTreasury::Models::IdentificationCreateParams
205
+
202
206
  IdentificationCreateRequest = ModernTreasury::Models::IdentificationCreateRequest
203
207
 
208
+ IdentificationRetrieveParams = ModernTreasury::Models::IdentificationRetrieveParams
209
+
210
+ IdentificationUpdateParams = ModernTreasury::Models::IdentificationUpdateParams
211
+
204
212
  IncomingPaymentDetail = ModernTreasury::Models::IncomingPaymentDetail
205
213
 
206
214
  IncomingPaymentDetailCreateAsyncParams = ModernTreasury::Models::IncomingPaymentDetailCreateAsyncParams
@@ -0,0 +1,106 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ModernTreasury
4
+ module Resources
5
+ class Identifications
6
+ # Some parameter documentations has been truncated, see
7
+ # {ModernTreasury::Models::IdentificationCreateParams} for more details.
8
+ #
9
+ # Create an Identification for a Legal Entity.
10
+ #
11
+ # @overload create(id_number:, id_type:, legal_entity_id:, documents: nil, expiration_date: nil, issuing_country: nil, issuing_region: nil, request_options: {})
12
+ #
13
+ # @param id_number [String] The ID number of identification document.
14
+ #
15
+ # @param id_type [Symbol, ModernTreasury::Models::IdentificationCreateParams::IDType] The type of ID number.
16
+ #
17
+ # @param legal_entity_id [String] The ID of the Legal Entity the identification belongs to.
18
+ #
19
+ # @param documents [Array<ModernTreasury::Models::IdentificationCreateParams::Document>] A list of documents to attach to the identification.
20
+ #
21
+ # @param expiration_date [Date, nil] The date when the Identification is no longer considered valid by the issuing au
22
+ #
23
+ # @param issuing_country [String, nil] The ISO 3166-1 alpha-2 country code of the country that issued the identificatio
24
+ #
25
+ # @param issuing_region [String, nil] The region in which the identifcation was issued.
26
+ #
27
+ # @param request_options [ModernTreasury::RequestOptions, Hash{Symbol=>Object}, nil]
28
+ #
29
+ # @return [ModernTreasury::Models::Identification]
30
+ #
31
+ # @see ModernTreasury::Models::IdentificationCreateParams
32
+ def create(params)
33
+ parsed, options = ModernTreasury::IdentificationCreateParams.dump_request(params)
34
+ @client.request(
35
+ method: :post,
36
+ path: "api/identifications",
37
+ body: parsed,
38
+ model: ModernTreasury::Identification,
39
+ options: options
40
+ )
41
+ end
42
+
43
+ # Get an existing Identification.
44
+ #
45
+ # @overload retrieve(id, request_options: {})
46
+ #
47
+ # @param id [String] The id of an existing identification.
48
+ #
49
+ # @param request_options [ModernTreasury::RequestOptions, Hash{Symbol=>Object}, nil]
50
+ #
51
+ # @return [ModernTreasury::Models::Identification]
52
+ #
53
+ # @see ModernTreasury::Models::IdentificationRetrieveParams
54
+ def retrieve(id, params = {})
55
+ @client.request(
56
+ method: :get,
57
+ path: ["api/identifications/%1$s", id],
58
+ model: ModernTreasury::Identification,
59
+ options: params[:request_options]
60
+ )
61
+ end
62
+
63
+ # Some parameter documentations has been truncated, see
64
+ # {ModernTreasury::Models::IdentificationUpdateParams} for more details.
65
+ #
66
+ # Update an existing Identification.
67
+ #
68
+ # @overload update(id, expiration_date: nil, id_number: nil, id_type: nil, issuing_country: nil, issuing_region: nil, request_options: {})
69
+ #
70
+ # @param id [String] The id of an existing identification.
71
+ #
72
+ # @param expiration_date [Date, nil] The date when the Identification is no longer considered valid by the issuing au
73
+ #
74
+ # @param id_number [String] The ID number of identification document.
75
+ #
76
+ # @param id_type [Symbol, ModernTreasury::Models::IdentificationUpdateParams::IDType] The type of ID number.
77
+ #
78
+ # @param issuing_country [String, nil] The ISO 3166-1 alpha-2 country code of the country that issued the identificatio
79
+ #
80
+ # @param issuing_region [String, nil] The region in which the identifcation was issued.
81
+ #
82
+ # @param request_options [ModernTreasury::RequestOptions, Hash{Symbol=>Object}, nil]
83
+ #
84
+ # @return [ModernTreasury::Models::Identification]
85
+ #
86
+ # @see ModernTreasury::Models::IdentificationUpdateParams
87
+ def update(id, params = {})
88
+ parsed, options = ModernTreasury::IdentificationUpdateParams.dump_request(params)
89
+ @client.request(
90
+ method: :patch,
91
+ path: ["api/identifications/%1$s", id],
92
+ body: parsed,
93
+ model: ModernTreasury::Identification,
94
+ options: options
95
+ )
96
+ end
97
+
98
+ # @api private
99
+ #
100
+ # @param client [ModernTreasury::Client]
101
+ def initialize(client:)
102
+ @client = client
103
+ end
104
+ end
105
+ end
106
+ end
@@ -84,7 +84,7 @@ module ModernTreasury
84
84
  #
85
85
  # update internal account
86
86
  #
87
- # @overload update(id, contra_ledger_account_id: nil, counterparty_id: nil, external_id: nil, ledger_account_id: nil, metadata: nil, name: nil, parent_account_id: nil, status: nil, request_options: {})
87
+ # @overload update(id, contra_ledger_account_id: nil, counterparty_id: nil, external_id: nil, ledger_account_id: nil, metadata: nil, name: nil, parent_account_id: nil, party_address: nil, status: nil, request_options: {})
88
88
  #
89
89
  # @param id [String] Unique identifier for the account.
90
90
  #
@@ -102,6 +102,8 @@ module ModernTreasury
102
102
  #
103
103
  # @param parent_account_id [String] The parent internal account for this account.
104
104
  #
105
+ # @param party_address [ModernTreasury::Models::AddressRequest] The address associated with the owner of the internal account. Updating this val
106
+ #
105
107
  # @param status [Symbol, ModernTreasury::Models::InternalAccountUpdateParams::Status] Requests closure of the internal account. The resulting status may be `closed` f
106
108
  #
107
109
  # @param request_options [ModernTreasury::RequestOptions, Hash{Symbol=>Object}, nil]
@@ -5,14 +5,16 @@ module ModernTreasury
5
5
  class LegalEntityAssociations
6
6
  # Add an associated legal entity to a business legal entity.
7
7
  #
8
- # @overload create(child_legal_entity_id:, parent_legal_entity_id:, relationship_types:, ownership_percentage: nil, title: nil, request_options: {})
9
- #
10
- # @param child_legal_entity_id [String] The ID of the child legal entity.
8
+ # @overload create(parent_legal_entity_id:, relationship_types:, child_legal_entity: nil, child_legal_entity_id: nil, ownership_percentage: nil, title: nil, request_options: {})
11
9
  #
12
10
  # @param parent_legal_entity_id [String] The ID of the parent legal entity. This must be a business legal entity.
13
11
  #
14
12
  # @param relationship_types [Array<Symbol, ModernTreasury::Models::LegalEntityAssociationCreateParams::RelationshipType>]
15
13
  #
14
+ # @param child_legal_entity [ModernTreasury::Models::ChildLegalEntityCreate] The child legal entity.
15
+ #
16
+ # @param child_legal_entity_id [String] The ID of the child legal entity.
17
+ #
16
18
  # @param ownership_percentage [Integer, nil] The child entity's ownership percentage iff they are a beneficial owner.
17
19
  #
18
20
  # @param title [String, nil] The job title of the child entity at the parent entity.
@@ -8,7 +8,7 @@ module ModernTreasury
8
8
  #
9
9
  # create virtual_account
10
10
  #
11
- # @overload create(internal_account_id:, name:, account_details: nil, counterparty_id: nil, credit_ledger_account_id: nil, debit_ledger_account_id: nil, description: nil, ledger_account: nil, metadata: nil, routing_details: nil, virtual_account_setting_id: nil, request_options: {})
11
+ # @overload create(internal_account_id:, name:, account_details: nil, counterparty_id: nil, credit_ledger_account_id: nil, debit_ledger_account_id: nil, description: nil, ledger_account: nil, ledger_account_id: nil, metadata: nil, routing_details: nil, virtual_account_setting_id: nil, request_options: {})
12
12
  #
13
13
  # @param internal_account_id [String] The ID of the internal account that this virtual account is associated with.
14
14
  #
@@ -26,6 +26,8 @@ module ModernTreasury
26
26
  #
27
27
  # @param ledger_account [ModernTreasury::Models::LedgerAccountCreateRequest] Specifies a ledger account object that will be created with the virtual account.
28
28
  #
29
+ # @param ledger_account_id [String] The ledger account that you'd like to link to the virtual account.
30
+ #
29
31
  # @param metadata [Hash{Symbol=>String}] Additional data represented as key-value pairs. Both the key and value must be s
30
32
  #
31
33
  # @param routing_details [Array<ModernTreasury::Models::VirtualAccountCreateParams::RoutingDetail>] An array of routing detail objects.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ModernTreasury
4
- VERSION = "0.29.2"
4
+ VERSION = "0.30.0"
5
5
  end
@@ -138,7 +138,11 @@ require_relative "modern_treasury/models/hold_retrieve_params"
138
138
  require_relative "modern_treasury/models/hold_retrieve_response"
139
139
  require_relative "modern_treasury/models/hold_update_params"
140
140
  require_relative "modern_treasury/models/hold_update_response"
141
+ require_relative "modern_treasury/models/identification"
142
+ require_relative "modern_treasury/models/identification_create_params"
141
143
  require_relative "modern_treasury/models/identification_create_request"
144
+ require_relative "modern_treasury/models/identification_retrieve_params"
145
+ require_relative "modern_treasury/models/identification_update_params"
142
146
  require_relative "modern_treasury/models/incoming_payment_detail"
143
147
  require_relative "modern_treasury/models/incoming_payment_detail_create_async_params"
144
148
  require_relative "modern_treasury/models/incoming_payment_detail_list_params"
@@ -329,6 +333,7 @@ require_relative "modern_treasury/resources/expected_payments"
329
333
  require_relative "modern_treasury/resources/external_accounts"
330
334
  require_relative "modern_treasury/resources/foreign_exchange_quotes"
331
335
  require_relative "modern_treasury/resources/holds"
336
+ require_relative "modern_treasury/resources/identifications"
332
337
  require_relative "modern_treasury/resources/incoming_payment_details"
333
338
  require_relative "modern_treasury/resources/internal_accounts"
334
339
  require_relative "modern_treasury/resources/internal_accounts/balance_reports"
@@ -142,6 +142,9 @@ module ModernTreasury
142
142
  sig { returns(ModernTreasury::Resources::VirtualAccountSettings) }
143
143
  attr_reader :virtual_account_settings
144
144
 
145
+ sig { returns(ModernTreasury::Resources::Identifications) }
146
+ attr_reader :identifications
147
+
145
148
  # A test endpoint often used to confirm credentials and headers are being passed
146
149
  # in correctly.
147
150
  sig do