Class: Verizon::AccountShareUpdateTriggerRequest

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

Overview

AccountShareUpdateTriggerRequest Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(trigger_id: SKIP, trigger_name: SKIP, ecpd_id: SKIP, trigger_category: SKIP, price_plan_trigger: SKIP, notification: SKIP, active: SKIP, additional_properties: nil) ⇒ AccountShareUpdateTriggerRequest

Returns a new instance of AccountShareUpdateTriggerRequest.



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

def initialize(trigger_id: SKIP, trigger_name: SKIP, ecpd_id: SKIP,
               trigger_category: SKIP, price_plan_trigger: SKIP,
               notification: SKIP, active: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @trigger_id = trigger_id unless trigger_id == SKIP
  @trigger_name = trigger_name unless trigger_name == SKIP
  @ecpd_id = ecpd_id unless ecpd_id == 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
  @additional_properties = additional_properties
end

Instance Attribute Details

#activeActive

A flag to indicate of the trigger is active, true, or not, false

Returns:



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

def active
  @active
end

#ecpd_idString

The Enterprise Customer Profile Database ID

Returns:

  • (String)


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

def ecpd_id
  @ecpd_id
end

#notificationNotificationarray

The type of trigger being created or modified

Returns:



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

def notification
  @notification
end

#price_plan_triggerAccountSharePricePlanTrigger

The type of trigger being created or modified



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

def price_plan_trigger
  @price_plan_trigger
end

#trigger_categoryTriggerCategory

The type of trigger being created or modified

Returns:



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

def trigger_category
  @trigger_category
end

#trigger_idString

The system assigned UUID of the trigger

Returns:

  • (String)


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

def trigger_id
  @trigger_id
end

#trigger_nameString

The user defined name of the trigger

Returns:

  • (String)


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



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
116
117
118
# File 'lib/verizon/models/account_share_update_trigger_request.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
  ecpd_id = hash.key?('ecpdId') ? hash['ecpdId'] : SKIP
  trigger_category =
    hash.key?('triggerCategory') ? hash['triggerCategory'] : SKIP
  price_plan_trigger = AccountSharePricePlanTrigger.from_hash(hash['pricePlanTrigger']) if
    hash['pricePlanTrigger']
  notification = Notificationarray.from_hash(hash['notification']) if hash['notification']
  active = hash.key?('active') ? hash['active'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  AccountShareUpdateTriggerRequest.new(trigger_id: trigger_id,
                                       trigger_name: trigger_name,
                                       ecpd_id: ecpd_id,
                                       trigger_category: trigger_category,
                                       price_plan_trigger: price_plan_trigger,
                                       notification: notification,
                                       active: active,
                                       additional_properties: additional_properties)
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/account_share_update_trigger_request.rb', line 41

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

.nullablesObject

An array for nullable fields



67
68
69
# File 'lib/verizon/models/account_share_update_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/account_share_update_trigger_request.rb', line 54

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

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



122
123
124
125
126
127
128
# File 'lib/verizon/models/account_share_update_trigger_request.rb', line 122

def self.validate(value)
  return true if value.instance_of? self

  return false unless value.instance_of? Hash

  true
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



140
141
142
143
144
145
146
147
# File 'lib/verizon/models/account_share_update_trigger_request.rb', line 140

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} trigger_id: #{@trigger_id.inspect}, trigger_name: #{@trigger_name.inspect},"\
  " ecpd_id: #{@ecpd_id.inspect}, trigger_category: #{@trigger_category.inspect},"\
  " price_plan_trigger: #{@price_plan_trigger.inspect}, notification:"\
  " #{@notification.inspect}, active: #{@active.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



131
132
133
134
135
136
137
# File 'lib/verizon/models/account_share_update_trigger_request.rb', line 131

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} trigger_id: #{@trigger_id}, trigger_name: #{@trigger_name}, ecpd_id:"\
  " #{@ecpd_id}, trigger_category: #{@trigger_category}, price_plan_trigger:"\
  " #{@price_plan_trigger}, notification: #{@notification}, active: #{@active},"\
  " additional_properties: #{@additional_properties}>"
end