Class: MistApi::ResponseMspInventoryDevice

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

Overview

ResponseMspInventoryDevice 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(mac = nil, model = nil, org_id = nil, serial = nil, site_id = nil, type = nil, for_site = SKIP) ⇒ ResponseMspInventoryDevice

Returns a new instance of ResponseMspInventoryDevice.



65
66
67
68
69
70
71
72
73
74
# File 'lib/mist_api/models/response_msp_inventory_device.rb', line 65

def initialize(mac = nil, model = nil, org_id = nil, serial = nil,
               site_id = nil, type = nil, for_site = SKIP)
  @for_site = for_site unless for_site == SKIP
  @mac = mac
  @model = model
  @org_id = org_id
  @serial = serial
  @site_id = site_id
  @type = type
end

Instance Attribute Details

#for_siteTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def for_site
  @for_site
end

#macString

TODO: Write general description for this method

Returns:

  • (String)


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

def mac
  @mac
end

#modelString

TODO: Write general description for this method

Returns:

  • (String)


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

def model
  @model
end

#org_idUUID | String

TODO: Write general description for this method

Returns:

  • (UUID | String)


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

def org_id
  @org_id
end

#serialString

TODO: Write general description for this method

Returns:

  • (String)


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

def serial
  @serial
end

#site_idUUID | String

TODO: Write general description for this method

Returns:

  • (UUID | String)


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

def site_id
  @site_id
end

#typeString

TODO: Write general description for this method

Returns:

  • (String)


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

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/mist_api/models/response_msp_inventory_device.rb', line 77

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  mac = hash.key?('mac') ? hash['mac'] : nil
  model = hash.key?('model') ? hash['model'] : nil
  org_id = hash.key?('org_id') ? hash['org_id'] : nil
  serial = hash.key?('serial') ? hash['serial'] : nil
  site_id = hash.key?('site_id') ? hash['site_id'] : nil
  type = hash.key?('type') ? hash['type'] : nil
  for_site = hash.key?('for_site') ? hash['for_site'] : SKIP

  # Create object from extracted values.
  ResponseMspInventoryDevice.new(mac,
                                 model,
                                 org_id,
                                 serial,
                                 site_id,
                                 type,
                                 for_site)
end

.namesObject

A mapping from model property names to API property names.



41
42
43
44
45
46
47
48
49
50
51
# File 'lib/mist_api/models/response_msp_inventory_device.rb', line 41

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['for_site'] = 'for_site'
  @_hash['mac'] = 'mac'
  @_hash['model'] = 'model'
  @_hash['org_id'] = 'org_id'
  @_hash['serial'] = 'serial'
  @_hash['site_id'] = 'site_id'
  @_hash['type'] = 'type'
  @_hash
end

.nullablesObject

An array for nullable fields



61
62
63
# File 'lib/mist_api/models/response_msp_inventory_device.rb', line 61

def self.nullables
  []
end

.optionalsObject

An array for optional fields



54
55
56
57
58
# File 'lib/mist_api/models/response_msp_inventory_device.rb', line 54

def self.optionals
  %w[
    for_site
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



107
108
109
110
111
112
# File 'lib/mist_api/models/response_msp_inventory_device.rb', line 107

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} for_site: #{@for_site.inspect}, mac: #{@mac.inspect}, model:"\
  " #{@model.inspect}, org_id: #{@org_id.inspect}, serial: #{@serial.inspect}, site_id:"\
  " #{@site_id.inspect}, type: #{@type.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



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

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} for_site: #{@for_site}, mac: #{@mac}, model: #{@model}, org_id: #{@org_id},"\
  " serial: #{@serial}, site_id: #{@site_id}, type: #{@type}>"
end