Class: Verizon::FotaV2Subscription

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

Overview

FOTA Subscription.

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, purchase_type = SKIP, license_count = SKIP, license_used_count = SKIP, update_time = SKIP) ⇒ FotaV2Subscription

Returns a new instance of FotaV2Subscription.



59
60
61
62
63
64
65
66
67
# File 'lib/verizon/models/fota_v2_subscription.rb', line 59

def initialize( = SKIP, purchase_type = SKIP,
               license_count = SKIP, license_used_count = SKIP,
               update_time = SKIP)
  @account_name =  unless  == 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_nameString

Account identifier in “##########-#####”.

Returns:

  • (String)


14
15
16
# File 'lib/verizon/models/fota_v2_subscription.rb', line 14

def 
  @account_name
end

#license_countInteger

Number of monthly licenses in an MRC subscription.

Returns:

  • (Integer)


22
23
24
# File 'lib/verizon/models/fota_v2_subscription.rb', line 22

def license_count
  @license_count
end

#license_used_countInteger

Number of licenses currently assigned to devices.

Returns:

  • (Integer)


26
27
28
# File 'lib/verizon/models/fota_v2_subscription.rb', line 26

def license_used_count
  @license_used_count
end

#purchase_typeString

Subscription models used by the account.

Returns:

  • (String)


18
19
20
# File 'lib/verizon/models/fota_v2_subscription.rb', line 18

def purchase_type
  @purchase_type
end

#update_timeString

The date and time of when the subscription was last updated.

Returns:

  • (String)


30
31
32
# File 'lib/verizon/models/fota_v2_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_v2_subscription.rb', line 70

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = 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.
  FotaV2Subscription.new(,
                         purchase_type,
                         license_count,
                         license_used_count,
                         update_time)
end

.namesObject

A mapping from model property names to API property names.



33
34
35
36
37
38
39
40
41
# File 'lib/verizon/models/fota_v2_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

.nullablesObject

An array for nullable fields



55
56
57
# File 'lib/verizon/models/fota_v2_subscription.rb', line 55

def self.nullables
  []
end

.optionalsObject

An array for optional fields



44
45
46
47
48
49
50
51
52
# File 'lib/verizon/models/fota_v2_subscription.rb', line 44

def self.optionals
  %w[
    account_name
    purchase_type
    license_count
    license_used_count
    update_time
  ]
end