trustcomponent 0.0.1.beta.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 (86) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.md +21 -0
  3. data/README.md +78 -0
  4. data/lib/trustcomponent/captcha.rb +24 -0
  5. data/lib/trustcomponent/client.rb +44 -0
  6. data/lib/trustcomponent/errors.rb +58 -0
  7. data/lib/trustcomponent/http_middleware.rb +83 -0
  8. data/lib/trustcomponent.rb +15 -0
  9. data/lib/trustcomponent_generated/api/analytics_server_events_api.rb +90 -0
  10. data/lib/trustcomponent_generated/api/analytics_websites_api.rb +527 -0
  11. data/lib/trustcomponent_generated/api/captcha_verifications_api.rb +88 -0
  12. data/lib/trustcomponent_generated/api/monitoring_heartbeats_api.rb +89 -0
  13. data/lib/trustcomponent_generated/api/platform_events_api.rb +106 -0
  14. data/lib/trustcomponent_generated/api/tax_validation_schedules_api.rb +147 -0
  15. data/lib/trustcomponent_generated/api/tax_validation_validation_results_api.rb +83 -0
  16. data/lib/trustcomponent_generated/api/tax_validation_validations_api.rb +156 -0
  17. data/lib/trustcomponent_generated/api_client.rb +441 -0
  18. data/lib/trustcomponent_generated/api_error.rb +58 -0
  19. data/lib/trustcomponent_generated/api_model_base.rb +88 -0
  20. data/lib/trustcomponent_generated/configuration.rb +400 -0
  21. data/lib/trustcomponent_generated/models/analytics_event_category_enum.rb +52 -0
  22. data/lib/trustcomponent_generated/models/analytics_realtime.rb +251 -0
  23. data/lib/trustcomponent_generated/models/analytics_realtime_page.rb +193 -0
  24. data/lib/trustcomponent_generated/models/analytics_realtime_point.rb +193 -0
  25. data/lib/trustcomponent_generated/models/analytics_server_event_batch_create_params.rb +295 -0
  26. data/lib/trustcomponent_generated/models/analytics_server_event_batch_event_commerce_create_params.rb +366 -0
  27. data/lib/trustcomponent_generated/models/analytics_server_event_batch_event_commerce_product_create_params.rb +298 -0
  28. data/lib/trustcomponent_generated/models/analytics_server_event_batch_event_create_params.rb +508 -0
  29. data/lib/trustcomponent_generated/models/analytics_server_event_batch_event_error_create_params.rb +269 -0
  30. data/lib/trustcomponent_generated/models/analytics_server_event_batch_event_refund_create_params.rb +211 -0
  31. data/lib/trustcomponent_generated/models/analytics_server_event_batch_result.rb +194 -0
  32. data/lib/trustcomponent_generated/models/analytics_server_event_batch_result_drop_reason_enum.rb +52 -0
  33. data/lib/trustcomponent_generated/models/analytics_server_event_batch_result_dropped.rb +213 -0
  34. data/lib/trustcomponent_generated/models/analytics_stats_breakdown.rb +351 -0
  35. data/lib/trustcomponent_generated/models/analytics_stats_breakdown_row.rb +201 -0
  36. data/lib/trustcomponent_generated/models/analytics_stats_breakdown_row_page.rb +226 -0
  37. data/lib/trustcomponent_generated/models/analytics_stats_conversions.rb +249 -0
  38. data/lib/trustcomponent_generated/models/analytics_stats_conversions_goal.rb +260 -0
  39. data/lib/trustcomponent_generated/models/analytics_stats_conversions_goal_revenue.rb +193 -0
  40. data/lib/trustcomponent_generated/models/analytics_stats_dimension_enum.rb +69 -0
  41. data/lib/trustcomponent_generated/models/analytics_stats_filter_match_mode_enum.rb +40 -0
  42. data/lib/trustcomponent_generated/models/analytics_stats_filter_operator_enum.rb +45 -0
  43. data/lib/trustcomponent_generated/models/analytics_stats_granularity_enum.rb +40 -0
  44. data/lib/trustcomponent_generated/models/analytics_stats_overview.rb +282 -0
  45. data/lib/trustcomponent_generated/models/analytics_stats_timeseries.rb +270 -0
  46. data/lib/trustcomponent_generated/models/analytics_stats_timeseries_point.rb +192 -0
  47. data/lib/trustcomponent_generated/models/analytics_stats_totals.rb +307 -0
  48. data/lib/trustcomponent_generated/models/analytics_website.rb +249 -0
  49. data/lib/trustcomponent_generated/models/analytics_websites_page.rb +249 -0
  50. data/lib/trustcomponent_generated/models/captcha_verification_result.rb +350 -0
  51. data/lib/trustcomponent_generated/models/platform_event.rb +439 -0
  52. data/lib/trustcomponent_generated/models/platform_event_actor.rb +218 -0
  53. data/lib/trustcomponent_generated/models/platform_event_actor_automation.rb +214 -0
  54. data/lib/trustcomponent_generated/models/platform_event_actor_automation_kind_enum.rb +41 -0
  55. data/lib/trustcomponent_generated/models/platform_event_actor_type_enum.rb +43 -0
  56. data/lib/trustcomponent_generated/models/platform_event_change.rb +263 -0
  57. data/lib/trustcomponent_generated/models/platform_event_change_operation_enum.rb +43 -0
  58. data/lib/trustcomponent_generated/models/platform_event_origin.rb +263 -0
  59. data/lib/trustcomponent_generated/models/platform_event_ref.rb +204 -0
  60. data/lib/trustcomponent_generated/models/platform_event_source_enum.rb +44 -0
  61. data/lib/trustcomponent_generated/models/platform_events_page.rb +314 -0
  62. data/lib/trustcomponent_generated/models/tax_validation_match_status_enum.rb +44 -0
  63. data/lib/trustcomponent_generated/models/tax_validation_provider_enum.rb +46 -0
  64. data/lib/trustcomponent_generated/models/tax_validation_provider_status_enum.rb +51 -0
  65. data/lib/trustcomponent_generated/models/tax_validation_schedule.rb +423 -0
  66. data/lib/trustcomponent_generated/models/tax_validation_schedule_create_params.rb +321 -0
  67. data/lib/trustcomponent_generated/models/tax_validation_tax_address.rb +188 -0
  68. data/lib/trustcomponent_generated/models/tax_validation_tax_identifier_scheme_enum.rb +49 -0
  69. data/lib/trustcomponent_generated/models/tax_validation_validation.rb +372 -0
  70. data/lib/trustcomponent_generated/models/tax_validation_validation_address_match.rb +290 -0
  71. data/lib/trustcomponent_generated/models/tax_validation_validation_batch_create_params.rb +176 -0
  72. data/lib/trustcomponent_generated/models/tax_validation_validation_create_params.rb +292 -0
  73. data/lib/trustcomponent_generated/models/tax_validation_validation_frequency_enum.rb +41 -0
  74. data/lib/trustcomponent_generated/models/tax_validation_validation_input.rb +322 -0
  75. data/lib/trustcomponent_generated/models/tax_validation_validation_match.rb +238 -0
  76. data/lib/trustcomponent_generated/models/tax_validation_validation_mode_enum.rb +40 -0
  77. data/lib/trustcomponent_generated/models/tax_validation_validation_outcome_enum.rb +44 -0
  78. data/lib/trustcomponent_generated/models/tax_validation_validation_request_status_enum.rb +44 -0
  79. data/lib/trustcomponent_generated/models/tax_validation_validation_response_data.rb +177 -0
  80. data/lib/trustcomponent_generated/models/tax_validation_validation_result.rb +459 -0
  81. data/lib/trustcomponent_generated/models/tax_validation_validation_schedule_attach_params.rb +225 -0
  82. data/lib/trustcomponent_generated/models/tax_validation_verification_method_enum.rb +40 -0
  83. data/lib/trustcomponent_generated/modules.rb +51 -0
  84. data/lib/trustcomponent_generated/version.rb +15 -0
  85. data/lib/trustcomponent_generated.rb +110 -0
  86. metadata +190 -0
