Class: Verizon::ServicePlanResponseforplanner
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- Verizon::ServicePlanResponseforplanner
- Defined in:
- lib/verizon/models/service_plan_responseforplanner.rb
Overview
ServicePlanResponseforplanner Model.
Instance Attribute Summary collapse
-
#carrier_service_plan_code ⇒ String
The name of the service plan code.
-
#code ⇒ String
The actiavtion code value.
-
#extended_attributes ⇒ Array[KvPairforplanner]
key/value pairs assigned by the user for filtering.
-
#name ⇒ String
The carrier name of the active profile.
-
#size_kb ⇒ Integer
size in Kilobytes of the service plan.
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.
Instance Method Summary collapse
-
#initialize(carrier_service_plan_code = SKIP, code = SKIP, extended_attributes = SKIP, name = SKIP, size_kb = SKIP) ⇒ ServicePlanResponseforplanner
constructor
A new instance of ServicePlanResponseforplanner.
-
#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(carrier_service_plan_code = SKIP, code = SKIP, extended_attributes = SKIP, name = SKIP, size_kb = SKIP) ⇒ ServicePlanResponseforplanner
Returns a new instance of ServicePlanResponseforplanner.
59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/verizon/models/service_plan_responseforplanner.rb', line 59 def initialize(carrier_service_plan_code = SKIP, code = SKIP, extended_attributes = SKIP, name = SKIP, size_kb = SKIP) unless carrier_service_plan_code == SKIP @carrier_service_plan_code = carrier_service_plan_code end @code = code unless code == SKIP @extended_attributes = extended_attributes unless extended_attributes == SKIP @name = name unless name == SKIP @size_kb = size_kb unless size_kb == SKIP end |
Instance Attribute Details
#carrier_service_plan_code ⇒ String
The name of the service plan code
14 15 16 |
# File 'lib/verizon/models/service_plan_responseforplanner.rb', line 14 def carrier_service_plan_code @carrier_service_plan_code end |
#code ⇒ String
The actiavtion code value.
18 19 20 |
# File 'lib/verizon/models/service_plan_responseforplanner.rb', line 18 def code @code end |
#extended_attributes ⇒ Array[KvPairforplanner]
key/value pairs assigned by the user for filtering.
22 23 24 |
# File 'lib/verizon/models/service_plan_responseforplanner.rb', line 22 def extended_attributes @extended_attributes end |
#name ⇒ String
The carrier name of the active profile.
26 27 28 |
# File 'lib/verizon/models/service_plan_responseforplanner.rb', line 26 def name @name end |
#size_kb ⇒ Integer
size in Kilobytes of the service plan
30 31 32 |
# File 'lib/verizon/models/service_plan_responseforplanner.rb', line 30 def size_kb @size_kb end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/verizon/models/service_plan_responseforplanner.rb', line 72 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. carrier_service_plan_code = hash.key?('carrierServicePlanCode') ? hash['carrierServicePlanCode'] : SKIP code = hash.key?('code') ? hash['code'] : SKIP # Parameter is an array, so we need to iterate through it extended_attributes = nil unless hash['extendedAttributes'].nil? extended_attributes = [] hash['extendedAttributes'].each do |structure| extended_attributes << (KvPairforplanner.from_hash(structure) if structure) end end extended_attributes = SKIP unless hash.key?('extendedAttributes') name = hash.key?('name') ? hash['name'] : SKIP size_kb = hash.key?('sizeKb') ? hash['sizeKb'] : SKIP # Create object from extracted values. ServicePlanResponseforplanner.new(carrier_service_plan_code, code, extended_attributes, name, size_kb) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 39 40 41 |
# File 'lib/verizon/models/service_plan_responseforplanner.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['carrier_service_plan_code'] = 'carrierServicePlanCode' @_hash['code'] = 'code' @_hash['extended_attributes'] = 'extendedAttributes' @_hash['name'] = 'name' @_hash['size_kb'] = 'sizeKb' @_hash end |
.nullables ⇒ Object
An array for nullable fields
55 56 57 |
# File 'lib/verizon/models/service_plan_responseforplanner.rb', line 55 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
44 45 46 47 48 49 50 51 52 |
# File 'lib/verizon/models/service_plan_responseforplanner.rb', line 44 def self.optionals %w[ carrier_service_plan_code code extended_attributes name size_kb ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
108 109 110 111 112 113 |
# File 'lib/verizon/models/service_plan_responseforplanner.rb', line 108 def inspect class_name = self.class.name.split('::').last "<#{class_name} carrier_service_plan_code: #{@carrier_service_plan_code.inspect}, code:"\ " #{@code.inspect}, extended_attributes: #{@extended_attributes.inspect}, name:"\ " #{@name.inspect}, size_kb: #{@size_kb.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
101 102 103 104 105 |
# File 'lib/verizon/models/service_plan_responseforplanner.rb', line 101 def to_s class_name = self.class.name.split('::').last "<#{class_name} carrier_service_plan_code: #{@carrier_service_plan_code}, code: #{@code},"\ " extended_attributes: #{@extended_attributes}, name: #{@name}, size_kb: #{@size_kb}>" end |