Class: Verizon::AssignLicenseRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/verizon/models/assign_license_request.rb

Overview

Request to assign license.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

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( = SKIP, devices = SKIP, sku_number = SKIP)
  @account_name =  unless  == SKIP
  @devices = devices unless devices == SKIP
  @sku_number = sku_number unless sku_number == SKIP
end

Instance Attribute Details

#account_nameString

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.

Returns:

  • (String)


16
17
18
# File 'lib/verizon/models/assign_license_request.rb', line 16

def 
  @account_name
end

#devicesArray[LicenseDeviceList]

A list of 4G devices.

Returns:



20
21
22
# File 'lib/verizon/models/assign_license_request.rb', line 20

def devices
  @devices
end

#sku_numberString

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.

Returns:

  • (String)


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.
   = 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(,
                           devices,
                           sku_number)
end

.namesObject

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

.nullablesObject

An array for nullable fields



52
53
54
# File 'lib/verizon/models/assign_license_request.rb', line 52

def self.nullables
  []
end

.optionalsObject

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