Class: MistApi::CoaServer
- Defined in:
- lib/mist_api/models/coa_server.rb
Overview
CoA Server
Instance Attribute Summary collapse
-
#disable_event_timestamp_check ⇒ TrueClass | FalseClass
Whether to disable Event-Timestamp Check.
-
#enabled ⇒ TrueClass | FalseClass
Whether to disable Event-Timestamp Check.
-
#ip ⇒ String
Whether to disable Event-Timestamp Check.
-
#port ⇒ Object
Radius CoA Port, value from 1 to 65535, default is 3799.
-
#secret ⇒ String
Radius CoA Port, value from 1 to 65535, default is 3799.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(ip = nil, secret = nil, disable_event_timestamp_check = false, enabled = false, port = SKIP) ⇒ CoaServer
constructor
A new instance of CoaServer.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(ip = nil, secret = nil, disable_event_timestamp_check = false, enabled = false, port = SKIP) ⇒ CoaServer
Returns a new instance of CoaServer.
58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/mist_api/models/coa_server.rb', line 58 def initialize(ip = nil, secret = nil, = false, enabled = false, port = SKIP) unless == SKIP @disable_event_timestamp_check = end @enabled = enabled unless enabled == SKIP @ip = ip @port = port unless port == SKIP @secret = secret end |
Instance Attribute Details
#disable_event_timestamp_check ⇒ TrueClass | FalseClass
Whether to disable Event-Timestamp Check
14 15 16 |
# File 'lib/mist_api/models/coa_server.rb', line 14 def @disable_event_timestamp_check end |
#enabled ⇒ TrueClass | FalseClass
Whether to disable Event-Timestamp Check
18 19 20 |
# File 'lib/mist_api/models/coa_server.rb', line 18 def enabled @enabled end |
#ip ⇒ String
Whether to disable Event-Timestamp Check
22 23 24 |
# File 'lib/mist_api/models/coa_server.rb', line 22 def ip @ip end |
#port ⇒ Object
Radius CoA Port, value from 1 to 65535, default is 3799
26 27 28 |
# File 'lib/mist_api/models/coa_server.rb', line 26 def port @port end |
#secret ⇒ String
Radius CoA Port, value from 1 to 65535, default is 3799
30 31 32 |
# File 'lib/mist_api/models/coa_server.rb', line 30 def secret @secret end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/mist_api/models/coa_server.rb', line 72 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. ip = hash.key?('ip') ? hash['ip'] : nil secret = hash.key?('secret') ? hash['secret'] : nil = hash['disable_event_timestamp_check'] ||= false enabled = hash['enabled'] ||= false port = hash.key?('port') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:RadiusCoaPort), hash['port'] ) : SKIP # Create object from extracted values. CoaServer.new(ip, secret, , enabled, port) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/mist_api/models/coa_server.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['disable_event_timestamp_check'] = 'disable_event_timestamp_check' @_hash['enabled'] = 'enabled' @_hash['ip'] = 'ip' @_hash['port'] = 'port' @_hash['secret'] = 'secret' @_hash end |
.nullables ⇒ Object
An array for nullable fields
54 55 56 |
# File 'lib/mist_api/models/coa_server.rb', line 54 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
45 46 47 48 49 50 51 |
# File 'lib/mist_api/models/coa_server.rb', line 45 def self.optionals %w[ disable_event_timestamp_check enabled port ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/mist_api/models/coa_server.rb', line 95 def self.validate(value) if value.instance_of? self return ( APIHelper.valid_type?(value.ip, ->(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['ip'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['secret'], ->(val) { val.instance_of? String }) ) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
123 124 125 126 127 128 |
# File 'lib/mist_api/models/coa_server.rb', line 123 def inspect class_name = self.class.name.split('::').last "<#{class_name} disable_event_timestamp_check: #{@disable_event_timestamp_check.inspect},"\ " enabled: #{@enabled.inspect}, ip: #{@ip.inspect}, port: #{@port.inspect}, secret:"\ " #{@secret.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
116 117 118 119 120 |
# File 'lib/mist_api/models/coa_server.rb', line 116 def to_s class_name = self.class.name.split('::').last "<#{class_name} disable_event_timestamp_check: #{@disable_event_timestamp_check}, enabled:"\ " #{@enabled}, ip: #{@ip}, port: #{@port}, secret: #{@secret}>" end |