Class: Verizon::UpgradeListQueryResult
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- Verizon::UpgradeListQueryResult
- Defined in:
- lib/verizon/models/upgrade_list_query_result.rb
Overview
Upgrade information.
Instance Attribute Summary collapse
-
#has_more_flag ⇒ TrueClass | FalseClass
True if there are more devices to retrieve.
-
#last_seen_upgrade_id ⇒ Integer
If hasMoreData=true, the startIndex to use for the next request.
-
#report_list ⇒ Array[FirmwareUpgrade]
Array of upgrade objects with the specified status.
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(has_more_flag: SKIP, last_seen_upgrade_id: SKIP, report_list: SKIP, additional_properties: nil) ⇒ UpgradeListQueryResult
constructor
A new instance of UpgradeListQueryResult.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(has_more_flag: SKIP, last_seen_upgrade_id: SKIP, report_list: SKIP, additional_properties: nil) ⇒ UpgradeListQueryResult
Returns a new instance of UpgradeListQueryResult.
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/verizon/models/upgrade_list_query_result.rb', line 50 def initialize(has_more_flag: SKIP, last_seen_upgrade_id: SKIP, report_list: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @has_more_flag = has_more_flag unless has_more_flag == SKIP @last_seen_upgrade_id = last_seen_upgrade_id unless last_seen_upgrade_id == SKIP @report_list = report_list unless report_list == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#has_more_flag ⇒ TrueClass | FalseClass
True if there are more devices to retrieve.
14 15 16 |
# File 'lib/verizon/models/upgrade_list_query_result.rb', line 14 def has_more_flag @has_more_flag end |
#last_seen_upgrade_id ⇒ Integer
If hasMoreData=true, the startIndex to use for the next request. 0 if hasMoreData=false.
19 20 21 |
# File 'lib/verizon/models/upgrade_list_query_result.rb', line 19 def last_seen_upgrade_id @last_seen_upgrade_id end |
#report_list ⇒ Array[FirmwareUpgrade]
Array of upgrade objects with the specified status.
23 24 25 |
# File 'lib/verizon/models/upgrade_list_query_result.rb', line 23 def report_list @report_list end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
62 63 64 65 66 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 |
# File 'lib/verizon/models/upgrade_list_query_result.rb', line 62 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. has_more_flag = hash.key?('hasMoreFlag') ? hash['hasMoreFlag'] : SKIP last_seen_upgrade_id = hash.key?('lastSeenUpgradeId') ? hash['lastSeenUpgradeId'] : SKIP # Parameter is an array, so we need to iterate through it report_list = nil unless hash['reportList'].nil? report_list = [] hash['reportList'].each do |structure| report_list << (FirmwareUpgrade.from_hash(structure) if structure) end end report_list = SKIP unless hash.key?('reportList') # 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. UpgradeListQueryResult.new(has_more_flag: has_more_flag, last_seen_upgrade_id: last_seen_upgrade_id, report_list: report_list, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
26 27 28 29 30 31 32 |
# File 'lib/verizon/models/upgrade_list_query_result.rb', line 26 def self.names @_hash = {} if @_hash.nil? @_hash['has_more_flag'] = 'hasMoreFlag' @_hash['last_seen_upgrade_id'] = 'lastSeenUpgradeId' @_hash['report_list'] = 'reportList' @_hash end |
.nullables ⇒ Object
An array for nullable fields
44 45 46 47 48 |
# File 'lib/verizon/models/upgrade_list_query_result.rb', line 44 def self.nullables %w[ report_list ] end |
.optionals ⇒ Object
An array for optional fields
35 36 37 38 39 40 41 |
# File 'lib/verizon/models/upgrade_list_query_result.rb', line 35 def self.optionals %w[ has_more_flag last_seen_upgrade_id report_list ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
103 104 105 106 107 108 |
# File 'lib/verizon/models/upgrade_list_query_result.rb', line 103 def inspect class_name = self.class.name.split('::').last "<#{class_name} has_more_flag: #{@has_more_flag.inspect}, last_seen_upgrade_id:"\ " #{@last_seen_upgrade_id.inspect}, report_list: #{@report_list.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
95 96 97 98 99 100 |
# File 'lib/verizon/models/upgrade_list_query_result.rb', line 95 def to_s class_name = self.class.name.split('::').last "<#{class_name} has_more_flag: #{@has_more_flag}, last_seen_upgrade_id:"\ " #{@last_seen_upgrade_id}, report_list: #{@report_list}, additional_properties:"\ " #{@additional_properties}>" end |