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

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(count: SKIP, has_more_data: SKIP, update_time: SKIP, device_list: SKIP, additional_properties: nil) ⇒ V1ListOfLicensesToRemove

Returns a new instance of V1ListOfLicensesToRemove.



54
55
56
57
58
59
60
61
62
63
64
# 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, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @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
  @additional_properties = additional_properties
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.



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/verizon/models/v1_list_of_licenses_to_remove.rb', line 67

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 a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  V1ListOfLicensesToRemove.new(count: count,
                               has_more_data: has_more_data,
                               update_time: update_time,
                               device_list: device_list,
                               additional_properties: additional_properties)
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

#inspectObject

Provides a debugging-friendly string with detailed object information.



108
109
110
111
112
113
# File 'lib/verizon/models/v1_list_of_licenses_to_remove.rb', line 108

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} count: #{@count.inspect}, has_more_data: #{@has_more_data.inspect},"\
  " update_time: #{@update_time.inspect}, device_list: #{@device_list.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_custom_update_timeObject



95
96
97
# File 'lib/verizon/models/v1_list_of_licenses_to_remove.rb', line 95

def to_custom_update_time
  DateTimeHelper.to_rfc3339(update_time)
end

#to_sObject

Provides a human-readable string representation of the object.



100
101
102
103
104
105
# File 'lib/verizon/models/v1_list_of_licenses_to_remove.rb', line 100

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} count: #{@count}, has_more_data: #{@has_more_data}, update_time:"\
  " #{@update_time}, device_list: #{@device_list}, additional_properties:"\
  " #{@additional_properties}>"
end