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,322 @@
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
+ # Echo of the input the validation was run with — including the customerMetadata you supplied, so results can be correlated back to your request.
18
+ class TaxValidationValidationInput < ApiModelBase
19
+ attr_accessor :scheme
20
+
21
+ attr_accessor :country_code
22
+
23
+ attr_accessor :raw_value
24
+
25
+ attr_accessor :normalized_value
26
+
27
+ attr_accessor :company_name
28
+
29
+ attr_accessor :address
30
+
31
+ attr_accessor :requester_vat_id
32
+
33
+ attr_accessor :customer_metadata
34
+
35
+ class EnumAttributeValidator
36
+ attr_reader :datatype
37
+ attr_reader :allowable_values
38
+
39
+ def initialize(datatype, allowable_values)
40
+ @allowable_values = allowable_values.map do |value|
41
+ case datatype.to_s
42
+ when /Integer/i
43
+ value.to_i
44
+ when /Float/i
45
+ value.to_f
46
+ else
47
+ value
48
+ end
49
+ end
50
+ end
51
+
52
+ def valid?(value)
53
+ !value || allowable_values.include?(value)
54
+ end
55
+ end
56
+
57
+ # Attribute mapping from ruby-style variable name to JSON key.
58
+ def self.attribute_map
59
+ {
60
+ :'scheme' => :'scheme',
61
+ :'country_code' => :'countryCode',
62
+ :'raw_value' => :'rawValue',
63
+ :'normalized_value' => :'normalizedValue',
64
+ :'company_name' => :'companyName',
65
+ :'address' => :'address',
66
+ :'requester_vat_id' => :'requesterVatId',
67
+ :'customer_metadata' => :'customerMetadata'
68
+ }
69
+ end
70
+
71
+ # Returns attribute mapping this model knows about
72
+ def self.acceptable_attribute_map
73
+ attribute_map
74
+ end
75
+
76
+ # Returns all the JSON keys this model knows about
77
+ def self.acceptable_attributes
78
+ acceptable_attribute_map.values
79
+ end
80
+
81
+ # Attribute type mapping.
82
+ def self.openapi_types
83
+ {
84
+ :'scheme' => :'TaxValidationTaxIdentifierSchemeEnum',
85
+ :'country_code' => :'String',
86
+ :'raw_value' => :'String',
87
+ :'normalized_value' => :'String',
88
+ :'company_name' => :'String',
89
+ :'address' => :'TaxValidationTaxAddress',
90
+ :'requester_vat_id' => :'String',
91
+ :'customer_metadata' => :'Hash<String, String>'
92
+ }
93
+ end
94
+
95
+ # List of attributes with nullable: true
96
+ def self.openapi_nullable
97
+ Set.new([
98
+ :'company_name',
99
+ :'requester_vat_id',
100
+ ])
101
+ end
102
+
103
+ # Initializes the object
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ def initialize(attributes = {})
106
+ if (!attributes.is_a?(Hash))
107
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrustComponent::Generated::TaxValidationValidationInput` initialize method"
108
+ end
109
+
110
+ # check to see if the attribute exists and convert string to symbol for hash key
111
+ acceptable_attribute_map = self.class.acceptable_attribute_map
112
+ attributes = attributes.each_with_object({}) { |(k, v), h|
113
+ if (!acceptable_attribute_map.key?(k.to_sym))
114
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrustComponent::Generated::TaxValidationValidationInput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
115
+ end
116
+ h[k.to_sym] = v
117
+ }
118
+
119
+ if attributes.key?(:'scheme')
120
+ self.scheme = attributes[:'scheme']
121
+ else
122
+ self.scheme = nil
123
+ end
124
+
125
+ if attributes.key?(:'country_code')
126
+ self.country_code = attributes[:'country_code']
127
+ else
128
+ self.country_code = nil
129
+ end
130
+
131
+ if attributes.key?(:'raw_value')
132
+ self.raw_value = attributes[:'raw_value']
133
+ else
134
+ self.raw_value = nil
135
+ end
136
+
137
+ if attributes.key?(:'normalized_value')
138
+ self.normalized_value = attributes[:'normalized_value']
139
+ else
140
+ self.normalized_value = nil
141
+ end
142
+
143
+ if attributes.key?(:'company_name')
144
+ self.company_name = attributes[:'company_name']
145
+ end
146
+
147
+ if attributes.key?(:'address')
148
+ self.address = attributes[:'address']
149
+ end
150
+
151
+ if attributes.key?(:'requester_vat_id')
152
+ self.requester_vat_id = attributes[:'requester_vat_id']
153
+ end
154
+
155
+ if attributes.key?(:'customer_metadata')
156
+ if (value = attributes[:'customer_metadata']).is_a?(Hash)
157
+ self.customer_metadata = value
158
+ end
159
+ else
160
+ self.customer_metadata = nil
161
+ end
162
+ end
163
+
164
+ # Show invalid properties with the reasons. Usually used together with valid?
165
+ # @return Array for valid properties with the reasons
166
+ def list_invalid_properties
167
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
168
+ invalid_properties = Array.new
169
+ if @scheme.nil?
170
+ invalid_properties.push('invalid value for "scheme", scheme cannot be nil.')
171
+ end
172
+
173
+ if @country_code.nil?
174
+ invalid_properties.push('invalid value for "country_code", country_code cannot be nil.')
175
+ end
176
+
177
+ if @raw_value.nil?
178
+ invalid_properties.push('invalid value for "raw_value", raw_value cannot be nil.')
179
+ end
180
+
181
+ if @normalized_value.nil?
182
+ invalid_properties.push('invalid value for "normalized_value", normalized_value cannot be nil.')
183
+ end
184
+
185
+ if @customer_metadata.nil?
186
+ invalid_properties.push('invalid value for "customer_metadata", customer_metadata cannot be nil.')
187
+ end
188
+
189
+ invalid_properties
190
+ end
191
+
192
+ # Check to see if the all the properties in the model are valid
193
+ # @return true if the model is valid
194
+ def valid?
195
+ warn '[DEPRECATED] the `valid?` method is obsolete'
196
+ return false if @scheme.nil?
197
+ return false if @country_code.nil?
198
+ return false if @raw_value.nil?
199
+ return false if @normalized_value.nil?
200
+ return false if @customer_metadata.nil?
201
+ true
202
+ end
203
+
204
+ # Custom attribute writer method with validation
205
+ # @param [Object] scheme Value to be assigned
206
+ def scheme=(scheme)
207
+ if scheme.nil?
208
+ fail ArgumentError, 'scheme cannot be nil'
209
+ end
210
+
211
+ @scheme = scheme
212
+ end
213
+
214
+ # Custom attribute writer method with validation
215
+ # @param [Object] country_code Value to be assigned
216
+ def country_code=(country_code)
217
+ if country_code.nil?
218
+ fail ArgumentError, 'country_code cannot be nil'
219
+ end
220
+
221
+ @country_code = country_code
222
+ end
223
+
224
+ # Custom attribute writer method with validation
225
+ # @param [Object] raw_value Value to be assigned
226
+ def raw_value=(raw_value)
227
+ if raw_value.nil?
228
+ fail ArgumentError, 'raw_value cannot be nil'
229
+ end
230
+
231
+ @raw_value = raw_value
232
+ end
233
+
234
+ # Custom attribute writer method with validation
235
+ # @param [Object] normalized_value Value to be assigned
236
+ def normalized_value=(normalized_value)
237
+ if normalized_value.nil?
238
+ fail ArgumentError, 'normalized_value cannot be nil'
239
+ end
240
+
241
+ @normalized_value = normalized_value
242
+ end
243
+
244
+ # Custom attribute writer method with validation
245
+ # @param [Object] customer_metadata Value to be assigned
246
+ def customer_metadata=(customer_metadata)
247
+ if customer_metadata.nil?
248
+ fail ArgumentError, 'customer_metadata cannot be nil'
249
+ end
250
+
251
+ @customer_metadata = customer_metadata
252
+ end
253
+
254
+ # Checks equality by comparing each attribute.
255
+ # @param [Object] Object to be compared
256
+ def ==(o)
257
+ return true if self.equal?(o)
258
+ self.class == o.class &&
259
+ scheme == o.scheme &&
260
+ country_code == o.country_code &&
261
+ raw_value == o.raw_value &&
262
+ normalized_value == o.normalized_value &&
263
+ company_name == o.company_name &&
264
+ address == o.address &&
265
+ requester_vat_id == o.requester_vat_id &&
266
+ customer_metadata == o.customer_metadata
267
+ end
268
+
269
+ # @see the `==` method
270
+ # @param [Object] Object to be compared
271
+ def eql?(o)
272
+ self == o
273
+ end
274
+
275
+ # Calculates hash code according to all attributes.
276
+ # @return [Integer] Hash code
277
+ def hash
278
+ [scheme, country_code, raw_value, normalized_value, company_name, address, requester_vat_id, customer_metadata].hash
279
+ end
280
+
281
+ # Builds the object from hash
282
+ # @param [Hash] attributes Model attributes in the form of hash
283
+ # @return [Object] Returns the model itself
284
+ def self.build_from_hash(attributes)
285
+ return nil unless attributes.is_a?(Hash)
286
+ attributes = attributes.transform_keys(&:to_sym)
287
+ transformed_hash = {}
288
+ openapi_types.each_pair do |key, type|
289
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
290
+ transformed_hash["#{key}"] = nil
291
+ elsif type =~ /\AArray<(.*)>/i
292
+ # check to ensure the input is an array given that the attribute
293
+ # is documented as an array but the input is not
294
+ if attributes[attribute_map[key]].is_a?(Array)
295
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
296
+ end
297
+ elsif !attributes[attribute_map[key]].nil?
298
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
299
+ end
300
+ end
301
+ new(transformed_hash)
302
+ end
303
+
304
+ # Returns the object in the form of hash
305
+ # @return [Hash] Returns the object in the form of hash
306
+ def to_hash
307
+ hash = {}
308
+ self.class.attribute_map.each_pair do |attr, param|
309
+ value = self.send(attr)
310
+ if value.nil?
311
+ is_nullable = self.class.openapi_nullable.include?(attr)
312
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
313
+ end
314
+
315
+ hash[param] = _to_hash(value)
316
+ end
317
+ hash
318
+ end
319
+
320
+ end
321
+
322
+ end
@@ -0,0 +1,238 @@
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 TaxValidationValidationMatch < ApiModelBase
18
+ attr_accessor :company_name
19
+
20
+ attr_accessor :address
21
+
22
+ attr_accessor :address_details
23
+
24
+ class EnumAttributeValidator
25
+ attr_reader :datatype
26
+ attr_reader :allowable_values
27
+
28
+ def initialize(datatype, allowable_values)
29
+ @allowable_values = allowable_values.map do |value|
30
+ case datatype.to_s
31
+ when /Integer/i
32
+ value.to_i
33
+ when /Float/i
34
+ value.to_f
35
+ else
36
+ value
37
+ end
38
+ end
39
+ end
40
+
41
+ def valid?(value)
42
+ !value || allowable_values.include?(value)
43
+ end
44
+ end
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'company_name' => :'companyName',
50
+ :'address' => :'address',
51
+ :'address_details' => :'addressDetails'
52
+ }
53
+ end
54
+
55
+ # Returns attribute mapping this model knows about
56
+ def self.acceptable_attribute_map
57
+ attribute_map
58
+ end
59
+
60
+ # Returns all the JSON keys this model knows about
61
+ def self.acceptable_attributes
62
+ acceptable_attribute_map.values
63
+ end
64
+
65
+ # Attribute type mapping.
66
+ def self.openapi_types
67
+ {
68
+ :'company_name' => :'TaxValidationMatchStatusEnum',
69
+ :'address' => :'TaxValidationMatchStatusEnum',
70
+ :'address_details' => :'TaxValidationValidationAddressMatch'
71
+ }
72
+ end
73
+
74
+ # List of attributes with nullable: true
75
+ def self.openapi_nullable
76
+ Set.new([
77
+ ])
78
+ end
79
+
80
+ # Initializes the object
81
+ # @param [Hash] attributes Model attributes in the form of hash
82
+ def initialize(attributes = {})
83
+ if (!attributes.is_a?(Hash))
84
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrustComponent::Generated::TaxValidationValidationMatch` initialize method"
85
+ end
86
+
87
+ # check to see if the attribute exists and convert string to symbol for hash key
88
+ acceptable_attribute_map = self.class.acceptable_attribute_map
89
+ attributes = attributes.each_with_object({}) { |(k, v), h|
90
+ if (!acceptable_attribute_map.key?(k.to_sym))
91
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrustComponent::Generated::TaxValidationValidationMatch`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
92
+ end
93
+ h[k.to_sym] = v
94
+ }
95
+
96
+ if attributes.key?(:'company_name')
97
+ self.company_name = attributes[:'company_name']
98
+ else
99
+ self.company_name = nil
100
+ end
101
+
102
+ if attributes.key?(:'address')
103
+ self.address = attributes[:'address']
104
+ else
105
+ self.address = nil
106
+ end
107
+
108
+ if attributes.key?(:'address_details')
109
+ self.address_details = attributes[:'address_details']
110
+ else
111
+ self.address_details = nil
112
+ end
113
+ end
114
+
115
+ # Show invalid properties with the reasons. Usually used together with valid?
116
+ # @return Array for valid properties with the reasons
117
+ def list_invalid_properties
118
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
119
+ invalid_properties = Array.new
120
+ if @company_name.nil?
121
+ invalid_properties.push('invalid value for "company_name", company_name cannot be nil.')
122
+ end
123
+
124
+ if @address.nil?
125
+ invalid_properties.push('invalid value for "address", address cannot be nil.')
126
+ end
127
+
128
+ if @address_details.nil?
129
+ invalid_properties.push('invalid value for "address_details", address_details cannot be nil.')
130
+ end
131
+
132
+ invalid_properties
133
+ end
134
+
135
+ # Check to see if the all the properties in the model are valid
136
+ # @return true if the model is valid
137
+ def valid?
138
+ warn '[DEPRECATED] the `valid?` method is obsolete'
139
+ return false if @company_name.nil?
140
+ return false if @address.nil?
141
+ return false if @address_details.nil?
142
+ true
143
+ end
144
+
145
+ # Custom attribute writer method with validation
146
+ # @param [Object] company_name Value to be assigned
147
+ def company_name=(company_name)
148
+ if company_name.nil?
149
+ fail ArgumentError, 'company_name cannot be nil'
150
+ end
151
+
152
+ @company_name = company_name
153
+ end
154
+
155
+ # Custom attribute writer method with validation
156
+ # @param [Object] address Value to be assigned
157
+ def address=(address)
158
+ if address.nil?
159
+ fail ArgumentError, 'address cannot be nil'
160
+ end
161
+
162
+ @address = address
163
+ end
164
+
165
+ # Custom attribute writer method with validation
166
+ # @param [Object] address_details Value to be assigned
167
+ def address_details=(address_details)
168
+ if address_details.nil?
169
+ fail ArgumentError, 'address_details cannot be nil'
170
+ end
171
+
172
+ @address_details = address_details
173
+ end
174
+
175
+ # Checks equality by comparing each attribute.
176
+ # @param [Object] Object to be compared
177
+ def ==(o)
178
+ return true if self.equal?(o)
179
+ self.class == o.class &&
180
+ company_name == o.company_name &&
181
+ address == o.address &&
182
+ address_details == o.address_details
183
+ end
184
+
185
+ # @see the `==` method
186
+ # @param [Object] Object to be compared
187
+ def eql?(o)
188
+ self == o
189
+ end
190
+
191
+ # Calculates hash code according to all attributes.
192
+ # @return [Integer] Hash code
193
+ def hash
194
+ [company_name, address, address_details].hash
195
+ end
196
+
197
+ # Builds the object from hash
198
+ # @param [Hash] attributes Model attributes in the form of hash
199
+ # @return [Object] Returns the model itself
200
+ def self.build_from_hash(attributes)
201
+ return nil unless attributes.is_a?(Hash)
202
+ attributes = attributes.transform_keys(&:to_sym)
203
+ transformed_hash = {}
204
+ openapi_types.each_pair do |key, type|
205
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
206
+ transformed_hash["#{key}"] = nil
207
+ elsif type =~ /\AArray<(.*)>/i
208
+ # check to ensure the input is an array given that the attribute
209
+ # is documented as an array but the input is not
210
+ if attributes[attribute_map[key]].is_a?(Array)
211
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
212
+ end
213
+ elsif !attributes[attribute_map[key]].nil?
214
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
215
+ end
216
+ end
217
+ new(transformed_hash)
218
+ end
219
+
220
+ # Returns the object in the form of hash
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_hash
223
+ hash = {}
224
+ self.class.attribute_map.each_pair do |attr, param|
225
+ value = self.send(attr)
226
+ if value.nil?
227
+ is_nullable = self.class.openapi_nullable.include?(attr)
228
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
229
+ end
230
+
231
+ hash[param] = _to_hash(value)
232
+ end
233
+ hash
234
+ end
235
+
236
+ end
237
+
238
+ end
@@ -0,0 +1,40 @@
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 TaxValidationValidationModeEnum
18
+ AUTOMATIC = "AUTOMATIC".freeze
19
+ MANUAL = "MANUAL".freeze
20
+
21
+ def self.all_vars
22
+ @all_vars ||= [AUTOMATIC, MANUAL].freeze
23
+ end
24
+
25
+ # Builds the enum from string
26
+ # @param [String] The enum value in the form of the string
27
+ # @return [String] The enum value
28
+ def self.build_from_hash(value)
29
+ new.build_from_hash(value)
30
+ end
31
+
32
+ # Builds the enum from string
33
+ # @param [String] The enum value in the form of the string
34
+ # @return [String] The enum value
35
+ def build_from_hash(value)
36
+ return value if TaxValidationValidationModeEnum.all_vars.include?(value)
37
+ raise "Invalid ENUM value #{value} for class #TaxValidationValidationModeEnum"
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,44 @@
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 TaxValidationValidationOutcomeEnum
18
+ VALID = "VALID".freeze
19
+ INVALID = "INVALID".freeze
20
+ UNKNOWN = "UNKNOWN".freeze
21
+ SOURCE_UNAVAILABLE = "SOURCE_UNAVAILABLE".freeze
22
+ NOT_SUPPORTED = "NOT_SUPPORTED".freeze
23
+ PLAN_RESTRICTED = "PLAN_RESTRICTED".freeze
24
+
25
+ def self.all_vars
26
+ @all_vars ||= [VALID, INVALID, UNKNOWN, SOURCE_UNAVAILABLE, NOT_SUPPORTED, PLAN_RESTRICTED].freeze
27
+ end
28
+
29
+ # Builds the enum from string
30
+ # @param [String] The enum value in the form of the string
31
+ # @return [String] The enum value
32
+ def self.build_from_hash(value)
33
+ new.build_from_hash(value)
34
+ end
35
+
36
+ # Builds the enum from string
37
+ # @param [String] The enum value in the form of the string
38
+ # @return [String] The enum value
39
+ def build_from_hash(value)
40
+ return value if TaxValidationValidationOutcomeEnum.all_vars.include?(value)
41
+ raise "Invalid ENUM value #{value} for class #TaxValidationValidationOutcomeEnum"
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,44 @@
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 TaxValidationValidationRequestStatusEnum
18
+ PENDING = "PENDING".freeze
19
+ PROCESSING = "PROCESSING".freeze
20
+ WAITING_FOR_RETRY = "WAITING_FOR_RETRY".freeze
21
+ WAITING_FOR_MANUAL_REVIEW = "WAITING_FOR_MANUAL_REVIEW".freeze
22
+ COMPLETED = "COMPLETED".freeze
23
+ CANCELLED = "CANCELLED".freeze
24
+
25
+ def self.all_vars
26
+ @all_vars ||= [PENDING, PROCESSING, WAITING_FOR_RETRY, WAITING_FOR_MANUAL_REVIEW, COMPLETED, CANCELLED].freeze
27
+ end
28
+
29
+ # Builds the enum from string
30
+ # @param [String] The enum value in the form of the string
31
+ # @return [String] The enum value
32
+ def self.build_from_hash(value)
33
+ new.build_from_hash(value)
34
+ end
35
+
36
+ # Builds the enum from string
37
+ # @param [String] The enum value in the form of the string
38
+ # @return [String] The enum value
39
+ def build_from_hash(value)
40
+ return value if TaxValidationValidationRequestStatusEnum.all_vars.include?(value)
41
+ raise "Invalid ENUM value #{value} for class #TaxValidationValidationRequestStatusEnum"
42
+ end
43
+ end
44
+ end