Class: MistApi::WxlanRule
- Defined in:
- lib/mist_api/models/wxlan_rule.rb
Overview
WXlan
Instance Attribute Summary collapse
-
#action ⇒ WxlanRuleActionEnum
type of action, allow / block.
-
#apply_tags ⇒ Array[String]
type of action, allow / block.
-
#blocked_apps ⇒ Array[String]
Blocked apps (always blocking, ignoring action), the key of Get Application List.
-
#created_time ⇒ Float
When the object has been created, in epoch.
-
#dst_allow_wxtags ⇒ Array[String]
List of WxTag UUID to indicate these tags are allowed access.
-
#dst_deny_wxtags ⇒ Array[String]
List of WxTag UUID to indicate these tags are blocked access.
-
#dst_wxtags ⇒ Array[String]
List of WxTag UUID.
-
#enabled ⇒ TrueClass | FalseClass
List of WxTag UUID.
-
#for_site ⇒ TrueClass | FalseClass
List of WxTag UUID.
-
#id ⇒ UUID | String
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.
-
#order ⇒ Integer
Order how rules would be looked up, > 0 and bigger order got matched first, -1 means LAST, uniqueness not checked.
-
#org_id ⇒ UUID | String
Order how rules would be looked up, > 0 and bigger order got matched first, -1 means LAST, uniqueness not checked.
-
#site_id ⇒ UUID | String
Order how rules would be looked up, > 0 and bigger order got matched first, -1 means LAST, uniqueness not checked.
-
#src_wxtags ⇒ Array[String]
List of WxTag UUID to determine if this rule would match.
-
#template_id ⇒ UUID | String
Only for Org Level WxRule.
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(order = nil, src_wxtags = nil, action = SKIP, apply_tags = SKIP, blocked_apps = SKIP, created_time = SKIP, dst_allow_wxtags = SKIP, dst_deny_wxtags = SKIP, dst_wxtags = SKIP, enabled = true, for_site = SKIP, id = SKIP, modified_time = SKIP, org_id = SKIP, site_id = SKIP, template_id = SKIP, additional_properties = nil) ⇒ WxlanRule
constructor
A new instance of WxlanRule.
-
#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(order = nil, src_wxtags = nil, action = SKIP, apply_tags = SKIP, blocked_apps = SKIP, created_time = SKIP, dst_allow_wxtags = SKIP, dst_deny_wxtags = SKIP, dst_wxtags = SKIP, enabled = true, for_site = SKIP, id = SKIP, modified_time = SKIP, org_id = SKIP, site_id = SKIP, template_id = SKIP, additional_properties = nil) ⇒ WxlanRule
Returns a new instance of WxlanRule.
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 |
# File 'lib/mist_api/models/wxlan_rule.rb', line 127 def initialize(order = nil, = nil, action = SKIP, = SKIP, blocked_apps = SKIP, created_time = SKIP, = SKIP, = SKIP, = SKIP, enabled = true, for_site = SKIP, id = SKIP, modified_time = SKIP, org_id = SKIP, site_id = SKIP, template_id = SKIP, additional_properties = nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @action = action unless action == SKIP @apply_tags = unless == SKIP @blocked_apps = blocked_apps unless blocked_apps == SKIP @created_time = created_time unless created_time == SKIP @dst_allow_wxtags = unless == SKIP @dst_deny_wxtags = unless == SKIP @dst_wxtags = unless == SKIP @enabled = enabled unless enabled == SKIP @for_site = for_site unless for_site == SKIP @id = id unless id == SKIP @modified_time = modified_time unless modified_time == SKIP @order = order @org_id = org_id unless org_id == SKIP @site_id = site_id unless site_id == SKIP @src_wxtags = @template_id = template_id unless template_id == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#action ⇒ WxlanRuleActionEnum
type of action, allow / block. enum: ‘allow`, `block`
14 15 16 |
# File 'lib/mist_api/models/wxlan_rule.rb', line 14 def action @action end |
#apply_tags ⇒ Array[String]
type of action, allow / block. enum: ‘allow`, `block`
18 19 20 |
# File 'lib/mist_api/models/wxlan_rule.rb', line 18 def @apply_tags end |
#blocked_apps ⇒ Array[String]
Blocked apps (always blocking, ignoring action), the key of Get Application List
23 24 25 |
# File 'lib/mist_api/models/wxlan_rule.rb', line 23 def blocked_apps @blocked_apps end |
#created_time ⇒ Float
When the object has been created, in epoch
27 28 29 |
# File 'lib/mist_api/models/wxlan_rule.rb', line 27 def created_time @created_time end |
#dst_allow_wxtags ⇒ Array[String]
List of WxTag UUID to indicate these tags are allowed access
31 32 33 |
# File 'lib/mist_api/models/wxlan_rule.rb', line 31 def @dst_allow_wxtags end |
#dst_deny_wxtags ⇒ Array[String]
List of WxTag UUID to indicate these tags are blocked access
35 36 37 |
# File 'lib/mist_api/models/wxlan_rule.rb', line 35 def @dst_deny_wxtags end |
#dst_wxtags ⇒ Array[String]
List of WxTag UUID
39 40 41 |
# File 'lib/mist_api/models/wxlan_rule.rb', line 39 def @dst_wxtags end |
#enabled ⇒ TrueClass | FalseClass
List of WxTag UUID
43 44 45 |
# File 'lib/mist_api/models/wxlan_rule.rb', line 43 def enabled @enabled end |
#for_site ⇒ TrueClass | FalseClass
List of WxTag UUID
47 48 49 |
# File 'lib/mist_api/models/wxlan_rule.rb', line 47 def for_site @for_site end |
#id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization
51 52 53 |
# File 'lib/mist_api/models/wxlan_rule.rb', line 51 def id @id end |
#modified_time ⇒ Float
When the object has been modified for the last time, in epoch
55 56 57 |
# File 'lib/mist_api/models/wxlan_rule.rb', line 55 def modified_time @modified_time end |
#order ⇒ Integer
Order how rules would be looked up, > 0 and bigger order got matched first, -1 means LAST, uniqueness not checked
60 61 62 |
# File 'lib/mist_api/models/wxlan_rule.rb', line 60 def order @order end |
#org_id ⇒ UUID | String
Order how rules would be looked up, > 0 and bigger order got matched first, -1 means LAST, uniqueness not checked
65 66 67 |
# File 'lib/mist_api/models/wxlan_rule.rb', line 65 def org_id @org_id end |
#site_id ⇒ UUID | String
Order how rules would be looked up, > 0 and bigger order got matched first, -1 means LAST, uniqueness not checked
70 71 72 |
# File 'lib/mist_api/models/wxlan_rule.rb', line 70 def site_id @site_id end |
#src_wxtags ⇒ Array[String]
List of WxTag UUID to determine if this rule would match
74 75 76 |
# File 'lib/mist_api/models/wxlan_rule.rb', line 74 def @src_wxtags end |
#template_id ⇒ UUID | String
Only for Org Level WxRule
78 79 80 |
# File 'lib/mist_api/models/wxlan_rule.rb', line 78 def template_id @template_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
157 158 159 160 161 162 163 164 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 197 198 199 200 201 202 203 204 205 |
# File 'lib/mist_api/models/wxlan_rule.rb', line 157 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. order = hash.key?('order') ? hash['order'] : nil = hash.key?('src_wxtags') ? hash['src_wxtags'] : nil action = hash.key?('action') ? hash['action'] : SKIP = hash.key?('apply_tags') ? hash['apply_tags'] : SKIP blocked_apps = hash.key?('blocked_apps') ? hash['blocked_apps'] : SKIP created_time = hash.key?('created_time') ? hash['created_time'] : SKIP = hash.key?('dst_allow_wxtags') ? hash['dst_allow_wxtags'] : SKIP = hash.key?('dst_deny_wxtags') ? hash['dst_deny_wxtags'] : SKIP = hash.key?('dst_wxtags') ? hash['dst_wxtags'] : SKIP enabled = hash['enabled'] ||= true for_site = hash.key?('for_site') ? hash['for_site'] : SKIP id = hash.key?('id') ? hash['id'] : SKIP modified_time = hash.key?('modified_time') ? hash['modified_time'] : SKIP org_id = hash.key?('org_id') ? hash['org_id'] : SKIP site_id = hash.key?('site_id') ? hash['site_id'] : SKIP template_id = hash.key?('template_id') ? hash['template_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. WxlanRule.new(order, , action, , blocked_apps, created_time, , , , enabled, for_site, id, modified_time, org_id, site_id, template_id, additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/mist_api/models/wxlan_rule.rb', line 81 def self.names @_hash = {} if @_hash.nil? @_hash['action'] = 'action' @_hash['apply_tags'] = 'apply_tags' @_hash['blocked_apps'] = 'blocked_apps' @_hash['created_time'] = 'created_time' @_hash['dst_allow_wxtags'] = 'dst_allow_wxtags' @_hash['dst_deny_wxtags'] = 'dst_deny_wxtags' @_hash['dst_wxtags'] = 'dst_wxtags' @_hash['enabled'] = 'enabled' @_hash['for_site'] = 'for_site' @_hash['id'] = 'id' @_hash['modified_time'] = 'modified_time' @_hash['order'] = 'order' @_hash['org_id'] = 'org_id' @_hash['site_id'] = 'site_id' @_hash['src_wxtags'] = 'src_wxtags' @_hash['template_id'] = 'template_id' @_hash end |
.nullables ⇒ Object
An array for nullable fields
123 124 125 |
# File 'lib/mist_api/models/wxlan_rule.rb', line 123 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/mist_api/models/wxlan_rule.rb', line 103 def self.optionals %w[ action apply_tags blocked_apps created_time dst_allow_wxtags dst_deny_wxtags dst_wxtags enabled for_site id modified_time org_id site_id template_id ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
219 220 221 222 223 224 225 226 227 228 229 |
# File 'lib/mist_api/models/wxlan_rule.rb', line 219 def inspect class_name = self.class.name.split('::').last "<#{class_name} action: #{@action.inspect}, apply_tags: #{@apply_tags.inspect},"\ " blocked_apps: #{@blocked_apps.inspect}, created_time: #{@created_time.inspect},"\ " dst_allow_wxtags: #{@dst_allow_wxtags.inspect}, dst_deny_wxtags:"\ " #{@dst_deny_wxtags.inspect}, dst_wxtags: #{@dst_wxtags.inspect}, enabled:"\ " #{@enabled.inspect}, for_site: #{@for_site.inspect}, id: #{@id.inspect}, modified_time:"\ " #{@modified_time.inspect}, order: #{@order.inspect}, org_id: #{@org_id.inspect}, site_id:"\ " #{@site_id.inspect}, src_wxtags: #{@src_wxtags.inspect}, template_id:"\ " #{@template_id.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
208 209 210 211 212 213 214 215 216 |
# File 'lib/mist_api/models/wxlan_rule.rb', line 208 def to_s class_name = self.class.name.split('::').last "<#{class_name} action: #{@action}, apply_tags: #{@apply_tags}, blocked_apps:"\ " #{@blocked_apps}, created_time: #{@created_time}, dst_allow_wxtags: #{@dst_allow_wxtags},"\ " dst_deny_wxtags: #{@dst_deny_wxtags}, dst_wxtags: #{@dst_wxtags}, enabled: #{@enabled},"\ " for_site: #{@for_site}, id: #{@id}, modified_time: #{@modified_time}, order: #{@order},"\ " org_id: #{@org_id}, site_id: #{@site_id}, src_wxtags: #{@src_wxtags}, template_id:"\ " #{@template_id}, additional_properties: #{@additional_properties}>" end |