Class: MistApi::WlanBonjour

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

Overview

Bonjour gateway wlan 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(additional_vlan_ids = SKIP, enabled = false, services = SKIP) ⇒ WlanBonjour

Returns a new instance of WlanBonjour.



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

def initialize(additional_vlan_ids = SKIP, enabled = false, services = SKIP)
  @additional_vlan_ids = additional_vlan_ids unless additional_vlan_ids == SKIP
  @enabled = enabled unless enabled == SKIP
  @services = services unless services == SKIP
end

Instance Attribute Details

#additional_vlan_idsObject

List or Comma separated list of additional VLAN IDs (on the LAN side or from other WLANs) should we be forwarding bonjour queries/responses

Returns:

  • (Object)


15
16
17
# File 'lib/mist_api/models/wlan_bonjour.rb', line 15

def additional_vlan_ids
  @additional_vlan_ids
end

#enabledTrueClass | FalseClass

Whether to enable bonjour for this WLAN. Once enabled, limit_bcast is assumed true, allow_mdns is assumed false

Returns:

  • (TrueClass | FalseClass)


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

def enabled
  @enabled
end

#servicesHash[String, WlanBonjourServiceProperties]

What services are allowed. Property key is the service name

Returns:



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

def services
  @services
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/mist_api/models/wlan_bonjour.rb', line 57

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  additional_vlan_ids = hash.key?('additional_vlan_ids') ? APIHelper.deserialize_union_type(
    UnionTypeLookUp.get(:AdditionalVlanIds2), hash['additional_vlan_ids']
  ) : SKIP
  enabled = hash['enabled'] ||= false
  services = WlanBonjourServiceProperties.from_hash(hash['services']) if hash['services']

  services = SKIP unless hash.key?('services')

  # Create object from extracted values.
  WlanBonjour.new(additional_vlan_ids,
                  enabled,
                  services)
end

.namesObject

A mapping from model property names to API property names.



28
29
30
31
32
33
34
# File 'lib/mist_api/models/wlan_bonjour.rb', line 28

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['additional_vlan_ids'] = 'additional_vlan_ids'
  @_hash['enabled'] = 'enabled'
  @_hash['services'] = 'services'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    additional_vlan_ids
    enabled
    services
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:

  • The (WlanBonjour | Hash)

    value against the validation is performed.



77
78
79
80
81
82
83
# File 'lib/mist_api/models/wlan_bonjour.rb', line 77

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.



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

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

#to_sObject

Provides a human-readable string representation of the object.



86
87
88
89
90
# File 'lib/mist_api/models/wlan_bonjour.rb', line 86

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