Class: MistApi::ResponseAutoMapAssignment

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

Overview

ResponseAutoMapAssignment 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(devices = SKIP, estimated_runtime = SKIP, reason = SKIP, started = SKIP, valid = SKIP) ⇒ ResponseAutoMapAssignment

Returns a new instance of ResponseAutoMapAssignment.



60
61
62
63
64
65
66
67
# File 'lib/mist_api/models/response_auto_map_assignment.rb', line 60

def initialize(devices = SKIP, estimated_runtime = SKIP, reason = SKIP,
               started = SKIP, valid = SKIP)
  @devices = devices unless devices == SKIP
  @estimated_runtime = estimated_runtime unless estimated_runtime == SKIP
  @reason = reason unless reason == SKIP
  @started = started unless started == SKIP
  @valid = valid unless valid == SKIP
end

Instance Attribute Details

#devicesHash[String, ResponseAutoMapAssignmentDevice]

Contains the validation status of each device. The property key is the device MAC address.

Returns:



15
16
17
# File 'lib/mist_api/models/response_auto_map_assignment.rb', line 15

def devices
  @devices
end

#estimated_runtimeInteger

Estimated runtime for the process in seconds

Returns:

  • (Integer)


19
20
21
# File 'lib/mist_api/models/response_auto_map_assignment.rb', line 19

def estimated_runtime
  @estimated_runtime
end

#reasonString

Provides the reason for the status

Returns:

  • (String)


23
24
25
# File 'lib/mist_api/models/response_auto_map_assignment.rb', line 23

def reason
  @reason
end

#startedTrueClass | FalseClass

Indicates whether the auto map assignment process has started

Returns:

  • (TrueClass | FalseClass)


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

def started
  @started
end

#validTrueClass | FalseClass

Indicates whether the auto map assignment request is valid

Returns:

  • (TrueClass | FalseClass)


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

def valid
  @valid
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



70
71
72
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.rb', line 70

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  devices = ResponseAutoMapAssignmentDevice.from_hash(hash['devices']) if hash['devices']

  devices = SKIP unless hash.key?('devices')
  estimated_runtime =
    hash.key?('estimated_runtime') ? hash['estimated_runtime'] : SKIP
  reason = hash.key?('reason') ? hash['reason'] : SKIP
  started = hash.key?('started') ? hash['started'] : SKIP
  valid = hash.key?('valid') ? hash['valid'] : SKIP

  # Create object from extracted values.
  ResponseAutoMapAssignment.new(devices,
                                estimated_runtime,
                                reason,
                                started,
                                valid)
end

.namesObject

A mapping from model property names to API property names.



34
35
36
37
38
39
40
41
42
# File 'lib/mist_api/models/response_auto_map_assignment.rb', line 34

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['devices'] = 'devices'
  @_hash['estimated_runtime'] = 'estimated_runtime'
  @_hash['reason'] = 'reason'
  @_hash['started'] = 'started'
  @_hash['valid'] = 'valid'
  @_hash
end

.nullablesObject

An array for nullable fields



56
57
58
# File 'lib/mist_api/models/response_auto_map_assignment.rb', line 56

def self.nullables
  []
end

.optionalsObject

An array for optional fields



45
46
47
48
49
50
51
52
53
# File 'lib/mist_api/models/response_auto_map_assignment.rb', line 45

def self.optionals
  %w[
    devices
    estimated_runtime
    reason
    started
    valid
  ]
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.rb', line 99

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} devices: #{@devices.inspect}, estimated_runtime:"\
  " #{@estimated_runtime.inspect}, reason: #{@reason.inspect}, started: #{@started.inspect},"\
  " valid: #{@valid.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.rb', line 92

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} devices: #{@devices}, estimated_runtime: #{@estimated_runtime}, reason:"\
  " #{@reason}, started: #{@started}, valid: #{@valid}>"
end