Class: MistApi::ResponseAsyncLicense
- Defined in:
- lib/mist_api/models/response_async_license.rb
Overview
ResponseAsyncLicense Model.
Instance Attribute Summary collapse
-
#completed ⇒ Array[String]
TODO: Write general description for this method.
-
#details ⇒ Array[ResponseAsyncLicenseDetail]
TODO: Write general description for this method.
-
#failed ⇒ Integer
Current failed number of device.
-
#incompleted ⇒ Array[String]
Current incompleted lists (macs).
-
#processed ⇒ Integer
Current processed number of device.
-
#scheduled_at ⇒ Integer
epoch time of aysnc claim scheduled.
-
#status ⇒ ResponseAsyncLicenseStatusEnum
processing status of async.
-
#succeed ⇒ Integer
Current succeed number of device.
-
#timestamp ⇒ Float
Epoch (seconds).
-
#total ⇒ Integer
total number of device included in claim.
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(completed = SKIP, details = SKIP, failed = SKIP, incompleted = SKIP, processed = SKIP, scheduled_at = SKIP, status = SKIP, succeed = SKIP, timestamp = SKIP, total = SKIP) ⇒ ResponseAsyncLicense
constructor
A new instance of ResponseAsyncLicense.
-
#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(completed = SKIP, details = SKIP, failed = SKIP, incompleted = SKIP, processed = SKIP, scheduled_at = SKIP, status = SKIP, succeed = SKIP, timestamp = SKIP, total = SKIP) ⇒ ResponseAsyncLicense
Returns a new instance of ResponseAsyncLicense.
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/mist_api/models/response_async_license.rb', line 89 def initialize(completed = SKIP, details = SKIP, failed = SKIP, incompleted = SKIP, processed = SKIP, scheduled_at = SKIP, status = SKIP, succeed = SKIP, = SKIP, total = SKIP) @completed = completed unless completed == SKIP @details = details unless details == SKIP @failed = failed unless failed == SKIP @incompleted = incompleted unless incompleted == SKIP @processed = processed unless processed == SKIP @scheduled_at = scheduled_at unless scheduled_at == SKIP @status = status unless status == SKIP @succeed = succeed unless succeed == SKIP @timestamp = unless == SKIP @total = total unless total == SKIP end |
Instance Attribute Details
#completed ⇒ Array[String]
TODO: Write general description for this method
14 15 16 |
# File 'lib/mist_api/models/response_async_license.rb', line 14 def completed @completed end |
#details ⇒ Array[ResponseAsyncLicenseDetail]
TODO: Write general description for this method
18 19 20 |
# File 'lib/mist_api/models/response_async_license.rb', line 18 def details @details end |
#failed ⇒ Integer
Current failed number of device
22 23 24 |
# File 'lib/mist_api/models/response_async_license.rb', line 22 def failed @failed end |
#incompleted ⇒ Array[String]
Current incompleted lists (macs)
26 27 28 |
# File 'lib/mist_api/models/response_async_license.rb', line 26 def incompleted @incompleted end |
#processed ⇒ Integer
Current processed number of device
30 31 32 |
# File 'lib/mist_api/models/response_async_license.rb', line 30 def processed @processed end |
#scheduled_at ⇒ Integer
epoch time of aysnc claim scheduled
34 35 36 |
# File 'lib/mist_api/models/response_async_license.rb', line 34 def scheduled_at @scheduled_at end |
#status ⇒ ResponseAsyncLicenseStatusEnum
processing status of async. enum: ‘prepared`, `ongoing`, `done`
38 39 40 |
# File 'lib/mist_api/models/response_async_license.rb', line 38 def status @status end |
#succeed ⇒ Integer
Current succeed number of device
42 43 44 |
# File 'lib/mist_api/models/response_async_license.rb', line 42 def succeed @succeed end |
#timestamp ⇒ Float
Epoch (seconds)
46 47 48 |
# File 'lib/mist_api/models/response_async_license.rb', line 46 def @timestamp end |
#total ⇒ Integer
total number of device included in claim
50 51 52 |
# File 'lib/mist_api/models/response_async_license.rb', line 50 def total @total end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/mist_api/models/response_async_license.rb', line 106 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. completed = hash.key?('completed') ? hash['completed'] : SKIP # Parameter is an array, so we need to iterate through it details = nil unless hash['details'].nil? details = [] hash['details'].each do |structure| details << (ResponseAsyncLicenseDetail.from_hash(structure) if structure) end end details = SKIP unless hash.key?('details') failed = hash.key?('failed') ? hash['failed'] : SKIP incompleted = hash.key?('incompleted') ? hash['incompleted'] : SKIP processed = hash.key?('processed') ? hash['processed'] : SKIP scheduled_at = hash.key?('scheduled_at') ? hash['scheduled_at'] : SKIP status = hash.key?('status') ? hash['status'] : SKIP succeed = hash.key?('succeed') ? hash['succeed'] : SKIP = hash.key?('timestamp') ? hash['timestamp'] : SKIP total = hash.key?('total') ? hash['total'] : SKIP # Create object from extracted values. ResponseAsyncLicense.new(completed, details, failed, incompleted, processed, scheduled_at, status, succeed, , total) end |
.names ⇒ Object
A mapping from model property names to API property names.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/mist_api/models/response_async_license.rb', line 53 def self.names @_hash = {} if @_hash.nil? @_hash['completed'] = 'completed' @_hash['details'] = 'details' @_hash['failed'] = 'failed' @_hash['incompleted'] = 'incompleted' @_hash['processed'] = 'processed' @_hash['scheduled_at'] = 'scheduled_at' @_hash['status'] = 'status' @_hash['succeed'] = 'succeed' @_hash['timestamp'] = 'timestamp' @_hash['total'] = 'total' @_hash end |
.nullables ⇒ Object
An array for nullable fields
85 86 87 |
# File 'lib/mist_api/models/response_async_license.rb', line 85 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/mist_api/models/response_async_license.rb', line 69 def self.optionals %w[ completed details failed incompleted processed scheduled_at status succeed timestamp total ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
152 153 154 155 156 157 158 |
# File 'lib/mist_api/models/response_async_license.rb', line 152 def inspect class_name = self.class.name.split('::').last "<#{class_name} completed: #{@completed.inspect}, details: #{@details.inspect}, failed:"\ " #{@failed.inspect}, incompleted: #{@incompleted.inspect}, processed:"\ " #{@processed.inspect}, scheduled_at: #{@scheduled_at.inspect}, status: #{@status.inspect},"\ " succeed: #{@succeed.inspect}, timestamp: #{@timestamp.inspect}, total: #{@total.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
144 145 146 147 148 149 |
# File 'lib/mist_api/models/response_async_license.rb', line 144 def to_s class_name = self.class.name.split('::').last "<#{class_name} completed: #{@completed}, details: #{@details}, failed: #{@failed},"\ " incompleted: #{@incompleted}, processed: #{@processed}, scheduled_at: #{@scheduled_at},"\ " status: #{@status}, succeed: #{@succeed}, timestamp: #{@timestamp}, total: #{@total}>" end |