Class: TalonOne::CampaignAnalytics

Inherits:
Object
  • Object
show all
Defined in:
lib/talon_one/models/campaign_analytics.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ CampaignAnalytics

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
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
# File 'lib/talon_one/models/campaign_analytics.rb', line 162

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#added_loyalty_pointsObject

Number of added loyalty points in the campaign in a specific interval.



81
82
83
# File 'lib/talon_one/models/campaign_analytics.rb', line 81

def added_loyalty_points
  @added_loyalty_points
end

#campaign_discount_costsObject

Amount of cost caused by discounts given in the campaign.



33
34
35
# File 'lib/talon_one/models/campaign_analytics.rb', line 33

def campaign_discount_costs
  @campaign_discount_costs
end

#campaign_free_itemsObject

Amount of free items given in the campaign.



45
46
47
# File 'lib/talon_one/models/campaign_analytics.rb', line 45

def campaign_free_items
  @campaign_free_items
end

#campaign_refundObject

Amount of refunds in this campaign (for coupon or discount sessions).



27
28
29
# File 'lib/talon_one/models/campaign_analytics.rb', line 27

def campaign_refund
  @campaign_refund
end

#campaign_refunded_discountsObject

Amount of discounts rolledback due to refund in the campaign.



39
40
41
# File 'lib/talon_one/models/campaign_analytics.rb', line 39

def campaign_refunded_discounts
  @campaign_refunded_discounts
end

#campaign_revenueObject

Amount of revenue in this campaign (for coupon or discount sessions).



21
22
23
# File 'lib/talon_one/models/campaign_analytics.rb', line 21

def campaign_revenue
  @campaign_revenue
end

#coupon_redemptionsObject

Number of coupon redemptions in the campaign.



51
52
53
# File 'lib/talon_one/models/campaign_analytics.rb', line 51

def coupon_redemptions
  @coupon_redemptions
end

#coupon_rolledback_redemptionsObject

Number of coupon redemptions that have been rolled back (due to canceling closed session) in the campaign.



57
58
59
# File 'lib/talon_one/models/campaign_analytics.rb', line 57

def coupon_rolledback_redemptions
  @coupon_rolledback_redemptions
end

#coupons_createdObject

Number of coupons created in the campaign by the rule engine.



69
70
71
# File 'lib/talon_one/models/campaign_analytics.rb', line 69

def coupons_created
  @coupons_created
end

#dateObject

Returns the value of attribute date.



18
19
20
# File 'lib/talon_one/models/campaign_analytics.rb', line 18

def date
  @date
end

#deducted_loyalty_pointsObject

Number of deducted loyalty points in the campaign in a specific interval.



87
88
89
# File 'lib/talon_one/models/campaign_analytics.rb', line 87

def deducted_loyalty_points
  @deducted_loyalty_points
end

#referral_redemptionsObject

Number of referral redemptions in the campaign.



63
64
65
# File 'lib/talon_one/models/campaign_analytics.rb', line 63

def referral_redemptions
  @referral_redemptions
end

#referrals_createdObject

Number of referrals created in the campaign by the rule engine.



75
76
77
# File 'lib/talon_one/models/campaign_analytics.rb', line 75

def referrals_created
  @referrals_created
end

#total_added_loyalty_pointsObject

Number of added loyalty points in the campaign since it began.



84
85
86
# File 'lib/talon_one/models/campaign_analytics.rb', line 84

def total_added_loyalty_points
  @total_added_loyalty_points
end

#total_campaign_discount_costsObject

Amount of cost caused by discounts given in the campaign since it began.



36
37
38
# File 'lib/talon_one/models/campaign_analytics.rb', line 36

def total_campaign_discount_costs
  @total_campaign_discount_costs
end

#total_campaign_free_itemsObject

Amount of free items given in the campaign since it began.



48
49
50
# File 'lib/talon_one/models/campaign_analytics.rb', line 48

def total_campaign_free_items
  @total_campaign_free_items
end

#total_campaign_refundObject

Amount of refunds in this campaign since it began (for coupon or discount sessions).



30
31
32
# File 'lib/talon_one/models/campaign_analytics.rb', line 30

def total_campaign_refund
  @total_campaign_refund
end

#total_campaign_refunded_discountsObject

Amount of discounts rolledback due to refund in the campaign since it began.



42
43
44
# File 'lib/talon_one/models/campaign_analytics.rb', line 42

def total_campaign_refunded_discounts
  @total_campaign_refunded_discounts
end

#total_campaign_revenueObject

Amount of revenue in this campaign since it began (for coupon or discount sessions).



24
25
26
# File 'lib/talon_one/models/campaign_analytics.rb', line 24

def total_campaign_revenue
  @total_campaign_revenue
end

#total_coupon_redemptionsObject

Number of coupon redemptions in the campaign since it began.



