Class: MistApi::MxclusterNac

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

Overview

MxclusterNac 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(acct_server_port = 1813, auth_server_port = 1812, client_ips = SKIP, enabled = false, secret = SKIP) ⇒ MxclusterNac

Returns a new instance of MxclusterNac.



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

def initialize(acct_server_port = 1813, auth_server_port = 1812,
               client_ips = SKIP, enabled = false, secret = SKIP)
  @acct_server_port = acct_server_port unless acct_server_port == SKIP
  @auth_server_port = auth_server_port unless auth_server_port == SKIP
  @client_ips = client_ips unless client_ips == SKIP
  @enabled = enabled unless enabled == SKIP
  @secret = secret unless secret == SKIP
end

Instance Attribute Details

#acct_server_portInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def acct_server_port
  @acct_server_port
end

#auth_server_portInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def auth_server_port
  @auth_server_port
end

#client_ipsHash[String, MxclusterNacClientIp]

Property key is the RADIUS Client IP/Subnet.

Returns:



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

def client_ips
  @client_ips
end

#enabledTrueClass | FalseClass

Property key is the RADIUS Client IP/Subnet.

Returns:

  • (TrueClass | FalseClass)


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

def enabled
  @enabled
end

#secretString

Property key is the RADIUS Client IP/Subnet.

Returns:

  • (String)


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

def secret
  @secret
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
87
# File 'lib/mist_api/models/mxcluster_nac.rb', line 69

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  acct_server_port = hash['acct_server_port'] ||= 1813
  auth_server_port = hash['auth_server_port'] ||= 1812
  client_ips = MxclusterNacClientIp.from_hash(hash['client_ips']) if hash['client_ips']

  client_ips = SKIP unless hash.key?('client_ips')
  enabled = hash['enabled'] ||= false
  secret = hash.key?('secret') ? hash['secret'] : SKIP

  # Create object from extracted values.
  MxclusterNac.new(acct_server_port,
                   auth_server_port,
                   client_ips,
                   enabled,
                   secret)
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/mxcluster_nac.rb', line 33

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['acct_server_port'] = 'acct_server_port'
  @_hash['auth_server_port'] = 'auth_server_port'
  @_hash['client_ips'] = 'client_ips'
  @_hash['enabled'] = 'enabled'
  @_hash['secret'] = 'secret'
  @_hash
end

.nullablesObject

An array for nullable fields



55
56
57
# File 'lib/mist_api/models/mxcluster_nac.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/mxcluster_nac.rb', line 44

def self.optionals
  %w[
    acct_server_port
    auth_server_port
    client_ips
    enabled
    secret
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



98
99
100
101
102
103
# File 'lib/mist_api/models/mxcluster_nac.rb', line 98

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

#to_sObject

Provides a human-readable string representation of the object.



90
91
92
93
94
95
# File 'lib/mist_api/models/mxcluster_nac.rb', line 90

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