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