Class: Verizon::UpdateTriggerV2Request

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

Overview

Update Trigger Request

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(trigger_id = SKIP, trigger_name = SKIP, ecpd_id = SKIP, device_group_name = SKIP, trigger_category = SKIP, price_plan_trigger = SKIP, notification = SKIP, active = SKIP) ⇒ UpdateTriggerV2Request

Returns a new instance of UpdateTriggerV2Request.



77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/verizon/models/update_trigger_v2_request.rb', line 77

def initialize(trigger_id = SKIP, trigger_name = SKIP, ecpd_id = SKIP,
               device_group_name = SKIP, trigger_category = SKIP,
               price_plan_trigger = SKIP, notification = SKIP,
               active = SKIP)
  @trigger_id = trigger_id unless trigger_id == SKIP
  @trigger_name = trigger_name unless trigger_name == SKIP
  @ecpd_id = ecpd_id unless ecpd_id == SKIP
  @device_group_name = device_group_name unless device_group_name == SKIP
  @trigger_category = trigger_category unless trigger_category == SKIP
  @price_plan_trigger = price_plan_trigger unless price_plan_trigger == SKIP
  @notification = notification unless notification == SKIP
  @active = active unless active == SKIP
end

Instance Attribute Details

#activeTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def active
  @active
end

#device_group_nameString

TODO: Write general description for this method

Returns:

  • (String)


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

def device_group_name
  @device_group_name
end

#ecpd_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def ecpd_id
  @ecpd_id
end

#notificationNotification

TODO: Write general description for this method

Returns:



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

def notification
  @notification
end

#price_plan_triggerPricePlanTrigger

TODO: Write general description for this method

Returns:



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

def price_plan_trigger
  @price_plan_trigger
end

#trigger_categoryString

TODO: Write general description for this method

Returns:

  • (String)


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

def trigger_category
  @trigger_category
end

#trigger_idString

TODO: Write general description for this method

Returns:

  • (String)


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

def trigger_id
  @trigger_id
end

#trigger_nameString

TODO: Write general description for this method

Returns:

  • (String)


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

def trigger_name
  @trigger_name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  trigger_id = hash.key?('triggerId') ? hash['triggerId'] : SKIP
  trigger_name = hash.key?('triggerName') ? hash['triggerName'] : SKIP
  ecpd_id = hash.key?('ecpdId') ? hash['ecpdId'] : SKIP
  device_group_name =
    hash.key?('deviceGroupName') ? hash['deviceGroupName'] : SKIP
  trigger_category =
    hash.key?('triggerCategory') ? hash['triggerCategory'] : SKIP
  price_plan_trigger = PricePlanTrigger.from_hash(hash['pricePlanTrigger']) if
    hash['pricePlanTrigger']
  notification = Notification.from_hash(hash['notification']) if hash['notification']
  active = hash.key?('active') ? hash['active'] : SKIP

  # Create object from extracted values.
  UpdateTriggerV2Request.new(trigger_id,
                             trigger_name,
                             ecpd_id,
                             device_group_name,
                             trigger_category,
                             price_plan_trigger,
                             notification,
                             active)
end

.namesObject

A mapping from model property names to API property names.



45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/verizon/models/update_trigger_v2_request.rb', line 45

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['trigger_id'] = 'triggerId'
  @_hash['trigger_name'] = 'triggerName'
  @_hash['ecpd_id'] = 'ecpdId'
  @_hash['device_group_name'] = 'deviceGroupName'
  @_hash['trigger_category'] = 'triggerCategory'
  @_hash['price_plan_trigger'] = 'pricePlanTrigger'
  @_hash['notification'] = 'notification'
  @_hash['active'] = 'active'
  @_hash
end

.nullablesObject

An array for nullable fields



73
74
75
# File 'lib/verizon/models/update_trigger_v2_request.rb', line 73

def self.nullables
  []
end

.optionalsObject

An array for optional fields



59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/verizon/models/update_trigger_v2_request.rb', line 59

def self.optionals
  %w[
    trigger_id
    trigger_name
    ecpd_id
    device_group_name
    trigger_category
    price_plan_trigger
    notification
    active
  ]
end