Class: MistApi::Fingerprint

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

Overview

Fingerprint 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(family = SKIP, mac = SKIP, mfg = SKIP, model = SKIP, org_id = SKIP, os = SKIP, os_type = SKIP, random_mac = SKIP, site_id = SKIP, timestamp = SKIP) ⇒ Fingerprint

Returns a new instance of Fingerprint.



89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/mist_api/models/fingerprint.rb', line 89

def initialize(family = SKIP, mac = SKIP, mfg = SKIP, model = SKIP,
               org_id = SKIP, os = SKIP, os_type = SKIP, random_mac = SKIP,
               site_id = SKIP, timestamp = SKIP)
  @family = family unless family == SKIP
  @mac = mac unless mac == SKIP
  @mfg = mfg unless mfg == SKIP
  @model = model unless model == SKIP
  @org_id = org_id unless org_id == SKIP
  @os = os unless os == SKIP
  @os_type = os_type unless os_type == SKIP
  @random_mac = random_mac unless random_mac == SKIP
  @site_id = site_id unless site_id == SKIP
  @timestamp = timestamp unless timestamp == SKIP
end

Instance Attribute Details

#familyString

TODO: Write general description for this method

Returns:

  • (String)


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

def family
  @family
end

#macString

TODO: Write general description for this method

Returns:

  • (String)


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

def mac
  @mac
end

#mfgString

TODO: Write general description for this method

Returns:

  • (String)


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

def mfg
  @mfg
end

#modelString

TODO: Write general description for this method

Returns:

  • (String)


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

def model
  @model
end

#org_idUUID | String

TODO: Write general description for this method

Returns:

  • (UUID | String)


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

def org_id
  @org_id
end

#osString

TODO: Write general description for this method

Returns:

  • (String)


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

def os
  @os
end

#os_typeString

TODO: Write general description for this method

Returns:

  • (String)


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

def os_type
  @os_type
end

#random_macTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def random_mac
  @random_mac
end

#site_idUUID | String

TODO: Write general description for this method

Returns:

  • (UUID | String)


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

def site_id
  @site_id
end

#timestampFloat

Epoch (seconds)

Returns:

  • (Float)


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

def timestamp
  @timestamp
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/mist_api/models/fingerprint.rb', line 105

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  family = hash.key?('family') ? hash['family'] : SKIP
  mac = hash.key?('mac') ? hash['mac'] : SKIP
  mfg = hash.key?('mfg') ? hash['mfg'] : SKIP
  model = hash.key?('model') ? hash['model'] : SKIP
  org_id = hash.key?('org_id') ? hash['org_id'] : SKIP
  os = hash.key?('os') ? hash['os'] : SKIP
  os_type = hash.key?('os_type') ? hash['os_type'] : SKIP
  random_mac = hash.key?('random_mac') ? hash['random_mac'] : SKIP
  site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
  timestamp = hash.key?('timestamp') ? hash['timestamp'] : SKIP

  # Create object from extracted values.
  Fingerprint.new(family,
                  mac,
                  mfg,
                  model,
                  org_id,
                  os,
                  os_type,
                  random_mac,
                  site_id,
                  timestamp)
end

.namesObject

A mapping from model property names to API property names.



53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/mist_api/models/fingerprint.rb', line 53

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['family'] = 'family'
  @_hash['mac'] = 'mac'
  @_hash['mfg'] = 'mfg'
  @_hash['model'] = 'model'
  @_hash['org_id'] = 'org_id'
  @_hash['os'] = 'os'
  @_hash['os_type'] = 'os_type'
  @_hash['random_mac'] = 'random_mac'
  @_hash['site_id'] = 'site_id'
  @_hash['timestamp'] = 'timestamp'
  @_hash
end

.nullablesObject

An array for nullable fields



85
86
87
# File 'lib/mist_api/models/fingerprint.rb', line 85

def self.nullables
  []
end

.optionalsObject

An array for optional fields



69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/mist_api/models/fingerprint.rb', line 69

def self.optionals
  %w[
    family
    mac
    mfg
    model
    org_id
    os
    os_type
    random_mac
    site_id
    timestamp
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



142
143
144
145
146
147
148
# File 'lib/mist_api/models/fingerprint.rb', line 142

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} family: #{@family.inspect}, mac: #{@mac.inspect}, mfg: #{@mfg.inspect},"\
  " model: #{@model.inspect}, org_id: #{@org_id.inspect}, os: #{@os.inspect}, os_type:"\
  " #{@os_type.inspect}, random_mac: #{@random_mac.inspect}, site_id: #{@site_id.inspect},"\
  " timestamp: #{@timestamp.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



134
135
136
137
138
139
# File 'lib/mist_api/models/fingerprint.rb', line 134

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} family: #{@family}, mac: #{@mac}, mfg: #{@mfg}, model: #{@model}, org_id:"\
  " #{@org_id}, os: #{@os}, os_type: #{@os_type}, random_mac: #{@random_mac}, site_id:"\
  " #{@site_id}, timestamp: #{@timestamp}>"
end