Class: MistApi::NacTag
- Defined in:
- lib/mist_api/models/nac_tag.rb
Overview
NacTag Model.
Instance Attribute Summary collapse
-
#allow_usermac_override ⇒ TrueClass | FalseClass
Can be set to true to allow the override by usermac result.
-
#created_time ⇒ Float
When the object has been created, in epoch.
-
#egress_vlan_names ⇒ Array[String]
If ‘type`==`egress_vlan_names`, list of egress vlans to return.
-
#gbp_tag ⇒ Object
If ‘type`==`gbp_tag`.
-
#id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization.
-
#match ⇒ NacTagMatchEnum
if ‘type`==`match`.
-
#match_all ⇒ TrueClass | FalseClass
This field is applicable only when ‘type`==`match` * `false`: means it is sufficient to match any of the values (i.e., match-any behavior) * `true`: means all values should be matched (i.e., match-all behavior) Currently it makes sense to set this field to `true` only if the `match`==`idp_role`, `match`==`usermac_label` and `edr_status`.
-
#modified_time ⇒ Float
When the object has been modified for the last time, in epoch.
-
#nacportal_id ⇒ UUID | String
If ‘type`==`redirect_nacportal_id`, the ID of the NAC portal to redirect to.
-
#name ⇒ String
If ‘type`==`redirect_nacportal_id`, the ID of the NAC portal to redirect to.
-
#org_id ⇒ UUID | String
If ‘type`==`redirect_nacportal_id`, the ID of the NAC portal to redirect to.
-
#radius_attrs ⇒ Array[String]
If ‘type`==`radius_attrs`, user can specify a list of one or more standard attributes in the field “radius_attrs”.
-
#radius_group ⇒ String
If ‘type`==`radius_group`.
-
#radius_vendor_attrs ⇒ Array[String]
If ‘type`==`radius_vendor_attrs`, user can specify a list of one or more vendor-specific attributes in the field “radius_vendor_attrs”.
-
#session_timeout ⇒ Integer
If ‘type`==`session_timeout, in seconds.
-
#type ⇒ NacTagTypeEnum
enum: ‘egress_vlan_names`, `gbp_tag`, `match`, `radius_attrs`, `radius_group`, `radius_vendor_attrs`, `redirect_nacportal_id`, `session_timeout`, `username_attr`, `vlan`.
-
#username_attr ⇒ NacTagUsernameAttrEnum
enum: ‘automatic`, `cn`, `dns`, `email`, `upn`.
-
#values ⇒ Array[String]
If ‘type`==`match`.
-
#vlan ⇒ String
If ‘type`==`vlan`.
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(name = nil, type = nil, allow_usermac_override = false, created_time = SKIP, egress_vlan_names = SKIP, gbp_tag = SKIP, id = SKIP, match = SKIP, match_all = false, modified_time = SKIP, nacportal_id = SKIP, org_id = SKIP, radius_attrs = SKIP, radius_group = SKIP, radius_vendor_attrs = SKIP, session_timeout = SKIP, username_attr = SKIP, values = SKIP, vlan = SKIP, additional_properties = nil) ⇒ NacTag
constructor
A new instance of NacTag.
-
#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(name = nil, type = nil, allow_usermac_override = false, created_time = SKIP, egress_vlan_names = SKIP, gbp_tag = SKIP, id = SKIP, match = SKIP, match_all = false, modified_time = SKIP, nacportal_id = SKIP, org_id = SKIP, radius_attrs = SKIP, radius_group = SKIP, radius_vendor_attrs = SKIP, session_timeout = SKIP, username_attr = SKIP, values = SKIP, vlan = SKIP, additional_properties = nil) ⇒ NacTag
Returns a new instance of NacTag.
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 |
# File 'lib/mist_api/models/nac_tag.rb', line 165 def initialize(name = nil, type = nil, allow_usermac_override = false, created_time = SKIP, egress_vlan_names = SKIP, gbp_tag = SKIP, id = SKIP, match = SKIP, match_all = false, modified_time = SKIP, nacportal_id = SKIP, org_id = SKIP, radius_attrs = SKIP, radius_group = SKIP, radius_vendor_attrs = SKIP, session_timeout = SKIP, username_attr = SKIP, values = SKIP, vlan = SKIP, additional_properties = nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @allow_usermac_override = allow_usermac_override unless allow_usermac_override == SKIP @created_time = created_time unless created_time == SKIP @egress_vlan_names = egress_vlan_names unless egress_vlan_names == SKIP @gbp_tag = gbp_tag unless gbp_tag == SKIP @id = id unless id == SKIP @match = match unless match == SKIP @match_all = match_all unless match_all == SKIP @modified_time = modified_time unless modified_time == SKIP @nacportal_id = nacportal_id unless nacportal_id == SKIP @name = name @org_id = org_id unless org_id == SKIP @radius_attrs = radius_attrs unless radius_attrs == SKIP @radius_group = radius_group unless radius_group == SKIP @radius_vendor_attrs = radius_vendor_attrs unless radius_vendor_attrs == SKIP @session_timeout = session_timeout unless session_timeout == SKIP @type = type @username_attr = username_attr unless username_attr == SKIP @values = values unless values == SKIP @vlan = vlan unless vlan == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#allow_usermac_override ⇒ TrueClass | FalseClass
Can be set to true to allow the override by usermac result
14 15 16 |
# File 'lib/mist_api/models/nac_tag.rb', line 14 def allow_usermac_override @allow_usermac_override end |
#created_time ⇒ Float
When the object has been created, in epoch
18 19 20 |
# File 'lib/mist_api/models/nac_tag.rb', line 18 def created_time @created_time end |
#egress_vlan_names ⇒ Array[String]
If ‘type`==`egress_vlan_names`, list of egress vlans to return
22 23 24 |
# File 'lib/mist_api/models/nac_tag.rb', line 22 def egress_vlan_names @egress_vlan_names end |
#gbp_tag ⇒ Object
If ‘type`==`gbp_tag`
26 27 28 |
# File 'lib/mist_api/models/nac_tag.rb', line 26 def gbp_tag @gbp_tag end |
#id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization
30 31 32 |
# File 'lib/mist_api/models/nac_tag.rb', line 30 def id @id end |
#match ⇒ NacTagMatchEnum
if ‘type`==`match`. enum: `cert_cn`, `cert_eku`, `cert_issuer`, `cert_san`, `cert_serial`, `cert_sub`, `cert_template`, `client_mac`, `edr_status`, `gbp_tag`, `hostname`, `idp_role`, `ingress_vlan`, `mdm_status`, `nas_ip`, `radius_group`, `realm`, `ssid`, `user_name`, `usermac_label`
38 39 40 |
# File 'lib/mist_api/models/nac_tag.rb', line 38 def match @match end |
#match_all ⇒ TrueClass | FalseClass
This field is applicable only when ‘type`==`match`
* `false`: means it is sufficient to match any of the values (i.e.,
match-any behavior)
* `true`: means all values should be matched (i.e., match-all behavior)
Currently it makes sense to set this field to ‘true` only if the `match`==`idp_role`, `match`==`usermac_label` and `edr_status`
47 48 49 |
# File 'lib/mist_api/models/nac_tag.rb', line 47 def match_all @match_all end |
#modified_time ⇒ Float
When the object has been modified for the last time, in epoch
51 52 53 |
# File 'lib/mist_api/models/nac_tag.rb', line 51 def modified_time @modified_time end |
#nacportal_id ⇒ UUID | String
If ‘type`==`redirect_nacportal_id`, the ID of the NAC portal to redirect to
56 57 58 |
# File 'lib/mist_api/models/nac_tag.rb', line 56 def nacportal_id @nacportal_id end |
#name ⇒ String
If ‘type`==`redirect_nacportal_id`, the ID of the NAC portal to redirect to
61 62 63 |
# File 'lib/mist_api/models/nac_tag.rb', line 61 def name @name end |
#org_id ⇒ UUID | String
If ‘type`==`redirect_nacportal_id`, the ID of the NAC portal to redirect to
66 67 68 |
# File 'lib/mist_api/models/nac_tag.rb', line 66 def org_id @org_id end |
#radius_attrs ⇒ Array[String]
If ‘type`==`radius_attrs`, user can specify a list of one or more standard attributes in the field “radius_attrs”. It is the responsibility of the user to provide a syntactically correct string, otherwise it may not work as expected. Note that it is allowed to have more than one radius_attrs in the result of a given rule.
75 76 77 |
# File 'lib/mist_api/models/nac_tag.rb', line 75 def radius_attrs @radius_attrs end |
#radius_group ⇒ String
If ‘type`==`radius_group`
79 80 81 |
# File 'lib/mist_api/models/nac_tag.rb', line 79 def radius_group @radius_group end |
#radius_vendor_attrs ⇒ Array[String]
If ‘type`==`radius_vendor_attrs`, user can specify a list of one or more vendor-specific attributes in the field “radius_vendor_attrs”. It is the responsibility of the user to provide a syntactically correct string, otherwise it may not work as expected. Note that it is allowed to have more than one radius_vendor_attrs in the result of a given rule.
88 89 90 |
# File 'lib/mist_api/models/nac_tag.rb', line 88 def radius_vendor_attrs @radius_vendor_attrs end |
#session_timeout ⇒ Integer
If ‘type`==`session_timeout, in seconds
92 93 94 |
# File 'lib/mist_api/models/nac_tag.rb', line 92 def session_timeout @session_timeout end |
#type ⇒ NacTagTypeEnum
enum: ‘egress_vlan_names`, `gbp_tag`, `match`, `radius_attrs`, `radius_group`, `radius_vendor_attrs`, `redirect_nacportal_id`, `session_timeout`, `username_attr`, `vlan`
98 99 100 |
# File 'lib/mist_api/models/nac_tag.rb', line 98 def type @type end |
#username_attr ⇒ NacTagUsernameAttrEnum
enum: ‘automatic`, `cn`, `dns`, `email`, `upn`
102 103 104 |
# File 'lib/mist_api/models/nac_tag.rb', line 102 def username_attr @username_attr end |
#values ⇒ Array[String]
If ‘type`==`match`
106 107 108 |
# File 'lib/mist_api/models/nac_tag.rb', line 106 def values @values end |
#vlan ⇒ String
If ‘type`==`vlan`
110 111 112 |
# File 'lib/mist_api/models/nac_tag.rb', line 110 def vlan @vlan end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 |
# File 'lib/mist_api/models/nac_tag.rb', line 199 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. name = hash.key?('name') ? hash['name'] : nil type = hash.key?('type') ? hash['type'] : nil allow_usermac_override = hash['allow_usermac_override'] ||= false created_time = hash.key?('created_time') ? hash['created_time'] : SKIP egress_vlan_names = hash.key?('egress_vlan_names') ? hash['egress_vlan_names'] : SKIP gbp_tag = hash.key?('gbp_tag') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:NacTagGbpTag), hash['gbp_tag'] ) : SKIP id = hash.key?('id') ? hash['id'] : SKIP match = hash.key?('match') ? hash['match'] : SKIP match_all = hash['match_all'] ||= false modified_time = hash.key?('modified_time') ? hash['modified_time'] : SKIP nacportal_id = hash.key?('nacportal_id') ? hash['nacportal_id'] : SKIP org_id = hash.key?('org_id') ? hash['org_id'] : SKIP radius_attrs = hash.key?('radius_attrs') ? hash['radius_attrs'] : SKIP radius_group = hash.key?('radius_group') ? hash['radius_group'] : SKIP radius_vendor_attrs = hash.key?('radius_vendor_attrs') ? hash['radius_vendor_attrs'] : SKIP session_timeout = hash.key?('session_timeout') ? hash['session_timeout'] : SKIP username_attr = hash.key?('username_attr') ? hash['username_attr'] : SKIP values = hash.key?('values') ? hash['values'] : SKIP vlan = hash.key?('vlan') ? hash['vlan'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. NacTag.new(name, type, allow_usermac_override, created_time, egress_vlan_names, gbp_tag, id, match, match_all, modified_time, nacportal_id, org_id, radius_attrs, radius_group, radius_vendor_attrs, session_timeout, username_attr, values, vlan, additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/mist_api/models/nac_tag.rb', line 113 def self.names @_hash = {} if @_hash.nil? @_hash['allow_usermac_override'] = 'allow_usermac_override' @_hash['created_time'] = 'created_time' @_hash['egress_vlan_names'] = 'egress_vlan_names' @_hash['gbp_tag'] = 'gbp_tag' @_hash['id'] = 'id' @_hash['match'] = 'match' @_hash['match_all'] = 'match_all' @_hash['modified_time'] = 'modified_time' @_hash['nacportal_id'] = 'nacportal_id' @_hash['name'] = 'name' @_hash['org_id'] = 'org_id' @_hash['radius_attrs'] = 'radius_attrs' @_hash['radius_group'] = 'radius_group' @_hash['radius_vendor_attrs'] = 'radius_vendor_attrs' @_hash['session_timeout'] = 'session_timeout' @_hash['type'] = 'type' @_hash['username_attr'] = 'username_attr' @_hash['values'] = 'values' @_hash['vlan'] = 'vlan' @_hash end |
.nullables ⇒ Object
An array for nullable fields
161 162 163 |
# File 'lib/mist_api/models/nac_tag.rb', line 161 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
# File 'lib/mist_api/models/nac_tag.rb', line 138 def self.optionals %w[ allow_usermac_override created_time egress_vlan_names gbp_tag id match match_all modified_time nacportal_id org_id radius_attrs radius_group radius_vendor_attrs session_timeout username_attr values vlan ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 |
# File 'lib/mist_api/models/nac_tag.rb', line 260 def self.validate(value) if value.instance_of? self return ( APIHelper.valid_type?(value.name, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.type, ->(val) { NacTagTypeEnum.validate(val) }) ) end return false unless value.instance_of? Hash ( APIHelper.valid_type?(value['name'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['type'], ->(val) { NacTagTypeEnum.validate(val) }) ) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
294 295 296 297 298 299 300 301 302 303 304 305 306 |
# File 'lib/mist_api/models/nac_tag.rb', line 294 def inspect class_name = self.class.name.split('::').last "<#{class_name} allow_usermac_override: #{@allow_usermac_override.inspect}, created_time:"\ " #{@created_time.inspect}, egress_vlan_names: #{@egress_vlan_names.inspect}, gbp_tag:"\ " #{@gbp_tag.inspect}, id: #{@id.inspect}, match: #{@match.inspect}, match_all:"\ " #{@match_all.inspect}, modified_time: #{@modified_time.inspect}, nacportal_id:"\ " #{@nacportal_id.inspect}, name: #{@name.inspect}, org_id: #{@org_id.inspect},"\ " radius_attrs: #{@radius_attrs.inspect}, radius_group: #{@radius_group.inspect},"\ " radius_vendor_attrs: #{@radius_vendor_attrs.inspect}, session_timeout:"\ " #{@session_timeout.inspect}, type: #{@type.inspect}, username_attr:"\ " #{@username_attr.inspect}, values: #{@values.inspect}, vlan: #{@vlan.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
281 282 283 284 285 286 287 288 289 290 291 |
# File 'lib/mist_api/models/nac_tag.rb', line 281 def to_s class_name = self.class.name.split('::').last "<#{class_name} allow_usermac_override: #{@allow_usermac_override}, created_time:"\ " #{@created_time}, egress_vlan_names: #{@egress_vlan_names}, gbp_tag: #{@gbp_tag}, id:"\ " #{@id}, match: #{@match}, match_all: #{@match_all}, modified_time: #{@modified_time},"\ " nacportal_id: #{@nacportal_id}, name: #{@name}, org_id: #{@org_id}, radius_attrs:"\ " #{@radius_attrs}, radius_group: #{@radius_group}, radius_vendor_attrs:"\ " #{@radius_vendor_attrs}, session_timeout: #{@session_timeout}, type: #{@type},"\ " username_attr: #{@username_attr}, values: #{@values}, vlan: #{@vlan},"\ " additional_properties: #{@additional_properties}>" end |