Class: MistApi::WlanDynamicVlan

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

Overview

For 802.1x

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(default_vlan_id = SKIP, default_vlan_ids = SKIP, enabled = false, local_vlan_ids = SKIP, type = WlanDynamicVlanTypeEnum::STANDARD, vlans = SKIP) ⇒ WlanDynamicVlan

Returns a new instance of WlanDynamicVlan.



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

def initialize(default_vlan_id = SKIP, default_vlan_ids = SKIP,
               enabled = false, local_vlan_ids = SKIP,
               type = WlanDynamicVlanTypeEnum::STANDARD, vlans = SKIP)
  @default_vlan_id = default_vlan_id unless default_vlan_id == SKIP
  @default_vlan_ids = default_vlan_ids unless default_vlan_ids == SKIP
  @enabled = enabled unless enabled == SKIP
  @local_vlan_ids = local_vlan_ids unless local_vlan_ids == SKIP
  @type = type unless type == SKIP
  @vlans = vlans unless vlans == SKIP
end

Instance Attribute Details

#default_vlan_idObject

vlan_id to use when there’s no match from RADIUS

Returns:

  • (Object)


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

def default_vlan_id
  @default_vlan_id
end

#default_vlan_idsArray[Object]

Default VLAN ID(s) can be a number, a range of VLAN IDs, a variable or multiple numbers, ranges or variables as a VLAN pool. Default VLAN as a pool of VLANS requires 0.14.x or newer firmware

Returns:

  • (Array[Object])


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

def default_vlan_ids
  @default_vlan_ids
end

#enabledTrueClass | FalseClass

Requires ‘vlan_enabled`==`true` to be set to `true`. Whether to enable dynamic vlan

Returns:

  • (TrueClass | FalseClass)


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

def enabled
  @enabled
end

#local_vlan_idsArray[Object]

VLAN_ids to be locally bridged

Returns:

  • (Array[Object])


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

def local_vlan_ids
  @local_vlan_ids
end

#typeWlanDynamicVlanTypeEnum

standard (using Tunnel-Private-Group-ID, widely supported), airespace-interface-name (Airespace/Cisco). enum: ‘airespace-interface-name`, `standard`



35
36
37
# File 'lib/mist_api/models/wlan_dynamic_vlan.rb', line 35

def type
  @type
end

#vlansHash[String, String]

Map between vlan_id (as string) to airespace interface names (comma-separated) or null for standard mapping

* if `dynamic_vlan.type`==`standard`, property key is the Vlan ID and

property value is ""

* if `dynamic_vlan.type`==`airespace-interface-name`, property key is

the Vlan ID and property value is the Airespace Interface Name

Returns:

  • (Hash[String, String])


44
45
46
# File 'lib/mist_api/models/wlan_dynamic_vlan.rb', line 44

def vlans
  @vlans
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/mist_api/models/wlan_dynamic_vlan.rb', line 87

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  default_vlan_id = hash.key?('default_vlan_id') ? APIHelper.deserialize_union_type(
    UnionTypeLookUp.get(:WlanDynamicVlanDefaultVlanIdDeprecated), hash['default_vlan_id']
  ) : SKIP
  default_vlan_ids = hash.key?('default_vlan_ids') ? APIHelper.deserialize_union_type(
    UnionTypeLookUp.get(:WlanDynamicVlanDefaultVlanId), hash['default_vlan_ids']
  ) : SKIP
  enabled = hash['enabled'] ||= false
  local_vlan_ids = hash.key?('local_vlan_ids') ? APIHelper.deserialize_union_type(
    UnionTypeLookUp.get(:VlanIdWithVariable), hash['local_vlan_ids']
  ) : SKIP
  type = hash['type'] ||= WlanDynamicVlanTypeEnum::STANDARD
  vlans = hash.key?('vlans') ? hash['vlans'] : SKIP

  # Create object from extracted values.
  WlanDynamicVlan.new(default_vlan_id,
                      default_vlan_ids,
                      enabled,
                      local_vlan_ids,
                      type,
                      vlans)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['default_vlan_id'] = 'default_vlan_id'
  @_hash['default_vlan_ids'] = 'default_vlan_ids'
  @_hash['enabled'] = 'enabled'
  @_hash['local_vlan_ids'] = 'local_vlan_ids'
  @_hash['type'] = 'type'
  @_hash['vlans'] = 'vlans'
  @_hash
end

.nullablesObject

An array for nullable fields



71
72
73
# File 'lib/mist_api/models/wlan_dynamic_vlan.rb', line 71

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    default_vlan_id
    default_vlan_ids
    enabled
    local_vlan_ids
    type
    vlans
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:

  • The (WlanDynamicVlan | Hash)

    value against the validation is performed.



115
116
117
118
119
120
121
# File 'lib/mist_api/models/wlan_dynamic_vlan.rb', line 115

def self.validate(value)
  return true if value.instance_of? self

  return false unless value.instance_of? Hash

  true
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



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

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} default_vlan_id: #{@default_vlan_id.inspect}, default_vlan_ids:"\
  " #{@default_vlan_ids.inspect}, enabled: #{@enabled.inspect}, local_vlan_ids:"\
  " #{@local_vlan_ids.inspect}, type: #{@type.inspect}, vlans: #{@vlans.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



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

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} default_vlan_id: #{@default_vlan_id}, default_vlan_ids:"\
  " #{@default_vlan_ids}, enabled: #{@enabled}, local_vlan_ids: #{@local_vlan_ids}, type:"\
  " #{@type}, vlans: #{@vlans}>"
end