Class: Verizon::DeactivateDeviceProfileRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- Verizon::DeactivateDeviceProfileRequest
- Defined in:
- lib/verizon/models/deactivate_device_profile_request.rb
Overview
DeactivateDeviceProfileRequest 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[DeactivateDeviceList]
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(account_name = nil, reason_code = nil, devices = SKIP, carrier_name = SKIP, etf_waiver = true, check_fallback_profile = false) ⇒ DeactivateDeviceProfileRequest
constructor
A new instance of DeactivateDeviceProfileRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(account_name = nil, reason_code = nil, devices = SKIP, carrier_name = SKIP, etf_waiver = true, check_fallback_profile = false) ⇒ DeactivateDeviceProfileRequest
Returns a new instance of DeactivateDeviceProfileRequest.
63 64 65 66 67 68 69 70 71 72 |
# File 'lib/verizon/models/deactivate_device_profile_request.rb', line 63 def initialize(account_name = nil, reason_code = nil, devices = SKIP, carrier_name = SKIP, etf_waiver = true, check_fallback_profile = false) @account_name = account_name @reason_code = reason_code @devices = devices unless devices == SKIP @carrier_name = carrier_name unless carrier_name == 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
14 15 16 |
# File 'lib/verizon/models/deactivate_device_profile_request.rb', line 14 def account_name @account_name end |
#carrier_name ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/verizon/models/deactivate_device_profile_request.rb', line 26 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/deactivate_device_profile_request.rb', line 34 def check_fallback_profile @check_fallback_profile end |
#devices ⇒ Array[DeactivateDeviceList]
TODO: Write general description for this method
22 23 24 |
# File 'lib/verizon/models/deactivate_device_profile_request.rb', line 22 def devices @devices end |
#etf_waiver ⇒ TrueClass | FalseClass
TODO: Write general description for this method
30 31 32 |
# File 'lib/verizon/models/deactivate_device_profile_request.rb', line 30 def etf_waiver @etf_waiver end |
#reason_code ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/verizon/models/deactivate_device_profile_request.rb', line 18 def reason_code @reason_code end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
75 76 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 |
# File 'lib/verizon/models/deactivate_device_profile_request.rb', line 75 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_name = hash.key?('accountName') ? hash['accountName'] : nil reason_code = hash.key?('reasonCode') ? hash['reasonCode'] : nil # Parameter is an array, so we need to iterate through it devices = nil unless hash['devices'].nil? devices = [] hash['devices'].each do |structure| devices << (DeactivateDeviceList.from_hash(structure) if structure) end end devices = SKIP unless hash.key?('devices') carrier_name = hash.key?('carrierName') ? hash['carrierName'] : SKIP etf_waiver = hash['etfWaiver'] ||= true check_fallback_profile = hash['checkFallbackProfile'] ||= false # Create object from extracted values. DeactivateDeviceProfileRequest.new(account_name, reason_code, devices, carrier_name, 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/deactivate_device_profile_request.rb', line 37 def self.names @_hash = {} if @_hash.nil? @_hash['account_name'] = 'accountName' @_hash['reason_code'] = 'reasonCode' @_hash['devices'] = 'devices' @_hash['carrier_name'] = 'carrierName' @_hash['etf_waiver'] = 'etfWaiver' @_hash['check_fallback_profile'] = 'checkFallbackProfile' @_hash end |
.nullables ⇒ Object
An array for nullable fields
59 60 61 |
# File 'lib/verizon/models/deactivate_device_profile_request.rb', line 59 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
49 50 51 52 53 54 55 56 |
# File 'lib/verizon/models/deactivate_device_profile_request.rb', line 49 def self.optionals %w[ devices carrier_name etf_waiver check_fallback_profile ] end |