Class: Verizon::SecuritySubscription
- Defined in:
- lib/verizon/models/security_subscription.rb
Overview
Subscription of the device.
Instance Attribute Summary collapse
-
#extended_attributes ⇒ Array[ExtendedAttributes]
Attributes of the subscription.
-
#license_assigned ⇒ Integer
The total number of licenses for this license type that are assigned to device SIMs.
-
#license_available ⇒ Integer
The total number of licenses for this license type that are available to assign to device SIMs.
-
#license_purchased ⇒ Integer
The total number of licenses purchased for the license type.
-
#license_type ⇒ String
The license type associated with the skuNumber.
-
#sku_number ⇒ String
The skuNumber that identifies the license type.
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(extended_attributes = SKIP, license_assigned = SKIP, license_available = SKIP, license_purchased = SKIP, license_type = SKIP, sku_number = SKIP) ⇒ SecuritySubscription
constructor
A new instance of SecuritySubscription.
Methods inherited from BaseModel
Constructor Details
#initialize(extended_attributes = SKIP, license_assigned = SKIP, license_available = SKIP, license_purchased = SKIP, license_type = SKIP, sku_number = SKIP) ⇒ SecuritySubscription
Returns a new instance of SecuritySubscription.
67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/verizon/models/security_subscription.rb', line 67 def initialize(extended_attributes = SKIP, license_assigned = SKIP, license_available = SKIP, license_purchased = SKIP, license_type = SKIP, sku_number = SKIP) @extended_attributes = extended_attributes unless extended_attributes == SKIP @license_assigned = license_assigned unless license_assigned == SKIP @license_available = license_available unless license_available == SKIP @license_purchased = license_purchased unless license_purchased == SKIP @license_type = license_type unless license_type == SKIP @sku_number = sku_number unless sku_number == SKIP end |
Instance Attribute Details
#extended_attributes ⇒ Array[ExtendedAttributes]
Attributes of the subscription.
14 15 16 |
# File 'lib/verizon/models/security_subscription.rb', line 14 def extended_attributes @extended_attributes end |
#license_assigned ⇒ Integer
The total number of licenses for this license type that are assigned to device SIMs.
19 20 21 |
# File 'lib/verizon/models/security_subscription.rb', line 19 def license_assigned @license_assigned end |
#license_available ⇒ Integer
The total number of licenses for this license type that are available to assign to device SIMs.
24 25 26 |
# File 'lib/verizon/models/security_subscription.rb', line 24 def license_available @license_available end |
#license_purchased ⇒ Integer
The total number of licenses purchased for the license type.
28 29 30 |
# File 'lib/verizon/models/security_subscription.rb', line 28 def license_purchased @license_purchased end |
#license_type ⇒ String
The license type associated with the skuNumber.
32 33 34 |
# File 'lib/verizon/models/security_subscription.rb', line 32 def license_type @license_type end |
#sku_number ⇒ String
The skuNumber that identifies the license type.
36 37 38 |
# File 'lib/verizon/models/security_subscription.rb', line 36 def sku_number @sku_number end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/verizon/models/security_subscription.rb', line 82 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. # Parameter is an array, so we need to iterate through it extended_attributes = nil unless hash['extendedAttributes'].nil? extended_attributes = [] hash['extendedAttributes'].each do |structure| extended_attributes << (ExtendedAttributes.from_hash(structure) if structure) end end extended_attributes = SKIP unless hash.key?('extendedAttributes') license_assigned = hash.key?('licenseAssigned') ? hash['licenseAssigned'] : SKIP license_available = hash.key?('licenseAvailable') ? hash['licenseAvailable'] : SKIP license_purchased = hash.key?('licensePurchased') ? hash['licensePurchased'] : SKIP license_type = hash.key?('licenseType') ? hash['licenseType'] : SKIP sku_number = hash.key?('skuNumber') ? hash['skuNumber'] : SKIP # Create object from extracted values. SecuritySubscription.new(extended_attributes, license_assigned, license_available, license_purchased, license_type, sku_number) end |
.names ⇒ Object
A mapping from model property names to API property names.
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/verizon/models/security_subscription.rb', line 39 def self.names @_hash = {} if @_hash.nil? @_hash['extended_attributes'] = 'extendedAttributes' @_hash['license_assigned'] = 'licenseAssigned' @_hash['license_available'] = 'licenseAvailable' @_hash['license_purchased'] = 'licensePurchased' @_hash['license_type'] = 'licenseType' @_hash['sku_number'] = 'skuNumber' @_hash end |
.nullables ⇒ Object
An array for nullable fields
63 64 65 |
# File 'lib/verizon/models/security_subscription.rb', line 63 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/verizon/models/security_subscription.rb', line 51 def self.optionals %w[ extended_attributes license_assigned license_available license_purchased license_type sku_number ] end |