Class: Verizon::PromoAlertTriggerRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/verizon/models/promo_alert_trigger_request.rb

Overview

PromoAlertTriggerRequest Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(data_percentage50 = SKIP, data_percentage75 = SKIP, data_percentage90 = SKIP, no_of_days_b4_promo_exp = SKIP, sms_percentage50 = SKIP, sms_percentage75 = SKIP, sms_percentage90 = SKIP) ⇒ PromoAlertTriggerRequest

Returns a new instance of PromoAlertTriggerRequest.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/verizon/models/promo_alert_trigger_request.rb', line 71

def initialize(data_percentage50 = SKIP,
               data_percentage75 = SKIP,
               data_percentage90 = SKIP,
               no_of_days_b4_promo_exp = SKIP,
               sms_percentage50 = SKIP,
               sms_percentage75 = SKIP,
               sms_percentage90 = SKIP)
  @data_percentage50 = data_percentage50 unless data_percentage50 == SKIP
  @data_percentage75 = data_percentage75 unless data_percentage75 == SKIP
  @data_percentage90 = data_percentage90 unless data_percentage90 == SKIP
  @no_of_days_b4_promo_exp = no_of_days_b4_promo_exp unless no_of_days_b4_promo_exp == SKIP
  @sms_percentage50 = sms_percentage50 unless sms_percentage50 == SKIP
  @sms_percentage75 = sms_percentage75 unless sms_percentage75 == SKIP
  @sms_percentage90 = sms_percentage90 unless sms_percentage90 == SKIP
end

Instance Attribute Details

#data_percentage50TrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


14
15
16
# File 'lib/verizon/models/promo_alert_trigger_request.rb', line 14

def data_percentage50
  @data_percentage50
end

#data_percentage75TrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


18
19
20
# File 'lib/verizon/models/promo_alert_trigger_request.rb', line 18

def data_percentage75
  @data_percentage75
end

#data_percentage90TrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


22
23
24
# File 'lib/verizon/models/promo_alert_trigger_request.rb', line 22

def data_percentage90
  @data_percentage90
end

#no_of_days_b4_promo_expInteger

TODO: Write general description for this method

Returns:

  • (Integer)


26
27
28
# File 'lib/verizon/models/promo_alert_trigger_request.rb', line 26

def no_of_days_b4_promo_exp
  @no_of_days_b4_promo_exp
end

#sms_percentage50TrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


30
31
32
# File 'lib/verizon/models/promo_alert_trigger_request.rb', line 30

def sms_percentage50
  @sms_percentage50
end

#sms_percentage75TrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


34
35
36
# File 'lib/verizon/models/promo_alert_trigger_request.rb', line 34

def sms_percentage75
  @sms_percentage75
end

#sms_percentage90TrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


38
39
40
# File 'lib/verizon/models/promo_alert_trigger_request.rb', line 38

def sms_percentage90
  @sms_percentage90
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
# File 'lib/verizon/models/promo_alert_trigger_request.rb', line 88

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  data_percentage50 =
    hash.key?('dataPercentage50') ? hash['dataPercentage50'] : SKIP
  data_percentage75 =
    hash.key?('dataPercentage75') ? hash['dataPercentage75'] : SKIP
  data_percentage90 =
    hash.key?('dataPercentage90') ? hash['dataPercentage90'] : SKIP
  no_of_days_b4_promo_exp =
    hash.key?('noOfDaysB4PromoExp') ? hash['noOfDaysB4PromoExp'] : SKIP
  sms_percentage50 =
    hash.key?('smsPercentage50') ? hash['smsPercentage50'] : SKIP
  sms_percentage75 =
    hash.key?('smsPercentage75') ? hash['smsPercentage75'] : SKIP
  sms_percentage90 =
    hash.key?('smsPercentage90') ? hash['smsPercentage90'] : SKIP

  # Create object from extracted values.
  PromoAlertTriggerRequest.new(data_percentage50,
                               data_percentage75,
                               data_percentage90,
                               no_of_days_b4_promo_exp,
                               sms_percentage50,
                               sms_percentage75,
                               sms_percentage90)
end

.namesObject

A mapping from model property names to API property names.



41
42
43
44
45
46
47
48
49
50
51
# File 'lib/verizon/models/promo_alert_trigger_request.rb', line 41

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['data_percentage50'] = 'dataPercentage50'
  @_hash['data_percentage75'] = 'dataPercentage75'
  @_hash['data_percentage90'] = 'dataPercentage90'
  @_hash['no_of_days_b4_promo_exp'] = 'noOfDaysB4PromoExp'
  @_hash['sms_percentage50'] = 'smsPercentage50'
  @_hash['sms_percentage75'] = 'smsPercentage75'
  @_hash['sms_percentage90'] = 'smsPercentage90'
  @_hash
end

.nullablesObject

An array for nullable fields



67
68
69
# File 'lib/verizon/models/promo_alert_trigger_request.rb', line 67

def self.nullables
  []
end

.optionalsObject

An array for optional fields



54
55
56
57
58
59
60
61
62
63
64
# File 'lib/verizon/models/promo_alert_trigger_request.rb', line 54

def self.optionals
  %w[
    data_percentage50
    data_percentage75
    data_percentage90
    no_of_days_b4_promo_exp
    sms_percentage50
    sms_percentage75
    sms_percentage90
  ]
end