54
55
56
# File 'lib/talon_one/models/campaign_analytics.rb', line 54

def total_coupon_redemptions
  @total_coupon_redemptions
end

#total_coupon_rolledback_redemptionsObject

Number of coupon redemptions that have been rolled back (due to canceling closed session) in the campaign since it began.



60
61
62
# File 'lib/talon_one/models/campaign_analytics.rb', line 60

def total_coupon_rolledback_redemptions
  @total_coupon_rolledback_redemptions
end

#total_coupons_createdObject

Number of coupons created in the campaign by the rule engine since it began.



72
73
74
# File 'lib/talon_one/models/campaign_analytics.rb', line 72

def total_coupons_created
  @total_coupons_created
end

#total_deducted_loyalty_pointsObject

Number of deducted loyalty points in the campaign since it began.



90
91
92
# File 'lib/talon_one/models/campaign_analytics.rb', line 90

def total_deducted_loyalty_points
  @total_deducted_loyalty_points
end

#total_referral_redemptionsObject

Number of referral redemptions in the campaign since it began.



66
67
68
# File 'lib/talon_one/models/campaign_analytics.rb', line 66

def total_referral_redemptions
  @total_referral_redemptions
end

#total_referrals_createdObject

Number of referrals created in the campaign by the rule engine since it began.



78
79
80
# File 'lib/talon_one/models/campaign_analytics.rb', line 78

def total_referrals_created
  @total_referrals_created
end

Class Method Details

.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
# File 'lib/talon_one/models/campaign_analytics.rb', line 93

def self.attribute_map
  {
    :'date' => :'date',
    :'campaign_revenue' => :'campaignRevenue',
    :'total_campaign_revenue' => :'totalCampaignRevenue',
    :'campaign_refund' => :'campaignRefund',
    :'total_campaign_refund' => :'totalCampaignRefund',
    :'campaign_discount_costs' => :'campaignDiscountCosts',
    :'total_campaign_discount_costs' => :'totalCampaignDiscountCosts',
    :'campaign_refunded_discounts' => :'campaignRefundedDiscounts',
    :'total_campaign_refunded_discounts' => :'totalCampaignRefundedDiscounts',
    :'campaign_free_items' => :'campaignFreeItems',
    :'total_campaign_free_items' => :'totalCampaignFreeItems',
    :'coupon_redemptions' => :'couponRedemptions',
    :'total_coupon_redemptions' => :'totalCouponRedemptions',
    :'coupon_rolledback_redemptions' => :'couponRolledbackRedemptions',
    :'total_coupon_rolledback_redemptions' => :'totalCouponRolledbackRedemptions',
    :'referral_redemptions' => :'referralRedemptions',
    :'total_referral_redemptions' => :'totalReferralRedemptions',
    :'coupons_created' => :'couponsCreated',
    :'total_coupons_created' => :'totalCouponsCreated',
    :'referrals_created' => :'referralsCreated',
    :'total_referrals_created' => :'totalReferralsCreated',
    :'added_loyalty_points' => :'addedLoyaltyPoints',
    :'total_added_loyalty_points' => :'totalAddedLoyaltyPoints',
    :'deducted_loyalty_points' => :'deductedLoyaltyPoints',
    :'total_deducted_loyalty_points' => :'totalDeductedLoyaltyPoints'
  }
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



461
462
463
# File 'lib/talon_one/models/campaign_analytics.rb', line 461

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

.openapi_nullableObject

List of attributes with nullable: true



155
156
157
158
# File 'lib/talon_one/models/campaign_analytics.rb', line 155

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

.openapi_typesObject

Attribute type mapping.



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
149
150
151
152
# File 'lib/talon_one/models/campaign_analytics.rb', line 124

