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
@@ -7,7 +7,6 @@ module ModernTreasury
7
7
  sig do
8
8
  params(
9
9
  counterparty_id: T.nilable(String),
10
- body_external_id: T.nilable(String),
11
10
  account_details:
12
11
  T::Array[
13
12
  ModernTreasury::ExternalAccountCreateParams::AccountDetail::OrHash
@@ -15,6 +14,7 @@ module ModernTreasury
15
14
  account_type: ModernTreasury::ExternalAccountType::OrSymbol,
16
15
  contact_details:
17
16
  T::Array[ModernTreasury::ContactDetailCreateRequest::OrHash],
17
+ external_id: T.nilable(String),
18
18
  ledger_account: ModernTreasury::LedgerAccountCreateRequest::OrHash,
19
19
  metadata: T::Hash[Symbol, String],
20
20
  name: T.nilable(String),
@@ -34,41 +34,35 @@ module ModernTreasury
34
34
  ).returns(ModernTreasury::ExternalAccount)
35
35
  end
36
36
  def create(
37
- # Body param:
38
37
  counterparty_id:,
39
- # Body param: An optional user-defined 180 character unique identifier.
40
- body_external_id: nil,
41
- # Body param:
42
38
  account_details: nil,
43
- # Body param: Can be `checking`, `savings` or `other`.
39
+ # Can be `checking`, `savings` or `other`.
44
40
  account_type: nil,
45
- # Body param:
46
41
  contact_details: nil,
47
- # Body param: Specifies a ledger account object that will be created with the
48
- # external account. The resulting ledger account is linked to the external account
49
- # for auto-ledgering Payment objects. See
42
+ # An optional user-defined 180 character unique identifier.
43
+ external_id: nil,
44
+ # Specifies a ledger account object that will be created with the external
45
+ # account. The resulting ledger account is linked to the external account for
46
+ # auto-ledgering Payment objects. See
50
47
  # https://docs.moderntreasury.com/docs/linking-to-other-modern-treasury-objects
51
48
  # for more details.
52
49
  ledger_account: nil,
53
- # Body param: Additional data represented as key-value pairs. Both the key and
54
- # value must be strings.
50
+ # Additional data represented as key-value pairs. Both the key and value must be
51
+ # strings.
55
52
  metadata: nil,
56
- # Body param: A nickname for the external account. This is only for internal usage
57
- # and won't affect any payments
53
+ # A nickname for the external account. This is only for internal usage and won't
54
+ # affect any payments
58
55
  name: nil,
59
- # Body param: Required if receiving wire payments.
56
+ # Required if receiving wire payments.
60
57
  party_address: nil,
61
- # Body param:
62
58
  party_identifier: nil,
63
- # Body param: If this value isn't provided, it will be inherited from the
64
- # counterparty's name.
59
+ # If this value isn't provided, it will be inherited from the counterparty's name.
65
60
  party_name: nil,
66
- # Body param: Either `individual` or `business`.
61
+ # Either `individual` or `business`.
67
62
  party_type: nil,
68
- # Body param: If you've enabled the Modern Treasury + Plaid integration in your
69
- # Plaid account, you can pass the processor token in this field.
63
+ # If you've enabled the Modern Treasury + Plaid integration in your Plaid account,
64
+ # you can pass the processor token in this field.
70
65
  plaid_processor_token: nil,
71
- # Body param:
72
66
  routing_details: nil,
73
67
  request_options: {}
74
68
  )
@@ -0,0 +1,108 @@
1
+ # typed: strong
2
+
3
+ module ModernTreasury
4
+ module Resources
5
+ class Holds
6
+ # Create a new hold
7
+ sig do
8
+ params(
9
+ status: ModernTreasury::HoldCreateParams::Status::OrSymbol,
10
+ target_id: String,
11
+ target_type: ModernTreasury::HoldCreateParams::TargetType::OrSymbol,
12
+ metadata: T.nilable(T::Hash[Symbol, String]),
13
+ reason: T.nilable(String),
14
+ request_options: ModernTreasury::RequestOptions::OrHash
15
+ ).returns(ModernTreasury::Models::HoldCreateResponse)
16
+ end
17
+ def create(
18
+ # The status of the hold
19
+ status:,
20
+ # The ID of the target to hold
21
+ target_id:,
22
+ # The type of target to hold
23
+ target_type:,
24
+ # Additional metadata for the hold
25
+ metadata: nil,
26
+ # The reason for the hold
27
+ reason: nil,
28
+ request_options: {}
29
+ )
30
+ end
31
+
32
+ # Get a specific hold
33
+ sig do
34
+ params(
35
+ id: String,
36
+ request_options: ModernTreasury::RequestOptions::OrHash
37
+ ).returns(ModernTreasury::Models::HoldRetrieveResponse)
38
+ end
39
+ def retrieve(
40
+ # hold id
41
+ id,
42
+ request_options: {}
43
+ )
44
+ end
45
+
46
+ # Update a hold
47
+ sig do
48
+ params(
49
+ id: String,
50
+ status: ModernTreasury::HoldUpdateParams::Status::OrSymbol,
51
+ resolution: T.nilable(String),
52
+ request_options: ModernTreasury::RequestOptions::OrHash
53
+ ).returns(ModernTreasury::Models::HoldUpdateResponse)
54
+ end
55
+ def update(
56
+ # hold id
57
+ id,
58
+ # The new status of the hold
59
+ status:,
60
+ # The resolution of the hold
61
+ resolution: nil,
62
+ request_options: {}
63
+ )
64
+ end
65
+
66
+ # Get a list of holds.
67
+ sig do
68
+ params(
69
+ after_cursor: T.nilable(String),
70
+ metadata: T::Hash[Symbol, String],
71
+ per_page: Integer,
72
+ status: T.nilable(ModernTreasury::HoldListParams::Status::OrSymbol),
73
+ target_id: T.nilable(String),
74
+ target_type:
75
+ T.nilable(ModernTreasury::HoldListParams::TargetType::OrSymbol),
76
+ request_options: ModernTreasury::RequestOptions::OrHash
77
+ ).returns(
78
+ ModernTreasury::Internal::Page[
79
+ ModernTreasury::Models::HoldListResponse
80
+ ]
81
+ )
82
+ end
83
+ def list(
84
+ after_cursor: nil,
85
+ # For example, if you want to query for records with metadata key `Type` and value
86
+ # `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
87
+ # parameters.
88
+ metadata: nil,
89
+ per_page: nil,
90
+ # Translation missing: en.openapi.descriptions.payment_order.query_params.status
91
+ status: nil,
92
+ # Translation missing:
93
+ # en.openapi.descriptions.payment_order.query_params.target_id
94
+ target_id: nil,
95
+ # Translation missing:
96
+ # en.openapi.descriptions.payment_order.query_params.target_type
97
+ target_type: nil,
98
+ request_options: {}
99
+ )
100
+ end
101
+
102
+ # @api private
103
+ sig { params(client: ModernTreasury::Client).returns(T.attached_class) }
104
+ def self.new(client:)
105
+ end
106
+ end
107
+ end
108
+ end
@@ -147,6 +147,20 @@ module ModernTreasury
147
147
  )
