Class: MistApi::WlanBonjourServiceProperties

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

Overview

WlanBonjourServiceProperties 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(disable_local = false, radius_groups = SKIP, scope = WlanBonjourServicePropertiesScopeEnum::SAME_SITE) ⇒ WlanBonjourServiceProperties

Returns a new instance of WlanBonjourServiceProperties.



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

def initialize(disable_local = false, radius_groups = SKIP,
               scope = WlanBonjourServicePropertiesScopeEnum::SAME_SITE)
  @disable_local = disable_local unless disable_local == SKIP
  @radius_groups = radius_groups unless radius_groups == SKIP
  @scope = scope unless scope == SKIP
end

Instance Attribute Details

#disable_localTrueClass | FalseClass

Whether to prevent wireless clients to discover bonjour devices on the same WLAN

Returns:

  • (TrueClass | FalseClass)


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

def disable_local
  @disable_local
end

#radius_groupsArray[String]

Optional, if the service is further restricted for certain RADIUS groups

Returns:

  • (Array[String])


19
20
21
# File 'lib/mist_api/models/wlan_bonjour_service_properties.rb', line 19

def radius_groups
  @radius_groups
end

#scopeWlanBonjourServicePropertiesScopeEnum

how bonjour services should be discovered for the same WLAN. enum: ‘same_ap`, `same_map`, `same_site`



24
25
26
# File 'lib/mist_api/models/wlan_bonjour_service_properties.rb', line 24

def scope
  @scope
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
# File 'lib/mist_api/models/wlan_bonjour_service_properties.rb', line 57

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  disable_local = hash['disable_local'] ||= false
  radius_groups = hash.key?('radius_groups') ? hash['radius_groups'] : SKIP
  scope = hash['scope'] ||= WlanBonjourServicePropertiesScopeEnum::SAME_SITE

  # Create object from extracted values.
  WlanBonjourServiceProperties.new(disable_local,
                                   radius_groups,
                                   scope)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['disable_local'] = 'disable_local'
  @_hash['radius_groups'] = 'radius_groups'
  @_hash['scope'] = 'scope'
  @_hash
end

.nullablesObject

An array for nullable fields



45
46
47
# File 'lib/mist_api/models/wlan_bonjour_service_properties.rb', line 45

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    disable_local
    radius_groups
    scope
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



73
74
75
76
77
78
79
# File 'lib/mist_api/models/wlan_bonjour_service_properties.rb', line 73

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.



89
90
91
92
93
# File 'lib/mist_api/models/wlan_bonjour_service_properties.rb', line 89

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

#to_sObject

Provides a human-readable string representation of the object.



82
83
84
85
86
# File 'lib/mist_api/models/wlan_bonjour_service_properties.rb', line 82

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