tesser-api-sdk 1.0.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 (101) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +148 -0
  4. data/bin/console +15 -0
  5. data/lib/tesser_apiv1/api_helper.rb +10 -0
  6. data/lib/tesser_apiv1/client.rb +118 -0
  7. data/lib/tesser_apiv1/configuration.rb +182 -0
  8. data/lib/tesser_apiv1/controllers/accounts_controller.rb +193 -0
  9. data/lib/tesser_apiv1/controllers/base_controller.rb +60 -0
  10. data/lib/tesser_apiv1/controllers/counterparties_controller.rb +171 -0
  11. data/lib/tesser_apiv1/controllers/currencies_controller.rb +39 -0
  12. data/lib/tesser_apiv1/controllers/experimental_controller.rb +49 -0
  13. data/lib/tesser_apiv1/controllers/health_controller.rb +24 -0
  14. data/lib/tesser_apiv1/controllers/networks_controller.rb +39 -0
  15. data/lib/tesser_apiv1/controllers/payments_controller.rb +202 -0
  16. data/lib/tesser_apiv1/controllers/tenants_controller.rb +156 -0
  17. data/lib/tesser_apiv1/controllers/treasury_controller.rb +77 -0
  18. data/lib/tesser_apiv1/exceptions/api_exception.rb +21 -0
  19. data/lib/tesser_apiv1/http/auth/o_auth2.rb +53 -0
  20. data/lib/tesser_apiv1/http/http_call_back.rb +10 -0
  21. data/lib/tesser_apiv1/http/http_method_enum.rb +10 -0
  22. data/lib/tesser_apiv1/http/http_request.rb +10 -0
  23. data/lib/tesser_apiv1/http/http_response.rb +10 -0
  24. data/lib/tesser_apiv1/http/proxy_settings.rb +22 -0
  25. data/lib/tesser_apiv1/models/account.rb +230 -0
  26. data/lib/tesser_apiv1/models/account_list_item.rb +230 -0
  27. data/lib/tesser_apiv1/models/account_list_response.rb +69 -0
  28. data/lib/tesser_apiv1/models/account_response.rb +60 -0
  29. data/lib/tesser_apiv1/models/account_safe.rb +218 -0
  30. data/lib/tesser_apiv1/models/balance_status1_enum.rb +40 -0
  31. data/lib/tesser_apiv1/models/balance_status_enum.rb +40 -0
  32. data/lib/tesser_apiv1/models/base_model.rb +110 -0
  33. data/lib/tesser_apiv1/models/classification7_enum.rb +36 -0
  34. data/lib/tesser_apiv1/models/classification_enum.rb +36 -0
  35. data/lib/tesser_apiv1/models/counterparty.rb +411 -0
  36. data/lib/tesser_apiv1/models/counterparty_list_response.rb +69 -0
  37. data/lib/tesser_apiv1/models/counterparty_response.rb +60 -0
  38. data/lib/tesser_apiv1/models/create_bank_request.rb +122 -0
  39. data/lib/tesser_apiv1/models/create_bank_response.rb +60 -0
  40. data/lib/tesser_apiv1/models/create_counterparty_request.rb +350 -0
  41. data/lib/tesser_apiv1/models/create_counterparty_response.rb +60 -0
  42. data/lib/tesser_apiv1/models/create_deposit_request.rb +119 -0
  43. data/lib/tesser_apiv1/models/create_payment_request.rb +168 -0
  44. data/lib/tesser_apiv1/models/create_tenant_request.rb +183 -0
  45. data/lib/tesser_apiv1/models/create_tenant_response.rb +60 -0
  46. data/lib/tesser_apiv1/models/create_wallet_request.rb +112 -0
  47. data/lib/tesser_apiv1/models/create_wallet_response.rb +60 -0
  48. data/lib/tesser_apiv1/models/create_withdrawal_request.rb +130 -0
  49. data/lib/tesser_apiv1/models/currencies_response.rb +69 -0
  50. data/lib/tesser_apiv1/models/currency.rb +119 -0
  51. data/lib/tesser_apiv1/models/data.rb +221 -0
  52. data/lib/tesser_apiv1/models/data6.rb +242 -0
  53. data/lib/tesser_apiv1/models/data7.rb +419 -0
  54. data/lib/tesser_apiv1/models/data8.rb +200 -0
  55. data/lib/tesser_apiv1/models/direction1_enum.rb +40 -0
  56. data/lib/tesser_apiv1/models/direction_enum.rb +40 -0
  57. data/lib/tesser_apiv1/models/execute_payment_request_dto.rb +71 -0
  58. data/lib/tesser_apiv1/models/fee.rb +117 -0
  59. data/lib/tesser_apiv1/models/fee1.rb +117 -0
  60. data/lib/tesser_apiv1/models/network.rb +68 -0
  61. data/lib/tesser_apiv1/models/networks_response.rb +69 -0
  62. data/lib/tesser_apiv1/models/pagination.rb +104 -0
  63. data/lib/tesser_apiv1/models/payment.rb +421 -0
  64. data/lib/tesser_apiv1/models/payment_list_response.rb +79 -0
  65. data/lib/tesser_apiv1/models/payment_response.rb +60 -0
  66. data/lib/tesser_apiv1/models/payment_type3_enum.rb +52 -0
  67. data/lib/tesser_apiv1/models/payment_type_enum.rb +54 -0
  68. data/lib/tesser_apiv1/models/provider_key1_enum.rb +36 -0
  69. data/lib/tesser_apiv1/models/provider_key_enum.rb +36 -0
  70. data/lib/tesser_apiv1/models/response.rb +81 -0
  71. data/lib/tesser_apiv1/models/review_payment_request.rb +60 -0
  72. data/lib/tesser_apiv1/models/risk_status_enum.rb +44 -0
  73. data/lib/tesser_apiv1/models/status1_enum.rb +52 -0
  74. data/lib/tesser_apiv1/models/status_enum.rb +48 -0
  75. data/lib/tesser_apiv1/models/step.rb +421 -0
  76. data/lib/tesser_apiv1/models/step_type_enum.rb +44 -0
  77. data/lib/tesser_apiv1/models/tenant.rb +275 -0
  78. data/lib/tesser_apiv1/models/tenant_api_credentials.rb +88 -0
  79. data/lib/tesser_apiv1/models/tenant_list_response.rb +69 -0
  80. data/lib/tesser_apiv1/models/tenant_response.rb +60 -0
  81. data/lib/tesser_apiv1/models/transfer_step.rb +422 -0
  82. data/lib/tesser_apiv1/models/turnkey_stamp.rb +81 -0
  83. data/lib/tesser_apiv1/models/type3_enum.rb +40 -0
  84. data/lib/tesser_apiv1/models/type4_enum.rb +44 -0
  85. data/lib/tesser_apiv1/models/type_enum.rb +44 -0
  86. data/lib/tesser_apiv1/models/update_account_request.rb +62 -0
  87. data/lib/tesser_apiv1/models/update_account_response.rb +60 -0
  88. data/lib/tesser_apiv1/models/update_counterparty_request.rb +166 -0
  89. data/lib/tesser_apiv1/models/update_counterparty_response.rb +60 -0
  90. data/lib/tesser_apiv1/models/update_payment_request.rb +100 -0
  91. data/lib/tesser_apiv1/models/update_tenant_request.rb +111 -0
  92. data/lib/tesser_apiv1/models/update_tenant_response.rb +60 -0
  93. data/lib/tesser_apiv1/utilities/date_time_helper.rb +11 -0
  94. data/lib/tesser_apiv1/utilities/file_wrapper.rb +28 -0
  95. data/lib/tesser_apiv1/utilities/union_type_lookup.rb +1234 -0
  96. data/lib/tesser_apiv1.rb +116 -0
  97. data/test/controllers/controller_test_base.rb +23 -0
  98. data/test/controllers/test_health_controller.rb +31 -0
  99. data/test/controllers/test_tenants_controller.rb +133 -0
  100. data/test/http_response_catcher.rb +19 -0
  101. metadata +212 -0
