Class: MistApi::StatsApL2tpStatSession

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

Overview

StatsApL2tpStatSession 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(local_sid = SKIP, remote_id = SKIP, remote_sid = SKIP, state = SKIP) ⇒ StatsApL2tpStatSession

Returns a new instance of StatsApL2tpStatSession.



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

def initialize(local_sid = SKIP, remote_id = SKIP, remote_sid = SKIP,
               state = SKIP)
  @local_sid = local_sid unless local_sid == SKIP
  @remote_id = remote_id unless remote_id == SKIP
  @remote_sid = remote_sid unless remote_sid == SKIP
  @state = state unless state == SKIP
end

Instance Attribute Details

#local_sidInteger

Remote sessions id (dynamically unless Tunnel is said to be static)

Returns:

  • (Integer)


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

def local_sid
  @local_sid
end

#remote_idString

WxlanTunnel Remote ID (user-configured)

Returns:

  • (String)


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

def remote_id
  @remote_id
end

#remote_sidInteger

Remote sessions id (dynamically unless Tunnel is said to be static)

Returns:

  • (Integer)


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

def remote_sid
  @remote_sid
end

#stateL2tpStateEnum

enum: ‘established`, `established_with_session`, `idle`, `wait-ctrl-conn`, `wait-ctrl-reply`

Returns:



27
28
29
# File 'lib/mist_api/models/stats_ap_l2tp_stat_session.rb', line 27

def state
  @state
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/mist_api/models/stats_ap_l2tp_stat_session.rb', line 67

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  local_sid = hash.key?('local_sid') ? hash['local_sid'] : SKIP
  remote_id = hash.key?('remote_id') ? hash['remote_id'] : SKIP
  remote_sid = hash.key?('remote_sid') ? hash['remote_sid'] : SKIP
  state = hash.key?('state') ? hash['state'] : SKIP

  # Create object from extracted values.
  StatsApL2tpStatSession.new(local_sid,
                             remote_id,
                             remote_sid,
                             state)
end

.namesObject

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_session.rb', line 30

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['local_sid'] = 'local_sid'
  @_hash['remote_id'] = 'remote_id'
  @_hash['remote_sid'] = 'remote_sid'
  @_hash['state'] = 'state'
  @_hash
end

.nullablesObject

An array for nullable fields



50
51
52
53
54
55
56
# File 'lib/mist_api/models/stats_ap_l2tp_stat_session.rb', line 50

def self.nullables
  %w[
    local_sid
    remote_id
    remote_sid
  ]
end

.optionalsObject

An array for optional fields



40
41
42
43
44
45
46
47
# File 'lib/mist_api/models/stats_ap_l2tp_stat_session.rb', line 40

def self.optionals
  %w[
    local_sid
    remote_id
    remote_sid
    state
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



91
92
93
94
95
# File 'lib/mist_api/models/stats_ap_l2tp_stat_session.rb', line 91

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} local_sid: #{@local_sid.inspect}, remote_id: #{@remote_id.inspect},"\
  " remote_sid: #{@remote_sid.inspect}, state: #{@state.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



84
85
86
87
88
# File 'lib/mist_api/models/stats_ap_l2tp_stat_session.rb', line 84

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} local_sid: #{@local_sid}, remote_id: #{@remote_id}, remote_sid:"\
  " #{@remote_sid}, state: #{@state}>"
end