Class: MistApi::ApMesh

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

Overview

Mesh AP settings

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(bands = SKIP, enabled = false, group = SKIP, role = SKIP, use_wpa3_on_5 = false) ⇒ ApMesh

Returns a new instance of ApMesh.



64
65
66
67
68
69
70
71
# File 'lib/mist_api/models/ap_mesh.rb', line 64

def initialize(bands = SKIP, enabled = false, group = SKIP, role = SKIP,
               use_wpa3_on_5 = false)
  @bands = bands unless bands == SKIP
  @enabled = enabled unless enabled == SKIP
  @group = group unless group == SKIP
  @role = role unless role == SKIP
  @use_wpa3_on_5 = use_wpa3_on_5 unless use_wpa3_on_5 == SKIP
end

Instance Attribute Details

#bandsArray[Dot11BandEnum]

List of bands that the mesh should apply to. For relay, the first viable one will be picked. For relay, the first viable one will be picked. enum: ‘24`, `5`, `6`

Returns:



16
17
18
# File 'lib/mist_api/models/ap_mesh.rb', line 16

def bands
  @bands
end

#enabledTrueClass | FalseClass

Whether mesh is enabled on this AP

Returns:

  • (TrueClass | FalseClass)


20
21
22
# File 'lib/mist_api/models/ap_mesh.rb', line 20

def enabled
  @enabled
end

#groupInteger

Mesh group, base AP(s) will only allow remote AP(s) in the same mesh group to join, 1-9, optional

Returns:

  • (Integer)


25
26
27
# File 'lib/mist_api/models/ap_mesh.rb', line 25

def group
  @group
end

#roleApMeshRoleEnum

enum: ‘base`, `remote`

Returns:



29
30
31
# File 'lib/mist_api/models/ap_mesh.rb', line 29

def role
  @role
end

#use_wpa3_on_5TrueClass | FalseClass

Whether to use WPA3 on the 5 GHz band for mesh links

Returns:

  • (TrueClass | FalseClass)


33
34
35
# File 'lib/mist_api/models/ap_mesh.rb', line 33

def use_wpa3_on_5
  @use_wpa3_on_5
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/mist_api/models/ap_mesh.rb', line 74

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  bands = hash.key?('bands') ? hash['bands'] : SKIP
  enabled = hash['enabled'] ||= false
  group = hash.key?('group') ? hash['group'] : SKIP
  role = hash.key?('role') ? hash['role'] : SKIP
  use_wpa3_on_5 = hash['use_wpa3_on_5'] ||= false

  # Create object from extracted values.
  ApMesh.new(bands,
             enabled,
             group,
             role,
             use_wpa3_on_5)
end

.namesObject

A mapping from model property names to API property names.



36
37
38
39
40
41
42
43
44
# File 'lib/mist_api/models/ap_mesh.rb', line 36

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['bands'] = 'bands'
  @_hash['enabled'] = 'enabled'
  @_hash['group'] = 'group'
  @_hash['role'] = 'role'
  @_hash['use_wpa3_on_5'] = 'use_wpa3_on_5'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  %w[
    group
  ]
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    bands
    enabled
    group
    role
    use_wpa3_on_5
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



100
101
102
103
104
# File 'lib/mist_api/models/ap_mesh.rb', line 100

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} bands: #{@bands.inspect}, enabled: #{@enabled.inspect}, group:"\
  " #{@group.inspect}, role: #{@role.inspect}, use_wpa3_on_5: #{@use_wpa3_on_5.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



93
94
95
96
97
# File 'lib/mist_api/models/ap_mesh.rb', line 93

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} bands: #{@bands}, enabled: #{@enabled}, group: #{@group}, role: #{@role},"\
  " use_wpa3_on_5: #{@use_wpa3_on_5}>"
end