Class: MistApi::ResponseAutoPlacementInfo

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/response_auto_placement_info.rb

Overview

ResponseAutoPlacementInfo Model.

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(end_time = SKIP, est_time_left = SKIP, start_time = SKIP, status = SKIP) ⇒ ResponseAutoPlacementInfo

Returns a new instance of ResponseAutoPlacementInfo.



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

def initialize(end_time = SKIP, est_time_left = SKIP, start_time = SKIP,
               status = SKIP)
  @end_time = end_time unless end_time == SKIP
  @est_time_left = est_time_left unless est_time_left == SKIP
  @start_time = start_time unless start_time == SKIP
  @status = status unless status == SKIP
end

Instance Attribute Details

#end_timeFloat

Time when autoplacement completed or was manually stopped

Returns:

  • (Float)


14
15
16
# File 'lib/mist_api/models/response_auto_placement_info.rb', line 14

def end_time
  @end_time
end

#est_time_leftFloat

(Only when inprogress) estimate of the time to completion

Returns:

  • (Float)


18
19
20
# File 'lib/mist_api/models/response_auto_placement_info.rb', line 18

def est_time_left
  @est_time_left
end

#start_timeInteger

Time when autoplacement process was last queued for this map

Returns:

  • (Integer)


22
23
24
# File 'lib/mist_api/models/response_auto_placement_info.rb', line 22

def start_time
  @start_time
end

#statusAutoPlacementInfoStatusEnum

the status of autoplacement for a given map. enum: ‘done`, `error`, `inprogress`, `pending`



27
28
29
# File 'lib/mist_api/models/response_auto_placement_info.rb', line 27

def status
  @status
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
# File 'lib/mist_api/models/response_auto_placement_info.rb', line 63

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  end_time = hash.key?('end_time') ? hash['end_time'] : SKIP
  est_time_left = hash.key?('est_time_left') ? hash['est_time_left'] : SKIP
  start_time = hash.key?('start_time') ? hash['start_time'] : SKIP
  status = hash.key?('status') ? hash['status'] : SKIP

  # Create object from extracted values.
  ResponseAutoPlacementInfo.new(end_time,
                                est_time_left,
                                start_time,
                                status)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['end_time'] = 'end_time'
  @_hash['est_time_left'] = 'est_time_left'
  @_hash['start_time'] = 'start_time'
  @_hash['status'] = 'status'
  @_hash
end

.nullablesObject

An array for nullable fields



50
51
52
# File 'lib/mist_api/models/response_auto_placement_info.rb', line 50

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    end_time
    est_time_left
    start_time
    status
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



87
88
89
90
91
# File 'lib/mist_api/models/response_auto_placement_info.rb', line 87

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} end_time: #{@end_time.inspect}, est_time_left: #{@est_time_left.inspect},"\
  " start_time: #{@start_time.inspect}, status: #{@status.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



80
81
82
83
84
# File 'lib/mist_api/models/response_auto_placement_info.rb', line 80

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} end_time: #{@end_time}, est_time_left: #{@est_time_left}, start_time:"\
  " #{@start_time}, status: #{@status}>"
end