Class: Verizon::AccountGroupShareCreateTrigger

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

Overview

AccountGroupShareCreateTrigger 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_name: SKIP, account_name: SKIP, trigger_category: SKIP, price_plan_trigger: SKIP, notification: SKIP) ⇒ AccountGroupShareCreateTrigger

Returns a new instance of AccountGroupShareCreateTrigger.



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

def initialize(trigger_name: SKIP, account_name: SKIP,
               trigger_category: SKIP, price_plan_trigger: SKIP,
               notification: SKIP)
  @trigger_name = trigger_name unless trigger_name == SKIP
  @account_name =  unless  == 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
end

Instance Attribute Details

#account_nameString

The numeric name of the account and must include leading zeroes

Returns:

  • (String)


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

def 
  @account_name
end

#notificationNotificationarray

The type of trigger being created or modified

Returns:



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

def notification
  @notification
end

#price_plan_triggerAccountGroupShareObject

The type of trigger being created or modified



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

def price_plan_trigger
  @price_plan_trigger
end

#trigger_categoryTriggerCategory

The type of trigger being created or modified

Returns:



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

def trigger_category
  @trigger_category
end

#trigger_nameString

The user defined name of the trigger

Returns:

  • (String)


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

def trigger_name
  @trigger_name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  trigger_name = hash.key?('triggerName') ? hash['triggerName'] : SKIP
   = hash.key?('accountName') ? hash['accountName'] : SKIP
  trigger_category =
    hash.key?('triggerCategory') ? hash['triggerCategory'] : SKIP
  price_plan_trigger = AccountGroupShareObject.from_hash(hash['pricePlanTrigger']) if
    hash['pricePlanTrigger']
  notification = Notificationarray.from_hash(hash['notification']) if hash['notification']

  # Create object from extracted values.
  AccountGroupShareCreateTrigger.new(trigger_name: trigger_name,
                                     account_name: ,
                                     trigger_category: trigger_category,
                                     price_plan_trigger: price_plan_trigger,
                                     notification: notification)
end

.namesObject

A mapping from model property names to API property names.



33
34
35
36
37
38
39
40
41
# File 'lib/verizon/models/account_group_share_create_trigger.rb', line 33

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['trigger_name'] = 'triggerName'
  @_hash['account_name'] = 'accountName'
  @_hash['trigger_category'] = 'triggerCategory'
  @_hash['price_plan_trigger'] = 'pricePlanTrigger'
  @_hash['notification'] = 'notification'
  @_hash
end

.nullablesObject

An array for nullable fields



55
56
57
# File 'lib/verizon/models/account_group_share_create_trigger.rb', line 55

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    trigger_name
    account_name
    trigger_category
    price_plan_trigger
    notification
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



99
100
101
102
103
104
105
# File 'lib/verizon/models/account_group_share_create_trigger.rb', line 99

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

#to_sObject

Provides a human-readable string representation of the object.



91
92
93
94
95
96
# File 'lib/verizon/models/account_group_share_create_trigger.rb', line 91

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