Class: Verizon::CarrierDeactivateRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- Verizon::CarrierDeactivateRequest
- Defined in:
- lib/verizon/models/carrier_deactivate_request.rb
Overview
Request to deactivate a carrier.
Instance Attribute Summary collapse
-
#account_name ⇒ String
The name of a billing account.
-
#custom_fields ⇒ Array[CustomFields]
Custom field names and values, if you want to only include devices that have matching values.
-
#delete_after_deactivation ⇒ TrueClass | FalseClass
The name of a service plan, if you want to only include devices that have that service plan.
-
#devices ⇒ Array[AccountDeviceList]
The devices for which you want to deactivate service, specified by device identifier.
-
#etf_waiver ⇒ TrueClass | FalseClass
Fees may be assessed for deactivating Verizon Wireless devices, depending on the account contract.
-
#group_name ⇒ String
The name of a device group, if you want to deactivate all devices in that group.
-
#reason_code ⇒ String
Code identifying the reason for the deactivation.
-
#service_plan ⇒ String
The name of a service plan, if you want to only include devices that have that 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(account_name = nil, devices = nil, reason_code = nil, custom_fields = SKIP, etf_waiver = SKIP, group_name = SKIP, service_plan = SKIP, delete_after_deactivation = SKIP) ⇒ CarrierDeactivateRequest
constructor
A new instance of CarrierDeactivateRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(account_name = nil, devices = nil, reason_code = nil, custom_fields = SKIP, etf_waiver = SKIP, group_name = SKIP, service_plan = SKIP, delete_after_deactivation = SKIP) ⇒ CarrierDeactivateRequest
Returns a new instance of CarrierDeactivateRequest.
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/verizon/models/carrier_deactivate_request.rb', line 82 def initialize(account_name = nil, devices = nil, reason_code = nil, custom_fields = SKIP, etf_waiver = SKIP, group_name = SKIP, service_plan = SKIP, delete_after_deactivation = SKIP) @account_name = account_name @devices = devices @reason_code = reason_code @custom_fields = custom_fields unless custom_fields == SKIP @etf_waiver = etf_waiver unless etf_waiver == SKIP @group_name = group_name unless group_name == SKIP @service_plan = service_plan unless service_plan == SKIP unless delete_after_deactivation == SKIP @delete_after_deactivation = delete_after_deactivation end end |
Instance Attribute Details
#account_name ⇒ String
The name of a billing account.
14 15 16 |
# File 'lib/verizon/models/carrier_deactivate_request.rb', line 14 def account_name @account_name end |
#custom_fields ⇒ Array[CustomFields]
Custom field names and values, if you want to only include devices that have matching values.
29 30 31 |
# File 'lib/verizon/models/carrier_deactivate_request.rb', line 29 def custom_fields @custom_fields end |
#delete_after_deactivation ⇒ TrueClass | FalseClass
The name of a service plan, if you want to only include devices that have that service plan.
50 51 52 |
# File 'lib/verizon/models/carrier_deactivate_request.rb', line 50 def delete_after_deactivation @delete_after_deactivation end |
#devices ⇒ Array[AccountDeviceList]
The devices for which you want to deactivate service, specified by device identifier.
19 20 21 |
# File 'lib/verizon/models/carrier_deactivate_request.rb', line 19 def devices @devices end |
#etf_waiver ⇒ TrueClass | FalseClass
Fees may be assessed for deactivating Verizon Wireless devices, depending on the account contract. The etfWaiver parameter waives the Early Termination Fee (ETF), if applicable.
35 36 37 |
# File 'lib/verizon/models/carrier_deactivate_request.rb', line 35 def etf_waiver @etf_waiver end |
#group_name ⇒ String
The name of a device group, if you want to deactivate all devices in that group.
40 41 42 |
# File 'lib/verizon/models/carrier_deactivate_request.rb', line 40 def group_name @group_name end |
#reason_code ⇒ String
Code identifying the reason for the deactivation. Currently the only valid reason code is “FF”, which corresponds to General Admin/Maintenance.
24 25 26 |
# File 'lib/verizon/models/carrier_deactivate_request.rb', line 24 def reason_code @reason_code end |
#service_plan ⇒ String
The name of a service plan, if you want to only include devices that have that service plan.
45 46 47 |
# File 'lib/verizon/models/carrier_deactivate_request.rb', line 45 def service_plan @service_plan end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/verizon/models/carrier_deactivate_request.rb', line 99 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_name = hash.key?('accountName') ? hash['accountName'] : 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 << (AccountDeviceList.from_hash(structure) if structure) end end devices = nil unless hash.key?('devices') reason_code = hash.key?('reasonCode') ? hash['reasonCode'] : nil # Parameter is an array, so we need to iterate through it custom_fields = nil unless hash['customFields'].nil? custom_fields = [] hash['customFields'].each do |structure| custom_fields << (CustomFields.from_hash(structure) if structure) end end custom_fields = SKIP unless hash.key?('customFields') etf_waiver = hash.key?('etfWaiver') ? hash['etfWaiver'] : SKIP group_name = hash.key?('groupName') ? hash['groupName'] : SKIP service_plan = hash.key?('servicePlan') ? hash['servicePlan'] : SKIP delete_after_deactivation = hash.key?('deleteAfterDeactivation') ? hash['deleteAfterDeactivation'] : SKIP # Create object from extracted values. CarrierDeactivateRequest.new(account_name, devices, reason_code, custom_fields, etf_waiver, group_name, service_plan, delete_after_deactivation) end |
.names ⇒ Object
A mapping from model property names to API property names.
53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/verizon/models/carrier_deactivate_request.rb', line 53 def self.names @_hash = {} if @_hash.nil? @_hash['account_name'] = 'accountName' @_hash['devices'] = 'devices' @_hash['reason_code'] = 'reasonCode' @_hash['custom_fields'] = 'customFields' @_hash['etf_waiver'] = 'etfWaiver' @_hash['group_name'] = 'groupName' @_hash['service_plan'] = 'servicePlan' @_hash['delete_after_deactivation'] = 'deleteAfterDeactivation' @_hash end |
.nullables ⇒ Object
An array for nullable fields
78 79 80 |
# File 'lib/verizon/models/carrier_deactivate_request.rb', line 78 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
67 68 69 70 71 72 73 74 75 |
# File 'lib/verizon/models/carrier_deactivate_request.rb', line 67 def self.optionals %w[ custom_fields etf_waiver group_name service_plan delete_after_deactivation ] end |