Class: MistApi::PskPortal

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

Overview

PskPortal 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, ssid = nil, auth = PskPortalAuthEnum::SSO, bg_image_url = SKIP, cleanup_psk = false, created_time = SKIP, expire_time = SKIP, expiry_notification_time = SKIP, hide_psks_created_by_other_admins = false, id = SKIP, max_usage = 0, modified_time = SKIP, notification_renew_url = SKIP, notify_expiry = SKIP, notify_on_create_or_edit = false, org_id = SKIP, passphrase_rules = SKIP, required_fields = SKIP, role = SKIP, sso = SKIP, template_url = SKIP, thumbnail_url = SKIP, type = SKIP, ui_url = SKIP, vlan_id = SKIP, additional_properties = nil) ⇒ PskPortal

Returns a new instance of PskPortal.



185
186
187
188
189
190
191
192
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
# File 'lib/mist_api/models/psk_portal.rb', line 185

def initialize(name = nil, ssid = nil, auth = PskPortalAuthEnum::SSO,
               bg_image_url = SKIP, cleanup_psk = false,
               created_time = SKIP, expire_time = SKIP,
               expiry_notification_time = SKIP,
               hide_psks_created_by_other_admins = false, id = SKIP,
               max_usage = 0, modified_time = SKIP,
               notification_renew_url = SKIP, notify_expiry = SKIP,
               notify_on_create_or_edit = false, org_id = SKIP,
               passphrase_rules = SKIP, required_fields = SKIP, role = SKIP,
               sso = SKIP, template_url = SKIP, thumbnail_url = SKIP,
               type = SKIP, ui_url = SKIP, vlan_id = SKIP,
               additional_properties = nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @auth = auth unless auth == SKIP
  @bg_image_url = bg_image_url unless bg_image_url == SKIP
  @cleanup_psk = cleanup_psk unless cleanup_psk == SKIP
  @created_time = created_time unless created_time == SKIP
  @expire_time = expire_time unless expire_time == SKIP
  @expiry_notification_time = expiry_notification_time unless expiry_notification_time == SKIP
  unless hide_psks_created_by_other_admins == SKIP
    @hide_psks_created_by_other_admins =
      hide_psks_created_by_other_admins
  end
  @id = id unless id == SKIP
  @max_usage = max_usage unless max_usage == SKIP
  @modified_time = modified_time unless modified_time == SKIP
  @name = name
  @notification_renew_url = notification_renew_url unless notification_renew_url == SKIP
  @notify_expiry = notify_expiry unless notify_expiry == SKIP
  @notify_on_create_or_edit = notify_on_create_or_edit unless notify_on_create_or_edit == SKIP
  @org_id = org_id unless org_id == SKIP
  @passphrase_rules = passphrase_rules unless passphrase_rules == SKIP
  @required_fields = required_fields unless required_fields == SKIP
  @role = role unless role == SKIP
  @ssid = ssid
  @sso = sso unless sso == SKIP
  @template_url = template_url unless template_url == SKIP
  @thumbnail_url = thumbnail_url unless thumbnail_url == SKIP
  @type = type unless type == SKIP
  @ui_url = ui_url unless ui_url == SKIP
  @vlan_id = vlan_id unless vlan_id == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#authPskPortalAuthEnum

enum: ‘sponsor`, `sso`

Returns:



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

def auth
  @auth
end

#bg_image_urlString

enum: ‘sponsor`, `sso`

Returns:

  • (String)


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

def bg_image_url
  @bg_image_url
end

#cleanup_pskTrueClass | FalseClass

Used to cleanup exited psk when portal delete or ssid changed

Returns:

  • (TrueClass | FalseClass)


22
23
24
# File 'lib/mist_api/models/psk_portal.rb', line 22

def cleanup_psk
  @cleanup_psk
end

#created_timeFloat

When the object has been created, in epoch

Returns:

  • (Float)


26
27
28
# File 'lib/mist_api/models/psk_portal.rb', line 26

def created_time
  @created_time
end

#expire_timeInteger

unit min

Returns:

  • (Integer)


30
31
32
# File 'lib/mist_api/models/psk_portal.rb', line 30

def expire_time
  @expire_time
end

#expiry_notification_timeInteger

Number of days before psk is expired. Used as to when to start sending reminder notification when the psk is about to expire

Returns:

  • (Integer)


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

def expiry_notification_time
  @expiry_notification_time
end

#hide_psks_created_by_other_adminsTrueClass | FalseClass

Only if ‘type`==`admin`

Returns:

  • (TrueClass | FalseClass)


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

def hide_psks_created_by_other_admins
  @hide_psks_created_by_other_admins
end

#idUUID | String

Unique ID of the object instance in the Mist Organization

Returns:

  • (UUID | String)


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

def id
  @id
end

#max_usageInteger

‘max_usage`==`0` means unlimited

Returns:

  • (Integer)


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

def max_usage
  @max_usage
end

#modified_timeFloat

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

Returns:

  • (Float)


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

def modified_time
  @modified_time
end

#nameString

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

Returns:

  • (String)


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

def name
  @name
end

#notification_renew_urlString

Optional, will include the link in the notification email the customer can either provide their own url or use the one generate from mist, or do a url shorterner against either

Returns:

  • (String)


61
62
63
# File 'lib/mist_api/models/psk_portal.rb', line 61

def notification_renew_url
  @notification_renew_url
end

#notify_expiryTrueClass | FalseClass

If set to true, reminder notification will be sent when psk is about to expire

Returns:

  • (TrueClass | FalseClass)


66
67
68
# File 'lib/mist_api/models/psk_portal.rb', line 66

def notify_expiry
  @notify_expiry
end

#notify_on_create_or_editTrueClass | FalseClass

If set to true, reminder notification will be sent when psk is about to expire

Returns:

  • (TrueClass | FalseClass)


71
72
73
# File 'lib/mist_api/models/psk_portal.rb', line 71

def notify_on_create_or_edit
  @notify_on_create_or_edit
end

#org_idUUID | String

If set to true, reminder notification will be sent when psk is about to expire

Returns:

  • (UUID | String)


76
77
78
# File 'lib/mist_api/models/psk_portal.rb', line 76

def org_id
  @org_id
end

#passphrase_rulesPskPortalPassphraseRules

If set to true, reminder notification will be sent when psk is about to expire



81
82
83
# File 'lib/mist_api/models/psk_portal.rb', line 81

def passphrase_rules
  @passphrase_rules
end

#required_fieldsArray[String]

what information to ask for (email is required by default)

Returns:

  • (Array[String])


85
86
87
# File 'lib/mist_api/models/psk_portal.rb', line 85

def required_fields
  @required_fields
end

#roleString

what information to ask for (email is required by default)

Returns:

  • (String)


89
90
91
# File 'lib/mist_api/models/psk_portal.rb', line 89

def role
  @role
end

#ssidString

intended SSID

Returns:

  • (String)


93
94
95
# File 'lib/mist_api/models/psk_portal.rb', line 93

def ssid
  @ssid
end

#ssoPskPortalSso

If ‘auth`==`sso`

Returns:



97
98
99
# File 'lib/mist_api/models/psk_portal.rb', line 97

def sso
  @sso
end

#template_urlString

UI customization

Returns:

  • (String)


101
102
103
# File 'lib/mist_api/models/psk_portal.rb', line 101

def template_url
  @template_url
end

#thumbnail_urlString

UI customization

Returns:

  • (String)


105
106
107
# File 'lib/mist_api/models/psk_portal.rb', line 105

def thumbnail_url
  @thumbnail_url
end

#typePskPortalTypeEnum

for personal psk portal. enum: ‘admin`, `byod`

Returns:



109
110
111
# File 'lib/mist_api/models/psk_portal.rb', line 109

def type
  @type
end

#ui_urlString

for personal psk portal. enum: ‘admin`, `byod`

Returns:

  • (String)


113
114
115
# File 'lib/mist_api/models/psk_portal.rb', line 113

def ui_url
  @ui_url
end

#vlan_idObject

for personal psk portal. enum: ‘admin`, `byod`

Returns:

  • (Object)


117
118
119
# File 'lib/mist_api/models/psk_portal.rb', line 117

def vlan_id
  @vlan_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
# File 'lib/mist_api/models/psk_portal.rb', line 232

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  name = hash.key?('name') ? hash['name'] : nil
  ssid = hash.key?('ssid') ? hash['ssid'] : nil
  auth = hash['auth'] ||= PskPortalAuthEnum::SSO
  bg_image_url = hash.key?('bg_image_url') ? hash['bg_image_url'] : SKIP
  cleanup_psk = hash['cleanup_psk'] ||= false
  created_time = hash.key?('created_time') ? hash['created_time'] : SKIP
  expire_time = hash.key?('expire_time') ? hash['expire_time'] : SKIP
  expiry_notification_time =
    hash.key?('expiry_notification_time') ? hash['expiry_notification_time'] : SKIP
  hide_psks_created_by_other_admins =
    hash['hide_psks_created_by_other_admins'] ||= false
  id = hash.key?('id') ? hash['id'] : SKIP
  max_usage = hash['max_usage'] ||= 0
  modified_time = hash.key?('modified_time') ? hash['modified_time'] : SKIP
  notification_renew_url =
    hash.key?('notification_renew_url') ? hash['notification_renew_url'] : SKIP
  notify_expiry = hash.key?('notify_expiry') ? hash['notify_expiry'] : SKIP
  notify_on_create_or_edit = hash['notify_on_create_or_edit'] ||= false
  org_id = hash.key?('org_id') ? hash['org_id'] : SKIP
  passphrase_rules = PskPortalPassphraseRules.from_hash(hash['passphrase_rules']) if
    hash['passphrase_rules']
  required_fields =
    hash.key?('required_fields') ? hash['required_fields'] : SKIP
  role = hash.key?('role') ? hash['role'] : SKIP
  sso = PskPortalSso.from_hash(hash['sso']) if hash['sso']
  template_url = hash.key?('template_url') ? hash['template_url'] : SKIP
  thumbnail_url = hash.key?('thumbnail_url') ? hash['thumbnail_url'] : SKIP
  type = hash.key?('type') ? hash['type'] : SKIP
  ui_url = hash.key?('ui_url') ? hash['ui_url'] : SKIP
  vlan_id = hash.key?('vlan_id') ? APIHelper.deserialize_union_type(
    UnionTypeLookUp.get(:VlanIdWithVariable3), hash['vlan_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.
  PskPortal.new(name,
                ssid,
                auth,
                bg_image_url,
                cleanup_psk,
                created_time,
                expire_time,
                expiry_notification_time,
                hide_psks_created_by_other_admins,
                id,
                max_usage,
                modified_time,
                notification_renew_url,
                notify_expiry,
                notify_on_create_or_edit,
                org_id,
                passphrase_rules,
                required_fields,
                role,
                sso,
                template_url,
                thumbnail_url,
                type,
                ui_url,
                vlan_id,
                additional_properties)
end

.namesObject

A mapping from model property names to API property names.



120
121
122
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
# File 'lib/mist_api/models/psk_portal.rb', line 120

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['auth'] = 'auth'
  @_hash['bg_image_url'] = 'bg_image_url'
  @_hash['cleanup_psk'] = 'cleanup_psk'
  @_hash['created_time'] = 'created_time'
  @_hash['expire_time'] = 'expire_time'
  @_hash['expiry_notification_time'] = 'expiry_notification_time'
  @_hash['hide_psks_created_by_other_admins'] =
    'hide_psks_created_by_other_admins'
  @_hash['id'] = 'id'
  @_hash['max_usage'] = 'max_usage'
  @_hash['modified_time'] = 'modified_time'
  @_hash['name'] = 'name'
  @_hash['notification_renew_url'] = 'notification_renew_url'
  @_hash['notify_expiry'] = 'notify_expiry'
  @_hash['notify_on_create_or_edit'] = 'notify_on_create_or_edit'
  @_hash['org_id'] = 'org_id'
  @_hash['passphrase_rules'] = 'passphrase_rules'
  @_hash['required_fields'] = 'required_fields'
  @_hash['role'] = 'role'
  @_hash['ssid'] = 'ssid'
  @_hash['sso'] = 'sso'
  @_hash['template_url'] = 'template_url'
  @_hash['thumbnail_url'] = 'thumbnail_url'
  @_hash['type'] = 'type'
  @_hash['ui_url'] = 'ui_url'
  @_hash['vlan_id'] = 'vlan_id'
  @_hash
end

.nullablesObject

An array for nullable fields



181
182
183
# File 'lib/mist_api/models/psk_portal.rb', line 181

def self.nullables
  []
end

.optionalsObject

An array for optional fields



152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# File 'lib/mist_api/models/psk_portal.rb', line 152

def self.optionals
  %w[
    auth
    bg_image_url
    cleanup_psk
    created_time
    expire_time
    expiry_notification_time
    hide_psks_created_by_other_admins
    id
    max_usage
    modified_time
    notification_renew_url
    notify_expiry
    notify_on_create_or_edit
    org_id
    passphrase_rules
    required_fields
    role
    sso
    template_url
    thumbnail_url
    type
    ui_url
    vlan_id
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:

  • The (PskPortal | Hash)

    value against the validation is performed.



307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
# File 'lib/mist_api/models/psk_portal.rb', line 307

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.ssid,
                              ->(val) { val.instance_of? String })
    )
  end

  return false unless value.instance_of? Hash

  (
    APIHelper.valid_type?(value['name'],
                          ->(val) { val.instance_of? String }) and
      APIHelper.valid_type?(value['ssid'],
                            ->(val) { val.instance_of? String })
  )
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
# File 'lib/mist_api/models/psk_portal.rb', line 343

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} auth: #{@auth.inspect}, bg_image_url: #{@bg_image_url.inspect},"\
  " cleanup_psk: #{@cleanup_psk.inspect}, created_time: #{@created_time.inspect}, expire_time:"\
  " #{@expire_time.inspect}, expiry_notification_time: #{@expiry_notification_time.inspect},"\
  " hide_psks_created_by_other_admins: #{@hide_psks_created_by_other_admins.inspect}, id:"\
  " #{@id.inspect}, max_usage: #{@max_usage.inspect}, modified_time:"\
  " #{@modified_time.inspect}, name: #{@name.inspect}, notification_renew_url:"\
  " #{@notification_renew_url.inspect}, notify_expiry: #{@notify_expiry.inspect},"\
  " notify_on_create_or_edit: #{@notify_on_create_or_edit.inspect}, org_id:"\
  " #{@org_id.inspect}, passphrase_rules: #{@passphrase_rules.inspect}, required_fields:"\
  " #{@required_fields.inspect}, role: #{@role.inspect}, ssid: #{@ssid.inspect}, sso:"\
  " #{@sso.inspect}, template_url: #{@template_url.inspect}, thumbnail_url:"\
  " #{@thumbnail_url.inspect}, type: #{@type.inspect}, ui_url: #{@ui_url.inspect}, vlan_id:"\
  " #{@vlan_id.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



328
329
330
331
332
333
334
335
336
337
338
339
340
# File 'lib/mist_api/models/psk_portal.rb', line 328

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} auth: #{@auth}, bg_image_url: #{@bg_image_url}, cleanup_psk:"\
  " #{@cleanup_psk}, created_time: #{@created_time}, expire_time: #{@expire_time},"\
  " expiry_notification_time: #{@expiry_notification_time}, hide_psks_created_by_other_admins:"\
  " #{@hide_psks_created_by_other_admins}, id: #{@id}, max_usage: #{@max_usage},"\
  " modified_time: #{@modified_time}, name: #{@name}, notification_renew_url:"\
  " #{@notification_renew_url}, notify_expiry: #{@notify_expiry}, notify_on_create_or_edit:"\
  " #{@notify_on_create_or_edit}, org_id: #{@org_id}, passphrase_rules: #{@passphrase_rules},"\
  " required_fields: #{@required_fields}, role: #{@role}, ssid: #{@ssid}, sso: #{@sso},"\
  " template_url: #{@template_url}, thumbnail_url: #{@thumbnail_url}, type: #{@type}, ui_url:"\
  " #{@ui_url}, vlan_id: #{@vlan_id}, additional_properties: #{@additional_properties}>"
end