Class: MistApi::EventFastroam

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

Overview

EventFastroam 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(ap_mac = nil, client_mac = nil, fromap = nil, latency = nil, ssid = nil, timestamp = nil, subtype = SKIP, type = SKIP) ⇒ EventFastroam

Returns a new instance of EventFastroam.



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

def initialize(ap_mac = nil, client_mac = nil, fromap = nil, latency = nil,
               ssid = nil, timestamp = nil, subtype = SKIP, type = SKIP)
  @ap_mac = ap_mac
  @client_mac = client_mac
  @fromap = fromap
  @latency = latency
  @ssid = ssid
  @subtype = subtype unless subtype == SKIP
  @timestamp = timestamp
  @type = type unless type == SKIP
end

Instance Attribute Details

#ap_macString

TODO: Write general description for this method

Returns:

  • (String)


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

def ap_mac
  @ap_mac
end

#client_macString

TODO: Write general description for this method

Returns:

  • (String)


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

def client_mac
  @client_mac
end

#fromapString

TODO: Write general description for this method

Returns:

  • (String)


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

def fromap
  @fromap
end

#latencyFloat

TODO: Write general description for this method

Returns:

  • (Float)


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

def latency
  @latency
end

#ssidString

TODO: Write general description for this method

Returns:

  • (String)


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

def ssid
  @ssid
end

#subtypeString

TODO: Write general description for this method

Returns:

  • (String)


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

def subtype
  @subtype
end

#timestampFloat

Epoch (seconds)

Returns:

  • (Float)


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

def timestamp
  @timestamp
end

#typeEventFastroamTypeEnum

enum: ‘fail`, `none`, `pingpong`, `poor`, `slow`, `success`



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

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/mist_api/models/event_fastroam.rb', line 84

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  ap_mac = hash.key?('ap_mac') ? hash['ap_mac'] : nil
  client_mac = hash.key?('client_mac') ? hash['client_mac'] : nil
  fromap = hash.key?('fromap') ? hash['fromap'] : nil
  latency = hash.key?('latency') ? hash['latency'] : nil
  ssid = hash.key?('ssid') ? hash['ssid'] : nil
  timestamp = hash.key?('timestamp') ? hash['timestamp'] : nil
  subtype = hash.key?('subtype') ? hash['subtype'] : SKIP
  type = hash.key?('type') ? hash['type'] : SKIP

  # Create object from extracted values.
  EventFastroam.new(ap_mac,
                    client_mac,
                    fromap,
                    latency,
                    ssid,
                    timestamp,
                    subtype,
                    type)
end

.namesObject

A mapping from model property names to API property names.



45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/mist_api/models/event_fastroam.rb', line 45

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['ap_mac'] = 'ap_mac'
  @_hash['client_mac'] = 'client_mac'
  @_hash['fromap'] = 'fromap'
  @_hash['latency'] = 'latency'
  @_hash['ssid'] = 'ssid'
  @_hash['subtype'] = 'subtype'
  @_hash['timestamp'] = 'timestamp'
  @_hash['type'] = 'type'
  @_hash
end

.nullablesObject

An array for nullable fields



67
68
69
# File 'lib/mist_api/models/event_fastroam.rb', line 67

def self.nullables
  []
end

.optionalsObject

An array for optional fields



59
60
61
62
63
64
# File 'lib/mist_api/models/event_fastroam.rb', line 59

def self.optionals
  %w[
    subtype
    type
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



117
118
119
120
121
122
# File 'lib/mist_api/models/event_fastroam.rb', line 117

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} ap_mac: #{@ap_mac.inspect}, client_mac: #{@client_mac.inspect}, fromap:"\
  " #{@fromap.inspect}, latency: #{@latency.inspect}, ssid: #{@ssid.inspect}, subtype:"\
  " #{@subtype.inspect}, timestamp: #{@timestamp.inspect}, type: #{@type.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



109
110
111
112
113
114
# File 'lib/mist_api/models/event_fastroam.rb', line 109

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} ap_mac: #{@ap_mac}, client_mac: #{@client_mac}, fromap: #{@fromap},"\
  " latency: #{@latency}, ssid: #{@ssid}, subtype: #{@subtype}, timestamp: #{@timestamp},"\
  " type: #{@type}>"
end