Class: UltracartClient::OrderUtm

Inherits:
Object
  • Object
show all
Defined in:
lib/ultracart_api/models/order_utm.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ OrderUtm

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
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
# File 'lib/ultracart_api/models/order_utm.rb', line 172

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#attribution_first_click_subtotalObject

Returns the value of attribute attribution_first_click_subtotal.



18
19
20
# File 'lib/ultracart_api/models/order_utm.rb', line 18

def attribution_first_click_subtotal
  @attribution_first_click_subtotal
end

#attribution_first_click_totalObject

Returns the value of attribute attribution_first_click_total.



20
21
22
# File 'lib/ultracart_api/models/order_utm.rb', line 20

def attribution_first_click_total
  @attribution_first_click_total
end

#attribution_last_click_subtotalObject

Returns the value of attribute attribution_last_click_subtotal.



22
23
24
# File 'lib/ultracart_api/models/order_utm.rb', line 22

def attribution_last_click_subtotal
  @attribution_last_click_subtotal
end

#attribution_last_click_totalObject

Returns the value of attribute attribution_last_click_total.



24
25
26
# File 'lib/ultracart_api/models/order_utm.rb', line 24

def attribution_last_click_total
  @attribution_last_click_total
end

#attribution_linear_subtotalObject

Returns the value of attribute attribution_linear_subtotal.



26
27
28
# File 'lib/ultracart_api/models/order_utm.rb', line 26

def attribution_linear_subtotal
  @attribution_linear_subtotal
end

#attribution_linear_totalObject

Returns the value of attribute attribution_linear_total.



28
29
30
# File 'lib/ultracart_api/models/order_utm.rb', line 28

def attribution_linear_total
  @attribution_linear_total
end

#attribution_position_based_subtotalObject

Returns the value of attribute attribution_position_based_subtotal.



30
31
32
# File 'lib/ultracart_api/models/order_utm.rb', line 30

def attribution_position_based_subtotal
  @attribution_position_based_subtotal
end

#attribution_position_based_totalObject

Returns the value of attribute attribution_position_based_total.



32
33
34
# File 'lib/ultracart_api/models/order_utm.rb', line 32

def attribution_position_based_total
  @attribution_position_based_total
end

#click_dtsObject

Date/time that the click happened



35
36
37
# File 'lib/ultracart_api/models/order_utm.rb', line 35

def click_dts
  @click_dts
end

#facebook_ad_idObject

Returns the value of attribute facebook_ad_id.



37
38
39
# File 'lib/ultracart_api/models/order_utm.rb', line 37

def facebook_ad_id
  @facebook_ad_id
end

#fbclidObject

Returns the value of attribute fbclid.



39
40
41
# File 'lib/ultracart_api/models/order_utm.rb', line 39

def fbclid
  @fbclid
end

#gbraidObject

Returns the value of attribute gbraid.



41
42
43
# File 'lib/ultracart_api/models/order_utm.rb', line 41

def gbraid
  @gbraid
end

#glcidObject

Returns the value of attribute glcid.



43
44
45
# File 'lib/ultracart_api/models/order_utm.rb', line 43

def glcid
  @glcid
end

#itm_campaignObject

Returns the value of attribute itm_campaign.



45
46
47
# File 'lib/ultracart_api/models/order_utm.rb', line 45

def itm_campaign
  @itm_campaign
end

#itm_contentObject

Returns the value of attribute itm_content.



47
48
49
# File 'lib/ultracart_api/models/order_utm.rb', line 47

def itm_content
  @itm_content
end

#itm_idObject

Returns the value of attribute itm_id.



49
50
51
# File 'lib/ultracart_api/models/order_utm.rb', line 49

def itm_id
  @itm_id
end

#itm_mediumObject

Returns the value of attribute itm_medium.



51
52
53
# File 'lib/ultracart_api/models/order_utm.rb', line 51

def itm_medium
  @itm_medium
end

#itm_sourceObject

Returns the value of attribute itm_source.



53
54
55
# File 'lib/ultracart_api/models/order_utm.rb', line 53

def itm_source
  @itm_source
end

#itm_termObject

Returns the value of attribute itm_term.



55
56
57
# File 'lib/ultracart_api/models/order_utm.rb', line 55

def itm_term
  @itm_term
end

#msclkidObject

Returns the value of attribute msclkid.



57
58
59
# File 'lib/ultracart_api/models/order_utm.rb', line 57

def msclkid
  @msclkid
end

#short_codeObject

Returns the value of attribute short_code.



59
60
61
# File 'lib/ultracart_api/models/order_utm.rb', line 59