def self.openapi_types
  {
    :'date' => :'DateTime',
    :'campaign_revenue' => :'Float',
    :'total_campaign_revenue' => :'Float',
    :'campaign_refund' => :'Float',
    :'total_campaign_refund' => :'Float',
    :'campaign_discount_costs' => :'Float',
    :'total_campaign_discount_costs' => :'Float',
    :'campaign_refunded_discounts' => :'Float',
    :'total_campaign_refunded_discounts' => :'Float',
    :'campaign_free_items' => :'Integer',
    :'total_campaign_free_items' => :'Integer',
    :'coupon_redemptions' => :'Integer',
    :'total_coupon_redemptions' => :'Integer',
    :'coupon_rolledback_redemptions' => :'Integer',
    :'total_coupon_rolledback_redemptions' => :'Integer',
    :'referral_redemptions' => :'Integer',
    :'total_referral_redemptions' => :'Integer',
    :'coupons_created' => :'Integer',
    :'total_coupons_created' => :'Integer',
    :'referrals_created' => :'Integer',
    :'total_referrals_created' => :'Integer',
    :'added_loyalty_points' => :'Float',
    :'total_added_loyalty_points' => :'Float',
    :'deducted_loyalty_points' => :'Float',
    :'total_deducted_loyalty_points' => :'Float'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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
# File 'lib/talon_one/models/campaign_analytics.rb', line 416

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      date == o.date &&
      campaign_revenue == o.campaign_revenue &&
      total_campaign_revenue == o.total_campaign_revenue &&
      campaign_refund == o.campaign_refund &&
      total_campaign_refund == o.total_campaign_refund &&
      campaign_discount_costs == o.campaign_discount_costs &&
      total_campaign_discount_costs == o.total_campaign_discount_costs &&
      campaign_refunded_discounts == o.campaign_refunded_discounts &&
      total_campaign_refunded_discounts == o.total_campaign_refunded_discounts &&
      campaign_free_items == o.campaign_free_items &&
      total_campaign_free_items == o.total_campaign_free_items &&
      coupon_redemptions == o.coupon_redemptions &&
      total_coupon_redemptions == o.total_coupon_redemptions &&
      coupon_rolledback_redemptions == o.coupon_rolledback_redemptions &&
      total_coupon_rolledback_redemptions == o.total_coupon_rolledback_redemptions &&
      referral_redemptions == o.referral_redemptions &&
      total_referral_redemptions == o.total_referral_redemptions &&
      coupons_created == o.coupons_created &&
      total_coupons_created == o.total_coupons_created &&
      referrals_created == o.referrals_created &&
      total_referrals_created == o.total_referrals_created &&
      added_loyalty_points == o.added_loyalty_points &&
      total_added_loyalty_points == o.total_added_loyalty_points &&
      deducted_loyalty_points == o.deducted_loyalty_points &&
      total_deducted_loyalty_points == o.total_deducted_loyalty_points
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



489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
# File 'lib/talon_one/models/campaign_analytics.rb', line 489

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
    TalonOne.const_get(type).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



558
559
560
561
562
563
564
565
566
567
568
569
570
# File 'lib/talon_one/models/campaign_analytics.rb', line 558

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



468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
# File 'lib/talon_one/models/campaign_analytics.rb', line 468

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.openapi_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


448
449
450
# File 'lib/talon_one/models/campaign_analytics.rb', line 448

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



454
455
456
# File 'lib/talon_one/models/campaign_analytics.rb', line 454

def hash
  [date, campaign_revenue, total_campaign_revenue, campaign_refund, total_campaign_refund, campaign_discount_costs, total_campaign_discount_costs, campaign_refunded_discounts, total_campaign_refunded_discounts, campaign_free_items, total_campaign_free_items, coupon_redemptions, total_coupon_redemptions, coupon_rolledback_redemptions, total_coupon_rolledback_redemptions, referral_redemptions, total_referral_redemptions, coupons_created, total_coupons_created, referrals_created, total_referrals_created, added_loyalty_points, total_added_loyalty_points, deducted_loyalty_points, total_deducted_loyalty_points].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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
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
378
379
380
381
# File 'lib/talon_one/models/campaign_analytics.rb', line 278

def list_invalid_properties
  invalid_properties = Array.new
  if @date.nil?
    invalid_properties.push('invalid value for "date", date cannot be nil.')
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  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



534
535
536
# File 'lib/talon_one/models/campaign_analytics.rb', line 534

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



540
541
542
543
544
545
546
547
548
549
550
551
552
# File 'lib/talon_one/models/campaign_analytics.rb', line 540

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



528
529
530
# File 'lib/talon_one/models/campaign_analytics.rb', line 528

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



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
# File 'lib/talon_one/models/campaign_analytics.rb', line 385

def valid?
  return false if @date.nil?
  return false if @campaign_revenue.nil?
  return false if @total_campaign_revenue.nil?
  return false if @campaign_refund.nil?
  return false if @total_campaign_refund.nil?
  return false if @campaign_discount_costs.nil?
  return false if @total_campaign_discount_costs.nil?
  return false if @campaign_refunded_discounts.nil?
  return false if @total_campaign_refunded_discounts.nil?
  return false if @campaign_free_items.nil?
  return false if @total_campaign_free_items.nil?
  return false if @coupon_redemptions.nil?
  return false if @total_coupon_redemptions.nil?
  return false if @coupon_rolledback_redemptions.nil?
  return false if @total_coupon_rolledback_redemptions.nil?
  return false if @referral_redemptions.nil?
  return false if @total_referral_redemptions.nil?
  return false if @coupons_created.nil?
  return false if @total_coupons_created.nil?
  return false if @referrals_created.nil?
  return false if @total_referrals_created.nil?
  return false if @added_loyalty_points.nil?
  return false if @total_added_loyalty_points.nil?
  return false if @deducted_loyalty_points.nil?
  return false if @total_deducted_loyalty_points.nil?
  true
end