Class: MistApi::SwitchRadius
- Defined in:
- lib/mist_api/models/switch_radius.rb
Overview
By default, ‘radius_config` will be used. if a different one has to be used set `use_different_radius
Instance Attribute Summary collapse
-
#enabled ⇒ TrueClass | FalseClass
TODO: Write general description for this method.
-
#radius_config ⇒ SwitchRadiusConfig
Junos Radius config.
-
#use_different_radius ⇒ String
Junos Radius config.
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(enabled = SKIP, radius_config = SKIP, use_different_radius = SKIP) ⇒ SwitchRadius
constructor
A new instance of SwitchRadius.
-
#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(enabled = SKIP, radius_config = SKIP, use_different_radius = SKIP) ⇒ SwitchRadius
Returns a new instance of SwitchRadius.
48 49 50 51 52 53 |
# File 'lib/mist_api/models/switch_radius.rb', line 48 def initialize(enabled = SKIP, radius_config = SKIP, use_different_radius = SKIP) @enabled = enabled unless enabled == SKIP @radius_config = radius_config unless radius_config == SKIP @use_different_radius = use_different_radius unless use_different_radius == SKIP end |
Instance Attribute Details
#enabled ⇒ TrueClass | FalseClass
TODO: Write general description for this method
15 16 17 |
# File 'lib/mist_api/models/switch_radius.rb', line 15 def enabled @enabled end |
#radius_config ⇒ SwitchRadiusConfig
Junos Radius config
19 20 21 |
# File 'lib/mist_api/models/switch_radius.rb', line 19 def radius_config @radius_config end |
#use_different_radius ⇒ String
Junos Radius config
23 24 25 |
# File 'lib/mist_api/models/switch_radius.rb', line 23 def use_different_radius @use_different_radius end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/mist_api/models/switch_radius.rb', line 56 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. enabled = hash.key?('enabled') ? hash['enabled'] : SKIP radius_config = SwitchRadiusConfig.from_hash(hash['radius_config']) if hash['radius_config'] use_different_radius = hash.key?('use_different_radius') ? hash['use_different_radius'] : SKIP # Create object from extracted values. SwitchRadius.new(enabled, radius_config, use_different_radius) end |
.names ⇒ Object
A mapping from model property names to API property names.
26 27 28 29 30 31 32 |
# File 'lib/mist_api/models/switch_radius.rb', line 26 def self.names @_hash = {} if @_hash.nil? @_hash['enabled'] = 'enabled' @_hash['radius_config'] = 'radius_config' @_hash['use_different_radius'] = 'use_different_radius' @_hash end |
.nullables ⇒ Object
An array for nullable fields
44 45 46 |
# File 'lib/mist_api/models/switch_radius.rb', line 44 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
35 36 37 38 39 40 41 |
# File 'lib/mist_api/models/switch_radius.rb', line 35 def self.optionals %w[ enabled radius_config use_different_radius ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
73 74 75 76 77 78 79 |
# File 'lib/mist_api/models/switch_radius.rb', line 73 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
89 90 91 92 93 |
# File 'lib/mist_api/models/switch_radius.rb', line 89 def inspect class_name = self.class.name.split('::').last "<#{class_name} enabled: #{@enabled.inspect}, radius_config: #{@radius_config.inspect},"\ " use_different_radius: #{@use_different_radius.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
82 83 84 85 86 |
# File 'lib/mist_api/models/switch_radius.rb', line 82 def to_s class_name = self.class.name.split('::').last "<#{class_name} enabled: #{@enabled}, radius_config: #{@radius_config},"\ " use_different_radius: #{@use_different_radius}>" end |