Class: CypressTestApi::NacTag

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/cypress_test_api/models/nac_tag.rb

Overview

NacTag Model.

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(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, org_id = SKIP, radius_attrs = SKIP, radius_group = SKIP, radius_vendor_attrs = SKIP, session_timeout = SKIP, username_attr = SKIP, values = SKIP, vlan = SKIP) ⇒ 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
# File 'lib/cypress_test_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, org_id = SKIP, radius_attrs = SKIP,
               radius_group = SKIP, radius_vendor_attrs = SKIP,
               session_timeout = SKIP, username_attr = SKIP, values = SKIP,
               vlan = SKIP)
  @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
  @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
end

Instance Attribute Details

#allow_usermac_overrideTrueClass | FalseClass

can be set to true to allow the override by usermac result

Returns:

  • (TrueClass | FalseClass)


14
15
16
# File 'lib/cypress_test_api/models/nac_tag.rb', line 14

def allow_usermac_override
  @allow_usermac_override
end

#created_timeFloat

can be set to true to allow the override by usermac result

Returns:

  • (Float)


18
19
20
# File 'lib/cypress_test_api/models/nac_tag.rb', line 18

def created_time
  @created_time
end

#egress_vlan_namesArray[String]

if ‘type`==`egress_vlan_names`, list of egress vlans to return

Returns:

  • (Array[String])


22
23
24
# File 'lib/cypress_test_api/models/nac_tag.rb', line 22

def egress_vlan_names
  @egress_vlan_names
end

#gbp_tagInteger

if ‘type`==`gbp_tag`

Returns:

  • (Integer)


26
27
28
# File 'lib/cypress_test_api/models/nac_tag.rb', line 26

def gbp_tag
  @gbp_tag
end

#idUUID | String

if ‘type`==`gbp_tag`

Returns:

  • (UUID | String)


30
31
32
# File 'lib/cypress_test_api/models/nac_tag.rb', line 30

def id
  @id
end

#matchNacTag

if ‘type`==`gbp_tag`

Returns:



34
35
36
# File 'lib/cypress_test_api/models/nac_tag.rb', line 34

def match
  @match
end

#match_allTrueClass | 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` or `match`==`usermac_label`’

Returns:

  • (TrueClass | FalseClass)


43
44
45
# File 'lib/cypress_test_api/models/nac_tag.rb', line 43

def match_all
  @match_all
end

#modified_timeFloat

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` or `match`==`usermac_label`’

Returns:

  • (Float)


52
53
54
# File 'lib/cypress_test_api/models/nac_tag.rb', line 52

def modified_time
  @modified_time
end

#nameString

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` or `match`==`usermac_label`’

Returns:

  • (String)


61
62
63
# File 'lib/cypress_test_api/models/nac_tag.rb', line 61

def name
  @name
end

#org_idUUID | String

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` or `match`==`usermac_label`’

Returns:

  • (UUID | String)


70
71
72
# File 'lib/cypress_test_api/models/nac_tag.rb', line 70

def org_id
  @org_id
end

#radius_attrsArray[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.

Returns:

  • (Array[String])


79
80
81
# File 'lib/cypress_test_api/models/nac_tag.rb', line 79

def radius_attrs
  @radius_attrs
end

#radius_groupString

if ‘type`==`radius_group`

Returns:

  • (String)


83
84
85
# File 'lib/cypress_test_api/models/nac_tag.rb', line 83

def radius_group
  @radius_group
end

#radius_vendor_attrsArray[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.

Returns:

  • (Array[String])


92
93
94
# File 'lib/cypress_test_api/models/nac_tag.rb', line 92

def radius_vendor_attrs
  @radius_vendor_attrs
end

#session_timeoutInteger

if ‘type`==`session_timeout, in seconds

Returns:

  • (Integer)


96
97
98
# File 'lib/cypress_test_api/models/nac_tag.rb', line 96

def session_timeout
  @session_timeout
end

#typeNacTag

if ‘type`==`session_timeout, in seconds

Returns:



100
101
102
# File 'lib/cypress_test_api/models/nac_tag.rb', line 100

def type
  @type
end

#username_attrNacTag

if ‘type`==`session_timeout, in seconds

Returns:



104
105
106
# File 'lib/cypress_test_api/models/nac_tag.rb', line 104

def username_attr
  @username_attr
end

#valuesArray[String]

if ‘type`==`match`

Returns:

  • (Array[String])


108
109
110
# File 'lib/cypress_test_api/models/nac_tag.rb', line 108

def values
  @values
end

#vlanString

if ‘type`==`vlan`

Returns:

  • (String)


112
113
114
# File 'lib/cypress_test_api/models/nac_tag.rb', line 112

def vlan
  @vlan
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



193
194
195
196
197
198
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
# File 'lib/cypress_test_api/models/nac_tag.rb', line 193

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  name = hash.key?('name') ? hash['name'] : nil
  type = NacTag.from_hash(hash['type']) if hash['type']
  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') ? hash['gbp_tag'] : SKIP
  id = hash.key?('id') ? hash['id'] : SKIP
  match = NacTag.from_hash(hash['match']) if hash['match']
  match_all = hash['match_all'] ||= false
  modified_time = hash.key?('modified_time') ? hash['modified_time'] : 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 = NacTag.from_hash(hash['username_attr']) if hash['username_attr']
  values = hash.key?('values') ? hash['values'] : SKIP
  vlan = hash.key?('vlan') ? hash['vlan'] : SKIP

  # 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,
             org_id,
             radius_attrs,
             radius_group,
             radius_vendor_attrs,
             session_timeout,
             username_attr,
             values,
             vlan)
end

.namesObject

A mapping from model property names to API property names.



115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/cypress_test_api/models/nac_tag.rb', line 115

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['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

.nullablesObject

An array for nullable fields



161
162
163
# File 'lib/cypress_test_api/models/nac_tag.rb', line 161

def self.nullables
  []
end

.optionalsObject

An array for optional fields



139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/cypress_test_api/models/nac_tag.rb', line 139

def self.optionals
  %w[
    allow_usermac_override
    created_time
    egress_vlan_names
    gbp_tag
    id
    match
    match_all
    modified_time
    org_id
    radius_attrs
    radius_group
    radius_vendor_attrs
    session_timeout
    username_attr
    values
    vlan
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



253
254
255
256
257
258
259
260
261
262
263
# File 'lib/cypress_test_api/models/nac_tag.rb', line 253

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}, 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}>"
end

#to_sObject

Provides a human-readable string representation of the object.



241
242
243
244
245
246
247
248
249
250
# File 'lib/cypress_test_api/models/nac_tag.rb', line 241

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},"\
  " 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}>"
end