Class: MistApi::StatsApEslStat

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

Overview

StatsApEslStat 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(channel = SKIP, connected = SKIP, ip = SKIP, mac = SKIP, product_id = SKIP, type = SKIP, up = SKIP, vendor_id = SKIP) ⇒ StatsApEslStat

Returns a new instance of StatsApEslStat.



86
87
88
89
90
91
92
93
94
95
96
# File 'lib/mist_api/models/stats_ap_esl_stat.rb', line 86

def initialize(channel = SKIP, connected = SKIP, ip = SKIP, mac = SKIP,
               product_id = SKIP, type = SKIP, up = SKIP, vendor_id = SKIP)
  @channel = channel unless channel == SKIP
  @connected = connected unless connected == SKIP
  @ip = ip unless ip == SKIP
  @mac = mac unless mac == SKIP
  @product_id = product_id unless product_id == SKIP
  @type = type unless type == SKIP
  @up = up unless up == SKIP
  @vendor_id = vendor_id unless vendor_id == SKIP
end

Instance Attribute Details

#channelInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def channel
  @channel
end

#connectedTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def connected
  @connected
end

#ipString

IP address of Hanshow and SoluM dongles

Returns:

  • (String)


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

def ip
  @ip
end

#macString

MAC address of Hanshow and SoluM dongles

Returns:

  • (String)


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

def mac
  @mac
end

#product_idString

Product ID of Hanshow and SoluM dongles

Returns:

  • (String)


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

def product_id
  @product_id
end

#typeString

Product ID of Hanshow and SoluM dongles

Returns:

  • (String)


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

def type
  @type
end

#upTrueClass | FalseClass

Product ID of Hanshow and SoluM dongles

Returns:

  • (TrueClass | FalseClass)


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

def up
  @up
end

#vendor_idString

Vendor ID of Hanshow and SoluM dongles

Returns:

  • (String)


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

def vendor_id
  @vendor_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/mist_api/models/stats_ap_esl_stat.rb', line 99

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  channel = hash.key?('channel') ? hash['channel'] : SKIP
  connected = hash.key?('connected') ? hash['connected'] : SKIP
  ip = hash.key?('ip') ? hash['ip'] : SKIP
  mac = hash.key?('mac') ? hash['mac'] : SKIP
  product_id = hash.key?('product_id') ? hash['product_id'] : SKIP
  type = hash.key?('type') ? hash['type'] : SKIP
  up = hash.key?('up') ? hash['up'] : SKIP
  vendor_id = hash.key?('vendor_id') ? hash['vendor_id'] : SKIP

  # Create object from extracted values.
  StatsApEslStat.new(channel,
                     connected,
                     ip,
                     mac,
                     product_id,
                     type,
                     up,
                     vendor_id)
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/stats_ap_esl_stat.rb', line 45

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['channel'] = 'channel'
  @_hash['connected'] = 'connected'
  @_hash['ip'] = 'ip'
  @_hash['mac'] = 'mac'
  @_hash['product_id'] = 'product_id'
  @_hash['type'] = 'type'
  @_hash['up'] = 'up'
  @_hash['vendor_id'] = 'vendor_id'
  @_hash
end

.nullablesObject

An array for nullable fields



73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/mist_api/models/stats_ap_esl_stat.rb', line 73

def self.nullables
  %w[
    channel
    connected
    ip
    mac
    product_id
    type
    up
    vendor_id
  ]
end

.optionalsObject

An array for optional fields



59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/mist_api/models/stats_ap_esl_stat.rb', line 59

def self.optionals
  %w[
    channel
    connected
    ip
    mac
    product_id
    type
    up
    vendor_id
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



131
132
133
134
135
136
# File 'lib/mist_api/models/stats_ap_esl_stat.rb', line 131

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} channel: #{@channel.inspect}, connected: #{@connected.inspect}, ip:"\
  " #{@ip.inspect}, mac: #{@mac.inspect}, product_id: #{@product_id.inspect}, type:"\
  " #{@type.inspect}, up: #{@up.inspect}, vendor_id: #{@vendor_id.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



124
125
126
127
128
# File 'lib/mist_api/models/stats_ap_esl_stat.rb', line 124

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} channel: #{@channel}, connected: #{@connected}, ip: #{@ip}, mac: #{@mac},"\
  " product_id: #{@product_id}, type: #{@type}, up: #{@up}, vendor_id: #{@vendor_id}>"
end