Class: Verizon::PricePlanTrigger2
- Defined in:
- lib/verizon/models/price_plan_trigger2.rb
Overview
PricePlanTrigger2 Model.
Instance Attribute Summary collapse
-
#account_share ⇒ AccountShareFilterCriteria
TODO: Write general description for this method.
-
#action ⇒ Actionobject
The service plan code to switch to.
-
#change_plan ⇒ TrueClass | FalseClass
a flag to set if the trigger changes service plans, true, or not, false.
-
#change_plan_details ⇒ ChangePlanDetails
The service plan code to switch to.
-
#condition ⇒ Rateplantype2Condition
TODO: Write general description for this method.
-
#pay_as_you_go ⇒ PayAsYouGoFilterCriteria
The service plan code to switch to.
-
#stand_alone ⇒ FiltercriteriaObjectCall
The service plan code to switch to.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(account_share = SKIP, condition = SKIP, change_plan = SKIP, change_plan_details = SKIP, pay_as_you_go = SKIP, action = SKIP, stand_alone = SKIP) ⇒ PricePlanTrigger2
constructor
A new instance of PricePlanTrigger2.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
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_share = SKIP, condition = SKIP, change_plan = SKIP, change_plan_details = SKIP, pay_as_you_go = SKIP, action = SKIP, stand_alone = SKIP) ⇒ PricePlanTrigger2
Returns a new instance of PricePlanTrigger2.
71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/verizon/models/price_plan_trigger2.rb', line 71 def initialize(account_share = SKIP, condition = SKIP, change_plan = SKIP, change_plan_details = SKIP, pay_as_you_go = SKIP, action = SKIP, stand_alone = SKIP) @account_share = account_share unless account_share == 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_share ⇒ AccountShareFilterCriteria
TODO: Write general description for this method
14 15 16 |
# File 'lib/verizon/models/price_plan_trigger2.rb', line 14 def account_share @account_share end |
#action ⇒ Actionobject
The service plan code to switch to
34 35 36 |
# File 'lib/verizon/models/price_plan_trigger2.rb', line 34 def action @action end |
#change_plan ⇒ TrueClass | FalseClass
a flag to set if the trigger changes service plans, true, or not, false
22 23 24 |
# File 'lib/verizon/models/price_plan_trigger2.rb', line 22 def change_plan @change_plan end |
#change_plan_details ⇒ ChangePlanDetails
The service plan code to switch to
26 27 28 |
# File 'lib/verizon/models/price_plan_trigger2.rb', line 26 def change_plan_details @change_plan_details end |
#condition ⇒ Rateplantype2Condition
TODO: Write general description for this method
18 19 20 |
# File 'lib/verizon/models/price_plan_trigger2.rb', line 18 def condition @condition end |
#pay_as_you_go ⇒ PayAsYouGoFilterCriteria
The service plan code to switch to
30 31 32 |
# File 'lib/verizon/models/price_plan_trigger2.rb', line 30 def pay_as_you_go @pay_as_you_go end |
#stand_alone ⇒ FiltercriteriaObjectCall
The service plan code to switch to
38 39 40 |
# File 'lib/verizon/models/price_plan_trigger2.rb', line 38 def stand_alone @stand_alone end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/verizon/models/price_plan_trigger2.rb', line 84 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_share = AccountShareFilterCriteria.from_hash(hash['accountShare']) if hash['accountShare'] condition = hash.key?('condition') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:PricePlanTrigger2Condition), 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. PricePlanTrigger2.new(account_share, condition, change_plan, change_plan_details, pay_as_you_go, action, stand_alone) end |
.names ⇒ Object
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/price_plan_trigger2.rb', line 41 def self.names @_hash = {} if @_hash.nil? @_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 |
.nullables ⇒ Object
An array for nullable fields
67 68 69 |
# File 'lib/verizon/models/price_plan_trigger2.rb', line 67 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/verizon/models/price_plan_trigger2.rb', line 54 def self.optionals %w[ 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.
112 113 114 115 116 117 118 |
# File 'lib/verizon/models/price_plan_trigger2.rb', line 112 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
129 130 131 132 133 134 135 |
# File 'lib/verizon/models/price_plan_trigger2.rb', line 129 def inspect class_name = self.class.name.split('::').last "<#{class_name} 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_s ⇒ Object
Provides a human-readable string representation of the object.
121 122 123 124 125 126 |
# File 'lib/verizon/models/price_plan_trigger2.rb', line 121 def to_s class_name = self.class.name.split('::').last "<#{class_name} 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 |