Class: Verizon::PricePlanTrigger1

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

Overview

PricePlanTrigger1 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(account_group_share = SKIP, account_share = SKIP, condition = SKIP, change_plan = SKIP, change_plan_details = SKIP, pay_as_you_go = SKIP, action = SKIP, stand_alone = SKIP) ⇒ PricePlanTrigger1

Returns a new instance of PricePlanTrigger1.



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

def initialize( = SKIP,  = SKIP,
               condition = SKIP, change_plan = SKIP,
               change_plan_details = SKIP, pay_as_you_go = SKIP,
               action = SKIP, stand_alone = SKIP)
  @account_group_share =  unless  == SKIP
  @account_share =  unless  == SKIP
  @condition = condition unless condition == SKIP
  @change_plan = change_plan unless change_plan == SKIP
  @change_plan_details = change_plan_details unless change_plan_details == SKIP
  @pay_as_you_go = pay_as_you_go unless pay_as_you_go == SKIP
  @action = action unless action == SKIP
  @stand_alone = stand_alone unless stand_alone == SKIP
end

Instance Attribute Details

#account_group_shareAccountGroupShareIndividual1

TODO: Write general description for this method



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

def 
  @account_group_share
end

#account_shareAccountShareFilterCriteria

TODO: Write general description for this method



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

def 
  @account_share
end

#actionActionobject

The service plan code to switch to

Returns:



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

def action
  @action
end

#change_planTrueClass | FalseClass

a flag to set if the trigger changes service plans, true, or not, false

Returns:

  • (TrueClass | FalseClass)


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

def change_plan
  @change_plan
end

#change_plan_detailsChangePlanDetails

The service plan code to switch to

Returns:



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

def change_plan_details
  @change_plan_details
end

#conditionRateplantype2Condition

TODO: Write general description for this method



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

def condition
  @condition
end

#pay_as_you_goPayAsYouGoFilterCriteria

The service plan code to switch to



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

def pay_as_you_go
  @pay_as_you_go
end

#stand_aloneFiltercriteriaObjectCall

The service plan code to switch to



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

def stand_alone
  @stand_alone
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
118
119
# File 'lib/verizon/models/price_plan_trigger1.rb', line 92

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = AccountGroupShareIndividual1.from_hash(hash['accountGroupShare']) if
    hash['accountGroupShare']
   = AccountShareFilterCriteria.from_hash(hash['accountShare']) if
    hash['accountShare']
  condition = hash.key?('condition') ? APIHelper.deserialize_union_type(
    UnionTypeLookUp.get(:PricePlanTrigger1Condition), hash['condition']
  ) : SKIP
  change_plan = hash.key?('changePlan') ? hash['changePlan'] : SKIP
  change_plan_details = ChangePlanDetails.from_hash(hash['changePlanDetails']) if
    hash['changePlanDetails']
  pay_as_you_go = PayAsYouGoFilterCriteria.from_hash(hash['payAsYouGo']) if hash['payAsYouGo']
  action = Actionobject.from_hash(hash['action']) if hash['action']
  stand_alone = FiltercriteriaObjectCall.from_hash(hash['standAlone']) if hash['standAlone']

  # Create object from extracted values.
  PricePlanTrigger1.new(,
                        ,
                        condition,
                        change_plan,
                        change_plan_details,
                        pay_as_you_go,
                        action,
                        stand_alone)
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/price_plan_trigger1.rb', line 45

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_group_share'] = 'accountGroupShare'
  @_hash['account_share'] = 'accountShare'
  @_hash['condition'] = 'condition'
  @_hash['change_plan'] = 'changePlan'
  @_hash['change_plan_details'] = 'changePlanDetails'
  @_hash['pay_as_you_go'] = 'payAsYouGo'
  @_hash['action'] = 'action'
  @_hash['stand_alone'] = 'standAlone'
  @_hash
end

.nullablesObject

An array for nullable fields



73
74
75
# File 'lib/verizon/models/price_plan_trigger1.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/price_plan_trigger1.rb', line 59

def self.optionals
  %w[
    account_group_share
    account_share
    condition
    change_plan
    change_plan_details
    pay_as_you_go
    action
    stand_alone
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



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

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.



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

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} account_group_share: #{@account_group_share.inspect}, account_share:"\
  " #{@account_share.inspect}, condition: #{@condition.inspect}, change_plan:"\
  " #{@change_plan.inspect}, change_plan_details: #{@change_plan_details.inspect},"\
  " pay_as_you_go: #{@pay_as_you_go.inspect}, action: #{@action.inspect}, stand_alone:"\
  " #{@stand_alone.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



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

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} account_group_share: #{@account_group_share}, account_share:"\
  " #{@account_share}, condition: #{@condition}, change_plan: #{@change_plan},"\
  " change_plan_details: #{@change_plan_details}, pay_as_you_go: #{@pay_as_you_go}, action:"\
  " #{@action}, stand_alone: #{@stand_alone}>"
end