Class: MistApi::WlanCiscoCwa
- Defined in:
- lib/mist_api/models/wlan_cisco_cwa.rb
Overview
Cisco CWA (central web authentication) required RADIUS with COA in order to work. See CWA: www.cisco.com/c/en/us/support/docs/security/identity-services-engine /115732-central-web-auth-00.html
Instance Attribute Summary collapse
-
#allowed_hostnames ⇒ Array[String]
List of hostnames without http(s):// (matched by substring).
-
#allowed_subnets ⇒ Array[String]
List of CIDRs.
-
#blocked_subnets ⇒ Array[String]
List of blocked CIDRs.
-
#enabled ⇒ TrueClass | FalseClass
List of blocked CIDRs.
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(allowed_hostnames = SKIP, allowed_subnets = SKIP, blocked_subnets = SKIP, enabled = false) ⇒ WlanCiscoCwa
constructor
A new instance of WlanCiscoCwa.
-
#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(allowed_hostnames = SKIP, allowed_subnets = SKIP, blocked_subnets = SKIP, enabled = false) ⇒ WlanCiscoCwa
Returns a new instance of WlanCiscoCwa.
56 57 58 59 60 61 62 |
# File 'lib/mist_api/models/wlan_cisco_cwa.rb', line 56 def initialize(allowed_hostnames = SKIP, allowed_subnets = SKIP, blocked_subnets = SKIP, enabled = false) @allowed_hostnames = allowed_hostnames unless allowed_hostnames == SKIP @allowed_subnets = allowed_subnets unless allowed_subnets == SKIP @blocked_subnets = blocked_subnets unless blocked_subnets == SKIP @enabled = enabled unless enabled == SKIP end |
Instance Attribute Details
#allowed_hostnames ⇒ Array[String]
List of hostnames without http(s):// (matched by substring)
17 18 19 |
# File 'lib/mist_api/models/wlan_cisco_cwa.rb', line 17 def allowed_hostnames @allowed_hostnames end |
#allowed_subnets ⇒ Array[String]
List of CIDRs
21 22 23 |
# File 'lib/mist_api/models/wlan_cisco_cwa.rb', line 21 def allowed_subnets @allowed_subnets end |
#blocked_subnets ⇒ Array[String]
List of blocked CIDRs
25 26 27 |
# File 'lib/mist_api/models/wlan_cisco_cwa.rb', line 25 def blocked_subnets @blocked_subnets end |
#enabled ⇒ TrueClass | FalseClass
List of blocked CIDRs
29 30 31 |
# File 'lib/mist_api/models/wlan_cisco_cwa.rb', line 29 def enabled @enabled end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/mist_api/models/wlan_cisco_cwa.rb', line 65 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. allowed_hostnames = hash.key?('allowed_hostnames') ? hash['allowed_hostnames'] : SKIP allowed_subnets = hash.key?('allowed_subnets') ? hash['allowed_subnets'] : SKIP blocked_subnets = hash.key?('blocked_subnets') ? hash['blocked_subnets'] : SKIP enabled = hash['enabled'] ||= false # Create object from extracted values. WlanCiscoCwa.new(allowed_hostnames, allowed_subnets, blocked_subnets, enabled) end |
.names ⇒ Object
A mapping from model property names to API property names.
32 33 34 35 36 37 38 39 |
# File 'lib/mist_api/models/wlan_cisco_cwa.rb', line 32 def self.names @_hash = {} if @_hash.nil? @_hash['allowed_hostnames'] = 'allowed_hostnames' @_hash['allowed_subnets'] = 'allowed_subnets' @_hash['blocked_subnets'] = 'blocked_subnets' @_hash['enabled'] = 'enabled' @_hash end |
.nullables ⇒ Object
An array for nullable fields
52 53 54 |
# File 'lib/mist_api/models/wlan_cisco_cwa.rb', line 52 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
42 43 44 45 46 47 48 49 |
# File 'lib/mist_api/models/wlan_cisco_cwa.rb', line 42 def self.optionals %w[ allowed_hostnames allowed_subnets blocked_subnets enabled ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
86 87 88 89 90 91 92 |
# File 'lib/mist_api/models/wlan_cisco_cwa.rb', line 86 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.
102 103 104 105 106 107 |
# File 'lib/mist_api/models/wlan_cisco_cwa.rb', line 102 def inspect class_name = self.class.name.split('::').last "<#{class_name} allowed_hostnames: #{@allowed_hostnames.inspect}, allowed_subnets:"\ " #{@allowed_subnets.inspect}, blocked_subnets: #{@blocked_subnets.inspect}, enabled:"\ " #{@enabled.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
95 96 97 98 99 |
# File 'lib/mist_api/models/wlan_cisco_cwa.rb', line 95 def to_s class_name = self.class.name.split('::').last "<#{class_name} allowed_hostnames: #{@allowed_hostnames}, allowed_subnets:"\ " #{@allowed_subnets}, blocked_subnets: #{@blocked_subnets}, enabled: #{@enabled}>" end |