Class: Verizon::UpdateTriggerRequestOptions

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

Overview

UpdateTriggerRequestOptions Model.

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, trigger_category = SKIP, account_name = SKIP, anomaly_trigger_request = SKIP, notification = SKIP, active = SKIP) ⇒ UpdateTriggerRequestOptions

Returns a new instance of UpdateTriggerRequestOptions.



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

def initialize(trigger_id = SKIP, trigger_name = SKIP,
               trigger_category = SKIP,  = SKIP,
               anomaly_trigger_request = SKIP, notification = SKIP,
               active = SKIP)
  @trigger_id = trigger_id unless trigger_id == SKIP
  @trigger_name = trigger_name unless trigger_name == SKIP
  @trigger_category = trigger_category unless trigger_category == SKIP
  @account_name =  unless  == SKIP
  @anomaly_trigger_request = anomaly_trigger_request unless anomaly_trigger_request == SKIP
  @notification = notification unless notification == SKIP
  @active = active unless active == SKIP
end

Instance Attribute Details

#account_nameString

Account name.

Returns:

  • (String)


28
29
30
# File 'lib/verizon/models/update_trigger_request_options.rb', line 28

def 
  @account_name
end

#activeTrueClass | FalseClass

Indicates anomaly detection is active<br />True - Anomaly detection is active.<br />False - Anomaly detection is not active.

Returns:

  • (TrueClass | FalseClass)


41
42
43
# File 'lib/verizon/models/update_trigger_request_options.rb', line 41

def active
  @active
end

#anomaly_trigger_requestAnomalyTriggerRequest

The details of the UsageAnomaly trigger.



32
33
34
# File 'lib/verizon/models/update_trigger_request_options.rb', line 32

def anomaly_trigger_request
  @anomaly_trigger_request
end

#notificationTriggerNotification

The notification details of the trigger.

Returns:



36
37
38
# File 'lib/verizon/models/update_trigger_request_options.rb', line 36

def notification
  @notification
end

#trigger_categoryString

This is the value to use in the request body to detect anomalous behaivior. The values in this table will only be relevant when this parameter is set to this value.

Returns:

  • (String)


24
25
26
# File 'lib/verizon/models/update_trigger_request_options.rb', line 24

def trigger_category
  @trigger_category
end

#trigger_idString

Trigger ID.

Returns:

  • (String)


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

def trigger_id
  @trigger_id
end

#trigger_nameString

Trigger name.

Returns:

  • (String)


18
19
20
# File 'lib/verizon/models/update_trigger_request_options.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.



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/verizon/models/update_trigger_request_options.rb', line 88

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
  trigger_category =
    hash.key?('triggerCategory') ? hash['triggerCategory'] : SKIP
   = hash.key?('accountName') ? hash['accountName'] : SKIP
  anomaly_trigger_request = AnomalyTriggerRequest.from_hash(hash['anomalyTriggerRequest']) if
    hash['anomalyTriggerRequest']
  notification = TriggerNotification.from_hash(hash['notification']) if hash['notification']
  active = hash.key?('active') ? hash['active'] : SKIP

  # Create object from extracted values.
  UpdateTriggerRequestOptions.new(trigger_id,
                                  trigger_name,
                                  trigger_category,
                                  ,
                                  anomaly_trigger_request,
                                  notification,
                                  active)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['trigger_id'] = 'triggerId'
  @_hash['trigger_name'] = 'triggerName'
  @_hash['trigger_category'] = 'triggerCategory'
  @_hash['account_name'] = 'accountName'
  @_hash['anomaly_trigger_request'] = 'anomalyTriggerRequest'
  @_hash['notification'] = 'notification'
  @_hash['active'] = 'active'
  @_hash
end

.nullablesObject

An array for nullable fields



70
71
72
# File 'lib/verizon/models/update_trigger_request_options.rb', line 70

def self.nullables
  []
end

.optionalsObject

An array for optional fields



57
58
59
60
61
62
63
64
65
66
67
# File 'lib/verizon/models/update_trigger_request_options.rb', line 57

def self.optionals
  %w[
    trigger_id
    trigger_name
    trigger_category
    account_name
    anomaly_trigger_request
    notification
    active
  ]
end