Class: UltracartClient::EmailPostcardStat

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ EmailPostcardStat

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.has_key?(:'click_count')
    self.click_count = attributes[:'click_count']
  end

  if attributes.has_key?(:'click_count_formatted')
    self.click_count_formatted = attributes[:'click_count_formatted']
  end

  if attributes.has_key?(:'conversion_count')
    self.conversion_count = attributes[:'conversion_count']
  end

  if attributes.has_key?(:'conversion_count_formatted')
    self.conversion_count_formatted = attributes[:'conversion_count_formatted']
  end

  if attributes.has_key?(:'delivered_count')
    self.delivered_count = attributes[:'delivered_count']
  end

  if attributes.has_key?(:'delivered_count_formatted')
    self.delivered_count_formatted = attributes[:'delivered_count_formatted']
  end

  if attributes.has_key?(:'merchant_id')
    self.merchant_id = attributes[:'merchant_id']
  end

  if attributes.has_key?(:'name')
    self.name = attributes[:'name']
  end

  if attributes.has_key?(:'order_count')
    self.order_count = attributes[:'order_count']
  end

  if attributes.has_key?(:'order_count_formatted')
    self.order_count_formatted = attributes[:'order_count_formatted']
  end

  if attributes.has_key?(:'profit')
    self.profit = attributes[:'profit']
  end

  if attributes.has_key?(:'profit_formatted')
    self.profit_formatted = attributes[:'profit_formatted']
  end

  if attributes.has_key?(:'return_to_sender_count')
    self.return_to_sender_count = attributes[:'return_to_sender_count']
  end

  if attributes.has_key?(:'return_to_sender_count_formatted')
    self.return_to_sender_count_formatted = attributes[:'return_to_sender_count_formatted']
  end

  if attributes.has_key?(:'revenue')
    self.revenue = attributes[:'revenue']
  end

  if attributes.has_key?(:'revenue_formatted')
    self.revenue_formatted = attributes[:'revenue_formatted']
  end

  if attributes.has_key?(:'send_count')
    self.send_count = attributes[:'send_count']
  end

  if attributes.has_key?(:'send_count_formatted')
    self.send_count_formatted = attributes[:'send_count_formatted']
  end

  if attributes.has_key?(:'skipped_count')
    self.skipped_count = attributes[:'skipped_count']
  end

  if attributes.has_key?(:'skipped_count_formatted')
    self.skipped_count_formatted = attributes[:'skipped_count_formatted']
  end

  if attributes.has_key?(:'spam_count')
    self.spam_count = attributes[:'spam_count']
  end

  if attributes.has_key?(:'spam_count_formatted')
    self.spam_count_formatted = attributes[:'spam_count_formatted']
  end

  if attributes.has_key?(:'stat_type')
    self.stat_type = attributes[:'stat_type']
  end

  if attributes.has_key?(:'status')
    self.status = attributes[:'status']
  end

  if attributes.has_key?(:'status_dts')
    self.status_dts = attributes[:'status_dts']
  end

  if attributes.has_key?(:'steps')
    if (value = attributes[:'steps']).is_a?(Array)
      self.steps = value
    end
  end

  if attributes.has_key?(:'storefront_oid')
    self.storefront_oid = attributes[:'storefront_oid']
  end

  if attributes.has_key?(:'unsubscribe_count')
    self.unsubscribe_count = attributes[:'unsubscribe_count']
  end

  if attributes.has_key?(:'unsubscribe_count_formatted')
    self.unsubscribe_count_formatted = attributes[:'unsubscribe_count_formatted']
  end

  if attributes.has_key?(:'uuid')
    self.uuid = attributes[:'uuid']
  end

  if attributes.has_key?(:'view_count')
    self.view_count = attributes[:'view_count']
  end

  if attributes.has_key?(:'view_count_formatted')
    self.view_count_formatted = attributes[:'view_count_formatted']
  end
end

Instance Attribute Details

#click_countObject

Count of clicked emails



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

def click_count
  @click_count
end

#click_count_formattedObject

Count of clicked emails, formatted



21
22
23
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 21

def click_count_formatted
  @click_count_formatted
end

#conversion_countObject

Count of conversions



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

def conversion_count
  @conversion_count
end

#conversion_count_formattedObject

Count of conversions, formatted



27
28
29
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 27

def conversion_count_formatted
  @conversion_count_formatted
end

#delivered_countObject

Count of delivered emails



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

