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,350 @@
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 CaptchaVerificationResult < ApiModelBase
18
+ attr_accessor :captcha_id
19
+
20
+ attr_accessor :verification_id
21
+
22
+ attr_accessor :verification_passed
23
+
24
+ attr_accessor :score
25
+
26
+ # How the verification outcome was determined. Possible values include STANDARD, BYPASS_KEY, CUSTOM_ACCESS_RULE, GLOBAL_IP_ACCESS_RULE, FAILOVER, FAILOVER_TOLERANCE.
27
+ attr_accessor :decision_type
28
+
29
+ # The recommended action for this verification. Possible values include NO_ACTION, ALLOW, BLOCK, CUSTOM.
30
+ attr_accessor :decision_action
31
+
32
+ # True when the gateway synthesized this result because the captcha service was unreachable.
33
+ attr_accessor :gateway_failover_active
34
+
35
+ attr_accessor :risk_scoring_enabled
36
+
37
+ attr_accessor :minimal_data_mode_enabled
38
+
39
+ attr_accessor :origin
40
+
41
+ attr_accessor :ip_address
42
+
43
+ # Two-letter ISO 3166-1 alpha-2 country code derived from the client IP. Empty string if not resolvable.
44
+ attr_accessor :country_code
45
+
46
+ attr_accessor :device_family
47
+
48
+ attr_accessor :operating_system
49
+
50
+ attr_accessor :browser
51
+
52
+ attr_accessor :verification_started_at
53
+
54
+ attr_accessor :verification_finished_at
55
+
56
+ attr_accessor :result_expires_at
57
+
58
+ attr_accessor :result_first_fetched_at
59
+
60
+ attr_accessor :result_last_fetched_at
61
+
62
+ # Attribute mapping from ruby-style variable name to JSON key.
63
+ def self.attribute_map
64
+ {
65
+ :'captcha_id' => :'captchaId',
66
+ :'verification_id' => :'verificationId',
67
+ :'verification_passed' => :'verificationPassed',
68
+ :'score' => :'score',
69
+ :'decision_type' => :'decisionType',
70
+ :'decision_action' => :'decisionAction',
71
+ :'gateway_failover_active' => :'gatewayFailoverActive',
72
+ :'risk_scoring_enabled' => :'riskScoringEnabled',
73
+ :'minimal_data_mode_enabled' => :'minimalDataModeEnabled',
74
+ :'origin' => :'origin',
75
+ :'ip_address' => :'ipAddress',
76
+ :'country_code' => :'countryCode',
77
+ :'device_family' => :'deviceFamily',
78
+ :'operating_system' => :'operatingSystem',
79
+ :'browser' => :'browser',
80
+ :'verification_started_at' => :'verificationStartedAt',
81
+ :'verification_finished_at' => :'verificationFinishedAt',
82
+ :'result_expires_at' => :'resultExpiresAt',
83
+ :'result_first_fetched_at' => :'resultFirstFetchedAt',
84
+ :'result_last_fetched_at' => :'resultLastFetchedAt'
85
+ }
86
+ end
87
+
88
+ # Returns attribute mapping this model knows about
89
+ def self.acceptable_attribute_map
90
+ attribute_map
91
+ end
92
+
93
+ # Returns all the JSON keys this model knows about
94
+ def self.acceptable_attributes
95
+ acceptable_attribute_map.values
96
+ end
97
+
98
+ # Attribute type mapping.
99
+ def self.openapi_types
100
+ {
101
+ :'captcha_id' => :'String',
102
+ :'verification_id' => :'String',
103
+ :'verification_passed' => :'Boolean',
104
+ :'score' => :'Float',
105
+ :'decision_type' => :'String',
106
+ :'decision_action' => :'String',
107
+ :'gateway_failover_active' => :'Boolean',
108
+ :'risk_scoring_enabled' => :'Boolean',
109
+ :'minimal_data_mode_enabled' => :'Boolean',
110
+ :'origin' => :'String',
111
+ :'ip_address' => :'String',
112
+ :'country_code' => :'String',
113
+ :'device_family' => :'String',
114
+ :'operating_system' => :'String',
115
+ :'browser' => :'String',
116
+ :'verification_started_at' => :'String',
117
+ :'verification_finished_at' => :'String',
118
+ :'result_expires_at' => :'String',
119
+ :'result_first_fetched_at' => :'String',
120
+ :'result_last_fetched_at' => :'String'
121
+ }
122
+ end
123
+
124
+ # List of attributes with nullable: true
125
+ def self.openapi_nullable
126
+ Set.new([
127
+ ])
128
+ end
129
+
130
+ # Initializes the object
131
+ # @param [Hash] attributes Model attributes in the form of hash
132
+ def initialize(attributes = {})
133
+ if (!attributes.is_a?(Hash))
134
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrustComponent::Generated::CaptchaVerificationResult` initialize method"
135
+ end
136
+
137
+ # check to see if the attribute exists and convert string to symbol for hash key
138
+ acceptable_attribute_map = self.class.acceptable_attribute_map
139
+ attributes = attributes.each_with_object({}) { |(k, v), h|
140
+ if (!acceptable_attribute_map.key?(k.to_sym))
141
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrustComponent::Generated::CaptchaVerificationResult`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
142
+ end
143
+ h[k.to_sym] = v
144
+ }
145
+
146
+ if attributes.key?(:'captcha_id')
147
+ self.captcha_id = attributes[:'captcha_id']
148
+ end
149
+
150
+ if attributes.key?(:'verification_id')
151
+ self.verification_id = attributes[:'verification_id']
152
+ end
153
+
154
+ if attributes.key?(:'verification_passed')
155
+ self.verification_passed = attributes[:'verification_passed']
156
+ end
157
+
158
+ if attributes.key?(:'score')
159
+ self.score = attributes[:'score']
160
+ end
161
+
162
+ if attributes.key?(:'decision_type')
163
+ self.decision_type = attributes[:'decision_type']
164
+ end
165
+
166
+ if attributes.key?(:'decision_action')
167
+ self.decision_action = attributes[:'decision_action']
168
+ end
169
+
170
+ if attributes.key?(:'gateway_failover_active')
171
+ self.gateway_failover_active = attributes[:'gateway_failover_active']
172
+ end
173
+
174
+ if attributes.key?(:'risk_scoring_enabled')
175
+ self.risk_scoring_enabled = attributes[:'risk_scoring_enabled']
176
+ end
177
+
178
+ if attributes.key?(:'minimal_data_mode_enabled')
179
+ self.minimal_data_mode_enabled = attributes[:'minimal_data_mode_enabled']
180
+ end
181
+
182
+ if attributes.key?(:'origin')
183
+ self.origin = attributes[:'origin']
184
+ end
185
+
186
+ if attributes.key?(:'ip_address')
187
+ self.ip_address = attributes[:'ip_address']
188
+ end
189
+
190
+ if attributes.key?(:'country_code')
191
+ self.country_code = attributes[:'country_code']
192
+ end
193
+
194
+ if attributes.key?(:'device_family')
195
+ self.device_family = attributes[:'device_family']
196
+ end
197
+
198
+ if attributes.key?(:'operating_system')
199
+ self.operating_system = attributes[:'operating_system']
200
+ end
201
+
202
+ if attributes.key?(:'browser')
203
+ self.browser = attributes[:'browser']
204
+ end
205
+
206
+ if attributes.key?(:'verification_started_at')
207
+ self.verification_started_at = attributes[:'verification_started_at']
208
+ end
209
+
210
+ if attributes.key?(:'verification_finished_at')
211
+ self.verification_finished_at = attributes[:'verification_finished_at']
212
+ end
213
+
214
+ if attributes.key?(:'result_expires_at')
215
+ self.result_expires_at = attributes[:'result_expires_at']
216
+ end
217
+
218
+ if attributes.key?(:'result_first_fetched_at')
219
+ self.result_first_fetched_at = attributes[:'result_first_fetched_at']
220
+ end
221
+
222
+ if attributes.key?(:'result_last_fetched_at')
223
+ self.result_last_fetched_at = attributes[:'result_last_fetched_at']
224
+ end
225
+ end
226
+
227
+ # Show invalid properties with the reasons. Usually used together with valid?
228
+ # @return Array for valid properties with the reasons
229
+ def list_invalid_properties
230
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
231
+ invalid_properties = Array.new
232
+ if !@score.nil? && @score > 1
233
+ invalid_properties.push('invalid value for "score", must be smaller than or equal to 1.')
234
+ end
235
+
236
+ if !@score.nil? && @score < 0
237
+ invalid_properties.push('invalid value for "score", must be greater than or equal to 0.')
238
+ end
239
+
240
+ invalid_properties
241
+ end
242
+
243
+ # Check to see if the all the properties in the model are valid
244
+ # @return true if the model is valid
245
+ def valid?
246
+ warn '[DEPRECATED] the `valid?` method is obsolete'
247
+ return false if !@score.nil? && @score > 1
248
+ return false if !@score.nil? && @score < 0
249
+ true
250
+ end
251
+
252
+ # Custom attribute writer method with validation
253
+ # @param [Object] score Value to be assigned
254
+ def score=(score)
255
+ if score.nil?
256
+ fail ArgumentError, 'score cannot be nil'
257
+ end
258
+
259
+ if score > 1
260
+ fail ArgumentError, 'invalid value for "score", must be smaller than or equal to 1.'
261
+ end
262
+
263
+ if score < 0
264
+ fail ArgumentError, 'invalid value for "score", must be greater than or equal to 0.'
265
+ end
266
+
267
+ @score = score
268
+ end
269
+
270
+ # Checks equality by comparing each attribute.
271
+ # @param [Object] Object to be compared
272
+ def ==(o)
273
+ return true if self.equal?(o)
274
+ self.class == o.class &&
275
+ captcha_id == o.captcha_id &&
276
+ verification_id == o.verification_id &&
277
+ verification_passed == o.verification_passed &&
278
+ score == o.score &&
279
+ decision_type == o.decision_type &&
280
+ decision_action == o.decision_action &&
281
+ gateway_failover_active == o.gateway_failover_active &&
282
+ risk_scoring_enabled == o.risk_scoring_enabled &&
283
+ minimal_data_mode_enabled == o.minimal_data_mode_enabled &&
284
+ origin == o.origin &&
285
+ ip_address == o.ip_address &&
286
+ country_code == o.country_code &&
287
+ device_family == o.device_family &&
288
+ operating_system == o.operating_system &&
289
+ browser == o.browser &&
290
+ verification_started_at == o.verification_started_at &&
291
+ verification_finished_at == o.verification_finished_at &&
292
+ result_expires_at == o.result_expires_at &&
293
+ result_first_fetched_at == o.result_first_fetched_at &&
294
+ result_last_fetched_at == o.result_last_fetched_at
295
+ end
296
+
297
+ # @see the `==` method
298
+ # @param [Object] Object to be compared
299
+ def eql?(o)
300
+ self == o
301
+ end
302
+
303
+ # Calculates hash code according to all attributes.
304
+ # @return [Integer] Hash code
305
+ def hash
306
+ [captcha_id, verification_id, verification_passed, score, decision_type, decision_action, gateway_failover_active, risk_scoring_enabled, minimal_data_mode_enabled, origin, ip_address, country_code, device_family, operating_system, browser, verification_started_at, verification_finished_at, result_expires_at, result_first_fetched_at, result_last_fetched_at].hash
307
+ end
308
+
309
+ # Builds the object from hash
310
+ # @param [Hash] attributes Model attributes in the form of hash
311
+ # @return [Object] Returns the model itself
312
+ def self.build_from_hash(attributes)
313
+ return nil unless attributes.is_a?(Hash)
314
+ attributes = attributes.transform_keys(&:to_sym)
315
+ transformed_hash = {}
316
+ openapi_types.each_pair do |key, type|
317
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
318
+ transformed_hash["#{key}"] = nil
319
+ elsif type =~ /\AArray<(.*)>/i
320
+ # check to ensure the input is an array given that the attribute
321
+ # is documented as an array but the input is not
322
+ if attributes[attribute_map[key]].is_a?(Array)
323
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
324
+ end
325
+ elsif !attributes[attribute_map[key]].nil?
326
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
327
+ end
328
+ end
329
+ new(transformed_hash)
330
+ end
331
+
332
+ # Returns the object in the form of hash
333
+ # @return [Hash] Returns the object in the form of hash
334
+ def to_hash
335
+ hash = {}
336
+ self.class.attribute_map.each_pair do |attr, param|
337
+ value = self.send(attr)
338
+ if value.nil?
339
+ is_nullable = self.class.openapi_nullable.include?(attr)
340
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
341
+ end
342
+
343
+ hash[param] = _to_hash(value)
344
+ end
345
+ hash
346
+ end
347
+
348
+ end
349
+
350
+ end