Class: MistApi::StatsApL2tpStat
- Defined in:
- lib/mist_api/models/stats_ap_l2tp_stat.rb
Overview
StatsApL2tpStat Model.
Instance Attribute Summary collapse
-
#sessions ⇒ Array[StatsApL2tpStatSession]
List of sessions.
-
#state ⇒ L2tpStateEnum
enum: ‘established`, `established_with_session`, `idle`, `wait-ctrl-conn`, `wait-ctrl-reply`.
-
#uptime ⇒ Integer
Uptime.
-
#wxtunnel_id ⇒ UUID | String
WxlanTunnel ID.
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(sessions = SKIP, state = SKIP, uptime = SKIP, wxtunnel_id = SKIP) ⇒ StatsApL2tpStat
constructor
A new instance of StatsApL2tpStat.
-
#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(sessions = SKIP, state = SKIP, uptime = SKIP, wxtunnel_id = SKIP) ⇒ StatsApL2tpStat
Returns a new instance of StatsApL2tpStat.
57 58 59 60 61 62 63 |
# File 'lib/mist_api/models/stats_ap_l2tp_stat.rb', line 57 def initialize(sessions = SKIP, state = SKIP, uptime = SKIP, wxtunnel_id = SKIP) @sessions = sessions unless sessions == SKIP @state = state unless state == SKIP @uptime = uptime unless uptime == SKIP @wxtunnel_id = wxtunnel_id unless wxtunnel_id == SKIP end |
Instance Attribute Details
#sessions ⇒ Array[StatsApL2tpStatSession]
List of sessions
14 15 16 |
# File 'lib/mist_api/models/stats_ap_l2tp_stat.rb', line 14 def sessions @sessions end |
#state ⇒ L2tpStateEnum
enum: ‘established`, `established_with_session`, `idle`, `wait-ctrl-conn`, `wait-ctrl-reply`
19 20 21 |
# File 'lib/mist_api/models/stats_ap_l2tp_stat.rb', line 19 def state @state end |
#uptime ⇒ Integer
Uptime
23 24 25 |
# File 'lib/mist_api/models/stats_ap_l2tp_stat.rb', line 23 def uptime @uptime end |
#wxtunnel_id ⇒ UUID | String
WxlanTunnel ID
27 28 29 |
# File 'lib/mist_api/models/stats_ap_l2tp_stat.rb', line 27 def wxtunnel_id @wxtunnel_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/mist_api/models/stats_ap_l2tp_stat.rb', line 66 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. # Parameter is an array, so we need to iterate through it sessions = nil unless hash['sessions'].nil? sessions = [] hash['sessions'].each do |structure| sessions << (StatsApL2tpStatSession.from_hash(structure) if structure) end end sessions = SKIP unless hash.key?('sessions') state = hash.key?('state') ? hash['state'] : SKIP uptime = hash.key?('uptime') ? hash['uptime'] : SKIP wxtunnel_id = hash.key?('wxtunnel_id') ? hash['wxtunnel_id'] : SKIP # Create object from extracted values. StatsApL2tpStat.new(sessions, state, uptime, wxtunnel_id) end |
.names ⇒ Object
A mapping from model property names to API property names.
30 31 32 33 34 35 36 37 |
# File 'lib/mist_api/models/stats_ap_l2tp_stat.rb', line 30 def self.names @_hash = {} if @_hash.nil? @_hash['sessions'] = 'sessions' @_hash['state'] = 'state' @_hash['uptime'] = 'uptime' @_hash['wxtunnel_id'] = 'wxtunnel_id' @_hash end |
.nullables ⇒ Object
An array for nullable fields
50 51 52 53 54 55 |
# File 'lib/mist_api/models/stats_ap_l2tp_stat.rb', line 50 def self.nullables %w[ uptime wxtunnel_id ] end |
.optionals ⇒ Object
An array for optional fields
40 41 42 43 44 45 46 47 |
# File 'lib/mist_api/models/stats_ap_l2tp_stat.rb', line 40 def self.optionals %w[ sessions state uptime wxtunnel_id ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
99 100 101 102 103 |
# File 'lib/mist_api/models/stats_ap_l2tp_stat.rb', line 99 def inspect class_name = self.class.name.split('::').last "<#{class_name} sessions: #{@sessions.inspect}, state: #{@state.inspect}, uptime:"\ " #{@uptime.inspect}, wxtunnel_id: #{@wxtunnel_id.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
92 93 94 95 96 |
# File 'lib/mist_api/models/stats_ap_l2tp_stat.rb', line 92 def to_s class_name = self.class.name.split('::').last "<#{class_name} sessions: #{@sessions}, state: #{@state}, uptime: #{@uptime}, wxtunnel_id:"\ " #{@wxtunnel_id}>" end |