def short_code
  @short_code
end

#short_code_backupObject

Returns the value of attribute short_code_backup.



61
62
63
# File 'lib/ultracart_api/models/order_utm.rb', line 61

def short_code_backup
  @short_code_backup
end

#ttclidObject

Returns the value of attribute ttclid.



63
64
65
# File 'lib/ultracart_api/models/order_utm.rb', line 63

def ttclid
  @ttclid
end

#uc_message_idObject

Returns the value of attribute uc_message_id.



65
66
67
# File 'lib/ultracart_api/models/order_utm.rb', line 65

def uc_message_id
  @uc_message_id
end

#utm_campaignObject

Returns the value of attribute utm_campaign.



67
68
69
# File 'lib/ultracart_api/models/order_utm.rb', line 67

def utm_campaign
  @utm_campaign
end

#utm_contentObject

Returns the value of attribute utm_content.



69
70
71
# File 'lib/ultracart_api/models/order_utm.rb', line 69

def utm_content
  @utm_content
end

#utm_idObject

Returns the value of attribute utm_id.



71
72
73
# File 'lib/ultracart_api/models/order_utm.rb', line 71

def utm_id
  @utm_id
end

#utm_mediumObject

Returns the value of attribute utm_medium.



73
74
75
# File 'lib/ultracart_api/models/order_utm.rb', line 73

def utm_medium
  @utm_medium
end

#utm_sourceObject

Returns the value of attribute utm_source.



75
76
77
# File 'lib/ultracart_api/models/order_utm.rb', line 75

def utm_source
  @utm_source
end

#utm_termObject

Returns the value of attribute utm_term.



77
78
79
# File 'lib/ultracart_api/models/order_utm.rb', line 77

def utm_term
  @utm_term
end

#vmcidObject

Returns the value of attribute vmcid.



79
80
81
# File 'lib/ultracart_api/models/order_utm.rb', line 79

def vmcid
  @vmcid
end

#wbraidObject

Returns the value of attribute wbraid.



81
82
83
# File 'lib/ultracart_api/models/order_utm.rb', line 81

def wbraid
  @wbraid
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



122
123
124
# File 'lib/ultracart_api/models/order_utm.rb', line 122

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



84
85
86
87
88
89
90
91
92
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
# File 'lib/ultracart_api/models/order_utm.rb', line 84

def self.attribute_map
  {
    :'attribution_first_click_subtotal' => :'attribution_first_click_subtotal',
    :'attribution_first_click_total' => :'attribution_first_click_total',
    :'attribution_last_click_subtotal' => :'attribution_last_click_subtotal',
    :'attribution_last_click_total' => :'attribution_last_click_total',
    :'attribution_linear_subtotal' => :'attribution_linear_subtotal',
    :'attribution_linear_total' => :'attribution_linear_total',
    :'attribution_position_based_subtotal' => :'attribution_position_based_subtotal',
    :'attribution_position_based_total' => :'attribution_position_based_total',
    :'click_dts' => :'click_dts',
    :'facebook_ad_id' => :'facebook_ad_id',
    :'fbclid' => :'fbclid',
    :'gbraid' => :'gbraid',
    :'glcid' => :'glcid',
    :'itm_campaign' => :'itm_campaign',
    :'itm_content' => :'itm_content',
    :'itm_id' => :'itm_id',
    :'itm_medium' => :'itm_medium',
    :'itm_source' => :'itm_source',
    :'itm_term' => :'itm_term',
    :'msclkid' => :'msclkid',
    :'short_code' => :'short_code',
    :'short_code_backup' => :'short_code_backup',
    :'ttclid' => :'ttclid',
    :'uc_message_id' => :'uc_message_id',
    :'utm_campaign' => :'utm_campaign',
    :'utm_content' => :'utm_content',
    :'utm_id' => :'utm_id',
    :'utm_medium' => :'utm_medium',
    :'utm_source' => :'utm_source',
    :'utm_term' => :'utm_term',
    :'vmcid' => :'vmcid',
    :'wbraid' => :'wbraid'
  }
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



381
382
383
# File 'lib/ultracart_api/models/order_utm.rb', line 381

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



165
166
167
168
# File 'lib/ultracart_api/models/order_utm.rb', line 165

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

.openapi_typesObject

Attribute type mapping.



127
128
129
130
131
132
133
134
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
# File 'lib/ultracart_api/models/order_utm.rb', line 127

