Class: Verizon::UpdateTriggerRequest

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

Overview

UpdateTriggerRequest Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(account_name = SKIP, active = SKIP, anomaly_trigger_request = SKIP, cycle_type = SKIP, data_trigger_request = SKIP, group_name = SKIP, promo_alert_trigger_request = SKIP, session_trigger_request = SKIP, sms_trigger_request = SKIP, trigger_category = SKIP, trigger_id = SKIP, trigger_name = SKIP) ⇒ UpdateTriggerRequest

Returns a new instance of UpdateTriggerRequest.



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/verizon/models/update_trigger_request.rb', line 101

def initialize( = SKIP,
               active = SKIP,
               anomaly_trigger_request = SKIP,
               cycle_type = SKIP,
               data_trigger_request = SKIP,
               group_name = SKIP,
               promo_alert_trigger_request = SKIP,
               session_trigger_request = SKIP,
               sms_trigger_request = SKIP,
               trigger_category = SKIP,
               trigger_id = SKIP,
               trigger_name = SKIP)
  @account_name =  unless  == SKIP
  @active = active unless active == SKIP
  @anomaly_trigger_request = anomaly_trigger_request unless anomaly_trigger_request == SKIP
  @cycle_type = cycle_type unless cycle_type == SKIP
  @data_trigger_request = data_trigger_request unless data_trigger_request == SKIP
  @group_name = group_name unless group_name == SKIP
  unless promo_alert_trigger_request == SKIP
    @promo_alert_trigger_request =
      promo_alert_trigger_request
  end
  @session_trigger_request = session_trigger_request unless session_trigger_request == SKIP
  @sms_trigger_request = sms_trigger_request unless sms_trigger_request == SKIP
  @trigger_category = trigger_category unless trigger_category == SKIP
  @trigger_id = trigger_id unless trigger_id == SKIP
  @trigger_name = trigger_name unless trigger_name == SKIP
end

Instance Attribute Details

#account_nameString

TODO: Write general description for this method

Returns:

  • (String)


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

def 
  @account_name
end

#activeTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def active
  @active
end

#anomaly_trigger_requestAnomalyTriggerRequest

The details of the UsageAnomaly trigger.



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

def anomaly_trigger_request
  @anomaly_trigger_request
end

#cycle_typeCycleTypeEnum

The details of the UsageAnomaly trigger.

Returns:



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

def cycle_type
  @cycle_type
end

#data_trigger_requestDataTriggerRequest

The details of the UsageAnomaly trigger.

Returns:



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

def data_trigger_request
  @data_trigger_request
end

#group_nameString

The details of the UsageAnomaly trigger.

Returns:

  • (String)


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

def group_name
  @group_name
end

#promo_alert_trigger_requestPromoAlertTriggerRequest

The details of the UsageAnomaly trigger.



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

def promo_alert_trigger_request
  @promo_alert_trigger_request
end

#session_trigger_requestSessionTriggerRequest

The details of the UsageAnomaly trigger.



42
43
44
# File 'lib/verizon/models/update_trigger_request.rb', line 42

def session_trigger_request
  @session_trigger_request
end

#sms_trigger_requestSMSTriggerRequest

The details of the UsageAnomaly trigger.

Returns:



46
47
48
# File 'lib/verizon/models/update_trigger_request.rb', line 46

def sms_trigger_request
  @sms_trigger_request
end

#trigger_categoryString

The details of the UsageAnomaly trigger.

Returns:

  • (String)


50
51
52
# File 'lib/verizon/models/update_trigger_request.rb', line 50

def trigger_category
  @trigger_category
end

#trigger_idString

The details of the UsageAnomaly trigger.

Returns:

  • (String)


54
55
56
# File 'lib/verizon/models/update_trigger_request.rb', line 54

def trigger_id
  @trigger_id
end

#trigger_nameString

The details of the UsageAnomaly trigger.

Returns:

  • (String)


58
59
60
# File 'lib/verizon/models/update_trigger_request.rb', line 58

def trigger_name
  @trigger_name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
163
164
165
166
167
168
# File 'lib/verizon/models/update_trigger_request.rb', line 131

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('accountName') ? hash['accountName'] : SKIP
  active = hash.key?('active') ? hash['active'] : SKIP
  anomaly_trigger_request = AnomalyTriggerRequest.from_hash(hash['anomalyTriggerRequest']) if
    hash['anomalyTriggerRequest']
  cycle_type = hash.key?('cycleType') ? hash['cycleType'] : SKIP
  data_trigger_request = DataTriggerRequest.from_hash(hash['dataTriggerRequest']) if
    hash['dataTriggerRequest']
  group_name = hash.key?('groupName') ? hash['groupName'] : SKIP
  if hash['promoAlertTriggerRequest']
    promo_alert_trigger_request = PromoAlertTriggerRequest.from_hash(hash['promoAlertTriggerRequest'])
  end
  session_trigger_request = SessionTriggerRequest.from_hash(hash['sessionTriggerRequest']) if
    hash['sessionTriggerRequest']
  sms_trigger_request = SMSTriggerRequest.from_hash(hash['smsTriggerRequest']) if
    hash['smsTriggerRequest']
  trigger_category =
    hash.key?('triggerCategory') ? hash['triggerCategory'] : SKIP
  trigger_id = hash.key?('triggerId') ? hash['triggerId'] : SKIP
  trigger_name = hash.key?('triggerName') ? hash['triggerName'] : SKIP

  # Create object from extracted values.
  UpdateTriggerRequest.new(,
                           active,
                           anomaly_trigger_request,
                           cycle_type,
                           data_trigger_request,
                           group_name,
                           promo_alert_trigger_request,
                           session_trigger_request,
                           sms_trigger_request,
                           trigger_category,
                           trigger_id,
                           trigger_name)
end

.namesObject

A mapping from model property names to API property names.



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/verizon/models/update_trigger_request.rb', line 61

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_name'] = 'accountName'
  @_hash['active'] = 'active'
  @_hash['anomaly_trigger_request'] = 'anomalyTriggerRequest'
  @_hash['cycle_type'] = 'cycleType'
  @_hash['data_trigger_request'] = 'dataTriggerRequest'
  @_hash['group_name'] = 'groupName'
  @_hash['promo_alert_trigger_request'] = 'promoAlertTriggerRequest'
  @_hash['session_trigger_request'] = 'sessionTriggerRequest'
  @_hash['sms_trigger_request'] = 'smsTriggerRequest'
  @_hash['trigger_category'] = 'triggerCategory'
  @_hash['trigger_id'] = 'triggerId'
  @_hash['trigger_name'] = 'triggerName'
  @_hash
end

.nullablesObject

An array for nullable fields



97
98
99
# File 'lib/verizon/models/update_trigger_request.rb', line 97

def self.nullables
  []
end

.optionalsObject

An array for optional fields



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/verizon/models/update_trigger_request.rb', line 79

def self.optionals
  %w[
    account_name
    active
    anomaly_trigger_request
    cycle_type
    data_trigger_request
    group_name
    promo_alert_trigger_request
    session_trigger_request
    sms_trigger_request
    trigger_category
    trigger_id
    trigger_name
  ]
end