Class: MistApi::InstallerProvisionDevice

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

Overview

Provision Device

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(name = nil, deviceprofile_name = SKIP, for_site = SKIP, height = SKIP, map_id = SKIP, orientation = SKIP, replacing_mac = SKIP, role = SKIP, site_id = SKIP, site_name = SKIP, x = SKIP, y = SKIP, additional_properties = nil) ⇒ InstallerProvisionDevice

Returns a new instance of InstallerProvisionDevice.



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/mist_api/models/installer_provision_device.rb', line 100

def initialize(name = nil, deviceprofile_name = SKIP, for_site = SKIP,
               height = SKIP, map_id = SKIP, orientation = SKIP,
               replacing_mac = SKIP, role = SKIP, site_id = SKIP,
               site_name = SKIP, x = SKIP, y = SKIP,
               additional_properties = nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @deviceprofile_name = deviceprofile_name unless deviceprofile_name == SKIP
  @for_site = for_site unless for_site == SKIP
  @height = height unless height == SKIP
  @map_id = map_id unless map_id == SKIP
  @name = name
  @orientation = orientation unless orientation == SKIP
  @replacing_mac = replacing_mac unless replacing_mac == SKIP
  @role = role unless role == SKIP
  @site_id = site_id unless site_id == SKIP
  @site_name = site_name unless site_name == SKIP
  @x = x unless x == SKIP
  @y = y unless y == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#deviceprofile_nameString

TODO: Write general description for this method

Returns:

  • (String)


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

def deviceprofile_name
  @deviceprofile_name
end

#for_siteTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def for_site
  @for_site
end

#heightFloat

TODO: Write general description for this method

Returns:

  • (Float)


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

def height
  @height
end

#map_idUUID | String

TODO: Write general description for this method

Returns:

  • (UUID | String)


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

def map_id
  @map_id
end

#nameString

TODO: Write general description for this method

Returns:

  • (String)


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

def name
  @name
end

#orientationInteger

TODO: Write general description for this method

Returns:

  • (Integer)


34
35
36
# File 'lib/mist_api/models/installer_provision_device.rb', line 34

def orientation
  @orientation
end

#replacing_macString

Onlif this is to replace an existing device

Returns:

  • (String)


38
39
40
# File 'lib/mist_api/models/installer_provision_device.rb', line 38

def replacing_mac
  @replacing_mac
end

#roleString

Optional role for switch / gateway

Returns:

  • (String)


42
43
44
# File 'lib/mist_api/models/installer_provision_device.rb', line 42

def role
  @role
end

#site_idUUID | String

Optional role for switch / gateway

Returns:

  • (UUID | String)


46
47
48
# File 'lib/mist_api/models/installer_provision_device.rb', line 46

def site_id
  @site_id
end

#site_nameString

Optional role for switch / gateway

Returns:

  • (String)


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

def site_name
  @site_name
end

#xFloat

Optional role for switch / gateway

Returns:

  • (Float)


54
55
56
# File 'lib/mist_api/models/installer_provision_device.rb', line 54

def x
  @x
end

#yFloat

Optional role for switch / gateway

Returns:

  • (Float)


58
59
60
# File 'lib/mist_api/models/installer_provision_device.rb', line 58

def y
  @y
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/mist_api/models/installer_provision_device.rb', line 124

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  name = hash.key?('name') ? hash['name'] : nil
  deviceprofile_name =
    hash.key?('deviceprofile_name') ? hash['deviceprofile_name'] : SKIP
  for_site = hash.key?('for_site') ? hash['for_site'] : SKIP
  height = hash.key?('height') ? hash['height'] : SKIP
  map_id = hash.key?('map_id') ? hash['map_id'] : SKIP
  orientation = hash.key?('orientation') ? hash['orientation'] : SKIP
  replacing_mac = hash.key?('replacing_mac') ? hash['replacing_mac'] : SKIP
  role = hash.key?('role') ? hash['role'] : SKIP
  site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
  site_name = hash.key?('site_name') ? hash['site_name'] : SKIP
  x = hash.key?('x') ? hash['x'] : SKIP
  y = hash.key?('y') ? hash['y'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  InstallerProvisionDevice.new(name,
                               deviceprofile_name,
                               for_site,
                               height,
                               map_id,
                               orientation,
                               replacing_mac,
                               role,
                               site_id,
                               site_name,
                               x,
                               y,
                               additional_properties)
end

.namesObject

A mapping from model property names to API property names.



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/mist_api/models/installer_provision_device.rb', line 61

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['deviceprofile_name'] = 'deviceprofile_name'
  @_hash['for_site'] = 'for_site'
  @_hash['height'] = 'height'
  @_hash['map_id'] = 'map_id'
  @_hash['name'] = 'name'
  @_hash['orientation'] = 'orientation'
  @_hash['replacing_mac'] = 'replacing_mac'
  @_hash['role'] = 'role'
  @_hash['site_id'] = 'site_id'
  @_hash['site_name'] = 'site_name'
  @_hash['x'] = 'x'
  @_hash['y'] = 'y'
  @_hash
end

.nullablesObject

An array for nullable fields



96
97
98
# File 'lib/mist_api/models/installer_provision_device.rb', line 96

def self.nullables
  []
end

.optionalsObject

An array for optional fields



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/mist_api/models/installer_provision_device.rb', line 79

def self.optionals
  %w[
    deviceprofile_name
    for_site
    height
    map_id
    orientation
    replacing_mac
    role
    site_id
    site_name
    x
    y
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



175
176
177
178
179
180
181
182
183
# File 'lib/mist_api/models/installer_provision_device.rb', line 175

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} deviceprofile_name: #{@deviceprofile_name.inspect}, for_site:"\
  " #{@for_site.inspect}, height: #{@height.inspect}, map_id: #{@map_id.inspect}, name:"\
  " #{@name.inspect}, orientation: #{@orientation.inspect}, replacing_mac:"\
  " #{@replacing_mac.inspect}, role: #{@role.inspect}, site_id: #{@site_id.inspect},"\
  " site_name: #{@site_name.inspect}, x: #{@x.inspect}, y: #{@y.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



166
167
168
169
170
171
172
# File 'lib/mist_api/models/installer_provision_device.rb', line 166

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} deviceprofile_name: #{@deviceprofile_name}, for_site: #{@for_site}, height:"\
  " #{@height}, map_id: #{@map_id}, name: #{@name}, orientation: #{@orientation},"\
  " replacing_mac: #{@replacing_mac}, role: #{@role}, site_id: #{@site_id}, site_name:"\
  " #{@site_name}, x: #{@x}, y: #{@y}, additional_properties: #{@additional_properties}>"
end