def delivered_count
  @delivered_count
end

#delivered_count_formattedObject

Count of delivered emails, formatted



33
34
35
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 33

def delivered_count_formatted
  @delivered_count_formatted
end

#merchant_idObject

Merchant ID



36
37
38
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 36

def merchant_id
  @merchant_id
end

#nameObject

List or segment name



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

def name
  @name
end

#order_countObject

Count of orders



42
43
44
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 42

def order_count
  @order_count
end

#order_count_formattedObject

Count of orders, formatted



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

def order_count_formatted
  @order_count_formatted
end

#profitObject

Profit



48
49
50
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 48

def profit
  @profit
end

#profit_formattedObject

Profit, formatted



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

def profit_formatted
  @profit_formatted
end

#return_to_sender_countObject

Count of return to sender



54
55
56
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 54

def return_to_sender_count
  @return_to_sender_count
end

#return_to_sender_count_formattedObject

Count of return to sender, formatted



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

def return_to_sender_count_formatted
  @return_to_sender_count_formatted
end

#revenueObject

Revenue



60
61
62
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 60

def revenue
  @revenue
end

#revenue_formattedObject

Revenue, formatted



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

def revenue_formatted
  @revenue_formatted
end

#send_countObject

Count of emails sent



66
67
68
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 66

def send_count
  @send_count
end

#send_count_formattedObject

Count of emails sent, formatted



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

def send_count_formatted
  @send_count_formatted
end

#skipped_countObject

Count of skipped emails



72
73
74
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 72

def skipped_count
  @skipped_count
end

#skipped_count_formattedObject

Count of skipped emails, formatted



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

def skipped_count_formatted
  @skipped_count_formatted
end

#spam_countObject

Count of emails classified as spam



78
79
80
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 78

def spam_count
  @spam_count
end

#spam_count_formattedObject

Count of emails classified as spam, formatted



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

def spam_count_formatted
  @spam_count_formatted
end

#stat_typeObject

Campaign, Flow or None (for anything else)



84
85
86
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 84

def stat_type
  @stat_type
end

#statusObject

Status of campaign or flow



87
88
89
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 87

def status
  @status
end

#status_dtsObject

Status dts of campaign or flow



90
91
92
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 90

def status_dts
  @status_dts
end

#stepsObject

Returns the value of attribute steps.



92
93
94
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 92

def steps
  @steps
end

#storefront_oidObject

Storefront oid



95
96
97
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 95

def storefront_oid
  @storefront_oid
end

#unsubscribe_countObject

Count of emails classified as unsubscribe



98
99
100
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 98

def unsubscribe_count
  @unsubscribe_count
end

#unsubscribe_count_formattedObject

Count of emails classified as unsubscribe, formatted



101
102
103
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 101

def unsubscribe_count_formatted
  @unsubscribe_count_formatted
end

#uuidObject

List or segment uuid



104
105
106
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 104

def uuid
  @uuid
end

#view_countObject

Count of views



107
108
109
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 107

def view_count
  @view_count
end

#view_count_formattedObject

Count of views, formatted



110
111
112
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 110

def view_count_formatted
  @view_count_formatted
end

Class Method Details

.attribute_mapObject

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



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 113

