Class: MistApi::FwupdateStat
- Defined in:
- lib/mist_api/models/fwupdate_stat.rb
Overview
FwupdateStat Model.
Instance Attribute Summary collapse
-
#progress ⇒ Integer
TODO: Write general description for this method.
-
#status ⇒ FwupdateStatStatusEnum
enum: ‘inprogress`, `failed`, `upgraded`, `success`, `scheduled`, `error`.
-
#status_id ⇒ Integer
enum: ‘inprogress`, `failed`, `upgraded`, `success`, `scheduled`, `error`.
-
#timestamp ⇒ Float
Epoch (seconds).
-
#will_retry ⇒ TrueClass | FalseClass
Epoch (seconds).
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.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(progress = SKIP, status = SKIP, status_id = SKIP, timestamp = SKIP, will_retry = SKIP) ⇒ FwupdateStat
constructor
A new instance of FwupdateStat.
-
#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(progress = SKIP, status = SKIP, status_id = SKIP, timestamp = SKIP, will_retry = SKIP) ⇒ FwupdateStat
Returns a new instance of FwupdateStat.
64 65 66 67 68 69 70 71 |
# File 'lib/mist_api/models/fwupdate_stat.rb', line 64 def initialize(progress = SKIP, status = SKIP, status_id = SKIP, = SKIP, will_retry = SKIP) @progress = progress unless progress == SKIP @status = status unless status == SKIP @status_id = status_id unless status_id == SKIP @timestamp = unless == SKIP @will_retry = will_retry unless will_retry == SKIP end |
Instance Attribute Details
#progress ⇒ Integer
TODO: Write general description for this method
14 15 16 |
# File 'lib/mist_api/models/fwupdate_stat.rb', line 14 def progress @progress end |
#status ⇒ FwupdateStatStatusEnum
enum: ‘inprogress`, `failed`, `upgraded`, `success`, `scheduled`, `error`
18 19 20 |
# File 'lib/mist_api/models/fwupdate_stat.rb', line 18 def status @status end |
#status_id ⇒ Integer
enum: ‘inprogress`, `failed`, `upgraded`, `success`, `scheduled`, `error`
22 23 24 |
# File 'lib/mist_api/models/fwupdate_stat.rb', line 22 def status_id @status_id end |
#timestamp ⇒ Float
Epoch (seconds)
26 27 28 |
# File 'lib/mist_api/models/fwupdate_stat.rb', line 26 def @timestamp end |
#will_retry ⇒ TrueClass | FalseClass
Epoch (seconds)
30 31 32 |
# File 'lib/mist_api/models/fwupdate_stat.rb', line 30 def will_retry @will_retry end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/mist_api/models/fwupdate_stat.rb', line 74 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. progress = hash.key?('progress') ? hash['progress'] : SKIP status = hash.key?('status') ? hash['status'] : SKIP status_id = hash.key?('status_id') ? hash['status_id'] : SKIP = hash.key?('timestamp') ? hash['timestamp'] : SKIP will_retry = hash.key?('will_retry') ? hash['will_retry'] : SKIP # Create object from extracted values. FwupdateStat.new(progress, status, status_id, , will_retry) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 39 40 41 |
# File 'lib/mist_api/models/fwupdate_stat.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['progress'] = 'progress' @_hash['status'] = 'status' @_hash['status_id'] = 'status_id' @_hash['timestamp'] = 'timestamp' @_hash['will_retry'] = 'will_retry' @_hash end |
.nullables ⇒ Object
An array for nullable fields
55 56 57 58 59 60 61 62 |
# File 'lib/mist_api/models/fwupdate_stat.rb', line 55 def self.nullables %w[ progress status status_id will_retry ] end |
.optionals ⇒ Object
An array for optional fields
44 45 46 47 48 49 50 51 52 |
# File 'lib/mist_api/models/fwupdate_stat.rb', line 44 def self.optionals %w[ progress status status_id timestamp will_retry ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
94 95 96 97 98 99 100 |
# File 'lib/mist_api/models/fwupdate_stat.rb', line 94 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
110 111 112 113 114 115 |
# File 'lib/mist_api/models/fwupdate_stat.rb', line 110 def inspect class_name = self.class.name.split('::').last "<#{class_name} progress: #{@progress.inspect}, status: #{@status.inspect}, status_id:"\ " #{@status_id.inspect}, timestamp: #{@timestamp.inspect}, will_retry:"\ " #{@will_retry.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
103 104 105 106 107 |
# File 'lib/mist_api/models/fwupdate_stat.rb', line 103 def to_s class_name = self.class.name.split('::').last "<#{class_name} progress: #{@progress}, status: #{@status}, status_id: #{@status_id},"\ " timestamp: #{@timestamp}, will_retry: #{@will_retry}>" end |