Class: MistApi::DeviceOther

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

Overview

DeviceOther 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(created_time = SKIP, device_mac = SKIP, id = SKIP, mac = SKIP, model = SKIP, modified_time = SKIP, name = SKIP, org_id = SKIP, serial = SKIP, site_id = SKIP, state = SKIP, vendor = SKIP, vendor_api_id = SKIP) ⇒ DeviceOther

Returns a new instance of DeviceOther.



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/mist_api/models/device_other.rb', line 107

def initialize(created_time = SKIP, device_mac = SKIP, id = SKIP,
               mac = SKIP, model = SKIP, modified_time = SKIP, name = SKIP,
               org_id = SKIP, serial = SKIP, site_id = SKIP, state = SKIP,
               vendor = SKIP, vendor_api_id = SKIP)
  @created_time = created_time unless created_time == SKIP
  @device_mac = device_mac unless device_mac == SKIP
  @id = id unless id == SKIP
  @mac = mac unless mac == SKIP
  @model = model unless model == SKIP
  @modified_time = modified_time unless modified_time == SKIP
  @name = name unless name == SKIP
  @org_id = org_id unless org_id == SKIP
  @serial = serial unless serial == SKIP
  @site_id = site_id unless site_id == SKIP
  @state = state unless state == SKIP
  @vendor = vendor unless vendor == SKIP
  @vendor_api_id = vendor_api_id unless vendor_api_id == SKIP
end

Instance Attribute Details

#created_timeFloat

When the object has been created, in epoch

Returns:

  • (Float)


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

def created_time
  @created_time
end

#device_macString

When the object has been created, in epoch

Returns:

  • (String)


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

def device_mac
  @device_mac
end

#idUUID | String

Unique ID of the object instance in the Mist Organization

Returns:

  • (UUID | String)


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

def id
  @id
end

#macString

Unique ID of the object instance in the Mist Organization

Returns:

  • (String)


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

def mac
  @mac
end

#modelString

Unique ID of the object instance in the Mist Organization

Returns:

  • (String)


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

def model
  @model
end

#modified_timeFloat

When the object has been modified for the last time, in epoch

Returns:

  • (Float)


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

def modified_time
  @modified_time
end

#nameString

When the object has been modified for the last time, in epoch

Returns:

  • (String)


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

def name
  @name
end

#org_idUUID | String

When the object has been modified for the last time, in epoch

Returns:

  • (UUID | String)


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

def org_id
  @org_id
end

#serialString

When the object has been modified for the last time, in epoch

Returns:

  • (String)


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

def serial
  @serial
end

#site_idUUID | String

When the object has been modified for the last time, in epoch

Returns:

  • (UUID | String)


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

def site_id
  @site_id
end

#stateString

When the object has been modified for the last time, in epoch

Returns:

  • (String)


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

def state
  @state
end

#vendorString

When the object has been modified for the last time, in epoch

Returns:

  • (String)


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

def vendor
  @vendor
end

#vendor_api_idString

When the object has been modified for the last time, in epoch

Returns:

  • (String)


62
63
64
# File 'lib/mist_api/models/device_other.rb', line 62

def vendor_api_id
  @vendor_api_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
# File 'lib/mist_api/models/device_other.rb', line 127

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  created_time = hash.key?('created_time') ? hash['created_time'] : SKIP
  device_mac = hash.key?('device_mac') ? hash['device_mac'] : SKIP
  id = hash.key?('id') ? hash['id'] : SKIP
  mac = hash.key?('mac') ? hash['mac'] : SKIP
  model = hash.key?('model') ? hash['model'] : SKIP
  modified_time = hash.key?('modified_time') ? hash['modified_time'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  org_id = hash.key?('org_id') ? hash['org_id'] : SKIP
  serial = hash.key?('serial') ? hash['serial'] : SKIP
  site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
  state = hash.key?('state') ? hash['state'] : SKIP
  vendor = hash.key?('vendor') ? hash['vendor'] : SKIP
  vendor_api_id = hash.key?('vendor_api_id') ? hash['vendor_api_id'] : SKIP

  # Create object from extracted values.
  DeviceOther.new(created_time,
                  device_mac,
                  id,
                  mac,
                  model,
                  modified_time,
                  name,
                  org_id,
                  serial,
                  site_id,
                  state,
                  vendor,
                  vendor_api_id)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['created_time'] = 'created_time'
  @_hash['device_mac'] = 'device_mac'
  @_hash['id'] = 'id'
  @_hash['mac'] = 'mac'
  @_hash['model'] = 'model'
  @_hash['modified_time'] = 'modified_time'
  @_hash['name'] = 'name'
  @_hash['org_id'] = 'org_id'
  @_hash['serial'] = 'serial'
  @_hash['site_id'] = 'site_id'
  @_hash['state'] = 'state'
  @_hash['vendor'] = 'vendor'
  @_hash['vendor_api_id'] = 'vendor_api_id'
  @_hash
end

.nullablesObject

An array for nullable fields



103
104
105
# File 'lib/mist_api/models/device_other.rb', line 103

def self.nullables
  []
end

.optionalsObject

An array for optional fields



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/mist_api/models/device_other.rb', line 84

def self.optionals
  %w[
    created_time
    device_mac
    id
    mac
    model
    modified_time
    name
    org_id
    serial
    site_id
    state
    vendor
    vendor_api_id
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



171
172
173
174
175
176
177
178
# File 'lib/mist_api/models/device_other.rb', line 171

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} created_time: #{@created_time.inspect}, device_mac: #{@device_mac.inspect},"\
  " id: #{@id.inspect}, mac: #{@mac.inspect}, model: #{@model.inspect}, modified_time:"\
  " #{@modified_time.inspect}, name: #{@name.inspect}, org_id: #{@org_id.inspect}, serial:"\
  " #{@serial.inspect}, site_id: #{@site_id.inspect}, state: #{@state.inspect}, vendor:"\
  " #{@vendor.inspect}, vendor_api_id: #{@vendor_api_id.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



162
163
164
165
166
167
168
# File 'lib/mist_api/models/device_other.rb', line 162

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} created_time: #{@created_time}, device_mac: #{@device_mac}, id: #{@id},"\
  " mac: #{@mac}, model: #{@model}, modified_time: #{@modified_time}, name: #{@name}, org_id:"\
  " #{@org_id}, serial: #{@serial}, site_id: #{@site_id}, state: #{@state}, vendor:"\
  " #{@vendor}, vendor_api_id: #{@vendor_api_id}>"
end