Class: Verizon::V1ListOfLicensesToRemove

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

Overview

List of cancellation candidate devices.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(count = SKIP, has_more_data = SKIP, update_time = SKIP, device_list = SKIP) ⇒ V1ListOfLicensesToRemove

Returns a new instance of V1ListOfLicensesToRemove.



54
55
56
57
58
59
60
# File 'lib/verizon/models/v1_list_of_licenses_to_remove.rb', line 54

def initialize(count = SKIP, has_more_data = SKIP, update_time = SKIP,
               device_list = SKIP)
  @count = count unless count == SKIP
  @has_more_data = has_more_data unless has_more_data == SKIP
  @update_time = update_time unless update_time == SKIP
  @device_list = device_list unless device_list == SKIP
end

Instance Attribute Details

#countInteger

The total number of devices on the list.

Returns:

  • (Integer)


15
16
17
# File 'lib/verizon/models/v1_list_of_licenses_to_remove.rb', line 15

def count
  @count
end

#device_listArray[String]

The IMEIs of the devices.

Returns:

  • (Array[String])


27
28
29
# File 'lib/verizon/models/v1_list_of_licenses_to_remove.rb', line 27

def device_list
  @device_list
end

#has_more_dataTrueClass | FalseClass

True if there are more devices to retrieve.

Returns:

  • (TrueClass | FalseClass)


19
20
21
# File 'lib/verizon/models/v1_list_of_licenses_to_remove.rb', line 19

def has_more_data
  @has_more_data
end

#update_timeDateTime

The date and time that the list was last updated.

Returns:

  • (DateTime)


23
24
25
# File 'lib/verizon/models/v1_list_of_licenses_to_remove.rb', line 23

def update_time
  @update_time
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
# File 'lib/verizon/models/v1_list_of_licenses_to_remove.rb', line 63

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  count = hash.key?('count') ? hash['count'] : SKIP
  has_more_data = hash.key?('hasMoreData') ? hash['hasMoreData'] : SKIP
  update_time = if hash.key?('updateTime')
                  (DateTimeHelper.from_rfc3339(hash['updateTime']) if hash['updateTime'])
                else
                  SKIP
                end
  device_list = hash.key?('deviceList') ? hash['deviceList'] : SKIP

  # Create object from extracted values.
  V1ListOfLicensesToRemove.new(count,
                               has_more_data,
                               update_time,
                               device_list)
end

.namesObject

A mapping from model property names to API property names.



30
31
32
33
34
35
36
37
# File 'lib/verizon/models/v1_list_of_licenses_to_remove.rb', line 30

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['count'] = 'count'
  @_hash['has_more_data'] = 'hasMoreData'
  @_hash['update_time'] = 'updateTime'
  @_hash['device_list'] = 'deviceList'
  @_hash
end

.nullablesObject

An array for nullable fields



50
51
52
# File 'lib/verizon/models/v1_list_of_licenses_to_remove.rb', line 50

def self.nullables
  []
end

.optionalsObject

An array for optional fields



40
41
42
43
44
45
46
47
# File 'lib/verizon/models/v1_list_of_licenses_to_remove.rb', line 40

def self.optionals
  %w[
    count
    has_more_data
    update_time
    device_list
  ]
end

Instance Method Details

#to_custom_update_timeObject



83
84
85
# File 'lib/verizon/models/v1_list_of_licenses_to_remove.rb', line 83

def to_custom_update_time
  DateTimeHelper.to_rfc3339(update_time)
end