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,275 @@
1
+ # tesser_apiv1
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module TesserApiv1
7
+ # Tenant Model.
8
+ class Tenant < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Unique identifier for the tenant
13
+ # @return [String]
14
+ attr_accessor :id
15
+
16
+ # Workspace ID the tenant belongs to
17
+ # @return [String]
18
+ attr_accessor :workspace_id
19
+
20
+ # Legal business name
21
+ # @return [Object]
22
+ attr_accessor :business_legal_name
23
+
24
+ # DBA - Doing Business As
25
+ # @return [Object]
26
+ attr_accessor :business_dba
27
+
28
+ # Country code in ISO 3166-1 format
29
+ # @return [Object]
30
+ attr_accessor :business_address_country
31
+
32
+ # Street address line 1 (for businesses).
33
+ # @return [Object]
34
+ attr_accessor :business_street_address1
35
+
36
+ # Street address line 2 (for businesses).
37
+ # @return [Object]
38
+ attr_accessor :business_street_address2
39
+
40
+ # City (for businesses).
41
+ # @return [Object]
42
+ attr_accessor :business_city
43
+
44
+ # State/region (for businesses).
45
+ # @return [Object]
46
+ attr_accessor :business_state
47
+
48
+ # Legal Entity Identifier (for businesses).
49
+ # @return [Object]
50
+ attr_accessor :business_legal_entity_identifier
51
+
52
+ # Country code derived from business address
53
+ # @return [Object]
54
+ attr_accessor :country
55
+
56
+ # Webhook URL for payment creation notifications
57
+ # @return [Object]
58
+ attr_accessor :webhook_url
59
+
60
+ # Creation timestamp in ISO 8601 format
61
+ # @return [String]
62
+ attr_accessor :created_at
63
+
64
+ # Last update timestamp in ISO 8601 format
65
+ # @return [String]
66
+ attr_accessor :updated_at
67
+
68
+ # A mapping from model property names to API property names.
69
+ def self.names
70
+ @_hash = {} if @_hash.nil?
71
+ @_hash['id'] = 'id'
72
+ @_hash['workspace_id'] = 'workspace_id'
73
+ @_hash['business_legal_name'] = 'business_legal_name'
74
+ @_hash['business_dba'] = 'business_dba'
75
+ @_hash['business_address_country'] = 'business_address_country'
76
+ @_hash['business_street_address1'] = 'business_street_address1'
77
+ @_hash['business_street_address2'] = 'business_street_address2'
78
+ @_hash['business_city'] = 'business_city'
79
+ @_hash['business_state'] = 'business_state'
80
+ @_hash['business_legal_entity_identifier'] =
81
+ 'business_legal_entity_identifier'
82
+ @_hash['country'] = 'country'
83
+ @_hash['webhook_url'] = 'webhook_url'
84
+ @_hash['created_at'] = 'created_at'
85
+ @_hash['updated_at'] = 'updated_at'
86
+ @_hash
87
+ end
88
+
89
+ # An array for optional fields
90
+ def self.optionals
91
+ []
92
+ end
93
+
94
+ # An array for nullable fields
95
+ def self.nullables
96
+ []
97
+ end
98
+
99
+ def initialize(id = nil, workspace_id = nil, business_legal_name = nil,
100
+ business_dba = nil, business_address_country = nil,
101
+ business_street_address1 = nil,
102
+ business_street_address2 = nil, business_city = nil,
103
+ business_state = nil, business_legal_entity_identifier = nil,
104
+ country = nil, webhook_url = nil, created_at = nil,
105
+ updated_at = nil)
106
+ @id = id
107
+ @workspace_id = workspace_id
108
+ @business_legal_name = business_legal_name
109
+ @business_dba = business_dba
110
+ @business_address_country = business_address_country
111
+ @business_street_address1 = business_street_address1
112
+ @business_street_address2 = business_street_address2
113
+ @business_city = business_city
114
+ @business_state = business_state
115
+ @business_legal_entity_identifier = business_legal_entity_identifier
116
+ @country = country
117
+ @webhook_url = webhook_url
118
+ @created_at = created_at
119
+ @updated_at = updated_at
120
+ end
121
+
122
+ # Creates an instance of the object from a hash.
123
+ def self.from_hash(hash)
124
+ return nil unless hash
125
+
126
+ # Extract variables from the hash.
127
+ id = hash.key?('id') ? hash['id'] : nil
128
+ workspace_id = hash.key?('workspace_id') ? hash['workspace_id'] : nil
129
+ business_legal_name = hash.key?('business_legal_name') ? APIHelper.deserialize_union_type(
130
+ UnionTypeLookUp.get(:TenantBusinessLegalName), hash['business_legal_name']
131
+ ) : nil
132
+ business_dba = hash.key?('business_dba') ? APIHelper.deserialize_union_type(
133
+ UnionTypeLookUp.get(:TenantBusinessDba), hash['business_dba']
134
+ ) : nil
135
+ business_address_country = hash.key?('business_address_country') ? APIHelper.deserialize_union_type(
136
+ UnionTypeLookUp.get(:TenantBusinessAddressCountry), hash['business_address_country']
137
+ ) : nil
138
+ business_street_address1 = hash.key?('business_street_address1') ? APIHelper.deserialize_union_type(
139
+ UnionTypeLookUp.get(:TenantBusinessStreetAddress1), hash['business_street_address1']
140
+ ) : nil
141
+ business_street_address2 = hash.key?('business_street_address2') ? APIHelper.deserialize_union_type(
142
+ UnionTypeLookUp.get(:TenantBusinessStreetAddress2), hash['business_street_address2']
143
+ ) : nil
144
+ business_city = hash.key?('business_city') ? APIHelper.deserialize_union_type(
145
+ UnionTypeLookUp.get(:TenantBusinessCity), hash['business_city']
146
+ ) : nil
147
+ business_state = hash.key?('business_state') ? APIHelper.deserialize_union_type(
148
+ UnionTypeLookUp.get(:TenantBusinessState), hash['business_state']
149
+ ) : nil
150
+ business_legal_entity_identifier = hash.key?('business_legal_entity_identifier') ? APIHelper.deserialize_union_type(
151
+ UnionTypeLookUp.get(:TenantBusinessLegalEntityIdentifier), hash['business_legal_entity_identifier']
152
+ ) : nil
153
+ country = hash.key?('country') ? APIHelper.deserialize_union_type(
154
+ UnionTypeLookUp.get(:TenantCountry), hash['country']
155
+ ) : nil
156
+ webhook_url = hash.key?('webhook_url') ? APIHelper.deserialize_union_type(
157
+ UnionTypeLookUp.get(:TenantWebhookUrl), hash['webhook_url']
158
+ ) : nil
159
+ created_at = hash.key?('created_at') ? hash['created_at'] : nil
160
+ updated_at = hash.key?('updated_at') ? hash['updated_at'] : nil
161
+
162
+ # Create object from extracted values.
163
+ Tenant.new(id,
164
+ workspace_id,
165
+ business_legal_name,
166
+ business_dba,
167
+ business_address_country,
168
+ business_street_address1,
169
+ business_street_address2,
170
+ business_city,
171
+ business_state,
172
+ business_legal_entity_identifier,
173
+ country,
174
+ webhook_url,
175
+ created_at,
176
+ updated_at)
177
+ end
178
+
179
+ # Validates an instance of the object from a given value.
180
+ # @param [Tenant | Hash] The value against the validation is performed.
181
+ def self.validate(value)
182
+ if value.instance_of? self
183
+ return (
184
+ APIHelper.valid_type?(value.id,
185
+ ->(val) { val.instance_of? String }) and
186
+ APIHelper.valid_type?(value.workspace_id,
187
+ ->(val) { val.instance_of? String }) and
188
+ UnionTypeLookUp.get(:TenantBusinessLegalName)
189
+ .validate(value.business_legal_name) and
190
+ UnionTypeLookUp.get(:TenantBusinessDba)
191
+ .validate(value.business_dba) and
192
+ UnionTypeLookUp.get(:TenantBusinessAddressCountry)
193
+ .validate(value.business_address_country) and
194
+ UnionTypeLookUp.get(:TenantBusinessStreetAddress1)
195
+ .validate(value.business_street_address1) and
196
+ UnionTypeLookUp.get(:TenantBusinessStreetAddress2)
197
+ .validate(value.business_street_address2) and
198
+ UnionTypeLookUp.get(:TenantBusinessCity)
199
+ .validate(value.business_city) and
200
+ UnionTypeLookUp.get(:TenantBusinessState)
201
+ .validate(value.business_state) and
202
+ UnionTypeLookUp.get(:TenantBusinessLegalEntityIdentifier)
203
+ .validate(value.business_legal_entity_identifier) and
204
+ UnionTypeLookUp.get(:TenantCountry)
205
+ .validate(value.country) and
206
+ UnionTypeLookUp.get(:TenantWebhookUrl)
207
+ .validate(value.webhook_url) and
208
+ APIHelper.valid_type?(value.created_at,
209
+ ->(val) { val.instance_of? String }) and
210
+ APIHelper.valid_type?(value.updated_at,
211
+ ->(val) { val.instance_of? String })
212
+ )
213
+ end
214
+
215
+ return false unless value.instance_of? Hash
216
+
217
+ (
218
+ APIHelper.valid_type?(value['id'],
219
+ ->(val) { val.instance_of? String }) and
220
+ APIHelper.valid_type?(value['workspace_id'],
221
+ ->(val) { val.instance_of? String }) and
222
+ UnionTypeLookUp.get(:TenantBusinessLegalName)
223
+ .validate(value['business_legal_name']) and
224
+ UnionTypeLookUp.get(:TenantBusinessDba)
225
+ .validate(value['business_dba']) and
226
+ UnionTypeLookUp.get(:TenantBusinessAddressCountry)
227
+ .validate(value['business_address_country']) and
228
+ UnionTypeLookUp.get(:TenantBusinessStreetAddress1)
229
+ .validate(value['business_street_address1']) and
230
+ UnionTypeLookUp.get(:TenantBusinessStreetAddress2)
231
+ .validate(value['business_street_address2']) and
232
+ UnionTypeLookUp.get(:TenantBusinessCity)
233
+ .validate(value['business_city']) and
234
+ UnionTypeLookUp.get(:TenantBusinessState)
235
+ .validate(value['business_state']) and
236
+ UnionTypeLookUp.get(:TenantBusinessLegalEntityIdentifier)
237
+ .validate(value['business_legal_entity_identifier']) and
238
+ UnionTypeLookUp.get(:TenantCountry)
239
+ .validate(value['country']) and
240
+ UnionTypeLookUp.get(:TenantWebhookUrl)
241
+ .validate(value['webhook_url']) and
242
+ APIHelper.valid_type?(value['created_at'],
243
+ ->(val) { val.instance_of? String }) and
244
+ APIHelper.valid_type?(value['updated_at'],
245
+ ->(val) { val.instance_of? String })
246
+ )
247
+ end
248
+
249
+ # Provides a human-readable string representation of the object.
250
+ def to_s
251
+ class_name = self.class.name.split('::').last
252
+ "<#{class_name} id: #{@id}, workspace_id: #{@workspace_id}, business_legal_name:"\
253
+ " #{@business_legal_name}, business_dba: #{@business_dba}, business_address_country:"\
254
+ " #{@business_address_country}, business_street_address1: #{@business_street_address1},"\
255
+ " business_street_address2: #{@business_street_address2}, business_city: #{@business_city},"\
256
+ " business_state: #{@business_state}, business_legal_entity_identifier:"\
257
+ " #{@business_legal_entity_identifier}, country: #{@country}, webhook_url: #{@webhook_url},"\
258
+ " created_at: #{@created_at}, updated_at: #{@updated_at}>"
259
+ end
260
+
261
+ # Provides a debugging-friendly string with detailed object information.
262
+ def inspect
263
+ class_name = self.class.name.split('::').last
264
+ "<#{class_name} id: #{@id.inspect}, workspace_id: #{@workspace_id.inspect},"\
265
+ " business_legal_name: #{@business_legal_name.inspect}, business_dba:"\
266
+ " #{@business_dba.inspect}, business_address_country: #{@business_address_country.inspect},"\
267
+ " business_street_address1: #{@business_street_address1.inspect}, business_street_address2:"\
268
+ " #{@business_street_address2.inspect}, business_city: #{@business_city.inspect},"\
269
+ " business_state: #{@business_state.inspect}, business_legal_entity_identifier:"\
270
+ " #{@business_legal_entity_identifier.inspect}, country: #{@country.inspect}, webhook_url:"\
271
+ " #{@webhook_url.inspect}, created_at: #{@created_at.inspect}, updated_at:"\
272
+ " #{@updated_at.inspect}>"
273
+ end
274
+ end
275
+ end
@@ -0,0 +1,88 @@
1
+ # tesser_apiv1
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module TesserApiv1
7
+ # TenantApiCredentials Model.
8
+ class TenantApiCredentials < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Auth0 M2M Client ID
13
+ # @return [String]
14
+ attr_accessor :client_id
15
+
16
+ # Auth0 M2M Client Secret (only shown once!)
17
+ # @return [String]
18
+ attr_accessor :client_secret
19
+
20
+ # Auth0 token endpoint URL
21
+ # @return [String]
22
+ attr_accessor :token_endpoint
23
+
24
+ # API audience for token requests
25
+ # @return [String]
26
+ attr_accessor :audience
27
+
28
+ # A mapping from model property names to API property names.
29
+ def self.names
30
+ @_hash = {} if @_hash.nil?
31
+ @_hash['client_id'] = 'client_id'
32
+ @_hash['client_secret'] = 'client_secret'
33
+ @_hash['token_endpoint'] = 'token_endpoint'
34
+ @_hash['audience'] = 'audience'
35
+ @_hash
36
+ end
37
+
38
+ # An array for optional fields
39
+ def self.optionals
40
+ []
41
+ end
42
+
43
+ # An array for nullable fields
44
+ def self.nullables
45
+ []
46
+ end
47
+
48
+ def initialize(client_id = nil, client_secret = nil, token_endpoint = nil,
49
+ audience = nil)
50
+ @client_id = client_id
51
+ @client_secret = client_secret
52
+ @token_endpoint = token_endpoint
53
+ @audience = audience
54
+ end
55
+
56
+ # Creates an instance of the object from a hash.
57
+ def self.from_hash(hash)
58
+ return nil unless hash
59
+
60
+ # Extract variables from the hash.
61
+ client_id = hash.key?('client_id') ? hash['client_id'] : nil
62
+ client_secret = hash.key?('client_secret') ? hash['client_secret'] : nil
63
+ token_endpoint =
64
+ hash.key?('token_endpoint') ? hash['token_endpoint'] : nil
65
+ audience = hash.key?('audience') ? hash['audience'] : nil
66
+
67
+ # Create object from extracted values.
68
+ TenantApiCredentials.new(client_id,
69
+ client_secret,
70
+ token_endpoint,
71
+ audience)
72
+ end
73
+
74
+ # Provides a human-readable string representation of the object.
75
+ def to_s
76
+ class_name = self.class.name.split('::').last
77
+ "<#{class_name} client_id: #{@client_id}, client_secret: #{@client_secret}, token_endpoint:"\
78
+ " #{@token_endpoint}, audience: #{@audience}>"
79
+ end
80
+
81
+ # Provides a debugging-friendly string with detailed object information.
82
+ def inspect
83
+ class_name = self.class.name.split('::').last
84
+ "<#{class_name} client_id: #{@client_id.inspect}, client_secret: #{@client_secret.inspect},"\
85
+ " token_endpoint: #{@token_endpoint.inspect}, audience: #{@audience.inspect}>"
86
+ end
87
+ end
88
+ end
@@ -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
+ # TenantListResponse Model.
8
+ class TenantListResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # List of tenants
13
+ # @return [Array[Tenant]]
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 << (Tenant.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
+ TenantListResponse.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,60 @@
1
+ # tesser_apiv1
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module TesserApiv1
7
+ # TenantResponse Model.
8
+ class TenantResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [Data8]
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
+ data = Data8.from_hash(hash['data']) if hash['data']
43
+
44
+ # Create object from extracted values.
45
+ TenantResponse.new(data)
46
+ end
47
+
48
+ # Provides a human-readable string representation of the object.
49
+ def to_s
50
+ class_name = self.class.name.split('::').last
51
+ "<#{class_name} data: #{@data}>"
52
+ end
53
+
54
+ # Provides a debugging-friendly string with detailed object information.
55
+ def inspect
56
+ class_name = self.class.name.split('::').last
57
+ "<#{class_name} data: #{@data.inspect}>"
58
+ end
59
+ end
60
+ end