modern_treasury 0.9.0 → 0.11.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 (98) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -0
  3. data/README.md +1 -1
  4. data/lib/modern_treasury/client.rb +12 -0
  5. data/lib/modern_treasury/internal/transport/base_client.rb +7 -1
  6. data/lib/modern_treasury/internal/transport/pooled_net_requester.rb +6 -2
  7. data/lib/modern_treasury/models/counterparty_create_params.rb +9 -9
  8. data/lib/modern_treasury/models/external_account_create_params.rb +9 -9
  9. data/lib/modern_treasury/models/hold_create_params.rb +74 -0
  10. data/lib/modern_treasury/models/hold_create_response.rb +143 -0
  11. data/lib/modern_treasury/models/hold_list_params.rb +89 -0
  12. data/lib/modern_treasury/models/hold_list_response.rb +143 -0
  13. data/lib/modern_treasury/models/hold_retrieve_params.rb +14 -0
  14. data/lib/modern_treasury/models/hold_retrieve_response.rb +143 -0
  15. data/lib/modern_treasury/models/hold_update_params.rb +40 -0
  16. data/lib/modern_treasury/models/hold_update_response.rb +143 -0
  17. data/lib/modern_treasury/models/internal_account_request_closure_params.rb +14 -0
  18. data/lib/modern_treasury/models/journal_entry_list_params.rb +38 -0
  19. data/lib/modern_treasury/models/journal_entry_retrieve_params.rb +14 -0
  20. data/lib/modern_treasury/models/journal_report_list_params.rb +14 -0
  21. data/lib/modern_treasury/models/journal_report_retrieve_params.rb +14 -0
  22. data/lib/modern_treasury/models/journal_report_update_params.rb +26 -0
  23. data/lib/modern_treasury/models/payment_order.rb +1 -1
  24. data/lib/modern_treasury/models/payment_reference.rb +1 -1
  25. data/lib/modern_treasury/models/return_object.rb +1 -1
  26. data/lib/modern_treasury/models/transaction.rb +1 -1
  27. data/lib/modern_treasury/models.rb +20 -0
  28. data/lib/modern_treasury/resources/counterparties.rb +14 -16
  29. data/lib/modern_treasury/resources/external_accounts.rb +16 -18
  30. data/lib/modern_treasury/resources/holds.rb +126 -0
  31. data/lib/modern_treasury/resources/internal_accounts.rb +20 -0
  32. data/lib/modern_treasury/resources/journal_entries.rb +60 -0
  33. data/lib/modern_treasury/resources/journal_reports.rb +78 -0
  34. data/lib/modern_treasury/version.rb +1 -1
  35. data/lib/modern_treasury.rb +18 -0
  36. data/manifest.yaml +1 -0
  37. data/rbi/modern_treasury/client.rbi +9 -0
  38. data/rbi/modern_treasury/internal/transport/base_client.rbi +5 -0
  39. data/rbi/modern_treasury/internal/transport/pooled_net_requester.rbi +6 -2
  40. data/rbi/modern_treasury/internal/type/base_model.rbi +8 -4
  41. data/rbi/modern_treasury/models/counterparty_create_params.rbi +8 -8
  42. data/rbi/modern_treasury/models/external_account_create_params.rbi +8 -8
  43. data/rbi/modern_treasury/models/hold_create_params.rbi +125 -0
  44. data/rbi/modern_treasury/models/hold_create_response.rbi +232 -0
  45. data/rbi/modern_treasury/models/hold_list_params.rbi +150 -0
  46. data/rbi/modern_treasury/models/hold_list_response.rbi +225 -0
  47. data/rbi/modern_treasury/models/hold_retrieve_params.rbi +32 -0
  48. data/rbi/modern_treasury/models/hold_retrieve_response.rbi +234 -0
  49. data/rbi/modern_treasury/models/hold_update_params.rbi +79 -0
  50. data/rbi/modern_treasury/models/hold_update_response.rbi +232 -0
  51. data/rbi/modern_treasury/models/internal_account_request_closure_params.rbi +32 -0
  52. data/rbi/modern_treasury/models/journal_entry_list_params.rbi +68 -0
  53. data/rbi/modern_treasury/models/journal_entry_retrieve_params.rbi +32 -0
  54. data/rbi/modern_treasury/models/journal_report_list_params.rbi +32 -0
  55. data/rbi/modern_treasury/models/journal_report_retrieve_params.rbi +32 -0
  56. data/rbi/modern_treasury/models/journal_report_update_params.rbi +52 -0
  57. data/rbi/modern_treasury/models/payment_order.rbi +2 -2
  58. data/rbi/modern_treasury/models/payment_reference.rbi +2 -2
  59. data/rbi/modern_treasury/models/return_object.rbi +2 -2
  60. data/rbi/modern_treasury/models/transaction.rbi +2 -2
  61. data/rbi/modern_treasury/models.rbi +23 -0
  62. data/rbi/modern_treasury/resources/counterparties.rbi +15 -17
  63. data/rbi/modern_treasury/resources/external_accounts.rbi +16 -22
  64. data/rbi/modern_treasury/resources/holds.rbi +108 -0
  65. data/rbi/modern_treasury/resources/internal_accounts.rbi +14 -0
  66. data/rbi/modern_treasury/resources/journal_entries.rbi +46 -0
  67. data/rbi/modern_treasury/resources/journal_reports.rbi +51 -0
  68. data/sig/modern_treasury/client.rbs +6 -0
  69. data/sig/modern_treasury/internal/transport/base_client.rbs +2 -0
  70. data/sig/modern_treasury/internal/transport/pooled_net_requester.rbs +4 -1
  71. data/sig/modern_treasury/models/counterparty_create_params.rbs +5 -5
  72. data/sig/modern_treasury/models/external_account_create_params.rbs +5 -5
  73. data/sig/modern_treasury/models/hold_create_params.rbs +66 -0
  74. data/sig/modern_treasury/models/hold_create_response.rbs +108 -0
  75. data/sig/modern_treasury/models/hold_list_params.rbs +76 -0
  76. data/sig/modern_treasury/models/hold_list_response.rbs +108 -0
  77. data/sig/modern_treasury/models/hold_retrieve_params.rbs +15 -0
  78. data/sig/modern_treasury/models/hold_retrieve_response.rbs +108 -0
  79. data/sig/modern_treasury/models/hold_update_params.rbs +41 -0
  80. data/sig/modern_treasury/models/hold_update_response.rbs +108 -0
  81. data/sig/modern_treasury/models/internal_account_request_closure_params.rbs +15 -0
  82. data/sig/modern_treasury/models/journal_entry_list_params.rbs +36 -0
  83. data/sig/modern_treasury/models/journal_entry_retrieve_params.rbs +15 -0
  84. data/sig/modern_treasury/models/journal_report_list_params.rbs +15 -0
  85. data/sig/modern_treasury/models/journal_report_retrieve_params.rbs +15 -0
  86. data/sig/modern_treasury/models/journal_report_update_params.rbs +32 -0
  87. data/sig/modern_treasury/models/payment_order.rbs +2 -2
  88. data/sig/modern_treasury/models/payment_reference.rbs +2 -2
  89. data/sig/modern_treasury/models/return_object.rbs +2 -2
  90. data/sig/modern_treasury/models/transaction.rbs +2 -2
  91. data/sig/modern_treasury/models.rbs +20 -0
  92. data/sig/modern_treasury/resources/counterparties.rbs +1 -1
  93. data/sig/modern_treasury/resources/external_accounts.rbs +1 -1
  94. data/sig/modern_treasury/resources/holds.rbs +38 -0
  95. data/sig/modern_treasury/resources/internal_accounts.rbs +5 -0
  96. data/sig/modern_treasury/resources/journal_entries.rbs +19 -0
  97. data/sig/modern_treasury/resources/journal_reports.rbs +21 -0
  98. metadata +53 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0ece6a35181fd477de3a707e524d64731c9325fbd45cf05c2eed0a43bcff019a
