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,508 @@
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
+ # One event of any name, or one of the reserved `identify`, `purchase`, `refund` and `error`; a `purchase` needs the `commerce` block, a `refund` the `refund` block and every event of category ERRORS the `error` block
18
+ class AnalyticsServerEventBatchEventCreateParams < ApiModelBase
19
+ # Stable id of the event, unique within the website and compared exactly. A UUID, or the id the event already has in your system (an order id, the id of a payment provider's refund or webhook event); a retried batch and a webhook delivered twice then never create a second copy
20
+ attr_accessor :id
21
+
22
+ # When the event happened; events older than 48 hours are dropped as stale, and a time ahead of the server is stored as the time of receipt
23
+ attr_accessor :occurred_at
24
+
25
+ # Event name; `identify`, `purchase`, `refund` and `error` are reserved, `pageview` and `pageleave` are browser-only and dropped
26
+ attr_accessor :name
27
+
28
+ attr_accessor :category
29
+
30
+ # Page load of the browser the event belongs to, when the backend knows it (the SDK exposes it through getPageViewId()); the event then joins the visit of that page load. Without it the event joins the latest session of the userId within 30 minutes or opens a server session without a page
31
+ attr_accessor :page_view_id
32
+
33
+ # Id of the user in the customer's system; never an e-mail address. Required when pageViewId is absent, except on a `refund`, which its order id identifies
34
+ attr_accessor :user_id
35
+
36
+ # Page the event relates to, when there is one; the server keeps hostname, path and the query parameters the website's filter keeps, and reads the campaign parameters. Without it the event counts for no page
37
+ attr_accessor :url
38
+
39
+ # Route of the page as the website knows it, with its variables written as :name or *, e.g. /orders/:orderId/complete. Groups the page in reports; ignored when it does not match the path of url
40
+ attr_accessor :page_pattern
41
+
42
+ # Address of the end user, used for geo and tracking rules only and never stored; without it the geo stays unknown
43
+ attr_accessor :ip_address
44
+
45
+ # User agent of the end user, used for browser and device only and never stored; without it the device stays unknown
46
+ attr_accessor :user_agent
47
+
48
+ # Whether the end user of this event consented. Takes precedence over hasConsent of the batch, which applies when it is left out, so one batch can carry events of users with and without consent
49
+ attr_accessor :has_consent
50
+
51
+ # Custom properties of the event. The server keeps at most 50 keys of up to 100 characters and cuts values after 500 characters; a key with a control character and a value that is `null` are left out; for `identify` these are the traits
52
+ attr_accessor :properties
53
+
54
+ attr_accessor :commerce
55
+
56
+ attr_accessor :refund
57
+
58
+ attr_accessor :error
59
+
60
+ class EnumAttributeValidator
61
+ attr_reader :datatype
62
+ attr_reader :allowable_values
63
+
64
+ def initialize(datatype, allowable_values)
65
+ @allowable_values = allowable_values.map do |value|
66
+ case datatype.to_s
67
+ when /Integer/i
68
+ value.to_i
69
+ when /Float/i
70
+ value.to_f
71
+ else
72
+ value
73
+ end
74
+ end
75
+ end
76
+
77
+ def valid?(value)
78
+ !value || allowable_values.include?(value)
79
+ end
80
+ end
81
+
82
+ # Attribute mapping from ruby-style variable name to JSON key.
83
+ def self.attribute_map
84
+ {
85
+ :'id' => :'id',
86
+ :'occurred_at' => :'occurredAt',
87
+ :'name' => :'name',
88
+ :'category' => :'category',
89
+ :'page_view_id' => :'pageViewId',
90
+ :'user_id' => :'userId',
91
+ :'url' => :'url',
92
+ :'page_pattern' => :'pagePattern',
93
+ :'ip_address' => :'ipAddress',
94
+ :'user_agent' => :'userAgent',
95
+ :'has_consent' => :'hasConsent',
96
+ :'properties' => :'properties',
97
+ :'commerce' => :'commerce',
98
+ :'refund' => :'refund',
99
+ :'error' => :'error'
100
+ }
101
+ end
102
+
103
+ # Returns attribute mapping this model knows about
104
+ def self.acceptable_attribute_map
105
+ attribute_map
106
+ end
107
+
108
+ # Returns all the JSON keys this model knows about
109
+ def self.acceptable_attributes
110
+ acceptable_attribute_map.values
111
+ end
112
+
113
+ # Attribute type mapping.
114
+ def self.openapi_types
115
+ {
116
+ :'id' => :'String',
117
+ :'occurred_at' => :'String',
118
+ :'name' => :'String',
119
+ :'category' => :'AnalyticsEventCategoryEnum',
120
+ :'page_view_id' => :'String',
121
+ :'user_id' => :'String',
122
+ :'url' => :'String',
123
+ :'page_pattern' => :'String',
124
+ :'ip_address' => :'String',
125
+ :'user_agent' => :'String',
126
+ :'has_consent' => :'Boolean',
127
+ :'properties' => :'Hash<String, String>',
128
+ :'commerce' => :'AnalyticsServerEventBatchEventCommerceCreateParams',
129
+ :'refund' => :'AnalyticsServerEventBatchEventRefundCreateParams',
130
+ :'error' => :'AnalyticsServerEventBatchEventErrorCreateParams'
131
+ }
132
+ end
133
+
134
+ # List of attributes with nullable: true
135
+ def self.openapi_nullable
136
+ Set.new([
137
+ ])
138
+ end
139
+
140
+ # Initializes the object
141
+ # @param [Hash] attributes Model attributes in the form of hash
142
+ def initialize(attributes = {})
143
+ if (!attributes.is_a?(Hash))
144
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrustComponent::Generated::AnalyticsServerEventBatchEventCreateParams` initialize method"
145
+ end
146
+
147
+ # check to see if the attribute exists and convert string to symbol for hash key
148
+ acceptable_attribute_map = self.class.acceptable_attribute_map
149
+ attributes = attributes.each_with_object({}) { |(k, v), h|
150
+ if (!acceptable_attribute_map.key?(k.to_sym))
151
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrustComponent::Generated::AnalyticsServerEventBatchEventCreateParams`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
152
+ end
153
+ h[k.to_sym] = v
154
+ }
155
+
156
+ if attributes.key?(:'id')
157
+ self.id = attributes[:'id']
158
+ else
159
+ self.id = nil
160
+ end
161
+
162
+ if attributes.key?(:'occurred_at')
163
+ self.occurred_at = attributes[:'occurred_at']
164
+ else
165
+ self.occurred_at = nil
166
+ end
167
+
168
+ if attributes.key?(:'name')
169
+ self.name = attributes[:'name']
170
+ else
171
+ self.name = nil
172
+ end
173
+
174
+ if attributes.key?(:'category')
175
+ self.category = attributes[:'category']
176
+ else
177
+ self.category = nil
178
+ end
179
+
180
+ if attributes.key?(:'page_view_id')
181
+ self.page_view_id = attributes[:'page_view_id']
182
+ end
183
+
184
+ if attributes.key?(:'user_id')
185
+ self.user_id = attributes[:'user_id']
186
+ end
187
+
188
+ if attributes.key?(:'url')
189
+ self.url = attributes[:'url']
190
+ end
191
+
192
+ if attributes.key?(:'page_pattern')
193
+ self.page_pattern = attributes[:'page_pattern']
194
+ end
195
+
196
+ if attributes.key?(:'ip_address')
197
+ self.ip_address = attributes[:'ip_address']
198
+ end
199
+
200
+ if attributes.key?(:'user_agent')
201
+ self.user_agent = attributes[:'user_agent']
202
+ end
203
+
204
+ if attributes.key?(:'has_consent')
205
+ self.has_consent = attributes[:'has_consent']
206
+ end
207
+
208
+ if attributes.key?(:'properties')
209
+ if (value = attributes[:'properties']).is_a?(Hash)
210
+ self.properties = value
211
+ end
212
+ end
213
+
214
+ if attributes.key?(:'commerce')
215
+ self.commerce = attributes[:'commerce']
216
+ end
217
+
218
+ if attributes.key?(:'refund')
219
+ self.refund = attributes[:'refund']
220
+ end
221
+
222
+ if attributes.key?(:'error')
223
+ self.error = attributes[:'error']
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 @id.nil?
233
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
234
+ end
235
+
236
+ if @id.to_s.length > 100
237
+ invalid_properties.push('invalid value for "id", the character length must be smaller than or equal to 100.')
238
+ end
239
+
240
+ if @id.to_s.length < 1
241
+ invalid_properties.push('invalid value for "id", the character length must be greater than or equal to 1.')
242
+ end
243
+
244
+ if @occurred_at.nil?
245
+ invalid_properties.push('invalid value for "occurred_at", occurred_at cannot be nil.')
246
+ end
247
+
248
+ if @name.nil?
249
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
250
+ end
251
+
252
+ if @name.to_s.length > 100
253
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.')
254
+ end
255
+
256
+ if @name.to_s.length < 1
257
+ invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.')
258
+ end
259
+
260
+ if @category.nil?
261
+ invalid_properties.push('invalid value for "category", category cannot be nil.')
262
+ end
263
+
264
+ if !@user_id.nil? && @user_id.to_s.length > 200
265
+ invalid_properties.push('invalid value for "user_id", the character length must be smaller than or equal to 200.')
266
+ end
267
+
268
+ if !@url.nil? && @url.to_s.length > 8192
269
+ invalid_properties.push('invalid value for "url", the character length must be smaller than or equal to 8192.')
270
+ end
271
+
272
+ if !@page_pattern.nil? && @page_pattern.to_s.length > 300
273
+ invalid_properties.push('invalid value for "page_pattern", the character length must be smaller than or equal to 300.')
274
+ end
275
+
276
+ if !@ip_address.nil? && @ip_address.to_s.length > 45
277
+ invalid_properties.push('invalid value for "ip_address", the character length must be smaller than or equal to 45.')
278
+ end
279
+
280
+ if !@user_agent.nil? && @user_agent.to_s.length > 1000
281
+ invalid_properties.push('invalid value for "user_agent", the character length must be smaller than or equal to 1000.')
282
+ end
283
+
284
+ invalid_properties
285
+ end
286
+
287
+ # Check to see if the all the properties in the model are valid
288
+ # @return true if the model is valid
289
+ def valid?
290
+ warn '[DEPRECATED] the `valid?` method is obsolete'
291
+ return false if @id.nil?
292
+ return false if @id.to_s.length > 100
293
+ return false if @id.to_s.length < 1
294
+ return false if @occurred_at.nil?
295
+ return false if @name.nil?
296
+ return false if @name.to_s.length > 100
297
+ return false if @name.to_s.length < 1
298
+ return false if @category.nil?
299
+ return false if !@user_id.nil? && @user_id.to_s.length > 200
300
+ return false if !@url.nil? && @url.to_s.length > 8192
301
+ return false if !@page_pattern.nil? && @page_pattern.to_s.length > 300
302
+ return false if !@ip_address.nil? && @ip_address.to_s.length > 45
303
+ return false if !@user_agent.nil? && @user_agent.to_s.length > 1000
304
+ true
305
+ end
306
+
307
+ # Custom attribute writer method with validation
308
+ # @param [Object] id Value to be assigned
309
+ def id=(id)
310
+ if id.nil?
311
+ fail ArgumentError, 'id cannot be nil'
312
+ end
313
+
314
+ if id.to_s.length > 100
315
+ fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 100.'
316
+ end
317
+
318
+ if id.to_s.length < 1
319
+ fail ArgumentError, 'invalid value for "id", the character length must be greater than or equal to 1.'
320
+ end
321
+
322
+ @id = id
323
+ end
324
+
325
+ # Custom attribute writer method with validation
326
+ # @param [Object] occurred_at Value to be assigned
327
+ def occurred_at=(occurred_at)
328
+ if occurred_at.nil?
329
+ fail ArgumentError, 'occurred_at cannot be nil'
330
+ end
331
+
332
+ @occurred_at = occurred_at
333
+ end
334
+
335
+ # Custom attribute writer method with validation
336
+ # @param [Object] name Value to be assigned
337
+ def name=(name)
338
+ if name.nil?
339
+ fail ArgumentError, 'name cannot be nil'
340
+ end
341
+
342
+ if name.to_s.length > 100
343
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.'
344
+ end
345
+
346
+ if name.to_s.length < 1
347
+ fail ArgumentError, 'invalid value for "name", the character length must be greater than or equal to 1.'
348
+ end
349
+
350
+ @name = name
351
+ end
352
+
353
+ # Custom attribute writer method with validation
354
+ # @param [Object] category Value to be assigned
355
+ def category=(category)
356
+ if category.nil?
357
+ fail ArgumentError, 'category cannot be nil'
358
+ end
359
+
360
+ @category = category
361
+ end
362
+
363
+ # Custom attribute writer method with validation
364
+ # @param [Object] user_id Value to be assigned
365
+ def user_id=(user_id)
366
+ if user_id.nil?
367
+ fail ArgumentError, 'user_id cannot be nil'
368
+ end
369
+
370
+ if user_id.to_s.length > 200
371
+ fail ArgumentError, 'invalid value for "user_id", the character length must be smaller than or equal to 200.'
372
+ end
373
+
374
+ @user_id = user_id
375
+ end
376
+
377
+ # Custom attribute writer method with validation
378
+ # @param [Object] url Value to be assigned
379
+ def url=(url)
380
+ if url.nil?
381
+ fail ArgumentError, 'url cannot be nil'
382
+ end
383
+
384
+ if url.to_s.length > 8192
385
+ fail ArgumentError, 'invalid value for "url", the character length must be smaller than or equal to 8192.'
386
+ end
387
+
388
+ @url = url
389
+ end
390
+
391
+ # Custom attribute writer method with validation
392
+ # @param [Object] page_pattern Value to be assigned
393
+ def page_pattern=(page_pattern)
394
+ if page_pattern.nil?
395
+ fail ArgumentError, 'page_pattern cannot be nil'
396
+ end
397
+
398
+ if page_pattern.to_s.length > 300
399
+ fail ArgumentError, 'invalid value for "page_pattern", the character length must be smaller than or equal to 300.'
400
+ end
401
+
402
+ @page_pattern = page_pattern
403
+ end
404
+
405
+ # Custom attribute writer method with validation
406
+ # @param [Object] ip_address Value to be assigned
407
+ def ip_address=(ip_address)
408
+ if ip_address.nil?
409
+ fail ArgumentError, 'ip_address cannot be nil'
410
+ end
411
+
412
+ if ip_address.to_s.length > 45
413
+ fail ArgumentError, 'invalid value for "ip_address", the character length must be smaller than or equal to 45.'
414
+ end
415
+
416
+ @ip_address = ip_address
417
+ end
418
+
419
+ # Custom attribute writer method with validation
420
+ # @param [Object] user_agent Value to be assigned
421
+ def user_agent=(user_agent)
422
+ if user_agent.nil?
423
+ fail ArgumentError, 'user_agent cannot be nil'
424
+ end
425
+
426
+ if user_agent.to_s.length > 1000
427
+ fail ArgumentError, 'invalid value for "user_agent", the character length must be smaller than or equal to 1000.'
428
+ end
429
+
430
+ @user_agent = user_agent
431
+ end
432
+
433
+ # Checks equality by comparing each attribute.
434
+ # @param [Object] Object to be compared
435
+ def ==(o)
436
+ return true if self.equal?(o)
437
+ self.class == o.class &&
438
+ id == o.id &&
439
+ occurred_at == o.occurred_at &&
440
+ name == o.name &&
441
+ category == o.category &&
442
+ page_view_id == o.page_view_id &&
443
+ user_id == o.user_id &&
444
+ url == o.url &&
445
+ page_pattern == o.page_pattern &&
446
+ ip_address == o.ip_address &&
447
+ user_agent == o.user_agent &&
448
+ has_consent == o.has_consent &&
449
+ properties == o.properties &&
450
+ commerce == o.commerce &&
451
+ refund == o.refund &&
452
+ error == o.error
453
+ end
454
+
455
+ # @see the `==` method
456
+ # @param [Object] Object to be compared
457
+ def eql?(o)
458
+ self == o
459
+ end
460
+
461
+ # Calculates hash code according to all attributes.
462
+ # @return [Integer] Hash code
463
+ def hash
464
+ [id, occurred_at, name, category, page_view_id, user_id, url, page_pattern, ip_address, user_agent, has_consent, properties, commerce, refund, error].hash
465
+ end
466
+
467
+ # Builds the object from hash
468
+ # @param [Hash] attributes Model attributes in the form of hash
469
+ # @return [Object] Returns the model itself
470
+ def self.build_from_hash(attributes)
471
+ return nil unless attributes.is_a?(Hash)
472
+ attributes = attributes.transform_keys(&:to_sym)
473
+ transformed_hash = {}
474
+ openapi_types.each_pair do |key, type|
475
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
476
+ transformed_hash["#{key}"] = nil
477
+ elsif type =~ /\AArray<(.*)>/i
478
+ # check to ensure the input is an array given that the attribute
479
+ # is documented as an array but the input is not
480
+ if attributes[attribute_map[key]].is_a?(Array)
481
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
482
+ end
483
+ elsif !attributes[attribute_map[key]].nil?
484
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
485
+ end
486
+ end
487
+ new(transformed_hash)
488
+ end
489
+
490
+ # Returns the object in the form of hash
491
+ # @return [Hash] Returns the object in the form of hash
492
+ def to_hash
493
+ hash = {}
494
+ self.class.attribute_map.each_pair do |attr, param|
495
+ value = self.send(attr)
496
+ if value.nil?
497
+ is_nullable = self.class.openapi_nullable.include?(attr)
498
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
499
+ end
500
+
501
+ hash[param] = _to_hash(value)
502
+ end
503
+ hash
504
+ end
505
+
506
+ end
507
+
508
+ end