Class: Verizon::CreateTriggerRequest

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

Overview

CreateTriggerRequest 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, anomaly_trigger_request = SKIP, data_trigger_request = SKIP, group_name = SKIP, name = SKIP, session_trigger_request = SKIP, sms_trigger_request = SKIP, trigger_category = SKIP, trigger_cycle = SKIP) ⇒ CreateTriggerRequest

Returns a new instance of CreateTriggerRequest.



83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/verizon/models/create_trigger_request.rb', line 83

def initialize( = SKIP, anomaly_trigger_request = SKIP,
               data_trigger_request = SKIP, group_name = SKIP, name = SKIP,
               session_trigger_request = SKIP, sms_trigger_request = SKIP,
               trigger_category = SKIP, trigger_cycle = SKIP)
  @account_name =  unless  == SKIP
  @anomaly_trigger_request = anomaly_trigger_request unless anomaly_trigger_request == SKIP
  @data_trigger_request = data_trigger_request unless data_trigger_request == SKIP
  @group_name = group_name unless group_name == SKIP
  @name = name unless name == SKIP
  @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_cycle = trigger_cycle unless trigger_cycle == SKIP
end

Instance Attribute Details

#account_nameString

TODO: Write general description for this method

Returns:

  • (String)


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

def 
  @account_name
end

#anomaly_trigger_requestAnomalyTriggerRequest

The details of the UsageAnomaly trigger.



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

def anomaly_trigger_request
  @anomaly_trigger_request
end

#data_trigger_requestDataTriggerRequest

The details of the UsageAnomaly trigger.

Returns:



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

def data_trigger_request
  @data_trigger_request
end

#group_nameString

The details of the UsageAnomaly trigger.

Returns:

  • (String)


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

def group_name
  @group_name
end

#nameString

The details of the UsageAnomaly trigger.

Returns:

  • (String)


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

def name
  @name
end

#session_trigger_requestSessionTriggerRequest

The details of the UsageAnomaly trigger.



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

def session_trigger_request
  @session_trigger_request
end

#sms_trigger_requestSMSTriggerRequest

The details of the UsageAnomaly trigger.

Returns:



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

def sms_trigger_request
  @sms_trigger_request
end

#trigger_categoryString

The details of the UsageAnomaly trigger.

Returns:

  • (String)


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

def trigger_category
  @trigger_category
end

#trigger_cycleString

The details of the UsageAnomaly trigger.

Returns:

  • (String)


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

def trigger_cycle
  @trigger_cycle
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



99
100
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/create_trigger_request.rb', line 99

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('accountName') ? hash['accountName'] : SKIP
  anomaly_trigger_request = AnomalyTriggerRequest.from_hash(hash['anomalyTriggerRequest']) if
    hash['anomalyTriggerRequest']
  data_trigger_request = DataTriggerRequest.from_hash(hash['dataTriggerRequest']) if
    hash['dataTriggerRequest']
  group_name = hash.key?('groupName') ? hash['groupName'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  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_cycle = hash.key?('triggerCycle') ? hash['triggerCycle'] : SKIP

  # Create object from extracted values.
  CreateTriggerRequest.new(,
                           anomaly_trigger_request,
                           data_trigger_request,
                           group_name,
                           name,
                           session_trigger_request,
                           sms_trigger_request,
                           trigger_category,
                           trigger_cycle)
end

.namesObject

A mapping from model property names to API property names.



49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/verizon/models/create_trigger_request.rb', line 49

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_name'] = 'accountName'
  @_hash['anomaly_trigger_request'] = 'anomalyTriggerRequest'
  @_hash['data_trigger_request'] = 'dataTriggerRequest'
  @_hash['group_name'] = 'groupName'
  @_hash['name'] = 'name'
  @_hash['session_trigger_request'] = 'sessionTriggerRequest'
  @_hash['sms_trigger_request'] = 'smsTriggerRequest'
  @_hash['trigger_category'] = 'triggerCategory'
  @_hash['trigger_cycle'] = 'triggerCycle'
  @_hash
end

.nullablesObject

An array for nullable fields



79
80
81
# File 'lib/verizon/models/create_trigger_request.rb', line 79

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    account_name
    anomaly_trigger_request
    data_trigger_request
    group_name
    name
    session_trigger_request
    sms_trigger_request
    trigger_category
    trigger_cycle
  ]
end