@@ -0,0 +1,372 @@
1
+ =begin
2
+ #TrustComponent API
3
+
4
+ #The public API of every TrustComponent module, authenticated with an API key (`ak_…`). Each operation carries its own version in its path.
5
+
6
+ The version of the OpenAPI document: 0.0.1-beta.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.24.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TrustComponent::Generated
17
+ class TaxValidationValidation < ApiModelBase
18
+ attr_accessor :validation_request_id
19
+
20
+ attr_accessor :validation_result_id
21
+
22
+ # The stored TaxIdentifier this validation resolved to.
23
+ attr_accessor :tax_identifier_id
24
+
25
+ attr_accessor :status
26
+
27
+ attr_accessor :input
28
+
29
+ attr_accessor :outcome
30
+
31
+ attr_accessor :provider
32
+
33
+ attr_accessor :provider_status
34
+
35
+ attr_accessor :match
36
+
37
+ attr_accessor :response_data
38
+
39
+ attr_accessor :checked_at
40
+
41
+ # Why the last automatic attempt failed (e.g. the source was unavailable). Present while the validation is retrying or awaiting manual review.
42
+ attr_accessor :failure_reason
43
+
44
+ # When the next automatic attempt is scheduled, while the validation is retrying.
45
+ attr_accessor :next_retry_at
46
+
47
+ attr_accessor :idempotency_key
48
+
49
+ attr_accessor :correlation_id
50
+
51
+ class EnumAttributeValidator
52
+ attr_reader :datatype
53
+ attr_reader :allowable_values
54
+
55
+ def initialize(datatype, allowable_values)
56
+ @allowable_values = allowable_values.map do |value|
57
+ case datatype.to_s
58
+ when /Integer/i
59
+ value.to_i
60
+ when /Float/i
61
+ value.to_f
62
+ else
63
+ value
64
+ end
65
+ end
66
+ end
67
+
68
+ def valid?(value)
69
+ !value || allowable_values.include?(value)
70
+ end
71
+ end
72
+
73
+ # Attribute mapping from ruby-style variable name to JSON key.
74
+ def self.attribute_map
75
+ {
76
+ :'validation_request_id' => :'validationRequestId',
77
+ :'validation_result_id' => :'validationResultId',
78
+ :'tax_identifier_id' => :'taxIdentifierId',
79
+ :'status' => :'status',
80
+ :'input' => :'input',
81
+ :'outcome' => :'outcome',
82
+ :'provider' => :'provider',
83
+ :'provider_status' => :'providerStatus',
84
+ :'match' => :'match',
85
+ :'response_data' => :'responseData',
86
+ :'checked_at' => :'checkedAt',
87
+ :'failure_reason' => :'failureReason',
88
+ :'next_retry_at' => :'nextRetryAt',
89
+ :'idempotency_key' => :'idempotencyKey',
90
+ :'correlation_id' => :'correlationId'
91
+ }
92
+ end
93
+
94
+ # Returns attribute mapping this model knows about
95
+ def self.acceptable_attribute_map
96
+ attribute_map
97
+ end
98
+
99
+ # Returns all the JSON keys this model knows about
100
+ def self.acceptable_attributes
101
+ acceptable_attribute_map.values
102
+ end
103
+
104
+ # Attribute type mapping.
105
+ def self.openapi_types
106
+ {
107
+ :'validation_request_id' => :'String',
108
+ :'validation_result_id' => :'String',
109
+ :'tax_identifier_id' => :'String',
110
+ :'status' => :'TaxValidationValidationRequestStatusEnum',
111
+ :'input' => :'TaxValidationValidationInput',
112
+ :'outcome' => :'TaxValidationValidationOutcomeEnum',
113
+ :'provider' => :'TaxValidationProviderEnum',
114
+ :'provider_status' => :'TaxValidationProviderStatusEnum',
115
+ :'match' => :'TaxValidationValidationMatch',
116
+ :'response_data' => :'TaxValidationValidationResponseData',
117
+ :'checked_at' => :'String',
118
+ :'failure_reason' => :'String',
119
+ :'next_retry_at' => :'String',
120
+ :'idempotency_key' => :'String',
121
+ :'correlation_id' => :'String'
122
+ }
123
+ end
124
+
125
+ # List of attributes with nullable: true
126
+ def self.openapi_nullable
127
+ Set.new([
128
+ :'validation_result_id',
129
+ :'checked_at',
130
+ :'failure_reason',
131
+ :'next_retry_at',
132
+ :'idempotency_key',
133
+ :'correlation_id'
134
+ ])
135
+ end
136
+
137
+ # Initializes the object
138
+ # @param [Hash] attributes Model attributes in the form of hash
139
+ def initialize(attributes = {})
140
+ if (!attributes.is_a?(Hash))
141
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrustComponent::Generated::TaxValidationValidation` initialize method"
142
+ end
143
+
144
+ # check to see if the attribute exists and convert string to symbol for hash key
145
+ acceptable_attribute_map = self.class.acceptable_attribute_map
146
+ attributes = attributes.each_with_object({}) { |(k, v), h|
147
+ if (!acceptable_attribute_map.key?(k.to_sym))
148
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrustComponent::Generated::TaxValidationValidation`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
149
+ end
150
+ h[k.to_sym] = v
151
+ }
152
+
153
+ if attributes.key?(:'validation_request_id')
154
+ self.validation_request_id = attributes[:'validation_request_id']
155
+ else
156
+ self.validation_request_id = nil
157
+ end
158
+
159
+ if attributes.key?(:'validation_result_id')
160
+ self.validation_result_id = attributes[:'validation_result_id']
161
+ end
162
+
163
+ if attributes.key?(:'tax_identifier_id')
164
+ self.tax_identifier_id = attributes[:'tax_identifier_id']
165
+ else
166
+ self.tax_identifier_id = nil
167
+ end
168
+
169
+ if attributes.key?(:'status')
170
+ self.status = attributes[:'status']
171
+ else
172
+ self.status = nil
173
+ end
174
+
175
+ if attributes.key?(:'input')
176
+ self.input = attributes[:'input']
177
+ else
178
+ self.input = nil
179
+ end
180
+
181
+ if attributes.key?(:'outcome')
182
+ self.outcome = attributes[:'outcome']
183
+ end
184
+
185
+ if attributes.key?(:'provider')
186
+ self.provider = attributes[:'provider']
187
+ end
188
+
189
+ if attributes.key?(:'provider_status')
190
+ self.provider_status = attributes[:'provider_status']
191
+ end
192
+
193
+ if attributes.key?(:'match')
194
+ self.match = attributes[:'match']
195
+ end
196
+
197
+ if attributes.key?(:'response_data')
198
+ self.response_data = attributes[:'response_data']
199
+ end
200
+
201
+ if attributes.key?(:'checked_at')
202
+ self.checked_at = attributes[:'checked_at']
203
+ end
204
+
205
+ if attributes.key?(:'failure_reason')
206
+ self.failure_reason = attributes[:'failure_reason']
207
+ end
208
+
209
+ if attributes.key?(:'next_retry_at')
210
+ self.next_retry_at = attributes[:'next_retry_at']
211
+ end
212
+
213
+ if attributes.key?(:'idempotency_key')
214
+ self.idempotency_key = attributes[:'idempotency_key']
215
+ end
216
+
217
+ if attributes.key?(:'correlation_id')
218
+ self.correlation_id = attributes[:'correlation_id']
219
+ end
220
+ end
221
+
222
+ # Show invalid properties with the reasons. Usually used together with valid?
223
+ # @return Array for valid properties with the reasons
224
+ def list_invalid_properties
225
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
226
+ invalid_properties = Array.new
227
+ if @validation_request_id.nil?
228
+ invalid_properties.push('invalid value for "validation_request_id", validation_request_id cannot be nil.')
229
+ end
230
+
231
+ if @tax_identifier_id.nil?
232
+ invalid_properties.push('invalid value for "tax_identifier_id", tax_identifier_id cannot be nil.')
233
+ end
234
+
235
+ if @status.nil?
236
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
237
+ end
238
+
239
+ if @input.nil?
240
+ invalid_properties.push('invalid value for "input", input cannot be nil.')
241
+ end
242
+
243
+ invalid_properties
244
+ end
245
+
246
+ # Check to see if the all the properties in the model are valid
247
+ # @return true if the model is valid
248
+ def valid?
249
+ warn '[DEPRECATED] the `valid?` method is obsolete'
250
+ return false if @validation_request_id.nil?
251
+ return false if @tax_identifier_id.nil?
252
+ return false if @status.nil?
253
+ return false if @input.nil?
254
+ true
255
+ end
256
+
257
+ # Custom attribute writer method with validation
258
+ # @param [Object] validation_request_id Value to be assigned
259
+ def validation_request_id=(validation_request_id)
260
+ if validation_request_id.nil?
261
+ fail ArgumentError, 'validation_request_id cannot be nil'
262
+ end
263
+
264
+ @validation_request_id = validation_request_id
265
+ end
266
+
267
+ # Custom attribute writer method with validation
268
+ # @param [Object] tax_identifier_id Value to be assigned
269
+ def tax_identifier_id=(tax_identifier_id)
270
+ if tax_identifier_id.nil?
271
+ fail ArgumentError, 'tax_identifier_id cannot be nil'
272
+ end
273
+
274
+ @tax_identifier_id = tax_identifier_id
275
+ end
276
+
277
+ # Custom attribute writer method with validation
278
+ # @param [Object] status Value to be assigned
279
+ def status=(status)
280
+ if status.nil?
281
+ fail ArgumentError, 'status cannot be nil'
282
+ end
283
+
284
+ @status = status
285
+ end
286
+
287
+ # Custom attribute writer method with validation
288
+ # @param [Object] input Value to be assigned
289
+ def input=(input)
290
+ if input.nil?
291
+ fail ArgumentError, 'input cannot be nil'
292
+ end
293
+
294
+ @input = input
295
+ end
296
+
297
+ # Checks equality by comparing each attribute.
298
+ # @param [Object] Object to be compared
299
+ def ==(o)
300
+ return true if self.equal?(o)
301
+ self.class == o.class &&
302
+ validation_request_id == o.validation_request_id &&
303
+ validation_result_id == o.validation_result_id &&
304
+ tax_identifier_id == o.tax_identifier_id &&
305
+ status == o.status &&
306
+ input == o.input &&
307
+ outcome == o.outcome &&
308
+ provider == o.provider &&
309
+ provider_status == o.provider_status &&
310
+ match == o.match &&
311
+ response_data == o.response_data &&
312
+ checked_at == o.checked_at &&
313
+ failure_reason == o.failure_reason &&
314
+ next_retry_at == o.next_retry_at &&
315
+ idempotency_key == o.idempotency_key &&
316
+ correlation_id == o.correlation_id
317
+ end
318
+
319
+ # @see the `==` method
320
+ # @param [Object] Object to be compared
321
+ def eql?(o)
322
+ self == o
323
+ end
324
+
325
+ # Calculates hash code according to all attributes.
326
+ # @return [Integer] Hash code
327
+ def hash
328
+ [validation_request_id, validation_result_id, tax_identifier_id, status, input, outcome, provider, provider_status, match, response_data, checked_at, failure_reason, next_retry_at, idempotency_key, correlation_id].hash
329
+ end
330
+
331
+ # Builds the object from hash
332
+ # @param [Hash] attributes Model attributes in the form of hash
333
+ # @return [Object] Returns the model itself
334
+ def self.build_from_hash(attributes)
335
+ return nil unless attributes.is_a?(Hash)
336
+ attributes = attributes.transform_keys(&:to_sym)
337
+ transformed_hash = {}
338
+ openapi_types.each_pair do |key, type|
339
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
340
+ transformed_hash["#{key}"] = nil
341
+ elsif type =~ /\AArray<(.*)>/i
342
+ # check to ensure the input is an array given that the attribute
343
+ # is documented as an array but the input is not
344
+ if attributes[attribute_map[key]].is_a?(Array)
345
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
346
+ end
347
+ elsif !attributes[attribute_map[key]].nil?
348
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
349
+ end
350
+ end
351
+ new(transformed_hash)
352
+ end
353
+
354
+ # Returns the object in the form of hash
355
+ # @return [Hash] Returns the object in the form of hash
356
+ def to_hash
357
+ hash = {}
358
+ self.class.attribute_map.each_pair do |attr, param|
359
+ value = self.send(attr)
360
+ if value.nil?
361
+ is_nullable = self.class.openapi_nullable.include?(attr)
362
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
363
+ end
364
+
365
+ hash[param] = _to_hash(value)
366
+ end
367
+ hash
368
+ end
369
+
370
+ end
371
+
372
+ end
@@ -0,0 +1,290 @@
1
+ =begin
2
+ #TrustComponent API
3
+
4
+ #The public API of every TrustComponent module, authenticated with an API key (`ak_…`). Each operation carries its own version in its path.
5
+
6
+ The version of the OpenAPI document: 0.0.1-beta.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.24.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TrustComponent::Generated
17
+ class TaxValidationValidationAddressMatch < ApiModelBase
18
+ attr_accessor :street
19
+
20
+ attr_accessor :postal_code
21
+
22
+ attr_accessor :city
23
+
24
+ attr_accessor :region
25
+
26
+ attr_accessor :country_code
27
+
28
+ class EnumAttributeValidator
29
+ attr_reader :datatype
30
+ attr_reader :allowable_values
31
+
32
+ def initialize(datatype, allowable_values)
33
+ @allowable_values = allowable_values.map do |value|
34
+ case datatype.to_s
35
+ when /Integer/i
36
+ value.to_i
37
+ when /Float/i
38
+ value.to_f
39
+ else
40
+ value
41
+ end
42
+ end
43
+ end
44
+
45
+ def valid?(value)
46
+ !value || allowable_values.include?(value)
47
+ end
48
+ end
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'street' => :'street',
54
+ :'postal_code' => :'postalCode',
55
+ :'city' => :'city',
56
+ :'region' => :'region',
57
+ :'country_code' => :'countryCode'
58
+ }
59
+ end
60
+
61
+ # Returns attribute mapping this model knows about
62
+ def self.acceptable_attribute_map
63
+ attribute_map
64
+ end
65
+
66
+ # Returns all the JSON keys this model knows about
67
+ def self.acceptable_attributes
68
+ acceptable_attribute_map.values
69
+ end
70
+
71
+ # Attribute type mapping.
72
+ def self.openapi_types
73
+ {
74
+ :'street' => :'TaxValidationMatchStatusEnum',
75
+ :'postal_code' => :'TaxValidationMatchStatusEnum',
76
+ :'city' => :'TaxValidationMatchStatusEnum',
77
+ :'region' => :'TaxValidationMatchStatusEnum',
78
+ :'country_code' => :'TaxValidationMatchStatusEnum'
79
+ }
80
+ end
81
+
82
+ # List of attributes with nullable: true
83
+ def self.openapi_nullable
84
+ Set.new([
85
+ ])
86
+ end
87
+
88
+ # Initializes the object
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ def initialize(attributes = {})
91
+ if (!attributes.is_a?(Hash))
92
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrustComponent::Generated::TaxValidationValidationAddressMatch` initialize method"
93
+ end
94
+
95
+ # check to see if the attribute exists and convert string to symbol for hash key
96
+ acceptable_attribute_map = self.class.acceptable_attribute_map
97
+ attributes = attributes.each_with_object({}) { |(k, v), h|
98
+ if (!acceptable_attribute_map.key?(k.to_sym))
99
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrustComponent::Generated::TaxValidationValidationAddressMatch`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
100
+ end
101
+ h[k.to_sym] = v
102
+ }
103
+
104
+ if attributes.key?(:'street')
105
+ self.street = attributes[:'street']
106
+ else
107
+ self.street = nil
108
+ end
109
+
110
+ if attributes.key?(:'postal_code')
111
+ self.postal_code = attributes[:'postal_code']
112
+ else
113
+ self.postal_code = nil
114
+ end
115
+
116
+ if attributes.key?(:'city')
117
+ self.city = attributes[:'city']
118
+ else
119
+ self.city = nil
120
+ end
121
+
122
+ if attributes.key?(:'region')
123
+ self.region = attributes[:'region']
124
+ else
125
+ self.region = nil
126
+ end
127
+
128
+ if attributes.key?(:'country_code')
129
+ self.country_code = attributes[:'country_code']
130
+ else
131
+ self.country_code = nil
132
+ end
133
+ end
134
+
135
+ # Show invalid properties with the reasons. Usually used together with valid?
136
+ # @return Array for valid properties with the reasons
137
+ def list_invalid_properties
138
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
139
+ invalid_properties = Array.new
140
+ if @street.nil?
141
+ invalid_properties.push('invalid value for "street", street cannot be nil.')
142
+ end
143
+
144
+ if @postal_code.nil?
145
+ invalid_properties.push('invalid value for "postal_code", postal_code cannot be nil.')
146
+ end
147
+
148
+ if @city.nil?
149
+ invalid_properties.push('invalid value for "city", city cannot be nil.')
150
+ end
151
+
152
+ if @region.nil?
153
+ invalid_properties.push('invalid value for "region", region cannot be nil.')
154
+ end
155
+
156
+ if @country_code.nil?
157
+ invalid_properties.push('invalid value for "country_code", country_code cannot be nil.')
158
+ end
159
+
160
+ invalid_properties
161
+ end
162
+
163
+ # Check to see if the all the properties in the model are valid
164
+ # @return true if the model is valid
165
+ def valid?
166
+ warn '[DEPRECATED] the `valid?` method is obsolete'
167
+ return false if @street.nil?
168
+ return false if @postal_code.nil?
169
+ return false if @city.nil?
170
+ return false if @region.nil?
171
+ return false if @country_code.nil?
172
+ true
173
+ end
174
+
175
+ # Custom attribute writer method with validation
176
+ # @param [Object] street Value to be assigned
177
+ def street=(street)
178
+ if street.nil?
179
+ fail ArgumentError, 'street cannot be nil'
180
+ end
181
+
182
+ @street = street
183
+ end
184
+
185
+ # Custom attribute writer method with validation
186
+ # @param [Object] postal_code Value to be assigned
187
+ def postal_code=(postal_code)
188
+ if postal_code.nil?
189
+ fail ArgumentError, 'postal_code cannot be nil'
190
+ end
191
+
192
+ @postal_code = postal_code
193
+ end
194
+
195
+ # Custom attribute writer method with validation
196
+ # @param [Object] city Value to be assigned
197
+ def city=(city)
198
+ if city.nil?
199
+ fail ArgumentError, 'city cannot be nil'
200
+ end
201
+
202
+ @city = city
203
+ end
204
+
205
+ # Custom attribute writer method with validation
206
+ # @param [Object] region Value to be assigned
207
+ def region=(region)
208
+ if region.nil?
209
+ fail ArgumentError, 'region cannot be nil'
210
+ end
211
+
212
+ @region = region
213
+ end
214
+
215
+ # Custom attribute writer method with validation
216
+ # @param [Object] country_code Value to be assigned
217
+ def country_code=(country_code)
218
+ if country_code.nil?
219
+ fail ArgumentError, 'country_code cannot be nil'
220
+ end
221
+
222
+ @country_code = country_code
223
+ end
224
+
225
+ # Checks equality by comparing each attribute.
226
+ # @param [Object] Object to be compared
227
+ def ==(o)
228
+ return true if self.equal?(o)
229
+ self.class == o.class &&
230
+ street == o.street &&
231
+ postal_code == o.postal_code &&
232
+ city == o.city &&
233
+ region == o.region &&
234
+ country_code == o.country_code
235
+ end
236
+
237
+ # @see the `==` method
238
+ # @param [Object] Object to be compared
239
+ def eql?(o)
240
+ self == o
241
+ end
242
+
243
+ # Calculates hash code according to all attributes.
244
+ # @return [Integer] Hash code
245
+ def hash
246
+ [street, postal_code, city, region, country_code].hash
247
+ end
248
+
249
+ # Builds the object from hash
250
+ # @param [Hash] attributes Model attributes in the form of hash
251
+ # @return [Object] Returns the model itself
252
+ def self.build_from_hash(attributes)
253
+ return nil unless attributes.is_a?(Hash)
254
+ attributes = attributes.transform_keys(&:to_sym)
255
+ transformed_hash = {}
256
+ openapi_types.each_pair do |key, type|
257
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
258
+ transformed_hash["#{key}"] = nil
259
+ elsif type =~ /\AArray<(.*)>/i
260
+ # check to ensure the input is an array given that the attribute
261
+ # is documented as an array but the input is not
262
+ if attributes[attribute_map[key]].is_a?(Array)
263
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
264
+ end
265
+ elsif !attributes[attribute_map[key]].nil?
266
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
267
+ end
268
+ end
269
+ new(transformed_hash)
270
+ end
271
+
272
+ # Returns the object in the form of hash
273
+ # @return [Hash] Returns the object in the form of hash
274
+ def to_hash
275
+ hash = {}
276
+ self.class.attribute_map.each_pair do |attr, param|
277
+ value = self.send(attr)
278
+ if value.nil?
279
+ is_nullable = self.class.openapi_nullable.include?(attr)
280
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
281
+ end
282
+
283
+ hash[param] = _to_hash(value)
284
+ end
285
+ hash
286
+ end
287
+
288
+ end
289
+
290
+ end