Class: PlainRouter::OpenAPI::CreateEventRequestAnyOf1

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/plainrouter/openapi/models/create_event_request_any_of1.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 = {}) ⇒ CreateEventRequestAnyOf1

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
165
166
167
168
169
170
171
172
173
174
175
176
177
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
# File 'lib/plainrouter/openapi/models/create_event_request_any_of1.rb', line 138

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::CreateEventRequestAnyOf1` 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::CreateEventRequestAnyOf1`. 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?(:'event_id')
    self.event_id = attributes[:'event_id']
  end

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

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

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

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

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

  if attributes.key?(:'visitor_id')
    self.visitor_id = attributes[:'visitor_id']
  end

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

  if attributes.key?(:'consent')
    if (value = attributes[:'consent']).is_a?(Hash)
      self.consent = value
    end
  end

  if attributes.key?(:'consent_mode')
    if (value = attributes[:'consent_mode']).is_a?(Hash)
      self.consent_mode = value
    end
  end

  if attributes.key?(:'tcf')
    if (value = attributes[:'tcf']).is_a?(Hash)
      self.tcf = value
    end
  end

  if attributes.key?(:'user_data')
    if (value = attributes[:'user_data']).is_a?(Hash)
      self.user_data = value
    end
  end

  if attributes.key?(:'click_ids')
    if (value = attributes[:'click_ids']).is_a?(Hash)
      self.click_ids = value
    end
  end

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

Instance Attribute Details

#action_sourceObject

Optional action source; defaults to website and is limited to 50 characters.



33
34
35
# File 'lib/plainrouter/openapi/models/create_event_request_any_of1.rb', line 33

def action_source
  @action_source
end

#click_idsObject

Advertising click identifiers.



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

def click_ids
  @click_ids
end

Consent state supplied with the event.



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

def consent
  @consent
end

Legal basis for processing. Legitimate-interest revenue lifecycle events are rejected; use an authenticated server adapter.



39
40
41
# File 'lib/plainrouter/openapi/models/create_event_request_any_of1.rb', line 39

def consent_basis
  @consent_basis
end

Consent Mode v2 signal values supplied with the event.



45
46
47
# File 'lib/plainrouter/openapi/models/create_event_request_any_of1.rb', line 45

def consent_mode
  @consent_mode
end

#event_idObject

Caller-supplied idempotency key; maximum 128 characters.



19
20
21
# File 'lib/plainrouter/openapi/models/create_event_request_any_of1.rb', line 19

def event_id
  @event_id
end

#event_nameObject

Signal event name; maximum 100 characters.



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

def event_name
  @event_name
end

#event_sourceObject

Optional absolute source URL.



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

def event_source
  @event_source
end

#event_timeObject

Returns the value of attribute event_time.



27
28
29
# File 'lib/plainrouter/openapi/models/create_event_request_any_of1.rb', line 27

def event_time
  @event_time
end

#parent_event_idObject

Optional parent event id; maximum 128 characters.



25
26
27
# File 'lib/plainrouter/openapi/models/create_event_request_any_of1.rb', line 25

def parent_event_id
  @parent_event_id
end

#tcfObject

TCF v2 data containing string and optional captured_at.



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

def tcf
  @tcf
end

#user_dataObject

Identity fields accepted by the tracker.



51
52
53
# File 'lib/plainrouter/openapi/models/create_event_request_any_of1.rb', line 51

def user_data
  @user_data
end

#value_dataObject

Returns the value of attribute value_data.



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

def value_data
  @value_data
end

#visitor_idObject

Optional visitor identifier; maximum 255 characters.



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

def visitor_id
  @visitor_id
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



101
102
103
# File 'lib/plainrouter/openapi/models/create_event_request_any_of1.rb', line 101

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



106
107
108
# File 'lib/plainrouter/openapi/models/create_event_request_any_of1.rb', line 106

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/plainrouter/openapi/models/create_event_request_any_of1.rb', line 81

def self.attribute_map
  {
    :'event_id' => :'event_id',
    :'event_name' => :'event_name',
    :'parent_event_id' => :'parent_event_id',
    :'event_time' => :'event_time',
    :'event_source' => :'event_source',
    :'action_source' => :'action_source',
    :'visitor_id' => :'visitor_id',
    :'consent_basis' => :'consent_basis',
    :'consent' => :'consent',
    :'consent_mode' => :'consent_mode',
    :'tcf' => :'tcf',
    :'user_data' => :'user_data',
    :'click_ids' => :'click_ids',
    :'value_data' => :'value_data'
  }
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



308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# File 'lib/plainrouter/openapi/models/create_event_request_any_of1.rb', line 308

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



131
132
133
134
# File 'lib/plainrouter/openapi/models/create_event_request_any_of1.rb', line 131

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/plainrouter/openapi/models/create_event_request_any_of1.rb', line 111

def self.openapi_types
  {
    :'event_id' => :'String',
    :'event_name' => :'String',
    :'parent_event_id' => :'String',
    :'event_time' => :'CreateEventRequestAnyOfEventTime',
    :'event_source' => :'String',
    :'action_source' => :'String',
    :'visitor_id' => :'String',
    :'consent_basis' => :'String',
    :'consent' => :'Hash<String, Object>',
    :'consent_mode' => :'Hash<String, Object>',
    :'tcf' => :'Hash<String, Object>',
    :'user_data' => :'Hash<String, Object>',
    :'click_ids' => :'Hash<String, Object>',
    :'value_data' => :'CreateEventRequestAnyOfValueData'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
# File 'lib/plainrouter/openapi/models/create_event_request_any_of1.rb', line 274

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      event_id == o.event_id &&
      event_name == o.event_name &&
      parent_event_id == o.parent_event_id &&
      event_time == o.event_time &&
      event_source == o.event_source &&
      action_source == o.action_source &&
      visitor_id == o.visitor_id &&
      consent_basis == o.consent_basis &&
      consent == o.consent &&
      consent_mode == o.consent_mode &&
      tcf == o.tcf &&
      user_data == o.user_data &&
      click_ids == o.click_ids &&
      value_data == o.value_data
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


295
296
297
# File 'lib/plainrouter/openapi/models/create_event_request_any_of1.rb', line 295

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



301
302
303
# File 'lib/plainrouter/openapi/models/create_event_request_any_of1.rb', line 301

def hash
  [event_id, event_name, parent_event_id, event_time, event_source, action_source, visitor_id, consent_basis, consent, consent_mode, tcf, user_data, click_ids, value_data].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



225
226
227
228
229
230
231
232
233
234
235
236
237
# File 'lib/plainrouter/openapi/models/create_event_request_any_of1.rb', line 225

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

  if @consent_basis.nil?
    invalid_properties.push('invalid value for "consent_basis", consent_basis 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



330
331
332
333
334
335
336
337
338
339
340
341
342
# File 'lib/plainrouter/openapi/models/create_event_request_any_of1.rb', line 330

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



241
242
243
244
245
246
247
248
249
250
# File 'lib/plainrouter/openapi/models/create_event_request_any_of1.rb', line 241

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @event_name.nil?
  event_name_validator = EnumAttributeValidator.new('String', ["signal_verification", "consent_withdrawal"])
  return false unless event_name_validator.valid?(@event_name)
  return false if @consent_basis.nil?
  consent_basis_validator = EnumAttributeValidator.new('String', ["legitimate_interest"])
  return false unless consent_basis_validator.valid?(@consent_basis)
  true
end