4
- data.tar.gz: e9ca8f0c2217f92995b84f021be24278d1eb2309a4a0563d885a74d5a11504cf
3
+ metadata.gz: b381a706f133eb72893814e976dd56ea241993d748f2cfc1e2bd85e60990e169
4
+ data.tar.gz: 444a67e6296f57d0e5b1c3b90a7c9a569b3621ed8c6334aefc9201e1bd9dcfda
5
5
  SHA512:
6
- metadata.gz: de56922ecdeb9e7de342cccb9d895300609c567ac76d75f0aff0c7f39118d45aa141641d70f0ebd34409a31fc01e8d499f2a9003e0e3821ef7b6f3c43c016b9e
7
- data.tar.gz: d7e272c5915c13195b0d0e5a2ce604e82af5a436c087377b1e88ed8d9e5c5f78eab70d6e5fb51738c09cbd6d96316d7ffa049c3e07ec7e750c9d8924a1667a1e
6
+ metadata.gz: dab0a8bef3113dc6486a003d64740521d12a5c215aafa7aee0473c6e4434d46c32fcb7a3d5005fc45a49fccec13df6f5afd03ed94ffa1b208fa29062dec18e13
7
+ data.tar.gz: bad75b0ac520228ddb0b488e70332f64f590e59b86302ddd1ebcdaef2adc9e2f39dfbbceb71526653f217be5df907c06738c419de4b8610fccb2d7d8d9b4a273
data/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.11.0 (2025-11-06)
4
+
5
+ Full Changelog: [v0.10.0...v0.11.0](https://github.com/Modern-Treasury/modern-treasury-ruby/compare/v0.10.0...v0.11.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([f4da9a6](https://github.com/Modern-Treasury/modern-treasury-ruby/commit/f4da9a6d0b24404df268a58b2a5e26053c7b82fa))
10
+ * **api:** manual updates ([ae6a6be](https://github.com/Modern-Treasury/modern-treasury-ruby/commit/ae6a6bee005c5c7a84d23fefdd8659d238ca6d70))
11
+
12
+ ## 0.10.0 (2025-11-05)
13
+
14
+ Full Changelog: [v0.9.0...v0.10.0](https://github.com/Modern-Treasury/modern-treasury-ruby/compare/v0.9.0...v0.10.0)
15
+
16
+ ### Features
17
+
18
+ * **api:** api update ([7fb1734](https://github.com/Modern-Treasury/modern-treasury-ruby/commit/7fb17347c1b30ac236a1a4df294f5b49adc6647b))
19
+ * **api:** api update ([f5d639f](https://github.com/Modern-Treasury/modern-treasury-ruby/commit/f5d639f577bbe973d2a299282bee8815f9311aa3))
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * better thread safety via early initializing SSL store during HTTP client creation ([a56afe6](https://github.com/Modern-Treasury/modern-treasury-ruby/commit/a56afe6e3ad81b5baabd7e1f225341a68752a0cc))
25
+
26
+
27
+ ### Chores
28
+
29
+ * **client:** send user-agent header ([3301d2f](https://github.com/Modern-Treasury/modern-treasury-ruby/commit/3301d2f2b166f302c29ab5038708aed0f9ca325e))
30
+ * **internal:** codegen related update ([7f3208e](https://github.com/Modern-Treasury/modern-treasury-ruby/commit/7f3208e35064166fe4e49217c0701d5325e9f057))
31
+
3
32
  ## 0.9.0 (2025-10-23)
4
33
 
5
34
  Full Changelog: [v0.8.0...v0.9.0](https://github.com/Modern-Treasury/modern-treasury-ruby/compare/v0.8.0...v0.9.0)
data/README.md CHANGED
@@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
15
15
  <!-- x-release-please-start-version -->
16
16
 
17
17
  ```ruby
18
- gem "modern_treasury", "~> 0.9.0"
18
+ gem "modern_treasury", "~> 0.11.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -126,6 +126,15 @@ module ModernTreasury
126
126
  # @return [ModernTreasury::Resources::PaymentActions]
127
127
  attr_reader :payment_actions
128
128
 
129
+ # @return [ModernTreasury::Resources::JournalEntries]
130
+ attr_reader :journal_entries
131
+
132
+ # @return [ModernTreasury::Resources::JournalReports]
133
+ attr_reader :journal_reports
134
+
135
+ # @return [ModernTreasury::Resources::Holds]
136
+ attr_reader :holds
137
+
129
138
  # A test endpoint often used to confirm credentials and headers are being passed
130
139
  # in correctly.
131
140
  #
@@ -240,6 +249,9 @@ module ModernTreasury
240
249
  @legal_entities = ModernTreasury::Resources::LegalEntities.new(client: self)
241
250
  @legal_entity_associations = ModernTreasury::Resources::LegalEntityAssociations.new(client: self)
242
251
  @payment_actions = ModernTreasury::Resources::PaymentActions.new(client: self)
252
+ @journal_entries = ModernTreasury::Resources::JournalEntries.new(client: self)
253
+ @journal_reports = ModernTreasury::Resources::JournalReports.new(client: self)
254
+ @holds = ModernTreasury::Resources::Holds.new(client: self)
243
255
  end
244
256
  end
245
257
  end
@@ -201,7 +201,8 @@ module ModernTreasury
201
201
  self.class::PLATFORM_HEADERS,
202
202
  {
203
203
  "accept" => "application/json",
204
- "content-type" => "application/json"
204
+ "content-type" => "application/json",
205
+ "user-agent" => user_agent
205
206
  },
206
207
  headers
207
208
  )
@@ -219,6 +220,11 @@ module ModernTreasury
219
220
  # @return [Hash{String=>String}]
220
221
  private def auth_headers = {}
221
222
 
223
+ # @api private
224
+ #
225
+ # @return [String]
226
+ private def user_agent = "#{self.class.name}/Ruby #{ModernTreasury::VERSION}"
227
+
222
228
  # @api private
223
229
  #
224
230
  # @return [String]
@@ -16,10 +16,11 @@ module ModernTreasury
16
16
  class << self
17
17
  # @api private
18
18
  #
19
+ # @param cert_store [OpenSSL::X509::Store]
19
20
  # @param url [URI::Generic]
20
21
  #
21
22
  # @return [Net::HTTP]
22
- def connect(url)
23
+ def connect(cert_store:, url:)
23
24
  port =
24
25
  case [url.port, url.scheme]
25
26
  in [Integer, _]
@@ -33,6 +34,8 @@ module ModernTreasury
33
34
  Net::HTTP.new(url.host, port).tap do
34
35
  _1.use_ssl = %w[https wss].include?(url.scheme)
35
36
  _1.max_retries = 0
37
+
38
+ (_1.cert_store = cert_store) if _1.use_ssl?
36
39
  end
37
40
  end
38
41
 
@@ -102,7 +105,7 @@ module ModernTreasury
102
105
  pool =
103
106
  @mutex.synchronize do
104
107
  @pools[origin] ||= ConnectionPool.new(size: @size) do
105
- self.class.connect(url)
108
+ self.class.connect(cert_store: @cert_store, url: url)
106
109
  end
107
110
  end
108
111
 
@@ -192,6 +195,7 @@ module ModernTreasury
192
195
  def initialize(size: self.class::DEFAULT_MAX_CONNECTIONS)
193
196
  @mutex = Mutex.new
194
197
  @size = size
198
+ @cert_store = OpenSSL::X509::Store.new.tap(&:set_default_paths)
195
199
  @pools = {}
196
200
  end
197
201
 
@@ -13,12 +13,6 @@ module ModernTreasury
13
13
  # @return [String, nil]
14
14
  required :name, String, nil?: true
15
15
 
16
- # @!attribute body_external_id
17
- # An optional user-defined 180 character unique identifier.
18
- #
19
- # @return [String, nil]
20
- optional :body_external_id, String, api_name: :external_id, nil?: true
21
-
22
16
  # @!attribute accounting
23
17
  # @deprecated
24
18
  #
@@ -38,6 +32,12 @@ module ModernTreasury
38
32
  # @return [String, nil]
39
33
  optional :email, String, nil?: true
40
34
 
35
+ # @!attribute external_id
36
+ # An optional user-defined 180 character unique identifier.
37
+ #
38
+ # @return [String, nil]
39
+ optional :external_id, String, nil?: true
40
+
41
41
  # @!attribute ledger_type
42
42
  # @deprecated
43
43
  #
@@ -86,20 +86,20 @@ module ModernTreasury
86
86
  # @return [String, nil]
87
87
  optional :verification_status, String
88
88
 
89
- # @!method initialize(name:, body_external_id: nil, accounting: nil, accounts: nil, email: 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: {})
89
+ # @!method initialize(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: {})
90
90
  # Some parameter documentations has been truncated, see
91
91
  # {ModernTreasury::Models::CounterpartyCreateParams} for more details.
92
92
  #
93
93
  # @param name [String, nil] A human friendly name for this counterparty.
94
94
  #
95
- # @param body_external_id [String, nil] An optional user-defined 180 character unique identifier.
96
- #
97
95
  # @param accounting [ModernTreasury::Models::CounterpartyCreateParams::Accounting]
98
96
  #
99
97
  # @param accounts [Array<ModernTreasury::Models::CounterpartyCreateParams::Account>] The accounts for this counterparty.
100
98
  #
101
99
  # @param email [String, nil] The counterparty's email.
102
100
  #
101
+ # @param external_id [String, nil] An optional user-defined 180 character unique identifier.
102
+ #
103
103
  # @param ledger_type [Symbol, ModernTreasury::Models::CounterpartyCreateParams::LedgerType] An optional type to auto-sync the counterparty to your ledger. Either `customer`
104
104
  #
105
105
  # @param legal_entity [ModernTreasury::Models::CounterpartyCreateParams::LegalEntity]
@@ -12,12 +12,6 @@ module ModernTreasury
12
12
  # @return [String, nil]
13
13
  required :counterparty_id, String, nil?: true
14
14
 
15
- # @!attribute body_external_id
16
- # An optional user-defined 180 character unique identifier.
17
- #
18
- # @return [String, nil]
19
- optional :body_external_id, String, api_name: :external_id, nil?: true
20
-
21
15
  # @!attribute account_details
22
16
  #
23
17
  # @return [Array<ModernTreasury::Models::ExternalAccountCreateParams::AccountDetail>, nil]
@@ -36,6 +30,12 @@ module ModernTreasury
36
30
  optional :contact_details,
37
31
  -> { ModernTreasury::Internal::Type::ArrayOf[ModernTreasury::ContactDetailCreateRequest] }
38
32
 
33
+ # @!attribute external_id
34
+ # An optional user-defined 180 character unique identifier.
35
+ #
36
+ # @return [String, nil]
37
+ optional :external_id, String, nil?: true
38
+
39
39
  # @!attribute ledger_account
40
40
  # Specifies a ledger account object that will be created with the external
41
41
  # account. The resulting ledger account is linked to the external account for
@@ -96,20 +96,20 @@ module ModernTreasury
96
96
  optional :routing_details,
97
97
  -> { ModernTreasury::Internal::Type::ArrayOf[ModernTreasury::ExternalAccountCreateParams::RoutingDetail] }
98
98
 
99
- # @!method initialize(counterparty_id:, body_external_id: nil, account_details: nil, account_type: nil, contact_details: nil, ledger_account: nil, metadata: nil, name: nil, party_address: nil, party_identifier: nil, party_name: nil, party_type: nil, plaid_processor_token: nil, routing_details: nil, request_options: {})
99
+ # @!method initialize(counterparty_id:, account_details: nil, account_type: nil, contact_details: nil, external_id: nil, ledger_account: nil, metadata: nil, name: nil, party_address: nil, party_identifier: nil, party_name: nil, party_type: nil, plaid_processor_token: nil, routing_details: nil, request_options: {})
100
100
  # Some parameter documentations has been truncated, see
101
101
  # {ModernTreasury::Models::ExternalAccountCreateParams} for more details.
102
102
  #
103
103
  # @param counterparty_id [String, nil]
104
104
  #
105
- # @param body_external_id [String, nil] An optional user-defined 180 character unique identifier.
106
- #
107
105
  # @param account_details [Array<ModernTreasury::Models::ExternalAccountCreateParams::AccountDetail>]
108
106
  #
109
107
  # @param account_type [Symbol, ModernTreasury::Models::ExternalAccountType] Can be `checking`, `savings` or `other`.
110
108
  #
111
109
  # @param contact_details [Array<ModernTreasury::Models::ContactDetailCreateRequest>]
112
110
  #
111
+ # @param external_id [String, nil] An optional user-defined 180 character unique identifier.
112
+ #
113
113
  # @param ledger_account [ModernTreasury::Models::LedgerAccountCreateRequest] Specifies a ledger account object that will be created with the external account
114
114
  #
115
115
  # @param metadata [Hash{Symbol=>String}] Additional data represented as key-value pairs. Both the key and value must be s
@@ -0,0 +1,74 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ModernTreasury
4
+ module Models
5
+ # @see ModernTreasury::Resources::Holds#create
6
+ class HoldCreateParams < ModernTreasury::Internal::Type::BaseModel
7
+ extend ModernTreasury::Internal::Type::RequestParameters::Converter
8
+ include ModernTreasury::Internal::Type::RequestParameters
9
+
10
+ # @!attribute status
11
+ # The status of the hold
12
+ #
13
+ # @return [Symbol, ModernTreasury::Models::HoldCreateParams::Status]
14
+ required :status, enum: -> { ModernTreasury::HoldCreateParams::Status }
15
+
16
+ # @!attribute target_id
17
+ # The ID of the target to hold
18
+ #
19
+ # @return [String]
20
+ required :target_id, String
21
+
22
+ # @!attribute target_type
23
+ # The type of target to hold
24
+ #
25
+ # @return [Symbol, ModernTreasury::Models::HoldCreateParams::TargetType]
26
+ required :target_type, enum: -> { ModernTreasury::HoldCreateParams::TargetType }
27
+
28
+ # @!attribute metadata
29
+ # Additional metadata for the hold
30
+ #
31
+ # @return [Hash{Symbol=>String}, nil]
32
+ optional :metadata, ModernTreasury::Internal::Type::HashOf[String], nil?: true
33
+
34
+ # @!attribute reason
35
+ # The reason for the hold
36
+ #
37
+ # @return [String, nil]
38
+ optional :reason, String, nil?: true
39
+
40
+ # @!method initialize(status:, target_id:, target_type:, metadata: nil, reason: nil, request_options: {})
41
+ # @param status [Symbol, ModernTreasury::Models::HoldCreateParams::Status] The status of the hold
42
+ #
43
+ # @param target_id [String] The ID of the target to hold
44
+ #
45
+ # @param target_type [Symbol, ModernTreasury::Models::HoldCreateParams::TargetType] The type of target to hold
46
+ #
47
+ # @param metadata [Hash{Symbol=>String}, nil] Additional metadata for the hold
48
+ #
49
+ # @param reason [String, nil] The reason for the hold
50
+ #
51
+ # @param request_options [ModernTreasury::RequestOptions, Hash{Symbol=>Object}]
52
+
53
+ # The status of the hold
54
+ module Status
55
+ extend ModernTreasury::Internal::Type::Enum
56
+
57
+ ACTIVE = :active
58
+
59
+ # @!method self.values
60
+ # @return [Array<Symbol>]
61
+ end
62
+
63
+ # The type of target to hold
64
+ module TargetType
65
+ extend ModernTreasury::Internal::Type::Enum
66
+
67
+ PAYMENT_ORDER = :payment_order
68
+
69
+ # @!method self.values
70
+ # @return [Array<Symbol>]
71
+ end
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,143 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ModernTreasury
4
+ module Models
5
+ # @see ModernTreasury::Resources::Holds#create
6
+ class HoldCreateResponse < ModernTreasury::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ #
9
+ # @return [String]
10
+ required :id, String
11
+
12
+ # @!attribute created_at
13
+ #
14
+ # @return [Time]
15
+ required :created_at, Time
16
+
17
+ # @!attribute object
18
+ # The type of object
19
+ #
20
+ # @return [Symbol, ModernTreasury::Models::HoldCreateResponse::Object]
21
+ required :object, enum: -> { ModernTreasury::Models::HoldCreateResponse::Object }
22
+
23
+ # @!attribute status
24
+ # The status of the hold
25
+ #
26
+ # @return [Symbol, ModernTreasury::Models::HoldCreateResponse::Status]
27
+ required :status, enum: -> { ModernTreasury::Models::HoldCreateResponse::Status }
28
+
29
+ # @!attribute target_id
30
+ # The ID of the target being held
31
+ #
32
+ # @return [String]
33
+ required :target_id, String
34
+
35
+ # @!attribute target_type
36
+ # The type of target being held
37
+ #
38
+ # @return [Symbol, ModernTreasury::Models::HoldCreateResponse::TargetType]
39
+ required :target_type, enum: -> { ModernTreasury::Models::HoldCreateResponse::TargetType }
40
+
41
+ # @!attribute updated_at
42
+ #
43
+ # @return [Time]
44
+ required :updated_at, Time
45
+
46
+ # @!attribute live_mode
47
+ # This field will be true if this object exists in the live environment or false
48
+ # if it exists in the test environment.
49
+ #
50
+ # @return [Boolean, nil]
51
+ optional :live_mode, ModernTreasury::Internal::Type::Boolean
52
+
53
+ # @!attribute metadata
54
+ # Additional metadata for the hold
55
+ #
56
+ # @return [Hash{Symbol=>String}, nil]
57
+ optional :metadata, ModernTreasury::Internal::Type::HashOf[String], nil?: true
58
+
59
+ # @!attribute reason
60
+ # The reason for the hold
61
+ #
62
+ # @return [String, nil]
63
+ optional :reason, String, nil?: true
64
+
65
+ # @!attribute resolution
66
+ # The resolution of the hold
67
+ #
68
+ # @return [String, nil]
69
+ optional :resolution, String, nil?: true
70
+
71
+ # @!attribute resolved_at
72
+ # When the hold was resolved
73
+ #
74
+ # @return [Time, nil]
75
+ optional :resolved_at, Time, nil?: true
76
+
77
+ # @!method initialize(id:, created_at:, object:, status:, target_id:, target_type:, updated_at:, live_mode: nil, metadata: nil, reason: nil, resolution: nil, resolved_at: nil)
78
+ # Some parameter documentations has been truncated, see
79
+ # {ModernTreasury::Models::HoldCreateResponse} for more details.
80
+ #
81
+ # @param id [String]
82
+ #
83
+ # @param created_at [Time]
84
+ #
85
+ # @param object [Symbol, ModernTreasury::Models::HoldCreateResponse::Object] The type of object
86
+ #
87
+ # @param status [Symbol, ModernTreasury::Models::HoldCreateResponse::Status] The status of the hold
88
+ #
89
+ # @param target_id [String] The ID of the target being held
90
+ #
91
+ # @param target_type [Symbol, ModernTreasury::Models::HoldCreateResponse::TargetType] The type of target being held
92
+ #
93
+ # @param updated_at [Time]
94
+ #
95
+ # @param live_mode [Boolean] This field will be true if this object exists in the live environment or false i
96
+ #
97
+ # @param metadata [Hash{Symbol=>String}, nil] Additional metadata for the hold
98
+ #
99
+ # @param reason [String, nil] The reason for the hold
100
+ #
101
+ # @param resolution [String, nil] The resolution of the hold
102
+ #
103
+ # @param resolved_at [Time, nil] When the hold was resolved
104
+
105
+ # The type of object
106
+ #
107
+ # @see ModernTreasury::Models::HoldCreateResponse#object
108
+ module Object
109
+ extend ModernTreasury::Internal::Type::Enum
110
+
111
+ HOLD = :hold
112
+
113
+ # @!method self.values
114
+ # @return [Array<Symbol>]
115
+ end
116
+
117
+ # The status of the hold
118
+ #
119
+ # @see ModernTreasury::Models::HoldCreateResponse#status
120
+ module Status
121
+ extend ModernTreasury::Internal::Type::Enum
122
+
123
+ ACTIVE = :active
124
+ RESOLVED = :resolved
125
+
126
+ # @!method self.values
127
+ # @return [Array<Symbol>]
128
+ end
129
+
130
+ # The type of target being held
131
+ #
132
+ # @see ModernTreasury::Models::HoldCreateResponse#target_type
133
+ module TargetType
134
+ extend ModernTreasury::Internal::Type::Enum
135
+
136
+ PAYMENT_ORDER = :payment_order
137
+
138
+ # @!method self.values
139
+ # @return [Array<Symbol>]
140
+ end
141
+ end
142
+ end
143
+ end
@@ -0,0 +1,89 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ModernTreasury
4
+ module Models
5
+ # @see ModernTreasury::Resources::Holds#list
6
+ class HoldListParams < ModernTreasury::Internal::Type::BaseModel
7
+ extend ModernTreasury::Internal::Type::RequestParameters::Converter
8
+ include ModernTreasury::Internal::Type::RequestParameters
9
+
10
+ # @!attribute after_cursor
11
+ #
12
+ # @return [String, nil]
13
+ optional :after_cursor, String, nil?: true
14
+
15
+ # @!attribute metadata
16
+ # For example, if you want to query for records with metadata key `Type` and value
17
+ # `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
18
+ # parameters.
19
+ #
20
+ # @return [Hash{Symbol=>String}, nil]
21
+ optional :metadata, ModernTreasury::Internal::Type::HashOf[String]
22
+
23
+ # @!attribute per_page
24
+ #
25
+ # @return [Integer, nil]
26
+ optional :per_page, Integer
27
+
28
+ # @!attribute status
29
+ # Translation missing: en.openapi.descriptions.payment_order.query_params.status
30
+ #
31
+ # @return [Symbol, ModernTreasury::Models::HoldListParams::Status, nil]
32
+ optional :status, enum: -> { ModernTreasury::HoldListParams::Status }, nil?: true
33
+
34
+ # @!attribute target_id
35
+ # Translation missing:
36
+ # en.openapi.descriptions.payment_order.query_params.target_id
37
+ #
38
+ # @return [String, nil]
39
+ optional :target_id, String, nil?: true
40
+
41
+ # @!attribute target_type
42
+ # Translation missing:
43
+ # en.openapi.descriptions.payment_order.query_params.target_type
44
+ #
45
+ # @return [Symbol, ModernTreasury::Models::HoldListParams::TargetType, nil]
46
+ optional :target_type, enum: -> { ModernTreasury::HoldListParams::TargetType }, nil?: true
47
+
48
+ # @!method initialize(after_cursor: nil, metadata: nil, per_page: nil, status: nil, target_id: nil, target_type: nil, request_options: {})
49
+ # Some parameter documentations has been truncated, see
50
+ # {ModernTreasury::Models::HoldListParams} for more details.
51
+ #
52
+ # @param after_cursor [String, nil]
53
+ #
54
+ # @param metadata [Hash{Symbol=>String}] For example, if you want to query for records with metadata key `Type` and value
55
+ #
56
+ # @param per_page [Integer]
57
+ #
58
+ # @param status [Symbol, ModernTreasury::Models::HoldListParams::Status, nil] Translation missing: en.openapi.descriptions.payment_order.query_params.status
59
+ #
60
+ # @param target_id [String, nil] Translation missing: en.openapi.descriptions.payment_order.query_params.target_i
61
+ #
62
+ # @param target_type [Symbol, ModernTreasury::Models::HoldListParams::TargetType, nil] Translation missing: en.openapi.descriptions.payment_order.query_params.target_t
63
+ #
64
+ # @param request_options [ModernTreasury::RequestOptions, Hash{Symbol=>Object}]
65
+
66
+ # Translation missing: en.openapi.descriptions.payment_order.query_params.status
67
+ module Status
68
+ extend ModernTreasury::Internal::Type::Enum
69
+
70
+ ACTIVE = :active
71
+ RESOLVED = :resolved
72
+
73
+ # @!method self.values
74
+ # @return [Array<Symbol>]
75
+ end
76
+
77
+ # Translation missing:
78
+ # en.openapi.descriptions.payment_order.query_params.target_type
79
+ module TargetType
80
+ extend ModernTreasury::Internal::Type::Enum
81
+
82
+ PAYMENT_ORDER = :payment_order
83
+
84
+ # @!method self.values
85
+ # @return [Array<Symbol>]
86
+ end
87
+ end
88
+ end
89
+ end