def self.openapi_types
  {
    :'attribution_first_click_subtotal' => :'Float',
    :'attribution_first_click_total' => :'Float',
    :'attribution_last_click_subtotal' => :'Float',
    :'attribution_last_click_total' => :'Float',
    :'attribution_linear_subtotal' => :'Float',
    :'attribution_linear_total' => :'Float',
    :'attribution_position_based_subtotal' => :'Float',
    :'attribution_position_based_total' => :'Float',
    :'click_dts' => :'String',
    :'facebook_ad_id' => :'String',
    :'fbclid' => :'String',
    :'gbraid' => :'String',
    :'glcid' => :'String',
    :'itm_campaign' => :'String',
    :'itm_content' => :'String',
    :'itm_id' => :'String',
    :'itm_medium' => :'String',
    :'itm_source' => :'String',
    :'itm_term' => :'String',
    :'msclkid' => :'String',
    :'short_code' => :'String',
    :'short_code_backup' => :'Boolean',
    :'ttclid' => :'String',
    :'uc_message_id' => :'String',
    :'utm_campaign' => :'String',
    :'utm_content' => :'String',
    :'utm_id' => :'String',
    :'utm_medium' => :'String',
    :'utm_source' => :'String',
    :'utm_term' => :'String',
    :'vmcid' => :'String',
    :'wbraid' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
# File 'lib/ultracart_api/models/order_utm.rb', line 329

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      attribution_first_click_subtotal == o.attribution_first_click_subtotal &&
      attribution_first_click_total == o.attribution_first_click_total &&
      attribution_last_click_subtotal == o.attribution_last_click_subtotal &&
      attribution_last_click_total == o.attribution_last_click_total &&
      attribution_linear_subtotal == o.attribution_linear_subtotal &&
      attribution_linear_total == o.attribution_linear_total &&
      attribution_position_based_subtotal == o.attribution_position_based_subtotal &&
      attribution_position_based_total == o.attribution_position_based_total &&
      click_dts == o.click_dts &&
      facebook_ad_id == o.facebook_ad_id &&
      fbclid == o.fbclid &&
      gbraid == o.gbraid &&
      glcid == o.glcid &&
      itm_campaign == o.itm_campaign &&
      itm_content == o.itm_content &&
      itm_id == o.itm_id &&
      itm_medium == o.itm_medium &&
      itm_source == o.itm_source &&
      itm_term == o.itm_term &&
      msclkid == o.msclkid &&
      short_code == o.short_code &&
      short_code_backup == o.short_code_backup &&
      ttclid == o.ttclid &&
      uc_message_id == o.uc_message_id &&
      utm_campaign == o.utm_campaign &&
      utm_content == o.utm_content &&
      utm_id == o.utm_id &&
      utm_medium == o.utm_medium &&
      utm_source == o.utm_source &&
      utm_term == o.utm_term &&
      vmcid == o.vmcid &&
      wbraid == o.wbraid
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



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
446
447
448
449
# File 'lib/ultracart_api/models/order_utm.rb', line 412

def _deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = UltracartClient.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



483
484
485
486
487
488
489
490
491
492
493
494
495
# File 'lib/ultracart_api/models/order_utm.rb', line 483

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
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



388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
# File 'lib/ultracart_api/models/order_utm.rb', line 388

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  self.class.openapi_types.each_pair do |key, type|
    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{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[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


368
369
370
# File 'lib/ultracart_api/models/order_utm.rb', line 368

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



374
375
376
# File 'lib/ultracart_api/models/order_utm.rb', line 374

def hash
  [attribution_first_click_subtotal, attribution_first_click_total, attribution_last_click_subtotal, attribution_last_click_total, attribution_linear_subtotal, attribution_linear_total, attribution_position_based_subtotal, attribution_position_based_total, click_dts, facebook_ad_id, fbclid, gbraid, glcid, itm_campaign, itm_content, itm_id, itm_medium, itm_source, itm_term, msclkid, short_code, short_code_backup, ttclid, uc_message_id, utm_campaign, utm_content, utm_id, utm_medium, utm_source, utm_term, vmcid, wbraid].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



316
317
318
319
# File 'lib/ultracart_api/models/order_utm.rb', line 316

def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



459
460
461
# File 'lib/ultracart_api/models/order_utm.rb', line 459

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



465
466
467
468
469
470
471
472
473
474
475
476
477
# File 'lib/ultracart_api/models/order_utm.rb', line 465

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

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



453
454
455
# File 'lib/ultracart_api/models/order_utm.rb', line 453

def to_s
  to_hash.to_s
end

#valid?Boolean

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

Returns:

  • (Boolean)

    true if the model is valid



323
324
325
# File 'lib/ultracart_api/models/order_utm.rb', line 323

def valid?
  true
end