Class: Verizon::ProfileRequest2
- Defined in:
- lib/verizon/models/profile_request2.rb
Overview
ProfileRequest2 Model.
Instance Attribute Summary collapse
-
#account_name ⇒ String
TODO: Write general description for this method.
-
#carrier_name ⇒ String
TODO: Write general description for this method.
-
#check_fallback_profile ⇒ TrueClass | FalseClass
TODO: Write general description for this method.
-
#devices ⇒ Array[DeviceList2]
TODO: Write general description for this method.
-
#etf_waiver ⇒ TrueClass | FalseClass
TODO: Write general description for this method.
-
#reason_code ⇒ String
TODO: Write general description for this method.
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(devices = SKIP, account_name = SKIP, carrier_name = SKIP, reason_code = SKIP, etf_waiver = true, check_fallback_profile = false) ⇒ ProfileRequest2
constructor
A new instance of ProfileRequest2.
Methods inherited from BaseModel
Constructor Details
#initialize(devices = SKIP, account_name = SKIP, carrier_name = SKIP, reason_code = SKIP, etf_waiver = true, check_fallback_profile = false) ⇒ ProfileRequest2
Returns a new instance of ProfileRequest2.
65 66 67 68 69 70 71 72 73 74 |
# File 'lib/verizon/models/profile_request2.rb', line 65 def initialize(devices = SKIP, account_name = SKIP, carrier_name = SKIP, reason_code = SKIP, etf_waiver = true, check_fallback_profile = false) @devices = devices unless devices == SKIP @account_name = account_name unless account_name == SKIP @carrier_name = carrier_name unless carrier_name == SKIP @reason_code = reason_code unless reason_code == SKIP @etf_waiver = etf_waiver unless etf_waiver == SKIP @check_fallback_profile = check_fallback_profile unless check_fallback_profile == SKIP end |
Instance Attribute Details
#account_name ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/verizon/models/profile_request2.rb', line 18 def account_name @account_name end |
#carrier_name ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/verizon/models/profile_request2.rb', line 22 def carrier_name @carrier_name end |
#check_fallback_profile ⇒ TrueClass | FalseClass
TODO: Write general description for this method
34 35 36 |
# File 'lib/verizon/models/profile_request2.rb', line 34 def check_fallback_profile @check_fallback_profile end |
#devices ⇒ Array[DeviceList2]
TODO: Write general description for this method
14 15 16 |
# File 'lib/verizon/models/profile_request2.rb', line 14 def devices @devices end |
#etf_waiver ⇒ TrueClass | FalseClass
TODO: Write general description for this method
30 31 32 |
# File 'lib/verizon/models/profile_request2.rb', line 30 def etf_waiver @etf_waiver end |
#reason_code ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/verizon/models/profile_request2.rb', line 26 def reason_code @reason_code end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/verizon/models/profile_request2.rb', line 77 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. # Parameter is an array, so we need to iterate through it devices = nil unless hash['devices'].nil? devices = [] hash['devices'].each do |structure| devices << (DeviceList2.from_hash(structure) if structure) end end devices = SKIP unless hash.key?('devices') account_name = hash.key?('accountName') ? hash['accountName'] : SKIP carrier_name = hash.key?('carrierName') ? hash['carrierName'] : SKIP reason_code = hash.key?('reasonCode') ? hash['reasonCode'] : SKIP etf_waiver = hash['etfWaiver'] ||= true check_fallback_profile = hash['checkFallbackProfile'] ||= false # Create object from extracted values. ProfileRequest2.new(devices, account_name, carrier_name, reason_code, etf_waiver, check_fallback_profile) end |
.names ⇒ Object
A mapping from model property names to API property names.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/verizon/models/profile_request2.rb', line 37 def self.names @_hash = {} if @_hash.nil? @_hash['devices'] = 'devices' @_hash['account_name'] = 'accountName' @_hash['carrier_name'] = 'carrierName' @_hash['reason_code'] = 'reasonCode' @_hash['etf_waiver'] = 'etfWaiver' @_hash['check_fallback_profile'] = 'checkFallbackProfile' @_hash end |
.nullables ⇒ Object
An array for nullable fields
61 62 63 |
# File 'lib/verizon/models/profile_request2.rb', line 61 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/verizon/models/profile_request2.rb', line 49 def self.optionals %w[ devices account_name carrier_name reason_code etf_waiver check_fallback_profile ] end |