Class: MistApi::RadiusAcctServer

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

Overview

RadiusAcctServer 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(host = nil, secret = nil, keywrap_enabled = SKIP, keywrap_format = SKIP, keywrap_kek = SKIP, keywrap_mack = SKIP, port = SKIP) ⇒ RadiusAcctServer

Returns a new instance of RadiusAcctServer.



69
70
71
72
73
74
75
76
77
78
79
# File 'lib/mist_api/models/radius_acct_server.rb', line 69

def initialize(host = nil, secret = nil, keywrap_enabled = SKIP,
               keywrap_format = SKIP, keywrap_kek = SKIP,
               keywrap_mack = SKIP, port = SKIP)
  @host = host
  @keywrap_enabled = keywrap_enabled unless keywrap_enabled == SKIP
  @keywrap_format = keywrap_format unless keywrap_format == SKIP
  @keywrap_kek = keywrap_kek unless keywrap_kek == SKIP
  @keywrap_mack = keywrap_mack unless keywrap_mack == SKIP
  @port = port unless port == SKIP
  @secret = secret
end

Instance Attribute Details

#hostString

IP/ hostname of RADIUS server

Returns:

  • (String)


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

def host
  @host
end

#keywrap_enabledTrueClass | FalseClass

IP/ hostname of RADIUS server

Returns:

  • (TrueClass | FalseClass)


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

def keywrap_enabled
  @keywrap_enabled
end

#keywrap_formatRadiusKeywrapFormatEnum

enum: ‘ascii`, `hex`



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

def keywrap_format
  @keywrap_format
end

#keywrap_kekString

enum: ‘ascii`, `hex`

Returns:

  • (String)


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

def keywrap_kek
  @keywrap_kek
end

#keywrap_mackString

enum: ‘ascii`, `hex`

Returns:

  • (String)


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

def keywrap_mack
  @keywrap_mack
end

#portObject

Radius Auth Port, value from 1 to 65535, default is 1813

Returns:

  • (Object)


34
35
36
# File 'lib/mist_api/models/radius_acct_server.rb', line 34

def port
  @port
end

#secretString

Secret of RADIUS server

Returns:

  • (String)


38
39
40
# File 'lib/mist_api/models/radius_acct_server.rb', line 38

def secret
  @secret
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/mist_api/models/radius_acct_server.rb', line 82

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  host = hash.key?('host') ? hash['host'] : nil
  secret = hash.key?('secret') ? hash['secret'] : nil
  keywrap_enabled =
    hash.key?('keywrap_enabled') ? hash['keywrap_enabled'] : SKIP
  keywrap_format =
    hash.key?('keywrap_format') ? hash['keywrap_format'] : SKIP
  keywrap_kek = hash.key?('keywrap_kek') ? hash['keywrap_kek'] : SKIP
  keywrap_mack = hash.key?('keywrap_mack') ? hash['keywrap_mack'] : SKIP
  port = hash.key?('port') ? APIHelper.deserialize_union_type(
    UnionTypeLookUp.get(:RadiusAcctPort), hash['port']
  ) : SKIP

  # Create object from extracted values.
  RadiusAcctServer.new(host,
                       secret,
                       keywrap_enabled,
                       keywrap_format,
                       keywrap_kek,
                       keywrap_mack,
                       port)
end

.namesObject

A mapping from model property names to API property names.



41
42
43
44
45
46
47
48
49
50
51
# File 'lib/mist_api/models/radius_acct_server.rb', line 41

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['host'] = 'host'
  @_hash['keywrap_enabled'] = 'keywrap_enabled'
  @_hash['keywrap_format'] = 'keywrap_format'
  @_hash['keywrap_kek'] = 'keywrap_kek'
  @_hash['keywrap_mack'] = 'keywrap_mack'
  @_hash['port'] = 'port'
  @_hash['secret'] = 'secret'
  @_hash
end

.nullablesObject

An array for nullable fields



65
66
67
# File 'lib/mist_api/models/radius_acct_server.rb', line 65

def self.nullables
  []
end

.optionalsObject

An array for optional fields



54
55
56
57
58
59
60
61
62
# File 'lib/mist_api/models/radius_acct_server.rb', line 54

def self.optionals
  %w[
    keywrap_enabled
    keywrap_format
    keywrap_kek
    keywrap_mack
    port
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/mist_api/models/radius_acct_server.rb', line 110

def self.validate(value)
  if value.instance_of? self
    return (
      APIHelper.valid_type?(value.host,
                            ->(val) { val.instance_of? String }) and
        APIHelper.valid_type?(value.secret,
                              ->(val) { val.instance_of? String })
    )
  end

  return false unless value.instance_of? Hash

  (
    APIHelper.valid_type?(value['host'],
                          ->(val) { val.instance_of? String }) and
      APIHelper.valid_type?(value['secret'],
                            ->(val) { val.instance_of? String })
  )
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



139
140
141
142
143
144
145
# File 'lib/mist_api/models/radius_acct_server.rb', line 139

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} host: #{@host.inspect}, keywrap_enabled: #{@keywrap_enabled.inspect},"\
  " keywrap_format: #{@keywrap_format.inspect}, keywrap_kek: #{@keywrap_kek.inspect},"\
  " keywrap_mack: #{@keywrap_mack.inspect}, port: #{@port.inspect}, secret:"\
  " #{@secret.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



131
132
133
134
135
136
# File 'lib/mist_api/models/radius_acct_server.rb', line 131

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} host: #{@host}, keywrap_enabled: #{@keywrap_enabled}, keywrap_format:"\
  " #{@keywrap_format}, keywrap_kek: #{@keywrap_kek}, keywrap_mack: #{@keywrap_mack}, port:"\
  " #{@port}, secret: #{@secret}>"
end