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,423 @@
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 TaxValidationSchedule < ApiModelBase
18
+ attr_accessor :schedule_id
19
+
20
+ attr_accessor :tax_identifier_id
21
+
22
+ attr_accessor :country_code
23
+
24
+ attr_accessor :normalized_value
25
+
26
+ attr_accessor :frequency
27
+
28
+ attr_accessor :mode
29
+
30
+ attr_accessor :preferred_provider
31
+
32
+ attr_accessor :manual_review_on_automatic_failure
33
+
34
+ attr_accessor :is_enabled
35
+
36
+ attr_accessor :next_run_at
37
+
38
+ attr_accessor :last_run_at
39
+
40
+ attr_accessor :latest_validation_result_id
41
+
42
+ class EnumAttributeValidator
43
+ attr_reader :datatype
44
+ attr_reader :allowable_values
45
+
46
+ def initialize(datatype, allowable_values)
47
+ @allowable_values = allowable_values.map do |value|
48
+ case datatype.to_s
49
+ when /Integer/i
50
+ value.to_i
51
+ when /Float/i
52
+ value.to_f
53
+ else
54
+ value
55
+ end
56
+ end
57
+ end
58
+
59
+ def valid?(value)
60
+ !value || allowable_values.include?(value)
61
+ end
62
+ end
63
+
64
+ # Attribute mapping from ruby-style variable name to JSON key.
65
+ def self.attribute_map
66
+ {
67
+ :'schedule_id' => :'scheduleId',
68
+ :'tax_identifier_id' => :'taxIdentifierId',
69
+ :'country_code' => :'countryCode',
70
+ :'normalized_value' => :'normalizedValue',
71
+ :'frequency' => :'frequency',
72
+ :'mode' => :'mode',
73
+ :'preferred_provider' => :'preferredProvider',
74
+ :'manual_review_on_automatic_failure' => :'manualReviewOnAutomaticFailure',
75
+ :'is_enabled' => :'isEnabled',
76
+ :'next_run_at' => :'nextRunAt',
77
+ :'last_run_at' => :'lastRunAt',
78
+ :'latest_validation_result_id' => :'latestValidationResultId'
79
+ }
80
+ end
81
+
82
+ # Returns attribute mapping this model knows about
83
+ def self.acceptable_attribute_map
84
+ attribute_map
85
+ end
86
+
87
+ # Returns all the JSON keys this model knows about
88
+ def self.acceptable_attributes
89
+ acceptable_attribute_map.values
90
+ end
91
+
92
+ # Attribute type mapping.
93
+ def self.openapi_types
94
+ {
95
+ :'schedule_id' => :'String',
96
+ :'tax_identifier_id' => :'String',
97
+ :'country_code' => :'String',
98
+ :'normalized_value' => :'String',
99
+ :'frequency' => :'TaxValidationValidationFrequencyEnum',
100
+ :'mode' => :'TaxValidationValidationModeEnum',
101
+ :'preferred_provider' => :'TaxValidationProviderEnum',
102
+ :'manual_review_on_automatic_failure' => :'Boolean',
103
+ :'is_enabled' => :'Boolean',
104
+ :'next_run_at' => :'String',
105
+ :'last_run_at' => :'String',
106
+ :'latest_validation_result_id' => :'String'
107
+ }
108
+ end
109
+
110
+ # List of attributes with nullable: true
111
+ def self.openapi_nullable
112
+ Set.new([
113
+ :'last_run_at',
114
+ :'latest_validation_result_id'
115
+ ])
116
+ end
117
+
118
+ # Initializes the object
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ def initialize(attributes = {})
121
+ if (!attributes.is_a?(Hash))
122
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrustComponent::Generated::TaxValidationSchedule` initialize method"
123
+ end
124
+
125
+ # check to see if the attribute exists and convert string to symbol for hash key
126
+ acceptable_attribute_map = self.class.acceptable_attribute_map
127
+ attributes = attributes.each_with_object({}) { |(k, v), h|
128
+ if (!acceptable_attribute_map.key?(k.to_sym))
129
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrustComponent::Generated::TaxValidationSchedule`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
130
+ end
131
+ h[k.to_sym] = v
132
+ }
133
+
134
+ if attributes.key?(:'schedule_id')
135
+ self.schedule_id = attributes[:'schedule_id']
136
+ else
137
+ self.schedule_id = nil
138
+ end
139
+
140
+ if attributes.key?(:'tax_identifier_id')
141
+ self.tax_identifier_id = attributes[:'tax_identifier_id']
142
+ else
143
+ self.tax_identifier_id = nil
144
+ end
145
+
146
+ if attributes.key?(:'country_code')
147
+ self.country_code = attributes[:'country_code']
148
+ else
149
+ self.country_code = nil
150
+ end
151
+
152
+ if attributes.key?(:'normalized_value')
153
+ self.normalized_value = attributes[:'normalized_value']
154
+ else
155
+ self.normalized_value = nil
156
+ end
157
+
158
+ if attributes.key?(:'frequency')
159
+ self.frequency = attributes[:'frequency']
160
+ else
161
+ self.frequency = nil
162
+ end
163
+
164
+ if attributes.key?(:'mode')
165
+ self.mode = attributes[:'mode']
166
+ else
167
+ self.mode = nil
168
+ end
169
+
170
+ if attributes.key?(:'preferred_provider')
171
+ self.preferred_provider = attributes[:'preferred_provider']
172
+ end
173
+
174
+ if attributes.key?(:'manual_review_on_automatic_failure')
175
+ self.manual_review_on_automatic_failure = attributes[:'manual_review_on_automatic_failure']
176
+ else
177
+ self.manual_review_on_automatic_failure = nil
178
+ end
179
+
180
+ if attributes.key?(:'is_enabled')
181
+ self.is_enabled = attributes[:'is_enabled']
182
+ else
183
+ self.is_enabled = nil
184
+ end
185
+
186
+ if attributes.key?(:'next_run_at')
187
+ self.next_run_at = attributes[:'next_run_at']
188
+ else
189
+ self.next_run_at = nil
190
+ end
191
+
192
+ if attributes.key?(:'last_run_at')
193
+ self.last_run_at = attributes[:'last_run_at']
194
+ end
195
+
196
+ if attributes.key?(:'latest_validation_result_id')
197
+ self.latest_validation_result_id = attributes[:'latest_validation_result_id']
198
+ end
199
+ end
200
+
201
+ # Show invalid properties with the reasons. Usually used together with valid?
202
+ # @return Array for valid properties with the reasons
203
+ def list_invalid_properties
204
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
205
+ invalid_properties = Array.new
206
+ if @schedule_id.nil?
207
+ invalid_properties.push('invalid value for "schedule_id", schedule_id cannot be nil.')
208
+ end
209
+
210
+ if @tax_identifier_id.nil?
211
+ invalid_properties.push('invalid value for "tax_identifier_id", tax_identifier_id cannot be nil.')
212
+ end
213
+
214
+ if @country_code.nil?
215
+ invalid_properties.push('invalid value for "country_code", country_code cannot be nil.')
216
+ end
217
+
218
+ if @normalized_value.nil?
219
+ invalid_properties.push('invalid value for "normalized_value", normalized_value cannot be nil.')
220
+ end
221
+
222
+ if @frequency.nil?
223
+ invalid_properties.push('invalid value for "frequency", frequency cannot be nil.')
224
+ end
225
+
226
+ if @mode.nil?
227
+ invalid_properties.push('invalid value for "mode", mode cannot be nil.')
228
+ end
229
+
230
+ if @manual_review_on_automatic_failure.nil?
231
+ invalid_properties.push('invalid value for "manual_review_on_automatic_failure", manual_review_on_automatic_failure cannot be nil.')
232
+ end
233
+
234
+ if @is_enabled.nil?
235
+ invalid_properties.push('invalid value for "is_enabled", is_enabled cannot be nil.')
236
+ end
237
+
238
+ if @next_run_at.nil?
239
+ invalid_properties.push('invalid value for "next_run_at", next_run_at cannot be nil.')
240
+ end
241
+
242
+ invalid_properties
243
+ end
244
+
245
+ # Check to see if the all the properties in the model are valid
246
+ # @return true if the model is valid
247
+ def valid?
248
+ warn '[DEPRECATED] the `valid?` method is obsolete'
249
+ return false if @schedule_id.nil?
250
+ return false if @tax_identifier_id.nil?
251
+ return false if @country_code.nil?
252
+ return false if @normalized_value.nil?
253
+ return false if @frequency.nil?
254
+ return false if @mode.nil?
255
+ return false if @manual_review_on_automatic_failure.nil?
256
+ return false if @is_enabled.nil?
257
+ return false if @next_run_at.nil?
258
+ true
259
+ end
260
+
261
+ # Custom attribute writer method with validation
262
+ # @param [Object] schedule_id Value to be assigned
263
+ def schedule_id=(schedule_id)
264
+ if schedule_id.nil?
265
+ fail ArgumentError, 'schedule_id cannot be nil'
266
+ end
267
+
268
+ @schedule_id = schedule_id
269
+ end
270
+
271
+ # Custom attribute writer method with validation
272
+ # @param [Object] tax_identifier_id Value to be assigned
273
+ def tax_identifier_id=(tax_identifier_id)
274
+ if tax_identifier_id.nil?
275
+ fail ArgumentError, 'tax_identifier_id cannot be nil'
276
+ end
277
+
278
+ @tax_identifier_id = tax_identifier_id
279
+ end
280
+
281
+ # Custom attribute writer method with validation
282
+ # @param [Object] country_code Value to be assigned
283
+ def country_code=(country_code)
284
+ if country_code.nil?
285
+ fail ArgumentError, 'country_code cannot be nil'
286
+ end
287
+
288
+ @country_code = country_code
289
+ end
290
+
291
+ # Custom attribute writer method with validation
292
+ # @param [Object] normalized_value Value to be assigned
293
+ def normalized_value=(normalized_value)
294
+ if normalized_value.nil?
295
+ fail ArgumentError, 'normalized_value cannot be nil'
296
+ end
297
+
298
+ @normalized_value = normalized_value
299
+ end
300
+
301
+ # Custom attribute writer method with validation
302
+ # @param [Object] frequency Value to be assigned
303
+ def frequency=(frequency)
304
+ if frequency.nil?
305
+ fail ArgumentError, 'frequency cannot be nil'
306
+ end
307
+
308
+ @frequency = frequency
309
+ end
310
+
311
+ # Custom attribute writer method with validation
312
+ # @param [Object] mode Value to be assigned
313
+ def mode=(mode)
314
+ if mode.nil?
315
+ fail ArgumentError, 'mode cannot be nil'
316
+ end
317
+
318
+ @mode = mode
319
+ end
320
+
321
+ # Custom attribute writer method with validation
322
+ # @param [Object] manual_review_on_automatic_failure Value to be assigned
323
+ def manual_review_on_automatic_failure=(manual_review_on_automatic_failure)
324
+ if manual_review_on_automatic_failure.nil?
325
+ fail ArgumentError, 'manual_review_on_automatic_failure cannot be nil'
326
+ end
327
+
328
+ @manual_review_on_automatic_failure = manual_review_on_automatic_failure
329
+ end
330
+
331
+ # Custom attribute writer method with validation
332
+ # @param [Object] is_enabled Value to be assigned
333
+ def is_enabled=(is_enabled)
334
+ if is_enabled.nil?
335
+ fail ArgumentError, 'is_enabled cannot be nil'
336
+ end
337
+
338
+ @is_enabled = is_enabled
339
+ end
340
+
341
+ # Custom attribute writer method with validation
342
+ # @param [Object] next_run_at Value to be assigned
343
+ def next_run_at=(next_run_at)
344
+ if next_run_at.nil?
345
+ fail ArgumentError, 'next_run_at cannot be nil'
346
+ end
347
+
348
+ @next_run_at = next_run_at
349
+ end
350
+
351
+ # Checks equality by comparing each attribute.
352
+ # @param [Object] Object to be compared
353
+ def ==(o)
354
+ return true if self.equal?(o)
355
+ self.class == o.class &&
356
+ schedule_id == o.schedule_id &&
357
+ tax_identifier_id == o.tax_identifier_id &&
358
+ country_code == o.country_code &&
359
+ normalized_value == o.normalized_value &&
360
+ frequency == o.frequency &&
361
+ mode == o.mode &&
362
+ preferred_provider == o.preferred_provider &&
363
+ manual_review_on_automatic_failure == o.manual_review_on_automatic_failure &&
364
+ is_enabled == o.is_enabled &&
365
+ next_run_at == o.next_run_at &&
366
+ last_run_at == o.last_run_at &&
367
+ latest_validation_result_id == o.latest_validation_result_id
368
+ end
369
+
370
+ # @see the `==` method
371
+ # @param [Object] Object to be compared
372
+ def eql?(o)
373
+ self == o
374
+ end
375
+
376
+ # Calculates hash code according to all attributes.
377
+ # @return [Integer] Hash code
378
+ def hash
379
+ [schedule_id, tax_identifier_id, country_code, normalized_value, frequency, mode, preferred_provider, manual_review_on_automatic_failure, is_enabled, next_run_at, last_run_at, latest_validation_result_id].hash
380
+ end
381
+
382
+ # Builds the object from hash
383
+ # @param [Hash] attributes Model attributes in the form of hash
384
+ # @return [Object] Returns the model itself
385
+ def self.build_from_hash(attributes)
386
+ return nil unless attributes.is_a?(Hash)
387
+ attributes = attributes.transform_keys(&:to_sym)
388
+ transformed_hash = {}
389
+ openapi_types.each_pair do |key, type|
390
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
391
+ transformed_hash["#{key}"] = nil
392
+ elsif type =~ /\AArray<(.*)>/i
393
+ # check to ensure the input is an array given that the attribute
394
+ # is documented as an array but the input is not
395
+ if attributes[attribute_map[key]].is_a?(Array)
396
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
397
+ end
398
+ elsif !attributes[attribute_map[key]].nil?
399
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
400
+ end
401
+ end
402
+ new(transformed_hash)
403
+ end
404
+
405
+ # Returns the object in the form of hash
406
+ # @return [Hash] Returns the object in the form of hash
407
+ def to_hash
408
+ hash = {}
409
+ self.class.attribute_map.each_pair do |attr, param|
410
+ value = self.send(attr)
411
+ if value.nil?
412
+ is_nullable = self.class.openapi_nullable.include?(attr)
413
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
414
+ end
415
+
416
+ hash[param] = _to_hash(value)
417
+ end
418
+ hash
419
+ end
420
+
421
+ end
422
+
423
+ end