Class: PlainRouter::OpenAPI::Event

Inherits:
ApiModelBase show all
Defined in:
lib/plainrouter/openapi/models/event.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ Event

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
# File 'lib/plainrouter/openapi/models/event.rb', line 178

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::Event` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `PlainRouter::OpenAPI::Event`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'id')
    self.id = attributes[:'id']
  else
    self.id = nil
  end

  if attributes.key?(:'signal_tracker_id')
    self.signal_tracker_id = attributes[:'signal_tracker_id']
  else
    self.signal_tracker_id = nil
  end

  if attributes.key?(:'parent_event_id')
    self.parent_event_id = attributes[:'parent_event_id']
  else
    self.parent_event_id = nil
  end

  if attributes.key?(:'event_name')
    self.event_name = attributes[:'event_name']
  else
    self.event_name = nil
  end

  if attributes.key?(:'event_time')
    self.event_time = attributes[:'event_time']
  else
    self.event_time = nil
  end

  if attributes.key?(:'action_source')
    self.action_source = attributes[:'action_source']
  else
    self.action_source = nil
  end

  if attributes.key?(:'event_class')
    self.event_class = attributes[:'event_class']
  else
    self.event_class = nil
  end

  if attributes.key?(:'order_id')
    self.order_id = attributes[:'order_id']
  else
    self.order_id = nil
  end

  if attributes.key?(:'value_amount')
    self.value_amount = attributes[:'value_amount']
  else
    self.value_amount = nil
  end

  if attributes.key?(:'value_currency')
    self.value_currency = attributes[:'value_currency']
  else
    self.value_currency = nil
  end

  if attributes.key?(:'created_at')
    self.created_at = attributes[:'created_at']
  else
    self.created_at = nil
  end

  if attributes.key?(:'consent_basis')
    self.consent_basis = attributes[:'consent_basis']
  else
    self.consent_basis = nil
  end

  if attributes.key?(:'measurement_class')
    self.measurement_class = attributes[:'measurement_class']
  else
    self.measurement_class = nil
  end

  if attributes.key?(:'attribution_join')
    self.attribution_join = attributes[:'attribution_join']
  else
    self.attribution_join = nil
  end

  if attributes.key?(:'enforcement_scope')
    self.enforcement_scope = attributes[:'enforcement_scope']
  else
    self.enforcement_scope = nil
  end

  if attributes.key?(:'consent_normalization_version')
    self.consent_normalization_version = attributes[:'consent_normalization_version']
  else
    self.consent_normalization_version = nil
  end

  if attributes.key?(:'policy_class')
    self.policy_class = attributes[:'policy_class']
  else
    self.policy_class = nil
  end

  if attributes.key?(:'traffic_class')
    self.traffic_class = attributes[:'traffic_class']
  else
    self.traffic_class = nil
  end

  if attributes.key?(:'consent')
    self.consent = attributes[:'consent']
  else
    self.consent = nil
  end

  if attributes.key?(:'user_data_hashed')
    self.user_data_hashed = attributes[:'user_data_hashed']
  else
    self.user_data_hashed = nil
  end

  if attributes.key?(:'click_ids')
    self.click_ids = attributes[:'click_ids']
  else
    self.click_ids = nil
  end

  if attributes.key?(:'session')
    self.session = attributes[:'session']
  else
    self.session = nil
  end

  if attributes.key?(:'value_data')
    self.value_data = attributes[:'value_data']
  else
    self.value_data = nil
  end

  if attributes.key?(:'event_source')
    self.event_source = attributes[:'event_source']
  else
    self.event_source = nil
  end

  if attributes.key?(:'payload_expired')
    self.payload_expired = attributes[:'payload_expired']
  else
    self.payload_expired = nil
  end

  if attributes.key?(:'deliveries')
    if (value = attributes[:'deliveries']).is_a?(Array)
      self.deliveries = value
    end
  else
    self.deliveries = nil
  end
end

Instance Attribute Details

#action_sourceObject

Returns the value of attribute action_source.



28
29
30
# File 'lib/plainrouter/openapi/models/event.rb', line 28

def action_source
  @action_source
end

#attribution_joinObject

Returns the value of attribute attribution_join.



44
45
46
# File 'lib/plainrouter/openapi/models/event.rb', line 44

def attribution_join
  @attribution_join
end

#click_idsObject

Returns the value of attribute click_ids.



58
59
60
# File 'lib/plainrouter/openapi/models/event.rb', line 58

def click_ids
  @click_ids
end

Returns the value of attribute consent.



54
55
56
# File 'lib/plainrouter/openapi/models/event.rb', line 54

def consent
  @consent
end

Returns the value of attribute consent_basis.



40
41
42
# File 'lib/plainrouter/openapi/models/event.rb', line 40

def consent_basis
  @consent_basis
end

Returns the value of attribute consent_normalization_version.



48
49
50
# File 'lib/plainrouter/openapi/models/event.rb', line 48

def consent_normalization_version
  @consent_normalization_version
end

#created_atObject

Returns the value of attribute created_at.



38
39
40
# File 'lib/plainrouter/openapi/models/event.rb', line 38

def created_at
  @created_at
end

#deliveriesObject

Returns the value of attribute deliveries.



68
69
70
# File 'lib/plainrouter/openapi/models/event.rb', line 68

def deliveries
  @deliveries
end

#enforcement_scopeObject

Returns the value of attribute enforcement_scope.



46
47
48
# File 'lib/plainrouter/openapi/models/event.rb', line 46

def enforcement_scope
  @enforcement_scope
end

#event_classObject

Returns the value of attribute event_class.



30
31
32
# File 'lib/plainrouter/openapi/models/event.rb', line 30

def event_class
  @event_class
end

#event_nameObject

Returns the value of attribute event_name.



24
25
26
# File 'lib/plainrouter/openapi/models/event.rb', line 24

def event_name
  @event_name
end

#event_sourceObject

Returns the value of attribute event_source.



64
65
66
# File 'lib/plainrouter/openapi/models/event.rb', line 64

def event_source
  @event_source
end

#event_timeObject

Returns the value of attribute event_time.



26
27
28
# File 'lib/plainrouter/openapi/models/event.rb', line 26

def event_time
  @event_time
end

#idObject

Returns the value of attribute id.



18
19
20
# File 'lib/plainrouter/openapi/models/event.rb', line 18

def id
  @id
end

#measurement_classObject

Returns the value of attribute measurement_class.



42
43
44
# File 'lib/plainrouter/openapi/models/event.rb', line 42

def measurement_class
  @measurement_class
end

#order_idObject

Returns the value of attribute order_id.



32
33
34
# File 'lib/plainrouter/openapi/models/event.rb', line 32

def order_id
  @order_id
end

#parent_event_idObject

Returns the value of attribute parent_event_id.



22
23
24
# File 'lib/plainrouter/openapi/models/event.rb', line 22

def parent_event_id
  @parent_event_id
end

#payload_expiredObject

Returns the value of attribute payload_expired.



66
67
68
# File 'lib/plainrouter/openapi/models/event.rb', line 66

def payload_expired
  @payload_expired
end

#policy_classObject

Returns the value of attribute policy_class.



50
51
52
# File 'lib/plainrouter/openapi/models/event.rb', line 50

def policy_class
  @policy_class
end

#sessionObject

Returns the value of attribute session.



60
61
62
# File 'lib/plainrouter/openapi/models/event.rb', line 60

def session
  @session
end

#signal_tracker_idObject

Returns the value of attribute signal_tracker_id.



20
21
22
# File 'lib/plainrouter/openapi/models/event.rb', line 20

def signal_tracker_id
  @signal_tracker_id
end

#traffic_classObject

Returns the value of attribute traffic_class.



52
53
54
# File 'lib/plainrouter/openapi/models/event.rb', line 52

def traffic_class
  @traffic_class
end

#user_data_hashedObject

Returns the value of attribute user_data_hashed.



56
57
58
# File 'lib/plainrouter/openapi/models/event.rb', line 56

def user_data_hashed
  @user_data_hashed
end

#value_amountObject

Returns the value of attribute value_amount.



34
35
36
# File 'lib/plainrouter/openapi/models/event.rb', line 34

def value_amount
  @value_amount
end

#value_currencyObject

Returns the value of attribute value_currency.



36
37
38
# File 'lib/plainrouter/openapi/models/event.rb', line 36

def value_currency
  @value_currency
end

#value_dataObject

Returns the value of attribute value_data.



62
63
64
# File 'lib/plainrouter/openapi/models/event.rb', line 62

def value_data
  @value_data
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



125
126
127
# File 'lib/plainrouter/openapi/models/event.rb', line 125

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



130
131
132
# File 'lib/plainrouter/openapi/models/event.rb', line 130

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/plainrouter/openapi/models/event.rb', line 93

def self.attribute_map
  {
    :'id' => :'id',
    :'signal_tracker_id' => :'signal_tracker_id',
    :'parent_event_id' => :'parent_event_id',
    :'event_name' => :'event_name',
    :'event_time' => :'event_time',
    :'action_source' => :'action_source',
    :'event_class' => :'event_class',
    :'order_id' => :'order_id',
    :'value_amount' => :'value_amount',
    :'value_currency' => :'value_currency',
    :'created_at' => :'created_at',
    :'consent_basis' => :'consent_basis',
    :'measurement_class' => :'measurement_class',
    :'attribution_join' => :'attribution_join',
    :'enforcement_scope' => :'enforcement_scope',
    :'consent_normalization_version' => :'consent_normalization_version',
    :'policy_class' => :'policy_class',
    :'traffic_class' => :'traffic_class',
    :'consent' => :'consent',
    :'user_data_hashed' => :'user_data_hashed',
    :'click_ids' => :'click_ids',
    :'session' => :'session',
    :'value_data' => :'value_data',
    :'event_source' => :'event_source',
    :'payload_expired' => :'payload_expired',
    :'deliveries' => :'deliveries'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
# File 'lib/plainrouter/openapi/models/event.rb', line 744

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



167
168
169
170
171
172
173
174
# File 'lib/plainrouter/openapi/models/event.rb', line 167

def self.openapi_nullable
  Set.new([
    :'parent_event_id',
    :'order_id',
    :'value_amount',
    :'value_currency',
  ])
end

.openapi_typesObject

Attribute type mapping.



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/plainrouter/openapi/models/event.rb', line 135

def self.openapi_types
  {
    :'id' => :'String',
    :'signal_tracker_id' => :'String',
    :'parent_event_id' => :'String',
    :'event_name' => :'String',
    :'event_time' => :'Time',
    :'action_source' => :'String',
    :'event_class' => :'String',
    :'order_id' => :'String',
    :'value_amount' => :'Integer',
    :'value_currency' => :'String',
    :'created_at' => :'Time',
    :'consent_basis' => :'String',
    :'measurement_class' => :'String',
    :'attribution_join' => :'String',
    :'enforcement_scope' => :'String',
    :'consent_normalization_version' => :'String',
    :'policy_class' => :'JurisdictionPolicyClass',
    :'traffic_class' => :'TrafficClass',
    :'consent' => :'String',
    :'user_data_hashed' => :'String',
    :'click_ids' => :'String',
    :'session' => :'String',
    :'value_data' => :'String',
    :'event_source' => :'String',
    :'payload_expired' => :'Boolean',
    :'deliveries' => :'Array<Object>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
# File 'lib/plainrouter/openapi/models/event.rb', line 698

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      signal_tracker_id == o.signal_tracker_id &&
      parent_event_id == o.parent_event_id &&
      event_name == o.event_name &&
      event_time == o.event_time &&
      action_source == o.action_source &&
      event_class == o.event_class &&
      order_id == o.order_id &&
      value_amount == o.value_amount &&
      value_currency == o.value_currency &&
      created_at == o.created_at &&
      consent_basis == o.consent_basis &&
      measurement_class == o.measurement_class &&
      attribution_join == o.attribution_join &&
      enforcement_scope == o.enforcement_scope &&
      consent_normalization_version == o.consent_normalization_version &&
      policy_class == o.policy_class &&
      traffic_class == o.traffic_class &&
      consent == o.consent &&
      user_data_hashed == o.user_data_hashed &&
      click_ids == o.click_ids &&
      session == o.session &&
      value_data == o.value_data &&
      event_source == o.event_source &&
      payload_expired == o.payload_expired &&
      deliveries == o.deliveries
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


731
732
733
# File 'lib/plainrouter/openapi/models/event.rb', line 731

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



737
738
739
# File 'lib/plainrouter/openapi/models/event.rb', line 737

def hash
  [id, signal_tracker_id, parent_event_id, event_name, event_time, action_source, event_class, order_id, value_amount, value_currency, created_at, consent_basis, measurement_class, attribution_join, enforcement_scope, consent_normalization_version, policy_class, traffic_class, consent, user_data_hashed, click_ids, session, value_data, event_source, payload_expired, deliveries].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
# File 'lib/plainrouter/openapi/models/event.rb', line 353

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if @id.nil?
    invalid_properties.push('invalid value for "id", id cannot be nil.')
  end

  if @signal_tracker_id.nil?
    invalid_properties.push('invalid value for "signal_tracker_id", signal_tracker_id cannot be nil.')
  end

  if @event_name.nil?
    invalid_properties.push('invalid value for "event_name", event_name cannot be nil.')
  end

  if @event_time.nil?
    invalid_properties.push('invalid value for "event_time", event_time cannot be nil.')
  end

  if @action_source.nil?
    invalid_properties.push('invalid value for "action_source", action_source cannot be nil.')
  end

  if @event_class.nil?
    invalid_properties.push('invalid value for "event_class", event_class cannot be nil.')
  end

  if @created_at.nil?
    invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
  end

  if @consent_basis.nil?
    invalid_properties.push('invalid value for "consent_basis", consent_basis cannot be nil.')
  end

  if @measurement_class.nil?
    invalid_properties.push('invalid value for "measurement_class", measurement_class cannot be nil.')
  end

  if @attribution_join.nil?
    invalid_properties.push('invalid value for "attribution_join", attribution_join cannot be nil.')
  end

  if @enforcement_scope.nil?
    invalid_properties.push('invalid value for "enforcement_scope", enforcement_scope cannot be nil.')
  end

  if @consent_normalization_version.nil?
    invalid_properties.push('invalid value for "consent_normalization_version", consent_normalization_version cannot be nil.')
  end

  if @policy_class.nil?
    invalid_properties.push('invalid value for "policy_class", policy_class cannot be nil.')
  end

  if @traffic_class.nil?
    invalid_properties.push('invalid value for "traffic_class", traffic_class cannot be nil.')
  end

  if @consent.nil?
    invalid_properties.push('invalid value for "consent", consent cannot be nil.')
  end

  if @user_data_hashed.nil?
    invalid_properties.push('invalid value for "user_data_hashed", user_data_hashed cannot be nil.')
  end

  if @click_ids.nil?
    invalid_properties.push('invalid value for "click_ids", click_ids cannot be nil.')
  end

  if @session.nil?
    invalid_properties.push('invalid value for "session", session cannot be nil.')
  end

  if @value_data.nil?
    invalid_properties.push('invalid value for "value_data", value_data cannot be nil.')
  end

  if @event_source.nil?
    invalid_properties.push('invalid value for "event_source", event_source cannot be nil.')
  end

  if @payload_expired.nil?
    invalid_properties.push('invalid value for "payload_expired", payload_expired cannot be nil.')
  end

  if @deliveries.nil?
    invalid_properties.push('invalid value for "deliveries", deliveries cannot be nil.')
  end

  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



766
767
768
769
770
771
772
773
774
775
776
777
778
# File 'lib/plainrouter/openapi/models/event.rb', line 766

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
# File 'lib/plainrouter/openapi/models/event.rb', line 449

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @id.nil?
  return false if @signal_tracker_id.nil?
  return false if @event_name.nil?
  return false if @event_time.nil?
  return false if @action_source.nil?
  return false if @event_class.nil?
  return false if @created_at.nil?
  return false if @consent_basis.nil?
  return false if @measurement_class.nil?
  return false if @attribution_join.nil?
  return false if @enforcement_scope.nil?
  return false if @consent_normalization_version.nil?
  return false if @policy_class.nil?
  return false if @traffic_class.nil?
  return false if @consent.nil?
  return false if @user_data_hashed.nil?
  return false if @click_ids.nil?
  return false if @session.nil?
  return false if @value_data.nil?
  return false if @event_source.nil?
  return false if @payload_expired.nil?
  return false if @deliveries.nil?
  true
end