Class: Verizon::UploadsActivatesDeviceRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- Verizon::UploadsActivatesDeviceRequest
- Defined in:
- lib/verizon/models/uploads_activates_device_request.rb
Overview
The request body identifies the devices to upload.
Instance Attribute Summary collapse
-
#account_name ⇒ String
The name of a billing account.
-
#carrier_ip_pool_name ⇒ String
The pool from which your device IP addresses is derived.
-
#device_sku ⇒ String
The stock keeping unit that identifies the type of devices in the upload and activation.
-
#devices ⇒ Array[DeviceList]
The devices to upload, specified by device IDs in a format matching uploadType.
-
#email_address ⇒ String
The email address that the report should be sent to when the upload is complete.
-
#mdn_zip_code ⇒ String
The Zip code of the location where the line of service is primarily used, or a Zip code that you have been told to use with these devices.
-
#service_plan ⇒ String
The service plan code that you want to assign to all specified devices.
-
#upload_type ⇒ String
The format of the device identifiers in the upload and activation.
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, email_address = nil, device_sku = nil, upload_type = nil, service_plan = nil, mdn_zip_code = nil, devices = nil, carrier_ip_pool_name = SKIP) ⇒ UploadsActivatesDeviceRequest
constructor
A new instance of UploadsActivatesDeviceRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(account_name = nil, email_address = nil, device_sku = nil, upload_type = nil, service_plan = nil, mdn_zip_code = nil, devices = nil, carrier_ip_pool_name = SKIP) ⇒ UploadsActivatesDeviceRequest
Returns a new instance of UploadsActivatesDeviceRequest.
75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/verizon/models/uploads_activates_device_request.rb', line 75 def initialize(account_name = nil, email_address = nil, device_sku = nil, upload_type = nil, service_plan = nil, mdn_zip_code = nil, devices = nil, carrier_ip_pool_name = SKIP) @account_name = account_name @email_address = email_address @device_sku = device_sku @upload_type = upload_type @service_plan = service_plan @carrier_ip_pool_name = carrier_ip_pool_name unless carrier_ip_pool_name == SKIP @mdn_zip_code = mdn_zip_code @devices = devices end |
Instance Attribute Details
#account_name ⇒ String
The name of a billing account. An account name is usually numeric, and must include any leading zeros.
15 16 17 |
# File 'lib/verizon/models/uploads_activates_device_request.rb', line 15 def account_name @account_name end |
#carrier_ip_pool_name ⇒ String
The pool from which your device IP addresses is derived.
37 38 39 |
# File 'lib/verizon/models/uploads_activates_device_request.rb', line 37 def carrier_ip_pool_name @carrier_ip_pool_name end |
#device_sku ⇒ String
The stock keeping unit that identifies the type of devices in the upload and activation.
25 26 27 |
# File 'lib/verizon/models/uploads_activates_device_request.rb', line 25 def device_sku @device_sku end |
#devices ⇒ Array[DeviceList]
The devices to upload, specified by device IDs in a format matching uploadType.
47 48 49 |
# File 'lib/verizon/models/uploads_activates_device_request.rb', line 47 def devices @devices end |
#email_address ⇒ String
The email address that the report should be sent to when the upload is complete.
20 21 22 |
# File 'lib/verizon/models/uploads_activates_device_request.rb', line 20 def email_address @email_address end |
#mdn_zip_code ⇒ String
The Zip code of the location where the line of service is primarily used, or a Zip code that you have been told to use with these devices.
42 43 44 |
# File 'lib/verizon/models/uploads_activates_device_request.rb', line 42 def mdn_zip_code @mdn_zip_code end |
#service_plan ⇒ String
The service plan code that you want to assign to all specified devices.
33 34 35 |
# File 'lib/verizon/models/uploads_activates_device_request.rb', line 33 def service_plan @service_plan end |
#upload_type ⇒ String
The format of the device identifiers in the upload and activation.
29 30 31 |
# File 'lib/verizon/models/uploads_activates_device_request.rb', line 29 def upload_type @upload_type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/verizon/models/uploads_activates_device_request.rb', line 89 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_name = hash.key?('accountName') ? hash['accountName'] : nil email_address = hash.key?('emailAddress') ? hash['emailAddress'] : nil device_sku = hash.key?('deviceSku') ? hash['deviceSku'] : nil upload_type = hash.key?('uploadType') ? hash['uploadType'] : nil service_plan = hash.key?('servicePlan') ? hash['servicePlan'] : nil mdn_zip_code = hash.key?('mdnZipCode') ? hash['mdnZipCode'] : 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 << (DeviceList.from_hash(structure) if structure) end end devices = nil unless hash.key?('devices') carrier_ip_pool_name = hash.key?('carrierIpPoolName') ? hash['carrierIpPoolName'] : SKIP # Create object from extracted values. UploadsActivatesDeviceRequest.new(account_name, email_address, device_sku, upload_type, service_plan, mdn_zip_code, devices, carrier_ip_pool_name) end |
.names ⇒ Object
A mapping from model property names to API property names.
50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/verizon/models/uploads_activates_device_request.rb', line 50 def self.names @_hash = {} if @_hash.nil? @_hash['account_name'] = 'accountName' @_hash['email_address'] = 'emailAddress' @_hash['device_sku'] = 'deviceSku' @_hash['upload_type'] = 'uploadType' @_hash['service_plan'] = 'servicePlan' @_hash['carrier_ip_pool_name'] = 'carrierIpPoolName' @_hash['mdn_zip_code'] = 'mdnZipCode' @_hash['devices'] = 'devices' @_hash end |
.nullables ⇒ Object
An array for nullable fields
71 72 73 |
# File 'lib/verizon/models/uploads_activates_device_request.rb', line 71 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
64 65 66 67 68 |
# File 'lib/verizon/models/uploads_activates_device_request.rb', line 64 def self.optionals %w[ carrier_ip_pool_name ] end |