Class: MistApi::NacRule
- Defined in:
- lib/mist_api/models/nac_rule.rb
Overview
NacRule Model.
Instance Attribute Summary collapse
-
#action ⇒ NacRuleActionEnum
enum: ‘allow`, `block`.
-
#apply_tags ⇒ Array[String]
All optional, this goes into Access-Accept.
-
#created_time ⇒ Float
When the object has been created, in epoch.
-
#enabled ⇒ TrueClass | FalseClass
Enabled or not.
-
#guest_auth_state ⇒ NacRuleGuestAuthStateEnum
Guest portal authorization state.
-
#id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization.
-
#matching ⇒ NacRuleMatching
Unique ID of the object instance in the Mist Organization.
-
#modified_time ⇒ Float
When the object has been modified for the last time, in epoch.
-
#name ⇒ String
When the object has been modified for the last time, in epoch.
-
#not_matching ⇒ NacRuleMatching
When the object has been modified for the last time, in epoch.
-
#order ⇒ Integer
Order of the rule, lower value implies higher priority.
-
#org_id ⇒ UUID | String
Order of the rule, lower value implies higher priority.
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.
Instance Method Summary collapse
-
#initialize(action = nil, name = nil, apply_tags = SKIP, created_time = SKIP, enabled = true, guest_auth_state = SKIP, id = SKIP, matching = SKIP, modified_time = SKIP, not_matching = SKIP, order = SKIP, org_id = SKIP, additional_properties = nil) ⇒ NacRule
constructor
A new instance of NacRule.
-
#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(action = nil, name = nil, apply_tags = SKIP, created_time = SKIP, enabled = true, guest_auth_state = SKIP, id = SKIP, matching = SKIP, modified_time = SKIP, not_matching = SKIP, order = SKIP, org_id = SKIP, additional_properties = nil) ⇒ NacRule
Returns a new instance of NacRule.
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/mist_api/models/nac_rule.rb', line 99 def initialize(action = nil, name = nil, = SKIP, created_time = SKIP, enabled = true, guest_auth_state = SKIP, id = SKIP, matching = SKIP, modified_time = SKIP, not_matching = SKIP, order = SKIP, org_id = SKIP, additional_properties = nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @action = action @apply_tags = unless == SKIP @created_time = created_time unless created_time == SKIP @enabled = enabled unless enabled == SKIP @guest_auth_state = guest_auth_state unless guest_auth_state == SKIP @id = id unless id == SKIP @matching = matching unless matching == SKIP @modified_time = modified_time unless modified_time == SKIP @name = name @not_matching = not_matching unless not_matching == SKIP @order = order unless order == SKIP @org_id = org_id unless org_id == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#action ⇒ NacRuleActionEnum
enum: ‘allow`, `block`
14 15 16 |
# File 'lib/mist_api/models/nac_rule.rb', line 14 def action @action end |
#apply_tags ⇒ Array[String]
All optional, this goes into Access-Accept
18 19 20 |
# File 'lib/mist_api/models/nac_rule.rb', line 18 def @apply_tags end |
#created_time ⇒ Float
When the object has been created, in epoch
22 23 24 |
# File 'lib/mist_api/models/nac_rule.rb', line 22 def created_time @created_time end |
#enabled ⇒ TrueClass | FalseClass
Enabled or not
26 27 28 |
# File 'lib/mist_api/models/nac_rule.rb', line 26 def enabled @enabled end |
#guest_auth_state ⇒ NacRuleGuestAuthStateEnum
Guest portal authorization state. enum: ‘authorized`, `unknown`
30 31 32 |
# File 'lib/mist_api/models/nac_rule.rb', line 30 def guest_auth_state @guest_auth_state end |
#id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization
34 35 36 |
# File 'lib/mist_api/models/nac_rule.rb', line 34 def id @id end |
#matching ⇒ NacRuleMatching
Unique ID of the object instance in the Mist Organization
38 39 40 |
# File 'lib/mist_api/models/nac_rule.rb', line 38 def matching @matching end |
#modified_time ⇒ Float
When the object has been modified for the last time, in epoch
42 43 44 |
# File 'lib/mist_api/models/nac_rule.rb', line 42 def modified_time @modified_time end |
#name ⇒ String
When the object has been modified for the last time, in epoch
46 47 48 |
# File 'lib/mist_api/models/nac_rule.rb', line 46 def name @name end |
#not_matching ⇒ NacRuleMatching
When the object has been modified for the last time, in epoch
50 51 52 |
# File 'lib/mist_api/models/nac_rule.rb', line 50 def not_matching @not_matching end |
#order ⇒ Integer
Order of the rule, lower value implies higher priority
54 55 56 |
# File 'lib/mist_api/models/nac_rule.rb', line 54 def order @order end |
#org_id ⇒ UUID | String
Order of the rule, lower value implies higher priority
58 59 60 |
# File 'lib/mist_api/models/nac_rule.rb', line 58 def org_id @org_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/mist_api/models/nac_rule.rb', line 123 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. action = hash.key?('action') ? hash['action'] : nil name = hash.key?('name') ? hash['name'] : nil = hash.key?('apply_tags') ? hash['apply_tags'] : SKIP created_time = hash.key?('created_time') ? hash['created_time'] : SKIP enabled = hash['enabled'] ||= true guest_auth_state = hash.key?('guest_auth_state') ? hash['guest_auth_state'] : SKIP id = hash.key?('id') ? hash['id'] : SKIP matching = NacRuleMatching.from_hash(hash['matching']) if hash['matching'] modified_time = hash.key?('modified_time') ? hash['modified_time'] : SKIP not_matching = NacRuleMatching.from_hash(hash['not_matching']) if hash['not_matching'] order = hash.key?('order') ? hash['order'] : SKIP org_id = hash.key?('org_id') ? hash['org_id'] : 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. NacRule.new(action, name, , created_time, enabled, guest_auth_state, id, matching, modified_time, not_matching, order, org_id, additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/mist_api/models/nac_rule.rb', line 61 def self.names @_hash = {} if @_hash.nil? @_hash['action'] = 'action' @_hash['apply_tags'] = 'apply_tags' @_hash['created_time'] = 'created_time' @_hash['enabled'] = 'enabled' @_hash['guest_auth_state'] = 'guest_auth_state' @_hash['id'] = 'id' @_hash['matching'] = 'matching' @_hash['modified_time'] = 'modified_time' @_hash['name'] = 'name' @_hash['not_matching'] = 'not_matching' @_hash['order'] = 'order' @_hash['org_id'] = 'org_id' @_hash end |
.nullables ⇒ Object
An array for nullable fields
95 96 97 |
# File 'lib/mist_api/models/nac_rule.rb', line 95 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/mist_api/models/nac_rule.rb', line 79 def self.optionals %w[ apply_tags created_time enabled guest_auth_state id matching modified_time not_matching order org_id ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
175 176 177 178 179 180 181 182 183 |
# File 'lib/mist_api/models/nac_rule.rb', line 175 def inspect class_name = self.class.name.split('::').last "<#{class_name} action: #{@action.inspect}, apply_tags: #{@apply_tags.inspect},"\ " created_time: #{@created_time.inspect}, enabled: #{@enabled.inspect}, guest_auth_state:"\ " #{@guest_auth_state.inspect}, id: #{@id.inspect}, matching: #{@matching.inspect},"\ " modified_time: #{@modified_time.inspect}, name: #{@name.inspect}, not_matching:"\ " #{@not_matching.inspect}, order: #{@order.inspect}, org_id: #{@org_id.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
165 166 167 168 169 170 171 172 |
# File 'lib/mist_api/models/nac_rule.rb', line 165 def to_s class_name = self.class.name.split('::').last "<#{class_name} action: #{@action}, apply_tags: #{@apply_tags}, created_time:"\ " #{@created_time}, enabled: #{@enabled}, guest_auth_state: #{@guest_auth_state}, id:"\ " #{@id}, matching: #{@matching}, modified_time: #{@modified_time}, name: #{@name},"\ " not_matching: #{@not_matching}, order: #{@order}, org_id: #{@org_id},"\ " additional_properties: #{@additional_properties}>" end |