Class: MistApi::StatsApPortStat

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

Overview

StatsApPortStat 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(full_duplex = SKIP, rx_bytes = SKIP, rx_errors = SKIP, rx_peak_bps = SKIP, rx_pkts = SKIP, speed = SKIP, tx_bytes = SKIP, tx_peak_bps = SKIP, tx_pkts = SKIP, up = SKIP) ⇒ StatsApPortStat

Returns a new instance of StatsApPortStat.



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/mist_api/models/stats_ap_port_stat.rb', line 100

def initialize(full_duplex = SKIP, rx_bytes = SKIP, rx_errors = SKIP,
               rx_peak_bps = SKIP, rx_pkts = SKIP, speed = SKIP,
               tx_bytes = SKIP, tx_peak_bps = SKIP, tx_pkts = SKIP,
               up = SKIP)
  @full_duplex = full_duplex unless full_duplex == SKIP
  @rx_bytes = rx_bytes unless rx_bytes == SKIP
  @rx_errors = rx_errors unless rx_errors == SKIP
  @rx_peak_bps = rx_peak_bps unless rx_peak_bps == SKIP
  @rx_pkts = rx_pkts unless rx_pkts == SKIP
  @speed = speed unless speed == SKIP
  @tx_bytes = tx_bytes unless tx_bytes == SKIP
  @tx_peak_bps = tx_peak_bps unless tx_peak_bps == SKIP
  @tx_pkts = tx_pkts unless tx_pkts == SKIP
  @up = up unless up == SKIP
end

Instance Attribute Details

#full_duplexTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def full_duplex
  @full_duplex
end

#rx_bytesInteger

Amount of traffic received since connection

Returns:

  • (Integer)


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

def rx_bytes
  @rx_bytes
end

#rx_errorsInteger

Amount of traffic received since connection

Returns:

  • (Integer)


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

def rx_errors
  @rx_errors
end

#rx_peak_bpsInteger

Amount of traffic received since connection

Returns:

  • (Integer)


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

def rx_peak_bps
  @rx_peak_bps
end

#rx_pktsInteger

Amount of packets received since connection

Returns:

  • (Integer)


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

def rx_pkts
  @rx_pkts
end

#speedInteger

Amount of packets received since connection

Returns:

  • (Integer)


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

def speed
  @speed
end

#tx_bytesInteger

Amount of traffic sent since connection

Returns:

  • (Integer)


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

def tx_bytes
  @tx_bytes
end

#tx_peak_bpsInteger

Amount of traffic sent since connection

Returns:

  • (Integer)


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

def tx_peak_bps
  @tx_peak_bps
end

#tx_pktsInteger

Amount of packets sent since connection

Returns:

  • (Integer)


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

def tx_pkts
  @tx_pkts
end

#upTrueClass | FalseClass

Amount of packets sent since connection

Returns:

  • (TrueClass | FalseClass)


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

def up
  @up
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/mist_api/models/stats_ap_port_stat.rb', line 117

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  full_duplex = hash.key?('full_duplex') ? hash['full_duplex'] : SKIP
  rx_bytes = hash.key?('rx_bytes') ? hash['rx_bytes'] : SKIP
  rx_errors = hash.key?('rx_errors') ? hash['rx_errors'] : SKIP
  rx_peak_bps = hash.key?('rx_peak_bps') ? hash['rx_peak_bps'] : SKIP
  rx_pkts = hash.key?('rx_pkts') ? hash['rx_pkts'] : SKIP
  speed = hash.key?('speed') ? hash['speed'] : SKIP
  tx_bytes = hash.key?('tx_bytes') ? hash['tx_bytes'] : SKIP
  tx_peak_bps = hash.key?('tx_peak_bps') ? hash['tx_peak_bps'] : SKIP
  tx_pkts = hash.key?('tx_pkts') ? hash['tx_pkts'] : SKIP
  up = hash.key?('up') ? hash['up'] : SKIP

  # Create object from extracted values.
  StatsApPortStat.new(full_duplex,
                      rx_bytes,
                      rx_errors,
                      rx_peak_bps,
                      rx_pkts,
                      speed,
                      tx_bytes,
                      tx_peak_bps,
                      tx_pkts,
                      up)
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/stats_ap_port_stat.rb', line 53

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['full_duplex'] = 'full_duplex'
  @_hash['rx_bytes'] = 'rx_bytes'
  @_hash['rx_errors'] = 'rx_errors'
  @_hash['rx_peak_bps'] = 'rx_peak_bps'
  @_hash['rx_pkts'] = 'rx_pkts'
  @_hash['speed'] = 'speed'
  @_hash['tx_bytes'] = 'tx_bytes'
  @_hash['tx_peak_bps'] = 'tx_peak_bps'
  @_hash['tx_pkts'] = 'tx_pkts'
  @_hash['up'] = 'up'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  %w[
    full_duplex
    rx_bytes
    rx_errors
    rx_peak_bps
    rx_pkts
    speed
    tx_bytes
    tx_peak_bps
    tx_pkts
    up
  ]
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/stats_ap_port_stat.rb', line 69

def self.optionals
  %w[
    full_duplex
    rx_bytes
    rx_errors
    rx_peak_bps
    rx_pkts
    speed
    tx_bytes
    tx_peak_bps
    tx_pkts
    up
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



154
155
156
157
158
159
160
# File 'lib/mist_api/models/stats_ap_port_stat.rb', line 154

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} full_duplex: #{@full_duplex.inspect}, rx_bytes: #{@rx_bytes.inspect},"\
  " rx_errors: #{@rx_errors.inspect}, rx_peak_bps: #{@rx_peak_bps.inspect}, rx_pkts:"\
  " #{@rx_pkts.inspect}, speed: #{@speed.inspect}, tx_bytes: #{@tx_bytes.inspect},"\
  " tx_peak_bps: #{@tx_peak_bps.inspect}, tx_pkts: #{@tx_pkts.inspect}, up: #{@up.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



146
147
148
149
150
151
# File 'lib/mist_api/models/stats_ap_port_stat.rb', line 146

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} full_duplex: #{@full_duplex}, rx_bytes: #{@rx_bytes}, rx_errors:"\
  " #{@rx_errors}, rx_peak_bps: #{@rx_peak_bps}, rx_pkts: #{@rx_pkts}, speed: #{@speed},"\
  " tx_bytes: #{@tx_bytes}, tx_peak_bps: #{@tx_peak_bps}, tx_pkts: #{@tx_pkts}, up: #{@up}>"
end