Class: MistApi::ResponseAutoMapAssignmentInfo

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

Overview

ResponseAutoMapAssignmentInfo 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(status = nil, est_time_left = SKIP, start_time = SKIP, stop_time = SKIP, time_updated = SKIP) ⇒ ResponseAutoMapAssignmentInfo

Returns a new instance of ResponseAutoMapAssignmentInfo.



63
64
65
66
67
68
69
70
# File 'lib/mist_api/models/response_auto_map_assignment_info.rb', line 63

def initialize(status = nil, est_time_left = SKIP, start_time = SKIP,
               stop_time = SKIP, time_updated = SKIP)
  @est_time_left = est_time_left unless est_time_left == SKIP
  @start_time = start_time unless start_time == SKIP
  @status = status
  @stop_time = stop_time unless stop_time == SKIP
  @time_updated = time_updated unless time_updated == SKIP
end

Instance Attribute Details

#est_time_leftFloat

Only when ‘status`==`in_progress`, estimated seconds remaining

Returns:

  • (Float)


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

def est_time_left
  @est_time_left
end

#start_timeFloat

Unix timestamp when auto map assignment was started

Returns:

  • (Float)


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

def start_time
  @start_time
end

#statusResponseAutoMapAssignmentInfoStatusEnum

The status of auto map assignment for a given site. enum:

* `not_started`: Auto map assignment has not been requested
* `in_progress`: Auto map assignment is currently processing
* `completed`: The auto map assignment process has completed
* `error`: There was an error in the auto map assignment process


26
27
28
# File 'lib/mist_api/models/response_auto_map_assignment_info.rb', line 26

def status
  @status
end

#stop_timeFloat

Only when ‘status`==`completed`, Unix timestamp when auto map assignment stopped

Returns:

  • (Float)


31
32
33
# File 'lib/mist_api/models/response_auto_map_assignment_info.rb', line 31

def stop_time
  @stop_time
end

#time_updatedFloat

Unix timestamp when status was last updated

Returns:

  • (Float)


35
36
37
# File 'lib/mist_api/models/response_auto_map_assignment_info.rb', line 35

def time_updated
  @time_updated
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/mist_api/models/response_auto_map_assignment_info.rb', line 73

def self.from_hash(hash)
  return nil unless hash

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

  # Create object from extracted values.
  ResponseAutoMapAssignmentInfo.new(status,
                                    est_time_left,
                                    start_time,
                                    stop_time,
                                    time_updated)
end

.namesObject

A mapping from model property names to API property names.



38
39
40
41
42
43
44
45
46
# File 'lib/mist_api/models/response_auto_map_assignment_info.rb', line 38

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

.nullablesObject

An array for nullable fields



59
60
61
# File 'lib/mist_api/models/response_auto_map_assignment_info.rb', line 59

def self.nullables
  []
end

.optionalsObject

An array for optional fields



49
50
51
52
53
54
55
56
# File 'lib/mist_api/models/response_auto_map_assignment_info.rb', line 49

def self.optionals
  %w[
    est_time_left
    start_time
    stop_time
    time_updated
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



99
100
101
102
103
104
# File 'lib/mist_api/models/response_auto_map_assignment_info.rb', line 99

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

#to_sObject

Provides a human-readable string representation of the object.



92
93
94
95
96
# File 'lib/mist_api/models/response_auto_map_assignment_info.rb', line 92

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