def self.attribute_map
  {
    :'click_count' => :'click_count',
    :'click_count_formatted' => :'click_count_formatted',
    :'conversion_count' => :'conversion_count',
    :'conversion_count_formatted' => :'conversion_count_formatted',
    :'delivered_count' => :'delivered_count',
    :'delivered_count_formatted' => :'delivered_count_formatted',
    :'merchant_id' => :'merchant_id',
    :'name' => :'name',
    :'order_count' => :'order_count',
    :'order_count_formatted' => :'order_count_formatted',
    :'profit' => :'profit',
    :'profit_formatted' => :'profit_formatted',
    :'return_to_sender_count' => :'return_to_sender_count',
    :'return_to_sender_count_formatted' => :'return_to_sender_count_formatted',
    :'revenue' => :'revenue',
    :'revenue_formatted' => :'revenue_formatted',
    :'send_count' => :'send_count',
    :'send_count_formatted' => :'send_count_formatted',
    :'skipped_count' => :'skipped_count',
    :'skipped_count_formatted' => :'skipped_count_formatted',
    :'spam_count' => :'spam_count',
    :'spam_count_formatted' => :'spam_count_formatted',
    :'stat_type' => :'stat_type',
    :'status' => :'status',
    :'status_dts' => :'status_dts',
    :'steps' => :'steps',
    :'storefront_oid' => :'storefront_oid',
    :'unsubscribe_count' => :'unsubscribe_count',
    :'unsubscribe_count_formatted' => :'unsubscribe_count_formatted',
    :'uuid' => :'uuid',
    :'view_count' => :'view_count',
    :'view_count_formatted' => :'view_count_formatted'
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    :'click_count' => :'Integer',
    :'click_count_formatted' => :'String',
    :'conversion_count' => :'Integer',
    :'conversion_count_formatted' => :'String',
    :'delivered_count' => :'Integer',
    :'delivered_count_formatted' => :'String',
    :'merchant_id' => :'String',
    :'name' => :'String',
    :'order_count' => :'Integer',
    :'order_count_formatted' => :'String',
    :'profit' => :'Float',
    :'profit_formatted' => :'String',
    :'return_to_sender_count' => :'Integer',
    :'return_to_sender_count_formatted' => :'String',
    :'revenue' => :'Float',
    :'revenue_formatted' => :'String',
    :'send_count' => :'Integer',
    :'send_count_formatted' => :'String',
    :'skipped_count' => :'Integer',
    :'skipped_count_formatted' => :'String',
    :'spam_count' => :'Integer',
    :'spam_count_formatted' => :'String',
    :'stat_type' => :'String',
    :'status' => :'String',
    :'status_dts' => :'String',
    :'steps' => :'Array<EmailPostcardStat>',
    :'storefront_oid' => :'Integer',
    :'unsubscribe_count' => :'Integer',
    :'unsubscribe_count_formatted' => :'String',
    :'uuid' => :'String',
    :'view_count' => :'Integer',
    :'view_count_formatted' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



342
343
344
345
346
347
348
349
350
351
352
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
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 342

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      click_count == o.click_count &&
      click_count_formatted == o.click_count_formatted &&
      conversion_count == o.conversion_count &&
      conversion_count_formatted == o.conversion_count_formatted &&
      delivered_count == o.delivered_count &&
      delivered_count_formatted == o.delivered_count_formatted &&
      merchant_id == o.merchant_id &&
      name == o.name &&
      order_count == o.order_count &&
      order_count_formatted == o.order_count_formatted &&
      profit == o.profit &&
      profit_formatted == o.profit_formatted &&
      return_to_sender_count == o.return_to_sender_count &&
      return_to_sender_count_formatted == o.return_to_sender_count_formatted &&
      revenue == o.revenue &&
      revenue_formatted == o.revenue_formatted &&
      send_count == o.send_count &&
      send_count_formatted == o.send_count_formatted &&
      skipped_count == o.skipped_count &&
      skipped_count_formatted == o.skipped_count_formatted &&
      spam_count == o.spam_count &&
      spam_count_formatted == o.spam_count_formatted &&
      stat_type == o.stat_type &&
      status == o.status &&
      status_dts == o.status_dts &&
      steps == o.steps &&
      storefront_oid == o.storefront_oid &&
      unsubscribe_count == o.unsubscribe_count &&
      unsubscribe_count_formatted == o.unsubscribe_count_formatted &&
      uuid == o.uuid &&
      view_count == o.view_count &&
      view_count_formatted == o.view_count_formatted
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



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
450
451
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 415

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.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
    temp_model = UltracartClient.const_get(type).new
    temp_model.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



481
482
483
484
485
486
487
488
489
490
491
492
493
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 481

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



394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 394

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if 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 # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


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

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



387
388
389
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 387

def hash
  [click_count, click_count_formatted, conversion_count, conversion_count_formatted, delivered_count, delivered_count_formatted, merchant_id, name, order_count, order_count_formatted, profit, profit_formatted, return_to_sender_count, return_to_sender_count_formatted, revenue, revenue_formatted, send_count, send_count_formatted, skipped_count, skipped_count_formatted, spam_count, spam_count_formatted, stat_type, status, status_dts, steps, storefront_oid, unsubscribe_count, unsubscribe_count_formatted, uuid, view_count, view_count_formatted].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



329
330
331
332
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 329

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



461
462
463
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 461

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



467
468
469
470
471
472
473
474
475
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 467

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



455
456
457
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 455

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



336
337
338
# File 'lib/ultracart_api/models/email_postcard_stat.rb', line 336

def valid?
  true
end