Class: MistApi::ResponseMapImportFloorplan

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

Overview

ResponseMapImportFloorplan 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(action = nil, id = nil, map_id = nil, name = nil, reason = SKIP) ⇒ ResponseMapImportFloorplan

Returns a new instance of ResponseMapImportFloorplan.



55
56
57
58
59
60
61
62
# File 'lib/mist_api/models/response_map_import_floorplan.rb', line 55

def initialize(action = nil, id = nil, map_id = nil, name = nil,
               reason = SKIP)
  @action = action
  @id = id
  @map_id = map_id
  @name = name
  @reason = reason unless reason == SKIP
end

Instance Attribute Details

#actionString

TODO: Write general description for this method

Returns:

  • (String)


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

def action
  @action
end

#idUUID | String

Unique ID of the object instance in the Mist Organization

Returns:

  • (UUID | String)


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

def id
  @id
end

#map_idUUID | String

Unique ID of the object instance in the Mist Organization

Returns:

  • (UUID | String)


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

def map_id
  @map_id
end

#nameString

Unique ID of the object instance in the Mist Organization

Returns:

  • (String)


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

def name
  @name
end

#reasonString

Unique ID of the object instance in the Mist Organization

Returns:

  • (String)


30
31
32
# File 'lib/mist_api/models/response_map_import_floorplan.rb', line 30

def reason
  @reason
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/mist_api/models/response_map_import_floorplan.rb', line 65

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  action = hash.key?('action') ? hash['action'] : nil
  id = hash.key?('id') ? hash['id'] : nil
  map_id = hash.key?('map_id') ? hash['map_id'] : nil
  name = hash.key?('name') ? hash['name'] : nil
  reason = hash.key?('reason') ? hash['reason'] : SKIP

  # Create object from extracted values.
  ResponseMapImportFloorplan.new(action,
                                 id,
                                 map_id,
                                 name,
                                 reason)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['action'] = 'action'
  @_hash['id'] = 'id'
  @_hash['map_id'] = 'map_id'
  @_hash['name'] = 'name'
  @_hash['reason'] = 'reason'
  @_hash
end

.nullablesObject

An array for nullable fields



51
52
53
# File 'lib/mist_api/models/response_map_import_floorplan.rb', line 51

def self.nullables
  []
end

.optionalsObject

An array for optional fields



44
45
46
47
48
# File 'lib/mist_api/models/response_map_import_floorplan.rb', line 44

def self.optionals
  %w[
    reason
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



91
92
93
94
95
# File 'lib/mist_api/models/response_map_import_floorplan.rb', line 91

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} action: #{@action.inspect}, id: #{@id.inspect}, map_id: #{@map_id.inspect},"\
  " name: #{@name.inspect}, reason: #{@reason.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



84
85
86
87
88
# File 'lib/mist_api/models/response_map_import_floorplan.rb', line 84

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} action: #{@action}, id: #{@id}, map_id: #{@map_id}, name: #{@name}, reason:"\
  " #{@reason}>"
end