Class: Verizon::FotaV3Subscription
- Defined in:
- lib/verizon/models/fota_v3_subscription.rb
Overview
Information for licenses applied to devices.
Instance Attribute Summary collapse
-
#account_name ⇒ String
Account identifier in “##########-#####”.
-
#license_count ⇒ Integer
Number of monthly licenses in an MRC subscription.
-
#license_used_count ⇒ Integer
Number of licenses currently assigned to devices.
-
#purchase_type ⇒ String
Subscription models used by the account.
-
#update_time ⇒ String
The date and time of when the subscription was last updated.
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, purchase_type = SKIP, license_count = SKIP, license_used_count = SKIP, update_time = SKIP) ⇒ FotaV3Subscription
constructor
A new instance of FotaV3Subscription.
Methods inherited from BaseModel
Constructor Details
#initialize(account_name = SKIP, purchase_type = SKIP, license_count = SKIP, license_used_count = SKIP, update_time = SKIP) ⇒ FotaV3Subscription
Returns a new instance of FotaV3Subscription.
59 60 61 62 63 64 65 66 67 |
# File 'lib/verizon/models/fota_v3_subscription.rb', line 59 def initialize(account_name = SKIP, purchase_type = SKIP, license_count = SKIP, license_used_count = SKIP, update_time = SKIP) @account_name = account_name unless account_name == SKIP @purchase_type = purchase_type unless purchase_type == SKIP @license_count = license_count unless license_count == SKIP @license_used_count = license_used_count unless license_used_count == SKIP @update_time = update_time unless update_time == SKIP end |
Instance Attribute Details
#account_name ⇒ String
Account identifier in “##########-#####”.
14 15 16 |
# File 'lib/verizon/models/fota_v3_subscription.rb', line 14 def account_name @account_name end |
#license_count ⇒ Integer
Number of monthly licenses in an MRC subscription.
22 23 24 |
# File 'lib/verizon/models/fota_v3_subscription.rb', line 22 def license_count @license_count end |
#license_used_count ⇒ Integer
Number of licenses currently assigned to devices.
26 27 28 |
# File 'lib/verizon/models/fota_v3_subscription.rb', line 26 def license_used_count @license_used_count end |
#purchase_type ⇒ String
Subscription models used by the account.
18 19 20 |
# File 'lib/verizon/models/fota_v3_subscription.rb', line 18 def purchase_type @purchase_type end |
#update_time ⇒ String
The date and time of when the subscription was last updated.
30 31 32 |
# File 'lib/verizon/models/fota_v3_subscription.rb', line 30 def update_time @update_time end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/verizon/models/fota_v3_subscription.rb', line 70 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_name = hash.key?('accountName') ? hash['accountName'] : SKIP purchase_type = hash.key?('purchaseType') ? hash['purchaseType'] : SKIP license_count = hash.key?('licenseCount') ? hash['licenseCount'] : SKIP license_used_count = hash.key?('licenseUsedCount') ? hash['licenseUsedCount'] : SKIP update_time = hash.key?('updateTime') ? hash['updateTime'] : SKIP # Create object from extracted values. FotaV3Subscription.new(account_name, purchase_type, license_count, license_used_count, update_time) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 39 40 41 |
# File 'lib/verizon/models/fota_v3_subscription.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['account_name'] = 'accountName' @_hash['purchase_type'] = 'purchaseType' @_hash['license_count'] = 'licenseCount' @_hash['license_used_count'] = 'licenseUsedCount' @_hash['update_time'] = 'updateTime' @_hash end |
.nullables ⇒ Object
An array for nullable fields
55 56 57 |
# File 'lib/verizon/models/fota_v3_subscription.rb', line 55 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
44 45 46 47 48 49 50 51 52 |
# File 'lib/verizon/models/fota_v3_subscription.rb', line 44 def self.optionals %w[ account_name purchase_type license_count license_used_count update_time ] end |