Class: MistApi::WlanInjectDhcpOption82

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

Overview

WlanInjectDhcpOption82 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(circuit_id = SKIP, enabled = false) ⇒ WlanInjectDhcpOption82

Returns a new instance of WlanInjectDhcpOption82.



49
50
51
52
# File 'lib/mist_api/models/wlan_inject_dhcp_option82.rb', line 49

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

Instance Attribute Details

#circuit_idString

Information to set in the ‘circuit_id` field of the DHCP Option 82. It is possible to use static string or the following variables (e.g. `{SSID}:{AP_MAC}`):

* {{AP_MAC}}
* {{AP_MAC_DASHED}}
* {{AP_MODEL}}
* {{AP_NAME}}
* {{SITE_NAME}}
* {{SSID}}

Returns:

  • (String)


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

def circuit_id
  @circuit_id
end

#enabledTrueClass | FalseClass

Whether to inject option 82 when forwarding DHCP packets

Returns:

  • (TrueClass | FalseClass)


26
27
28
# File 'lib/mist_api/models/wlan_inject_dhcp_option82.rb', line 26

def enabled
  @enabled
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



55
56
57
58
59
60
61
62
63
64
65
# File 'lib/mist_api/models/wlan_inject_dhcp_option82.rb', line 55

def self.from_hash(hash)
  return nil unless hash

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

  # Create object from extracted values.
  WlanInjectDhcpOption82.new(circuit_id,
                             enabled)
end

.namesObject

A mapping from model property names to API property names.



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

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

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    circuit_id
    enabled
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



69
70
71
72
73
74
75
# File 'lib/mist_api/models/wlan_inject_dhcp_option82.rb', line 69

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.



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

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

#to_sObject

Provides a human-readable string representation of the object.



78
79
80
81
# File 'lib/mist_api/models/wlan_inject_dhcp_option82.rb', line 78

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