148
148
  end
149
149
 
150
+ # request closure of internal account
151
+ sig do
152
+ params(
153
+ id: String,
154
+ request_options: ModernTreasury::RequestOptions::OrHash
155
+ ).returns(ModernTreasury::InternalAccount)
156
+ end
157
+ def request_closure(
158
+ # Unique identifier for the account.
159
+ id,
160
+ request_options: {}
161
+ )
162
+ end
163
+
150
164
  # update account_capability
151
165
  sig do
152
166
  params(
@@ -0,0 +1,46 @@
1
+ # typed: strong
2
+
3
+ module ModernTreasury
4
+ module Resources
5
+ class JournalEntries
6
+ # Retrieve a specific journal entry
7
+ sig do
8
+ params(
9
+ id: String,
10
+ request_options: ModernTreasury::RequestOptions::OrHash
11
+ ).void
12
+ end
13
+ def retrieve(
14
+ # The ID of the journal entry
15
+ id,
16
+ request_options: {}
17
+ )
18
+ end
19
+
20
+ # Retrieve a list of journal entries
21
+ sig do
22
+ params(
23
+ journal_report_id: String,
24
+ page: Integer,
25
+ per_page: Integer,
26
+ request_options: ModernTreasury::RequestOptions::OrHash
27
+ ).void
28
+ end
29
+ def list(
30
+ # The ID of the journal report
31
+ journal_report_id:,
32
+ # Page number for pagination
33
+ page: nil,
34
+ # Number of items per page
35
+ per_page: nil,
36
+ request_options: {}
37
+ )
38
+ end
39
+
40
+ # @api private
41
+ sig { params(client: ModernTreasury::Client).returns(T.attached_class) }
42
+ def self.new(client:)
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,51 @@
1
+ # typed: strong
2
+
3
+ module ModernTreasury
4
+ module Resources
5
+ class JournalReports
6
+ # Retrieve a specific journal report
7
+ sig do
8
+ params(
9
+ id: String,
10
+ request_options: ModernTreasury::RequestOptions::OrHash
11
+ ).void
12
+ end
13
+ def retrieve(
14
+ # The ID of the journal report
15
+ id,
16
+ request_options: {}
17
+ )
18
+ end
19
+
20
+ # Update a journal report
21
+ sig do
22
+ params(
23
+ id: String,
24
+ metadata: T.anything,
25
+ status: String,
26
+ request_options: ModernTreasury::RequestOptions::OrHash
27
+ ).void
28
+ end
29
+ def update(
30
+ # The ID of the journal report
31
+ id,
32
+ metadata: nil,
33
+ status: nil,
34
+ request_options: {}
35
+ )
36
+ end
37
+
38
+ # Retrieve a list of journal reports
39
+ sig do
40
+ params(request_options: ModernTreasury::RequestOptions::OrHash).void
41
+ end
42
+ def list(request_options: {})
43
+ end
44
+
45
+ # @api private
46
+ sig { params(client: ModernTreasury::Client).returns(T.attached_class) }
47
+ def self.new(client:)
48
+ end
49
+ end
50
+ end
51
+ end
@@ -82,6 +82,12 @@ module ModernTreasury
82
82
 
83
83
  attr_reader payment_actions: ModernTreasury::Resources::PaymentActions
84
84
 
85
+ attr_reader journal_entries: ModernTreasury::Resources::JournalEntries
86
+
87
+ attr_reader journal_reports: ModernTreasury::Resources::JournalReports
88
+
89
+ attr_reader holds: ModernTreasury::Resources::Holds
90
+
85
91
  def ping: (
86
92
  ?request_options: ModernTreasury::request_opts
87
93
  ) -> ModernTreasury::PingResponse
@@ -87,6 +87,8 @@ module ModernTreasury
87
87
 
88
88
  private def auth_headers: -> ::Hash[String, String]
89
89
 
90
+ private def user_agent: -> String
91
+
90
92
  private def generate_idempotency_key: -> String
91
93
 
92
94
  private def build_request: (
@@ -17,7 +17,10 @@ module ModernTreasury
17
17
 
18
18
  DEFAULT_MAX_CONNECTIONS: Integer
19
19
 
20
- def self.connect: (URI::Generic url) -> top
20
+ def self.connect: (
21
+ cert_store: OpenSSL::X509::Store,
22
+ url: URI::Generic
23
+ ) -> top
21
24
 
22
25
  def self.calibrate_socket_timeout: (top conn, Float deadline) -> void
23
26
 
@@ -3,10 +3,10 @@ module ModernTreasury
3
3
  type counterparty_create_params =
4
4
  {
5
5
  name: String?,
6
- body_external_id: String?,
7
6
  accounting: ModernTreasury::CounterpartyCreateParams::Accounting,
8
7
  accounts: ::Array[ModernTreasury::CounterpartyCreateParams::Account],
9
8
  email: String?,
9
+ external_id: String?,
10
10
  ledger_type: ModernTreasury::Models::CounterpartyCreateParams::ledger_type,
11
11
  legal_entity: ModernTreasury::CounterpartyCreateParams::LegalEntity,
12
12
  legal_entity_id: String?,
@@ -23,8 +23,6 @@ module ModernTreasury
23
23
 
24
24
  attr_accessor name: String?
25
25
 
26
- attr_accessor body_external_id: String?
27
-
28
26
  attr_reader accounting: ModernTreasury::CounterpartyCreateParams::Accounting?
29
27
 
30
28
  def accounting=: (
@@ -39,6 +37,8 @@ module ModernTreasury
39
37
 
40
38
  attr_accessor email: String?
41
39
 
40
+ attr_accessor external_id: String?
41
+
42
42
  attr_reader ledger_type: ModernTreasury::Models::CounterpartyCreateParams::ledger_type?
43
43
 
44
44
  def ledger_type=: (
@@ -71,10 +71,10 @@ module ModernTreasury
71
71
 
72
72
  def initialize: (
73
73
  name: String?,
74
- ?body_external_id: String?,
75
74
  ?accounting: ModernTreasury::CounterpartyCreateParams::Accounting,
76
75
  ?accounts: ::Array[ModernTreasury::CounterpartyCreateParams::Account],
77
76
  ?email: String?,
77
+ ?external_id: String?,
78
78
  ?ledger_type: ModernTreasury::Models::CounterpartyCreateParams::ledger_type,
79
79
  ?legal_entity: ModernTreasury::CounterpartyCreateParams::LegalEntity,
80
80
  ?legal_entity_id: String?,
@@ -87,10 +87,10 @@ module ModernTreasury
87
87
 
88
88
  def to_hash: -> {
89
89
  name: String?,
90
- body_external_id: String?,
91
90
  accounting: ModernTreasury::CounterpartyCreateParams::Accounting,
92
91
  accounts: ::Array[ModernTreasury::CounterpartyCreateParams::Account],
93
92
  email: String?,
93
+ external_id: String?,
94
94
  ledger_type: ModernTreasury::Models::CounterpartyCreateParams::ledger_type,
95
95
  legal_entity: ModernTreasury::CounterpartyCreateParams::LegalEntity,
96
96
  legal_entity_id: String?,
@@ -3,10 +3,10 @@ module ModernTreasury
3
3
  type external_account_create_params =
4
4
  {
5
5
  counterparty_id: String?,
6
- body_external_id: String?,
7
6
  account_details: ::Array[ModernTreasury::ExternalAccountCreateParams::AccountDetail],
8
7
  account_type: ModernTreasury::Models::external_account_type,
9
8
  contact_details: ::Array[ModernTreasury::ContactDetailCreateRequest],
9
+ external_id: String?,
10
10
  ledger_account: ModernTreasury::LedgerAccountCreateRequest,
11
11
  metadata: ::Hash[Symbol, String],
12
12
  name: String?,
@@ -25,8 +25,6 @@ module ModernTreasury
25
25
 
26
26
  attr_accessor counterparty_id: String?
27
27
 
28
- attr_accessor body_external_id: String?
29
-
30
28
  attr_reader account_details: ::Array[ModernTreasury::ExternalAccountCreateParams::AccountDetail]?
31
29
 
32
30
  def account_details=: (
@@ -45,6 +43,8 @@ module ModernTreasury
45
43
  ::Array[ModernTreasury::ContactDetailCreateRequest]
46
44
  ) -> ::Array[ModernTreasury::ContactDetailCreateRequest]
47
45
 
46
+ attr_accessor external_id: String?
47
+
48
48
  attr_reader ledger_account: ModernTreasury::LedgerAccountCreateRequest?
49
49
 
50
50
  def ledger_account=: (
@@ -85,10 +85,10 @@ module ModernTreasury
85
85
 
86
86
  def initialize: (
87
87
  counterparty_id: String?,
88
- ?body_external_id: String?,
89
88
  ?account_details: ::Array[ModernTreasury::ExternalAccountCreateParams::AccountDetail],
90
89
  ?account_type: ModernTreasury::Models::external_account_type,
91
90
  ?contact_details: ::Array[ModernTreasury::ContactDetailCreateRequest],
91
+ ?external_id: String?,
92
92
  ?ledger_account: ModernTreasury::LedgerAccountCreateRequest,
93
93
  ?metadata: ::Hash[Symbol, String],
94
94
  ?name: String?,
@@ -103,10 +103,10 @@ module ModernTreasury
103
103
 
104
104
  def to_hash: -> {
105
105
  counterparty_id: String?,
106
- body_external_id: String?,
107
106
  account_details: ::Array[ModernTreasury::ExternalAccountCreateParams::AccountDetail],
108
107
  account_type: ModernTreasury::Models::external_account_type,
109
108
  contact_details: ::Array[ModernTreasury::ContactDetailCreateRequest],
109
+ external_id: String?,
110
110
  ledger_account: ModernTreasury::LedgerAccountCreateRequest,
111
111
  metadata: ::Hash[Symbol, String],
112
112
  name: String?,
@@ -0,0 +1,66 @@
1
+ module ModernTreasury
2
+ module Models
3
+ type hold_create_params =
4
+ {
5
+ status: ModernTreasury::Models::HoldCreateParams::status,
6
+ target_id: String,
7
+ target_type: ModernTreasury::Models::HoldCreateParams::target_type,
8
+ metadata: ::Hash[Symbol, String]?,
9
+ reason: String?
10
+ }
11
+ & ModernTreasury::Internal::Type::request_parameters
12
+
13
+ class HoldCreateParams < ModernTreasury::Internal::Type::BaseModel
14
+ extend ModernTreasury::Internal::Type::RequestParameters::Converter
15
+ include ModernTreasury::Internal::Type::RequestParameters
16
+
17
+ attr_accessor status: ModernTreasury::Models::HoldCreateParams::status
18
+
19
+ attr_accessor target_id: String
20
+
21
+ attr_accessor target_type: ModernTreasury::Models::HoldCreateParams::target_type
22
+
23
+ attr_accessor metadata: ::Hash[Symbol, String]?
24
+
25
+ attr_accessor reason: String?
26
+
27
+ def initialize: (
28
+ status: ModernTreasury::Models::HoldCreateParams::status,
29
+ target_id: String,
30
+ target_type: ModernTreasury::Models::HoldCreateParams::target_type,
31
+ ?metadata: ::Hash[Symbol, String]?,
32
+ ?reason: String?,
33
+ ?request_options: ModernTreasury::request_opts
34
+ ) -> void
35
+
36
+ def to_hash: -> {
37
+ status: ModernTreasury::Models::HoldCreateParams::status,
38
+ target_id: String,
39
+ target_type: ModernTreasury::Models::HoldCreateParams::target_type,
40
+ metadata: ::Hash[Symbol, String]?,
41
+ reason: String?,
42
+ request_options: ModernTreasury::RequestOptions
43
+ }
44
+
45
+ type status = :active
46
+
47
+ module Status
48
+ extend ModernTreasury::Internal::Type::Enum
49
+
50
+ ACTIVE: :active
51
+
52
+ def self?.values: -> ::Array[ModernTreasury::Models::HoldCreateParams::status]
53
+ end
54
+
55
+ type target_type = :payment_order
56
+
57
+ module TargetType
58
+ extend ModernTreasury::Internal::Type::Enum
59
+
60
+ PAYMENT_ORDER: :payment_order
61
+
62
+ def self?.values: -> ::Array[ModernTreasury::Models::HoldCreateParams::target_type]
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,108 @@
1
+ module ModernTreasury
2
+ module Models
3
+ type hold_create_response =
4
+ {
5
+ id: String,
6
+ created_at: Time,
7
+ object: ModernTreasury::Models::HoldCreateResponse::object,
8
+ status: ModernTreasury::Models::HoldCreateResponse::status,
9
+ target_id: String,
10
+ target_type: ModernTreasury::Models::HoldCreateResponse::target_type,
11
+ updated_at: Time,
12
+ live_mode: bool,
13
+ metadata: ::Hash[Symbol, String]?,
14
+ reason: String?,
15
+ resolution: String?,
16
+ resolved_at: Time?
17
+ }
18
+
19
+ class HoldCreateResponse < ModernTreasury::Internal::Type::BaseModel
20
+ attr_accessor id: String
21
+
22
+ attr_accessor created_at: Time
23
+
24
+ attr_accessor object: ModernTreasury::Models::HoldCreateResponse::object
25
+
26
+ attr_accessor status: ModernTreasury::Models::HoldCreateResponse::status
27
+
28
+ attr_accessor target_id: String
29
+
30
+ attr_accessor target_type: ModernTreasury::Models::HoldCreateResponse::target_type
31
+
32
+ attr_accessor updated_at: Time
33
+
34
+ attr_reader live_mode: bool?
35
+
36
+ def live_mode=: (bool) -> bool
37
+
38
+ attr_accessor metadata: ::Hash[Symbol, String]?
39
+
40
+ attr_accessor reason: String?
41
+
42
+ attr_accessor resolution: String?
43
+
44
+ attr_accessor resolved_at: Time?
45
+
46
+ def initialize: (
47
+ id: String,
48
+ created_at: Time,
49
+ object: ModernTreasury::Models::HoldCreateResponse::object,
50
+ status: ModernTreasury::Models::HoldCreateResponse::status,
51
+ target_id: String,
52
+ target_type: ModernTreasury::Models::HoldCreateResponse::target_type,
53
+ updated_at: Time,
54
+ ?live_mode: bool,
55
+ ?metadata: ::Hash[Symbol, String]?,
56
+ ?reason: String?,
57
+ ?resolution: String?,
58
+ ?resolved_at: Time?
59
+ ) -> void
60
+
61
+ def to_hash: -> {
62
+ id: String,
63
+ created_at: Time,
64
+ object: ModernTreasury::Models::HoldCreateResponse::object,
65
+ status: ModernTreasury::Models::HoldCreateResponse::status,
66
+ target_id: String,
67
+ target_type: ModernTreasury::Models::HoldCreateResponse::target_type,
68
+ updated_at: Time,
69
+ live_mode: bool,
70
+ metadata: ::Hash[Symbol, String]?,
71
+ reason: String?,
72
+ resolution: String?,
73
+ resolved_at: Time?
74
+ }
75
+
76
+ type object = :hold
77
+
78
+ module Object
79
+ extend ModernTreasury::Internal::Type::Enum
80
+
81
+ HOLD: :hold
82
+
83
+ def self?.values: -> ::Array[ModernTreasury::Models::HoldCreateResponse::object]
84
+ end
85
+
86
+ type status = :active | :resolved
87
+
88
+ module Status
89
+ extend ModernTreasury::Internal::Type::Enum
90
+
91
+ ACTIVE: :active
92
+ RESOLVED: :resolved
93
+
94
+ def self?.values: -> ::Array[ModernTreasury::Models::HoldCreateResponse::status]
95
+ end
96
+
97
+ type target_type = :payment_order
98
+
99
+ module TargetType
100
+ extend ModernTreasury::Internal::Type::Enum
101
+
102
+ PAYMENT_ORDER: :payment_order
103
+
104
+ def self?.values: -> ::Array[ModernTreasury::Models::HoldCreateResponse::target_type]
105
+ end
106
+ end
107
+ end
108
+ end
@@ -0,0 +1,76 @@
1
+ module ModernTreasury
2
+ module Models
3
+ type hold_list_params =
4
+ {
5
+ after_cursor: String?,
6
+ metadata: ::Hash[Symbol, String],
7
+ per_page: Integer,
8
+ status: ModernTreasury::Models::HoldListParams::status?,
9
+ target_id: String?,
10
+ target_type: ModernTreasury::Models::HoldListParams::target_type?
11
+ }
12
+ & ModernTreasury::Internal::Type::request_parameters
13
+
14
+ class HoldListParams < ModernTreasury::Internal::Type::BaseModel
15
+ extend ModernTreasury::Internal::Type::RequestParameters::Converter
16
+ include ModernTreasury::Internal::Type::RequestParameters
17
+
18
+ attr_accessor after_cursor: String?
19
+
20
+ attr_reader metadata: ::Hash[Symbol, String]?
21
+
22
+ def metadata=: (::Hash[Symbol, String]) -> ::Hash[Symbol, String]
23
+
24
+ attr_reader per_page: Integer?
25
+
26
+ def per_page=: (Integer) -> Integer
27
+
28
+ attr_accessor status: ModernTreasury::Models::HoldListParams::status?
29
+
30
+ attr_accessor target_id: String?
31
+
32
+ attr_accessor target_type: ModernTreasury::Models::HoldListParams::target_type?
33
+
34
+ def initialize: (
35
+ ?after_cursor: String?,
36
+ ?metadata: ::Hash[Symbol, String],
37
+ ?per_page: Integer,
38
+ ?status: ModernTreasury::Models::HoldListParams::status?,
39
+ ?target_id: String?,
40
+ ?target_type: ModernTreasury::Models::HoldListParams::target_type?,
41
+ ?request_options: ModernTreasury::request_opts
42
+ ) -> void
43
+
44
+ def to_hash: -> {
45
+ after_cursor: String?,
46
+ metadata: ::Hash[Symbol, String],
47
+ per_page: Integer,
48
+ status: ModernTreasury::Models::HoldListParams::status?,
49
+ target_id: String?,
50
+ target_type: ModernTreasury::Models::HoldListParams::target_type?,
51
+ request_options: ModernTreasury::RequestOptions
52
+ }
53
+
54
+ type status = :active | :resolved
55
+
56
+ module Status
57
+ extend ModernTreasury::Internal::Type::Enum
58
+
59
+ ACTIVE: :active
60
+ RESOLVED: :resolved
61
+
62
+ def self?.values: -> ::Array[ModernTreasury::Models::HoldListParams::status]
63
+ end
64
+
65
+ type target_type = :payment_order
66
+
67
+ module TargetType
68
+ extend ModernTreasury::Internal::Type::Enum
69
+
70
+ PAYMENT_ORDER: :payment_order
71
+
72
+ def self?.values: -> ::Array[ModernTreasury::Models::HoldListParams::target_type]
73
+ end
74
+ end
75
+ end
76
+ end