Class: MistApi::Fingerprint
- Defined in:
- lib/mist_api/models/fingerprint.rb
Overview
Fingerprint Model.
Instance Attribute Summary collapse
-
#family ⇒ String
TODO: Write general description for this method.
-
#mac ⇒ String
TODO: Write general description for this method.
-
#mfg ⇒ String
TODO: Write general description for this method.
-
#model ⇒ String
TODO: Write general description for this method.
-
#org_id ⇒ UUID | String
TODO: Write general description for this method.
-
#os ⇒ String
TODO: Write general description for this method.
-
#os_type ⇒ String
TODO: Write general description for this method.
-
#random_mac ⇒ TrueClass | FalseClass
TODO: Write general description for this method.
-
#site_id ⇒ UUID | String
TODO: Write general description for this method.
-
#timestamp ⇒ Float
Epoch (seconds).
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#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
constructor
A new instance of Fingerprint.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
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, = 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 = unless == SKIP end |
Instance Attribute Details
#family ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/mist_api/models/fingerprint.rb', line 14 def family @family end |
#mac ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/mist_api/models/fingerprint.rb', line 18 def mac @mac end |
#mfg ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/mist_api/models/fingerprint.rb', line 22 def mfg @mfg end |
#model ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/mist_api/models/fingerprint.rb', line 26 def model @model end |
#org_id ⇒ UUID | String
TODO: Write general description for this method
30 31 32 |
# File 'lib/mist_api/models/fingerprint.rb', line 30 def org_id @org_id end |
#os ⇒ String
TODO: Write general description for this method
34 35 36 |
# File 'lib/mist_api/models/fingerprint.rb', line 34 def os @os end |
#os_type ⇒ String
TODO: Write general description for this method
38 39 40 |
# File 'lib/mist_api/models/fingerprint.rb', line 38 def os_type @os_type end |
#random_mac ⇒ TrueClass | FalseClass
TODO: Write general description for this method
42 43 44 |
# File 'lib/mist_api/models/fingerprint.rb', line 42 def random_mac @random_mac end |
#site_id ⇒ UUID | String
TODO: Write general description for this method
46 47 48 |
# File 'lib/mist_api/models/fingerprint.rb', line 46 def site_id @site_id end |
#timestamp ⇒ Float
Epoch (seconds)
50 51 52 |
# File 'lib/mist_api/models/fingerprint.rb', line 50 def @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 = 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, ) end |
.names ⇒ Object
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 |
.nullables ⇒ Object
An array for nullable fields
85 86 87 |
# File 'lib/mist_api/models/fingerprint.rb', line 85 def self.nullables [] end |
.optionals ⇒ Object
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
#inspect ⇒ Object
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_s ⇒ Object
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 |