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