Class: MistApi::MistNacedge

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

Overview

MistNacedge 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(auth_ttl = 604800, default_dot1x_vlan = SKIP, default_vlan = SKIP, enabled = SKIP, mxedge_hosts = SKIP) ⇒ MistNacedge

Returns a new instance of MistNacedge.



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

def initialize(auth_ttl = 604800, default_dot1x_vlan = SKIP,
               default_vlan = SKIP, enabled = SKIP, mxedge_hosts = SKIP)
  @auth_ttl = auth_ttl unless auth_ttl == SKIP
  @default_dot1x_vlan = default_dot1x_vlan unless default_dot1x_vlan == SKIP
  @default_vlan = default_vlan unless default_vlan == SKIP
  @enabled = enabled unless enabled == SKIP
  @mxedge_hosts = mxedge_hosts unless mxedge_hosts == SKIP
end

Instance Attribute Details

#auth_ttlInteger

Cache of last auth result; in seconds

Returns:

  • (Integer)


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

def auth_ttl
  @auth_ttl
end

#default_dot1x_vlanString

Default vlan for all dot1x devices, if different from default_vlan

Returns:

  • (String)


18
19
20
# File 'lib/mist_api/models/mist_nacedge.rb', line 18

def default_dot1x_vlan
  @default_dot1x_vlan
end

#default_vlanString

Default vlan to assign for devices not in the cache

Returns:

  • (String)


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

def default_vlan
  @default_vlan
end

#enabledTrueClass | FalseClass

Default vlan to assign for devices not in the cache

Returns:

  • (TrueClass | FalseClass)


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

def enabled
  @enabled
end

#mxedge_hostsArray[String]

List of NAC Edges in this site

Returns:

  • (Array[String])


30
31
32
# File 'lib/mist_api/models/mist_nacedge.rb', line 30

def mxedge_hosts
  @mxedge_hosts
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/mist_api/models/mist_nacedge.rb', line 69

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  auth_ttl = hash['auth_ttl'] ||= 604800
  default_dot1x_vlan =
    hash.key?('default_dot1x_vlan') ? hash['default_dot1x_vlan'] : SKIP
  default_vlan = hash.key?('default_vlan') ? hash['default_vlan'] : SKIP
  enabled = hash.key?('enabled') ? hash['enabled'] : SKIP
  mxedge_hosts = hash.key?('mxedge_hosts') ? hash['mxedge_hosts'] : SKIP

  # Create object from extracted values.
  MistNacedge.new(auth_ttl,
                  default_dot1x_vlan,
                  default_vlan,
                  enabled,
                  mxedge_hosts)
end

.namesObject

A mapping from model property names to API property names.



33
34
35
36
37
38
39
40
41
# File 'lib/mist_api/models/mist_nacedge.rb', line 33

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['auth_ttl'] = 'auth_ttl'
  @_hash['default_dot1x_vlan'] = 'default_dot1x_vlan'
  @_hash['default_vlan'] = 'default_vlan'
  @_hash['enabled'] = 'enabled'
  @_hash['mxedge_hosts'] = 'mxedge_hosts'
  @_hash
end

.nullablesObject

An array for nullable fields



55
56
57
# File 'lib/mist_api/models/mist_nacedge.rb', line 55

def self.nullables
  []
end

.optionalsObject

An array for optional fields



44
45
46
47
48
49
50
51
52
# File 'lib/mist_api/models/mist_nacedge.rb', line 44

def self.optionals
  %w[
    auth_ttl
    default_dot1x_vlan
    default_vlan
    enabled
    mxedge_hosts
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



96
97
98
99
100
101
# File 'lib/mist_api/models/mist_nacedge.rb', line 96

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

#to_sObject

Provides a human-readable string representation of the object.



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

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