Class: Verizon::AccountLicenseInfo
- Defined in:
- lib/verizon/models/account_license_info.rb
Overview
Account license information.
Instance Attribute Summary collapse
-
#account_name ⇒ String
Account identifier in “##########-#####”.
-
#assigned_licenses ⇒ Integer
Number of licenses currently assigned to devices.
-
#device_list ⇒ Array[AccountLicenseDeviceListItem]
The list of devices that have licenses assigned, including the date and time of when each license was assigned.
-
#has_more_data ⇒ TrueClass | FalseClass
True if there are more devices to retrieve.
-
#last_seen_device_id ⇒ Integer
If hasMoreData=true, the startIndex to use for the next request.
-
#total_licenses ⇒ Integer
Number of monthly licenses in an MRC subscription.
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, total_licenses = SKIP, assigned_licenses = SKIP, has_more_data = SKIP, last_seen_device_id = SKIP, device_list = SKIP) ⇒ AccountLicenseInfo
constructor
A new instance of AccountLicenseInfo.
Methods inherited from BaseModel
Constructor Details
#initialize(account_name = SKIP, total_licenses = SKIP, assigned_licenses = SKIP, has_more_data = SKIP, last_seen_device_id = SKIP, device_list = SKIP) ⇒ AccountLicenseInfo
Returns a new instance of AccountLicenseInfo.
67 68 69 70 71 72 73 74 75 76 |
# File 'lib/verizon/models/account_license_info.rb', line 67 def initialize(account_name = SKIP, total_licenses = SKIP, assigned_licenses = SKIP, has_more_data = SKIP, last_seen_device_id = SKIP, device_list = SKIP) @account_name = account_name unless account_name == SKIP @total_licenses = total_licenses unless total_licenses == SKIP @assigned_licenses = assigned_licenses unless assigned_licenses == SKIP @has_more_data = has_more_data unless has_more_data == SKIP @last_seen_device_id = last_seen_device_id unless last_seen_device_id == SKIP @device_list = device_list unless device_list == SKIP end |
Instance Attribute Details
#account_name ⇒ String
Account identifier in “##########-#####”.
14 15 16 |
# File 'lib/verizon/models/account_license_info.rb', line 14 def account_name @account_name end |
#assigned_licenses ⇒ Integer
Number of licenses currently assigned to devices.
22 23 24 |
# File 'lib/verizon/models/account_license_info.rb', line 22 def assigned_licenses @assigned_licenses end |
#device_list ⇒ Array[AccountLicenseDeviceListItem]
The list of devices that have licenses assigned, including the date and time of when each license was assigned.
36 37 38 |
# File 'lib/verizon/models/account_license_info.rb', line 36 def device_list @device_list end |
#has_more_data ⇒ TrueClass | FalseClass
True if there are more devices to retrieve.
26 27 28 |
# File 'lib/verizon/models/account_license_info.rb', line 26 def has_more_data @has_more_data end |
#last_seen_device_id ⇒ Integer
If hasMoreData=true, the startIndex to use for the next request. 0 if hasMoreData=false.
31 32 33 |
# File 'lib/verizon/models/account_license_info.rb', line 31 def last_seen_device_id @last_seen_device_id end |
#total_licenses ⇒ Integer
Number of monthly licenses in an MRC subscription.
18 19 20 |
# File 'lib/verizon/models/account_license_info.rb', line 18 def total_licenses @total_licenses end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
79 80 81 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 |
# File 'lib/verizon/models/account_license_info.rb', line 79 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_name = hash.key?('accountName') ? hash['accountName'] : SKIP total_licenses = hash.key?('totalLicenses') ? hash['totalLicenses'] : SKIP assigned_licenses = hash.key?('assignedLicenses') ? hash['assignedLicenses'] : SKIP has_more_data = hash.key?('hasMoreData') ? hash['hasMoreData'] : SKIP last_seen_device_id = hash.key?('lastSeenDeviceId') ? hash['lastSeenDeviceId'] : SKIP # Parameter is an array, so we need to iterate through it device_list = nil unless hash['deviceList'].nil? device_list = [] hash['deviceList'].each do |structure| device_list << (AccountLicenseDeviceListItem.from_hash(structure) if structure) end end device_list = SKIP unless hash.key?('deviceList') # Create object from extracted values. AccountLicenseInfo.new(account_name, total_licenses, assigned_licenses, has_more_data, last_seen_device_id, device_list) 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/account_license_info.rb', line 39 def self.names @_hash = {} if @_hash.nil? @_hash['account_name'] = 'accountName' @_hash['total_licenses'] = 'totalLicenses' @_hash['assigned_licenses'] = 'assignedLicenses' @_hash['has_more_data'] = 'hasMoreData' @_hash['last_seen_device_id'] = 'lastSeenDeviceId' @_hash['device_list'] = 'deviceList' @_hash end |
.nullables ⇒ Object
An array for nullable fields
63 64 65 |
# File 'lib/verizon/models/account_license_info.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/account_license_info.rb', line 51 def self.optionals %w[ account_name total_licenses assigned_licenses has_more_data last_seen_device_id device_list ] end |