Class: Verizon::AssignLicenseRequest
- Defined in:
- lib/verizon/models/assign_license_request.rb
Overview
Request to assign license.
Instance Attribute Summary collapse
-
#account_name ⇒ String
The name of a billing account.This parameter is required only if the UWS account used for the current API session has access to multiple accounts.
-
#devices ⇒ Array[LicenseDeviceList]
A list of 4G devices.
-
#sku_number ⇒ String
The Stock Keeping Unit (SKU).
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 = SKIP, devices = SKIP, sku_number = SKIP) ⇒ AssignLicenseRequest
constructor
A new instance of AssignLicenseRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(account_name = SKIP, devices = SKIP, sku_number = SKIP) ⇒ AssignLicenseRequest
Returns a new instance of AssignLicenseRequest.
56 57 58 59 60 |
# File 'lib/verizon/models/assign_license_request.rb', line 56 def initialize(account_name = SKIP, devices = SKIP, sku_number = SKIP) @account_name = account_name unless account_name == SKIP @devices = devices unless devices == SKIP @sku_number = sku_number unless sku_number == SKIP end |
Instance Attribute Details
#account_name ⇒ String
The name of a billing account.This parameter is required only if the UWS account used for the current API session has access to multiple accounts. An account name is usually numeric, and must include any leading zeros.
16 17 18 |
# File 'lib/verizon/models/assign_license_request.rb', line 16 def account_name @account_name end |
#devices ⇒ Array[LicenseDeviceList]
A list of 4G devices.
20 21 22 |
# File 'lib/verizon/models/assign_license_request.rb', line 20 def devices @devices end |
#sku_number ⇒ String
The Stock Keeping Unit (SKU). Valid skuNumbers for license types: “SIMSec-IoT-Lt”. (Lifetime) Once a license is assigned to a SIM, the SIM-Secure feature is enabled for the life of the SIM.“TS-BUNDLE-KTO-SIMSEC-MRC”. (Bundle) The SIM-Secure Flex license can be assigned to or removed from a SIM at any time. This SKU is bundled with other ThingSpace Services.“SIMSec-IoT”. (Flex) The SIM-Secure Flex license can be assigned to or removed from a SIM at any time. This SKU is purchased a la carte.
31 32 33 |
# File 'lib/verizon/models/assign_license_request.rb', line 31 def sku_number @sku_number end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/verizon/models/assign_license_request.rb', line 63 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_name = hash.key?('accountName') ? hash['accountName'] : SKIP # Parameter is an array, so we need to iterate through it devices = nil unless hash['devices'].nil? devices = [] hash['devices'].each do |structure| devices << (LicenseDeviceList.from_hash(structure) if structure) end end devices = SKIP unless hash.key?('devices') sku_number = hash.key?('skuNumber') ? hash['skuNumber'] : SKIP # Create object from extracted values. AssignLicenseRequest.new(account_name, devices, sku_number) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 |
# File 'lib/verizon/models/assign_license_request.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['account_name'] = 'accountName' @_hash['devices'] = 'devices' @_hash['sku_number'] = 'skuNumber' @_hash end |
.nullables ⇒ Object
An array for nullable fields
52 53 54 |
# File 'lib/verizon/models/assign_license_request.rb', line 52 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
43 44 45 46 47 48 49 |
# File 'lib/verizon/models/assign_license_request.rb', line 43 def self.optionals %w[ account_name devices sku_number ] end |