@@ -0,0 +1,69 @@
1
+ # tesser_apiv1
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module TesserApiv1
7
+ # NetworksResponse Model.
8
+ class NetworksResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # List of all supported networks
13
+ # @return [Array[Network]]
14
+ attr_accessor :data
15
+
16
+ # A mapping from model property names to API property names.
17
+ def self.names
18
+ @_hash = {} if @_hash.nil?
19
+ @_hash['data'] = 'data'
20
+ @_hash
21
+ end
22
+
23
+ # An array for optional fields
24
+ def self.optionals
25
+ []
26
+ end
27
+
28
+ # An array for nullable fields
29
+ def self.nullables
30
+ []
31
+ end
32
+
33
+ def initialize(data = nil)
34
+ @data = data
35
+ end
36
+
37
+ # Creates an instance of the object from a hash.
38
+ def self.from_hash(hash)
39
+ return nil unless hash
40
+
41
+ # Extract variables from the hash.
42
+ # Parameter is an array, so we need to iterate through it
43
+ data = nil
44
+ unless hash['data'].nil?
45
+ data = []
46
+ hash['data'].each do |structure|
47
+ data << (Network.from_hash(structure) if structure)
48
+ end
49
+ end
50
+
51
+ data = nil unless hash.key?('data')
52
+
53
+ # Create object from extracted values.
54
+ NetworksResponse.new(data)
55
+ end
56
+
57
+ # Provides a human-readable string representation of the object.
58
+ def to_s
59
+ class_name = self.class.name.split('::').last
60
+ "<#{class_name} data: #{@data}>"
61
+ end
62
+
63
+ # Provides a debugging-friendly string with detailed object information.
64
+ def inspect
65
+ class_name = self.class.name.split('::').last
66
+ "<#{class_name} data: #{@data.inspect}>"
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,104 @@
1
+ # tesser_apiv1
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module TesserApiv1
7
+ # Pagination details
8
+ class Pagination < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Current page number
13
+ # @return [Float]
14
+ attr_accessor :page
15
+
16
+ # Items per page
17
+ # @return [Float]
18
+ attr_accessor :limit
19
+
20
+ # Total number of items
21
+ # @return [Float]
22
+ attr_accessor :total
23
+
24
+ # Total number of pages
25
+ # @return [Float]
26
+ attr_accessor :total_pages
27
+
28
+ # Has next page
29
+ # @return [TrueClass | FalseClass]
30
+ attr_accessor :has_next
31
+
32
+ # Has previous page
33
+ # @return [TrueClass | FalseClass]
34
+ attr_accessor :has_prev
35
+
36
+ # A mapping from model property names to API property names.
37
+ def self.names
38
+ @_hash = {} if @_hash.nil?
39
+ @_hash['page'] = 'page'
40
+ @_hash['limit'] = 'limit'
41
+ @_hash['total'] = 'total'
42
+ @_hash['total_pages'] = 'total_pages'
43
+ @_hash['has_next'] = 'has_next'
44
+ @_hash['has_prev'] = 'has_prev'
45
+ @_hash
46
+ end
47
+
48
+ # An array for optional fields
49
+ def self.optionals
50
+ []
51
+ end
52
+
53
+ # An array for nullable fields
54
+ def self.nullables
55
+ []
56
+ end
57
+
58
+ def initialize(page = nil, limit = nil, total = nil, total_pages = nil,
59
+ has_next = nil, has_prev = nil)
60
+ @page = page
61
+ @limit = limit
62
+ @total = total
63
+ @total_pages = total_pages
64
+ @has_next = has_next
65
+ @has_prev = has_prev
66
+ end
67
+
68
+ # Creates an instance of the object from a hash.
69
+ def self.from_hash(hash)
70
+ return nil unless hash
71
+
72
+ # Extract variables from the hash.
73
+ page = hash.key?('page') ? hash['page'] : nil
74
+ limit = hash.key?('limit') ? hash['limit'] : nil
75
+ total = hash.key?('total') ? hash['total'] : nil
76
+ total_pages = hash.key?('total_pages') ? hash['total_pages'] : nil
77
+ has_next = hash.key?('has_next') ? hash['has_next'] : nil
78
+ has_prev = hash.key?('has_prev') ? hash['has_prev'] : nil
79
+
80
+ # Create object from extracted values.
81
+ Pagination.new(page,
82
+ limit,
83
+ total,
84
+ total_pages,
85
+ has_next,
86
+ has_prev)
87
+ end
88
+
89
+ # Provides a human-readable string representation of the object.
90
+ def to_s
91
+ class_name = self.class.name.split('::').last
92
+ "<#{class_name} page: #{@page}, limit: #{@limit}, total: #{@total}, total_pages:"\
93
+ " #{@total_pages}, has_next: #{@has_next}, has_prev: #{@has_prev}>"
94
+ end
95
+
96
+ # Provides a debugging-friendly string with detailed object information.
97
+ def inspect
98
+ class_name = self.class.name.split('::').last
99
+ "<#{class_name} page: #{@page.inspect}, limit: #{@limit.inspect}, total: #{@total.inspect},"\
100
+ " total_pages: #{@total_pages.inspect}, has_next: #{@has_next.inspect}, has_prev:"\
101
+ " #{@has_prev.inspect}>"
102
+ end
103
+ end
104
+ end
@@ -0,0 +1,421 @@
1
+ # tesser_apiv1
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ require 'date'
7
+ module TesserApiv1
8
+ # Payment Model.
9
+ class Payment < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Unique identifier for the payment.
14
+ # @return [String]
15
+ attr_accessor :id
16
+
17
+ # Workspace ID the payment belongs to.
18
+ # @return [String]
19
+ attr_accessor :workspace_id
20
+
21
+ # Optional external reference ID.
22
+ # @return [Object]
23
+ attr_accessor :organization_reference_id
24
+
25
+ # Payment direction: 'inbound', 'outbound', 'internal'.
26
+ # @return [DirectionEnum]
27
+ attr_accessor :direction
28
+
29
+ # Type of payment operation: 'payment' (wallet-to-wallet), 'offramp'
30
+ # (crypto-to-fiat), 'onramp' (fiat-to-crypto), 'withdrawal', 'deposit', or
31
+ # 'transfer'.
32
+ # @return [PaymentTypeEnum]
33
+ attr_accessor :payment_type
34
+
35
+ # ID of the source account (paying wallet).
36
+ # @return [Object]
37
+ attr_accessor :source_account_id
38
+
39
+ # ID of the originator account.
40
+ # @return [Object]
41
+ attr_accessor :originator_account_id
42
+
43
+ # ID of the beneficiary account.
44
+ # @return [Object]
45
+ attr_accessor :beneficiary_account_id
46
+
47
+ # Amount to send.
48
+ # @return [String]
49
+ attr_accessor :from_amount
50
+
51
+ # Source currency code.
52
+ # @return [String]
53
+ attr_accessor :from_currency
54
+
55
+ # Source blockchain network.
56
+ # @return [Object]
57
+ attr_accessor :from_network
58
+
59
+ # Amount to receive.
60
+ # @return [String]
61
+ attr_accessor :to_amount
62
+
63
+ # Destination currency code.
64
+ # @return [String]
65
+ attr_accessor :to_currency
66
+
67
+ # Destination blockchain network.
68
+ # @return [Object]
69
+ attr_accessor :to_network
70
+
71
+ # Current risk status.
72
+ # @return [RiskStatusEnum]
73
+ attr_accessor :risk_status
74
+
75
+ # List of reasons for risk status.
76
+ # @return [Array[String]]
77
+ attr_accessor :risk_status_reasons
78
+
79
+ # ID of the user who performed the risk review.
80
+ # @return [Object]
81
+ attr_accessor :risk_reviewed_by
82
+
83
+ # Timestamp of risk review.
84
+ # @return [Object]
85
+ attr_accessor :risk_reviewed_at
86
+
87
+ # Balance reservation status.
88
+ # @return [BalanceStatus1Enum]
89
+ attr_accessor :balance_status
90
+
91
+ # Timestamp when balance was reserved.
92
+ # @return [Object]
93
+ attr_accessor :balance_reserved_at
94
+
95
+ # Optional list of system-generated steps that make up this payment/transfer
96
+ # route.
97
+ # @return [Array[Step]]
98
+ attr_accessor :steps
99
+
100
+ # ISO 8601 timestamp of creation.
101
+ # @return [DateTime]
102
+ attr_accessor :created_at
103
+
104
+ # ISO 8601 timestamp of last update.
105
+ # @return [DateTime]
106
+ attr_accessor :updated_at
107
+
108
+ # ISO 8601 timestamp when the quote expires.
109
+ # @return [DateTime]
110
+ attr_accessor :expires_at
111
+
112
+ # A mapping from model property names to API property names.
113
+ def self.names
114
+ @_hash = {} if @_hash.nil?
115
+ @_hash['id'] = 'id'
116
+ @_hash['workspace_id'] = 'workspace_id'
117
+ @_hash['organization_reference_id'] = 'organization_reference_id'
118
+ @_hash['direction'] = 'direction'
119
+ @_hash['payment_type'] = 'payment_type'
120
+ @_hash['source_account_id'] = 'source_account_id'
121
+ @_hash['originator_account_id'] = 'originator_account_id'
122
+ @_hash['beneficiary_account_id'] = 'beneficiary_account_id'
123
+ @_hash['from_amount'] = 'from_amount'
124
+ @_hash['from_currency'] = 'from_currency'
125
+ @_hash['from_network'] = 'from_network'
126
+ @_hash['to_amount'] = 'to_amount'
127
+ @_hash['to_currency'] = 'to_currency'
128
+ @_hash['to_network'] = 'to_network'
129
+ @_hash['risk_status'] = 'risk_status'
130
+ @_hash['risk_status_reasons'] = 'risk_status_reasons'
131
+ @_hash['risk_reviewed_by'] = 'risk_reviewed_by'
132
+ @_hash['risk_reviewed_at'] = 'risk_reviewed_at'
133
+ @_hash['balance_status'] = 'balance_status'
134
+ @_hash['balance_reserved_at'] = 'balance_reserved_at'
135
+ @_hash['steps'] = 'steps'
136
+ @_hash['created_at'] = 'created_at'
137
+ @_hash['updated_at'] = 'updated_at'
138
+ @_hash['expires_at'] = 'expires_at'
139
+ @_hash
140
+ end
141
+
142
+ # An array for optional fields
143
+ def self.optionals
144
+ %w[
145
+ organization_reference_id
146
+ source_account_id
147
+ originator_account_id
148
+ beneficiary_account_id
149
+ from_network
150
+ to_network
151
+ risk_status_reasons
152
+ risk_reviewed_by
153
+ risk_reviewed_at
154
+ balance_status
155
+ balance_reserved_at
156
+ steps
157
+ ]
158
+ end
159
+
160
+ # An array for nullable fields
161
+ def self.nullables
162
+ %w[
163
+ risk_status_reasons
164
+ balance_status
165
+ ]
166
+ end
167
+
168
+ def initialize(id = nil, workspace_id = nil, direction = nil,
169
+ payment_type = nil, from_amount = nil, from_currency = nil,
170
+ to_amount = nil, to_currency = nil, risk_status = nil,
171
+ created_at = nil, updated_at = nil, expires_at = nil,
172
+ organization_reference_id = SKIP, source_account_id = SKIP,
173
+ originator_account_id = SKIP, beneficiary_account_id = SKIP,
174
+ from_network = SKIP, to_network = SKIP,
175
+ risk_status_reasons = SKIP, risk_reviewed_by = SKIP,
176
+ risk_reviewed_at = SKIP, balance_status = SKIP,
177
+ balance_reserved_at = SKIP, steps = SKIP)
178
+ @id = id
179
+ @workspace_id = workspace_id
180
+ unless organization_reference_id == SKIP
181
+ @organization_reference_id =
182
+ organization_reference_id
183
+ end
184
+ @direction = direction
185
+ @payment_type = payment_type
186
+ @source_account_id = source_account_id unless source_account_id == SKIP
187
+ @originator_account_id = originator_account_id unless originator_account_id == SKIP
188
+ @beneficiary_account_id = beneficiary_account_id unless beneficiary_account_id == SKIP
189
+ @from_amount = from_amount
190
+ @from_currency = from_currency
191
+ @from_network = from_network unless from_network == SKIP
192
+ @to_amount = to_amount
193
+ @to_currency = to_currency
194
+ @to_network = to_network unless to_network == SKIP
195
+ @risk_status = risk_status
196
+ @risk_status_reasons = risk_status_reasons unless risk_status_reasons == SKIP
197
+ @risk_reviewed_by = risk_reviewed_by unless risk_reviewed_by == SKIP
198
+ @risk_reviewed_at = risk_reviewed_at unless risk_reviewed_at == SKIP
199
+ @balance_status = balance_status unless balance_status == SKIP
200
+ @balance_reserved_at = balance_reserved_at unless balance_reserved_at == SKIP
201
+ @steps = steps unless steps == SKIP
202
+ @created_at = created_at
203
+ @updated_at = updated_at
204
+ @expires_at = expires_at
205
+ end
206
+
207
+ # Creates an instance of the object from a hash.
208
+ def self.from_hash(hash)
209
+ return nil unless hash
210
+
211
+ # Extract variables from the hash.
212
+ id = hash.key?('id') ? hash['id'] : nil
213
+ workspace_id = hash.key?('workspace_id') ? hash['workspace_id'] : nil
214
+ direction = hash.key?('direction') ? hash['direction'] : nil
215
+ payment_type = hash.key?('payment_type') ? hash['payment_type'] : nil
216
+ from_amount = hash.key?('from_amount') ? hash['from_amount'] : nil
217
+ from_currency = hash.key?('from_currency') ? hash['from_currency'] : nil
218
+ to_amount = hash.key?('to_amount') ? hash['to_amount'] : nil
219
+ to_currency = hash.key?('to_currency') ? hash['to_currency'] : nil
220
+ risk_status = hash.key?('risk_status') ? hash['risk_status'] : nil
221
+ created_at = if hash.key?('created_at')
222
+ (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at'])
223
+ end
224
+ updated_at = if hash.key?('updated_at')
225
+ (DateTimeHelper.from_rfc3339(hash['updated_at']) if hash['updated_at'])
226
+ end
227
+ expires_at = if hash.key?('expires_at')
228
+ (DateTimeHelper.from_rfc3339(hash['expires_at']) if hash['expires_at'])
229
+ end
230
+ organization_reference_id = hash.key?('organization_reference_id') ? APIHelper.deserialize_union_type(
231
+ UnionTypeLookUp.get(:PaymentOrganizationReferenceId), hash['organization_reference_id']
232
+ ) : SKIP
233
+ source_account_id = hash.key?('source_account_id') ? APIHelper.deserialize_union_type(
234
+ UnionTypeLookUp.get(:PaymentSourceAccountId), hash['source_account_id']
235
+ ) : SKIP
236
+ originator_account_id = hash.key?('originator_account_id') ? APIHelper.deserialize_union_type(
237
+ UnionTypeLookUp.get(:PaymentOriginatorAccountId), hash['originator_account_id']
238
+ ) : SKIP
239
+ beneficiary_account_id = hash.key?('beneficiary_account_id') ? APIHelper.deserialize_union_type(
240
+ UnionTypeLookUp.get(:PaymentBeneficiaryAccountId), hash['beneficiary_account_id']
241
+ ) : SKIP
242
+ from_network = hash.key?('from_network') ? APIHelper.deserialize_union_type(
243
+ UnionTypeLookUp.get(:PaymentFromNetwork), hash['from_network']
244
+ ) : SKIP
245
+ to_network = hash.key?('to_network') ? APIHelper.deserialize_union_type(
246
+ UnionTypeLookUp.get(:PaymentToNetwork), hash['to_network']
247
+ ) : SKIP
248
+ risk_status_reasons =
249
+ hash.key?('risk_status_reasons') ? hash['risk_status_reasons'] : SKIP
250
+ risk_reviewed_by = hash.key?('risk_reviewed_by') ? APIHelper.deserialize_union_type(
251
+ UnionTypeLookUp.get(:PaymentRiskReviewedBy), hash['risk_reviewed_by']
252
+ ) : SKIP
253
+ risk_reviewed_at = hash.key?('risk_reviewed_at') ? APIHelper.deserialize_union_type(
254
+ UnionTypeLookUp.get(:PaymentRiskReviewedAt), hash['risk_reviewed_at']
255
+ ) : SKIP
256
+ balance_status = hash.key?('balance_status') ? APIHelper.deserialize_union_type(
257
+ UnionTypeLookUp.get(:PaymentBalanceStatus), hash['balance_status']
258
+ ) : SKIP
259
+ balance_reserved_at = hash.key?('balance_reserved_at') ? APIHelper.deserialize_union_type(
260
+ UnionTypeLookUp.get(:PaymentBalanceReservedAt), hash['balance_reserved_at']
261
+ ) : SKIP
262
+ # Parameter is an array, so we need to iterate through it
263
+ steps = nil
264
+ unless hash['steps'].nil?
265
+ steps = []
266
+ hash['steps'].each do |structure|
267
+ steps << (Step.from_hash(structure) if structure)
268
+ end
269
+ end
270
+
271
+ steps = SKIP unless hash.key?('steps')
272
+
273
+ # Create object from extracted values.
274
+ Payment.new(id,
275
+ workspace_id,
276
+ direction,
277
+ payment_type,
278
+ from_amount,
279
+ from_currency,
280
+ to_amount,
281
+ to_currency,
282
+ risk_status,
283
+ created_at,
284
+ updated_at,
285
+ expires_at,
286
+ organization_reference_id,
287
+ source_account_id,
288
+ originator_account_id,
289
+ beneficiary_account_id,
290
+ from_network,
291
+ to_network,
292
+ risk_status_reasons,
293
+ risk_reviewed_by,
294
+ risk_reviewed_at,
295
+ balance_status,
296
+ balance_reserved_at,
297
+ steps)
298
+ end
299
+
300
+ def to_union_type_risk_reviewed_at
301
+ UnionTypeLookUp.get(:PaymentRiskReviewedAt)
302
+ .validate(risk_reviewed_at)
303
+ .serialize(risk_reviewed_at)
304
+ end
305
+
306
+ def to_union_type_balance_reserved_at
307
+ UnionTypeLookUp.get(:PaymentBalanceReservedAt)
308
+ .validate(balance_reserved_at)
309
+ .serialize(balance_reserved_at)
310
+ end
311
+
312
+ def to_custom_created_at
313
+ DateTimeHelper.to_rfc3339(created_at)
314
+ end
315
+
316
+ def to_custom_updated_at
317
+ DateTimeHelper.to_rfc3339(updated_at)
318
+ end
319
+
320
+ def to_custom_expires_at
321
+ DateTimeHelper.to_rfc3339(expires_at)
322
+ end
323
+
324
+ # Validates an instance of the object from a given value.
325
+ # @param [Payment | Hash] The value against the validation is performed.
326
+ def self.validate(value)
327
+ if value.instance_of? self
328
+ return (
329
+ APIHelper.valid_type?(value.id,
330
+ ->(val) { val.instance_of? String }) and
331
+ APIHelper.valid_type?(value.workspace_id,
332
+ ->(val) { val.instance_of? String }) and
333
+ APIHelper.valid_type?(value.direction,
334
+ ->(val) { DirectionEnum.validate(val) }) and
335
+ APIHelper.valid_type?(value.payment_type,
336
+ ->(val) { PaymentTypeEnum.validate(val) }) and
337
+ APIHelper.valid_type?(value.from_amount,
338
+ ->(val) { val.instance_of? String }) and
339
+ APIHelper.valid_type?(value.from_currency,
340
+ ->(val) { val.instance_of? String }) and
341
+ APIHelper.valid_type?(value.to_amount,
342
+ ->(val) { val.instance_of? String }) and
343
+ APIHelper.valid_type?(value.to_currency,
344
+ ->(val) { val.instance_of? String }) and
345
+ APIHelper.valid_type?(value.risk_status,
346
+ ->(val) { RiskStatusEnum.validate(val) }) and
347
+ APIHelper.valid_type?(value.created_at,
348
+ ->(val) { val.instance_of? DateTime }) and
349
+ APIHelper.valid_type?(value.updated_at,
350
+ ->(val) { val.instance_of? DateTime }) and
351
+ APIHelper.valid_type?(value.expires_at,
352
+ ->(val) { val.instance_of? DateTime })
353
+ )
354
+ end
355
+
356
+ return false unless value.instance_of? Hash
357
+
358
+ (
359
+ APIHelper.valid_type?(value['id'],
360
+ ->(val) { val.instance_of? String }) and
361
+ APIHelper.valid_type?(value['workspace_id'],
362
+ ->(val) { val.instance_of? String }) and
363
+ APIHelper.valid_type?(value['direction'],
364
+ ->(val) { DirectionEnum.validate(val) }) and
365
+ APIHelper.valid_type?(value['payment_type'],
366
+ ->(val) { PaymentTypeEnum.validate(val) }) and
367
+ APIHelper.valid_type?(value['from_amount'],
368
+ ->(val) { val.instance_of? String }) and
369
+ APIHelper.valid_type?(value['from_currency'],
370
+ ->(val) { val.instance_of? String }) and
371
+ APIHelper.valid_type?(value['to_amount'],
372
+ ->(val) { val.instance_of? String }) and
373
+ APIHelper.valid_type?(value['to_currency'],
374
+ ->(val) { val.instance_of? String }) and
375
+ APIHelper.valid_type?(value['risk_status'],
376
+ ->(val) { RiskStatusEnum.validate(val) }) and
377
+ APIHelper.valid_type?(value['created_at'],
378
+ ->(val) { val.instance_of? String }) and
379
+ APIHelper.valid_type?(value['updated_at'],
380
+ ->(val) { val.instance_of? String }) and
381
+ APIHelper.valid_type?(value['expires_at'],
382
+ ->(val) { val.instance_of? String })
383
+ )
384
+ end
385
+
386
+ # Provides a human-readable string representation of the object.
387
+ def to_s
388
+ class_name = self.class.name.split('::').last
389
+ "<#{class_name} id: #{@id}, workspace_id: #{@workspace_id}, organization_reference_id:"\
390
+ " #{@organization_reference_id}, direction: #{@direction}, payment_type: #{@payment_type},"\
391
+ " source_account_id: #{@source_account_id}, originator_account_id:"\
392
+ " #{@originator_account_id}, beneficiary_account_id: #{@beneficiary_account_id},"\
393
+ " from_amount: #{@from_amount}, from_currency: #{@from_currency}, from_network:"\
394
+ " #{@from_network}, to_amount: #{@to_amount}, to_currency: #{@to_currency}, to_network:"\
395
+ " #{@to_network}, risk_status: #{@risk_status}, risk_status_reasons:"\
396
+ " #{@risk_status_reasons}, risk_reviewed_by: #{@risk_reviewed_by}, risk_reviewed_at:"\
397
+ " #{@risk_reviewed_at}, balance_status: #{@balance_status}, balance_reserved_at:"\
398
+ " #{@balance_reserved_at}, steps: #{@steps}, created_at: #{@created_at}, updated_at:"\
399
+ " #{@updated_at}, expires_at: #{@expires_at}>"
400
+ end
401
+
402
+ # Provides a debugging-friendly string with detailed object information.
403
+ def inspect
404
+ class_name = self.class.name.split('::').last
405
+ "<#{class_name} id: #{@id.inspect}, workspace_id: #{@workspace_id.inspect},"\
406
+ " organization_reference_id: #{@organization_reference_id.inspect}, direction:"\
407
+ " #{@direction.inspect}, payment_type: #{@payment_type.inspect}, source_account_id:"\
408
+ " #{@source_account_id.inspect}, originator_account_id: #{@originator_account_id.inspect},"\
409
+ " beneficiary_account_id: #{@beneficiary_account_id.inspect}, from_amount:"\
410
+ " #{@from_amount.inspect}, from_currency: #{@from_currency.inspect}, from_network:"\
411
+ " #{@from_network.inspect}, to_amount: #{@to_amount.inspect}, to_currency:"\
412
+ " #{@to_currency.inspect}, to_network: #{@to_network.inspect}, risk_status:"\
413
+ " #{@risk_status.inspect}, risk_status_reasons: #{@risk_status_reasons.inspect},"\
414
+ " risk_reviewed_by: #{@risk_reviewed_by.inspect}, risk_reviewed_at:"\
415
+ " #{@risk_reviewed_at.inspect}, balance_status: #{@balance_status.inspect},"\
416
+ " balance_reserved_at: #{@balance_reserved_at.inspect}, steps: #{@steps.inspect},"\
417
+ " created_at: #{@created_at.inspect}, updated_at: #{@updated_at.inspect}, expires_at:"\
418
+ " #{@expires_at.inspect}>"
419
+ end
420
+ end
421
+ end
@@ -0,0 +1,79 @@
1
+ # tesser_apiv1
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module TesserApiv1
7
+ # PaymentListResponse Model.
8
+ class PaymentListResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [Array[Data7]]
14
+ attr_accessor :data
15
+
16
+ # Pagination details
17
+ # @return [Pagination]
18
+ attr_accessor :pagination
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['data'] = 'data'
24
+ @_hash['pagination'] = 'pagination'
25
+ @_hash
26
+ end
27
+
28
+ # An array for optional fields
29
+ def self.optionals
30
+ %w[
31
+ pagination
32
+ ]
33
+ end
34
+
35
+ # An array for nullable fields
36
+ def self.nullables
37
+ []
38
+ end
39
+
40
+ def initialize(data = nil, pagination = SKIP)
41
+ @data = data
42
+ @pagination = pagination unless pagination == SKIP
43
+ end
44
+
45
+ # Creates an instance of the object from a hash.
46
+ def self.from_hash(hash)
47
+ return nil unless hash
48
+
49
+ # Extract variables from the hash.
50
+ # Parameter is an array, so we need to iterate through it
51
+ data = nil
52
+ unless hash['data'].nil?
53
+ data = []
54
+ hash['data'].each do |structure|
55
+ data << (Data7.from_hash(structure) if structure)
56
+ end
57
+ end
58
+
59
+ data = nil unless hash.key?('data')
60
+ pagination = Pagination.from_hash(hash['pagination']) if hash['pagination']
61
+
62
+ # Create object from extracted values.
63
+ PaymentListResponse.new(data,
64
+ pagination)
65
+ end
66
+
67
+ # Provides a human-readable string representation of the object.
68
+ def to_s
69
+ class_name = self.class.name.split('::').last
70
+ "<#{class_name} data: #{@data}, pagination: #{@pagination}>"
71
+ end
72
+
73
+ # Provides a debugging-friendly string with detailed object information.
74
+ def inspect
75
+ class_name = self.class.name.split('::').last
76
+ "<#{class_name} data: #{@data.inspect}, pagination: #{@pagination.inspect}>"
77
+ end
78
+ end
79
+ end