Class: MistApi::EventsRogue

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

Overview

Rogue events

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(ap = nil, bssid = nil, channel = nil, rssi = nil, ssid = nil, timestamp = nil) ⇒ EventsRogue

Returns a new instance of EventsRogue.



58
59
60
61
62
63
64
65
66
# File 'lib/mist_api/models/events_rogue.rb', line 58

def initialize(ap = nil, bssid = nil, channel = nil, rssi = nil, ssid = nil,
               timestamp = nil)
  @ap = ap
  @bssid = bssid
  @channel = channel
  @rssi = rssi
  @ssid = ssid
  @timestamp = timestamp
end

Instance Attribute Details

#apString

TODO: Write general description for this method

Returns:

  • (String)


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

def ap
  @ap
end

#bssidString

TODO: Write general description for this method

Returns:

  • (String)


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

def bssid
  @bssid
end

#channelInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def channel
  @channel
end

#rssiInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def rssi
  @rssi
end

#ssidString

TODO: Write general description for this method

Returns:

  • (String)


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

def ssid
  @ssid
end

#timestampFloat

Epoch (seconds)

Returns:

  • (Float)


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

def timestamp
  @timestamp
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/mist_api/models/events_rogue.rb', line 69

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  ap = hash.key?('ap') ? hash['ap'] : nil
  bssid = hash.key?('bssid') ? hash['bssid'] : nil
  channel = hash.key?('channel') ? hash['channel'] : nil
  rssi = hash.key?('rssi') ? hash['rssi'] : nil
  ssid = hash.key?('ssid') ? hash['ssid'] : nil
  timestamp = hash.key?('timestamp') ? hash['timestamp'] : nil

  # Create object from extracted values.
  EventsRogue.new(ap,
                  bssid,
                  channel,
                  rssi,
                  ssid,
                  timestamp)
end

.namesObject

A mapping from model property names to API property names.



37
38
39
40
41
42
43
44
45
46
# File 'lib/mist_api/models/events_rogue.rb', line 37

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['ap'] = 'ap'
  @_hash['bssid'] = 'bssid'
  @_hash['channel'] = 'channel'
  @_hash['rssi'] = 'rssi'
  @_hash['ssid'] = 'ssid'
  @_hash['timestamp'] = 'timestamp'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



49
50
51
# File 'lib/mist_api/models/events_rogue.rb', line 49

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



97
98
99
100
101
# File 'lib/mist_api/models/events_rogue.rb', line 97

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} ap: #{@ap.inspect}, bssid: #{@bssid.inspect}, channel: #{@channel.inspect},"\
  " rssi: #{@rssi.inspect}, ssid: #{@ssid.inspect}, timestamp: #{@timestamp.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



90
91
92
93
94
# File 'lib/mist_api/models/events_rogue.rb', line 90

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} ap: #{@ap}, bssid: #{@bssid}, channel: #{@channel}, rssi: #{@rssi}, ssid:"\
  " #{@ssid}, timestamp: #{@timestamp}>"
end