Class: MistApi::WxlanRule

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/wxlan_rule.rb

Overview

WXlan

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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, 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)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @action = action unless action == SKIP
  @apply_tags = apply_tags unless apply_tags == SKIP
  @blocked_apps = blocked_apps unless blocked_apps == SKIP
  @created_time = created_time unless created_time == SKIP
  @dst_allow_wxtags = dst_allow_wxtags unless dst_allow_wxtags == SKIP
  @dst_deny_wxtags = dst_deny_wxtags unless dst_deny_wxtags == SKIP
  @dst_wxtags = dst_wxtags unless dst_wxtags == 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 = src_wxtags
  @template_id = template_id unless template_id == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#actionWxlanRuleActionEnum

type of action, allow / block. enum: ‘allow`, `block`

Returns:



14
15
16
# File 'lib/mist_api/models/wxlan_rule.rb', line 14

def action
  @action
end

#apply_tagsArray[String]

type of action, allow / block. enum: ‘allow`, `block`

Returns:

  • (Array[String])


18
19
20
# File 'lib/mist_api/models/wxlan_rule.rb', line 18

def apply_tags
  @apply_tags
end

#blocked_appsArray[String]

Blocked apps (always blocking, ignoring action), the key of Get Application List

Returns:

  • (Array[String])


23
24
25
# File 'lib/mist_api/models/wxlan_rule.rb', line 23

def blocked_apps
  @blocked_apps
end

#created_timeFloat

When the object has been created, in epoch

Returns:

  • (Float)


27
28
29
# File 'lib/mist_api/models/wxlan_rule.rb', line 27

def created_time
  @created_time
end

#dst_allow_wxtagsArray[String]

List of WxTag UUID to indicate these tags are allowed access

Returns:

  • (Array[String])


31
32
33
# File 'lib/mist_api/models/wxlan_rule.rb', line 31

def dst_allow_wxtags
  @dst_allow_wxtags
end

#dst_deny_wxtagsArray[String]

List of WxTag UUID to indicate these tags are blocked access

Returns:

  • (Array[String])


35
36
37
# File 'lib/mist_api/models/wxlan_rule.rb', line 35

def dst_deny_wxtags
  @dst_deny_wxtags
end

#dst_wxtagsArray[String]

List of WxTag UUID

Returns:

  • (Array[String])


39
40
41
# File 'lib/mist_api/models/wxlan_rule.rb', line 39

def dst_wxtags
  @dst_wxtags
end

#enabledTrueClass | FalseClass

List of WxTag UUID

Returns:

  • (TrueClass | FalseClass)


43
44
45
# File 'lib/mist_api/models/wxlan_rule.rb', line 43

def enabled
  @enabled
end

#for_siteTrueClass | FalseClass

List of WxTag UUID

Returns:

  • (TrueClass | FalseClass)


47
48
49
# File 'lib/mist_api/models/wxlan_rule.rb', line 47

def for_site
  @for_site
end

#idUUID | String

Unique ID of the object instance in the Mist Organization

Returns:

  • (UUID | String)


51
52
53
# File 'lib/mist_api/models/wxlan_rule.rb', line 51

def id
  @id
end

#modified_timeFloat

When the object has been modified for the last time, in epoch

Returns:

  • (Float)


55
56
57
# File 'lib/mist_api/models/wxlan_rule.rb', line 55

def modified_time
  @modified_time
end

#orderInteger

Order how rules would be looked up, > 0 and bigger order got matched first, -1 means LAST, uniqueness not checked

Returns:

  • (Integer)


60
61
62
# File 'lib/mist_api/models/wxlan_rule.rb', line 60

def order
  @order
end

#org_idUUID | String

Order how rules would be looked up, > 0 and bigger order got matched first, -1 means LAST, uniqueness not checked

Returns:

  • (UUID | String)


65
66
67
# File 'lib/mist_api/models/wxlan_rule.rb', line 65

def org_id
  @org_id
end

#site_idUUID | String

Order how rules would be looked up, > 0 and bigger order got matched first, -1 means LAST, uniqueness not checked

Returns:

  • (UUID | String)


70
71
72
# File 'lib/mist_api/models/wxlan_rule.rb', line 70

def site_id
  @site_id
end

#src_wxtagsArray[String]

List of WxTag UUID to determine if this rule would match

Returns:

  • (Array[String])


74
75
76
# File 'lib/mist_api/models/wxlan_rule.rb', line 74

def src_wxtags
  @src_wxtags
end

#template_idUUID | String

Only for Org Level WxRule

Returns:

  • (UUID | String)


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
  src_wxtags = hash.key?('src_wxtags') ? hash['src_wxtags'] : nil
  action = hash.key?('action') ? hash['action'] : SKIP
  apply_tags = 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
  dst_allow_wxtags =
    hash.key?('dst_allow_wxtags') ? hash['dst_allow_wxtags'] : SKIP
  dst_deny_wxtags =
    hash.key?('dst_deny_wxtags') ? hash['dst_deny_wxtags'] : SKIP
  dst_wxtags = 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,
                src_wxtags,
                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,
                additional_properties)
end

.namesObject

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

.nullablesObject

An array for nullable fields



123
124
125
# File 'lib/mist_api/models/wxlan_rule.rb', line 123

def self.nullables
  []
end

.optionalsObject

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

#inspectObject

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_sObject

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