Class: MistApi::Psk
- Defined in:
- lib/mist_api/models/psk.rb
Overview
PSK
Instance Attribute Summary collapse
-
#admin_sso_id ⇒ String
sso id for psk created from psk portal.
-
#created_time ⇒ Float
When the object has been created, in epoch.
-
#email ⇒ String
email to send psk expiring notifications to.
-
#expire_time ⇒ Integer
Expire time for this PSK key (epoch time in seconds).
-
#expiry_notification_time ⇒ Integer
Number of days before psk is expired.
-
#id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization.
-
#mac ⇒ String
If ‘usage`==`single`, the mac that this PSK ties to, empty if `auto-binding`.
-
#macs ⇒ Array[String]
If ‘usage`==`macs`, this list contains N number of client mac addresses or mac patterns(1122*) or both.
-
#max_usage ⇒ Integer
For Org PSK Only.
-
#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.
-
#note ⇒ String
When the object has been modified for the last time, in epoch.
-
#notify_expiry ⇒ TrueClass | FalseClass
If set to true, reminder notification will be sent when psk is about to expire.
-
#notify_on_create_or_edit ⇒ TrueClass | FalseClass
If set to true, notification will be sent when psk is created or edited.
-
#old_passphrase ⇒ String
previous passphrase of the PSK if it has been rotated.
-
#org_id ⇒ UUID | String
previous passphrase of the PSK if it has been rotated.
-
#passphrase ⇒ String
passphrase of the PSK (8-63 character or 64 in hex).
-
#role ⇒ String
passphrase of the PSK (8-63 character or 64 in hex).
-
#site_id ⇒ UUID | String
passphrase of the PSK (8-63 character or 64 in hex).
-
#ssid ⇒ String
SSID this PSK should be applicable to.
-
#usage ⇒ PskUsageEnum
enum: ‘macs`, `multi`, `single`.
-
#vlan_id ⇒ Object
VLAN for this PSK key.
-
#vlan_name ⇒ String
VLAN name to be assigned.
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.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(name = nil, passphrase = nil, ssid = nil, admin_sso_id = SKIP, created_time = SKIP, email = SKIP, expire_time = SKIP, expiry_notification_time = SKIP, id = SKIP, mac = SKIP, macs = SKIP, max_usage = 0, modified_time = SKIP, note = SKIP, notify_expiry = false, notify_on_create_or_edit = SKIP, old_passphrase = SKIP, org_id = SKIP, role = SKIP, site_id = SKIP, usage = PskUsageEnum::MULTI, vlan_id = SKIP, vlan_name = SKIP, additional_properties = nil) ⇒ Psk
constructor
A new instance of Psk.
-
#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(name = nil, passphrase = nil, ssid = nil, admin_sso_id = SKIP, created_time = SKIP, email = SKIP, expire_time = SKIP, expiry_notification_time = SKIP, id = SKIP, mac = SKIP, macs = SKIP, max_usage = 0, modified_time = SKIP, note = SKIP, notify_expiry = false, notify_on_create_or_edit = SKIP, old_passphrase = SKIP, org_id = SKIP, role = SKIP, site_id = SKIP, usage = PskUsageEnum::MULTI, vlan_id = SKIP, vlan_name = SKIP, additional_properties = nil) ⇒ Psk
Returns a new instance of Psk.
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 206 207 208 209 |
# File 'lib/mist_api/models/psk.rb', line 173 def initialize(name = nil, passphrase = nil, ssid = nil, admin_sso_id = SKIP, created_time = SKIP, email = SKIP, expire_time = SKIP, expiry_notification_time = SKIP, id = SKIP, mac = SKIP, macs = SKIP, max_usage = 0, modified_time = SKIP, note = SKIP, notify_expiry = false, notify_on_create_or_edit = SKIP, old_passphrase = SKIP, org_id = SKIP, role = SKIP, site_id = SKIP, usage = PskUsageEnum::MULTI, vlan_id = SKIP, vlan_name = SKIP, additional_properties = nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @admin_sso_id = admin_sso_id unless admin_sso_id == SKIP @created_time = created_time unless created_time == SKIP @email = email unless email == SKIP @expire_time = expire_time unless expire_time == SKIP @expiry_notification_time = expiry_notification_time unless expiry_notification_time == SKIP @id = id unless id == SKIP @mac = mac unless mac == SKIP @macs = macs unless macs == SKIP @max_usage = max_usage unless max_usage == SKIP @modified_time = modified_time unless modified_time == SKIP @name = name @note = note unless note == 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 @old_passphrase = old_passphrase unless old_passphrase == SKIP @org_id = org_id unless org_id == SKIP @passphrase = passphrase @role = role unless role == SKIP @site_id = site_id unless site_id == SKIP @ssid = ssid @usage = usage unless usage == SKIP @vlan_id = vlan_id unless vlan_id == SKIP @vlan_name = vlan_name unless vlan_name == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#admin_sso_id ⇒ String
sso id for psk created from psk portal
14 15 16 |
# File 'lib/mist_api/models/psk.rb', line 14 def admin_sso_id @admin_sso_id end |
#created_time ⇒ Float
When the object has been created, in epoch
18 19 20 |
# File 'lib/mist_api/models/psk.rb', line 18 def created_time @created_time end |
#email ⇒ String
email to send psk expiring notifications to
22 23 24 |
# File 'lib/mist_api/models/psk.rb', line 22 def email @email end |
#expire_time ⇒ Integer
Expire time for this PSK key (epoch time in seconds). Default ‘null` (as no expiration)
27 28 29 |
# File 'lib/mist_api/models/psk.rb', line 27 def expire_time @expire_time end |
#expiry_notification_time ⇒ Integer
Number of days before psk is expired. Used as to when to start sending reminder notification when the psk is about to expire
32 33 34 |
# File 'lib/mist_api/models/psk.rb', line 32 def expiry_notification_time @expiry_notification_time end |
#id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization
36 37 38 |
# File 'lib/mist_api/models/psk.rb', line 36 def id @id end |
#mac ⇒ String
If ‘usage`==`single`, the mac that this PSK ties to, empty if `auto-binding`
41 42 43 |
# File 'lib/mist_api/models/psk.rb', line 41 def mac @mac end |
#macs ⇒ Array[String]
If ‘usage`==`macs`, this list contains N number of client mac addresses or mac patterns(1122*) or both. This list is capped at 5000
46 47 48 |
# File 'lib/mist_api/models/psk.rb', line 46 def macs @macs end |
#max_usage ⇒ Integer
For Org PSK Only. Max concurrent users for this PSK key. Default is 0 (unlimited)
51 52 53 |
# File 'lib/mist_api/models/psk.rb', line 51 def max_usage @max_usage end |
#modified_time ⇒ Float
When the object has been modified for the last time, in epoch
55 56 57 |
# File 'lib/mist_api/models/psk.rb', line 55 def modified_time @modified_time end |
#name ⇒ String
When the object has been modified for the last time, in epoch
59 60 61 |
# File 'lib/mist_api/models/psk.rb', line 59 def name @name end |
#note ⇒ String
When the object has been modified for the last time, in epoch
63 64 65 |
# File 'lib/mist_api/models/psk.rb', line 63 def note @note end |
#notify_expiry ⇒ TrueClass | FalseClass
If set to true, reminder notification will be sent when psk is about to expire
68 69 70 |
# File 'lib/mist_api/models/psk.rb', line 68 def notify_expiry @notify_expiry end |
#notify_on_create_or_edit ⇒ TrueClass | FalseClass
If set to true, notification will be sent when psk is created or edited
72 73 74 |
# File 'lib/mist_api/models/psk.rb', line 72 def notify_on_create_or_edit @notify_on_create_or_edit end |
#old_passphrase ⇒ String
previous passphrase of the PSK if it has been rotated
76 77 78 |
# File 'lib/mist_api/models/psk.rb', line 76 def old_passphrase @old_passphrase end |
#org_id ⇒ UUID | String
previous passphrase of the PSK if it has been rotated
80 81 82 |
# File 'lib/mist_api/models/psk.rb', line 80 def org_id @org_id end |
#passphrase ⇒ String
passphrase of the PSK (8-63 character or 64 in hex)
84 85 86 |
# File 'lib/mist_api/models/psk.rb', line 84 def passphrase @passphrase end |
#role ⇒ String
passphrase of the PSK (8-63 character or 64 in hex)
88 89 90 |
# File 'lib/mist_api/models/psk.rb', line 88 def role @role end |
#site_id ⇒ UUID | String
passphrase of the PSK (8-63 character or 64 in hex)
92 93 94 |
# File 'lib/mist_api/models/psk.rb', line 92 def site_id @site_id end |
#ssid ⇒ String
SSID this PSK should be applicable to
96 97 98 |
# File 'lib/mist_api/models/psk.rb', line 96 def ssid @ssid end |
#usage ⇒ PskUsageEnum
enum: ‘macs`, `multi`, `single`
100 101 102 |
# File 'lib/mist_api/models/psk.rb', line 100 def usage @usage end |
#vlan_id ⇒ Object
VLAN for this PSK key
104 105 106 |
# File 'lib/mist_api/models/psk.rb', line 104 def vlan_id @vlan_id end |
#vlan_name ⇒ String
VLAN name to be assigned. Optional, ‘vlan_id` takes precedence if both are provided
109 110 111 |
# File 'lib/mist_api/models/psk.rb', line 109 def vlan_name @vlan_name end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 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 |
# File 'lib/mist_api/models/psk.rb', line 212 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. name = hash.key?('name') ? hash['name'] : nil passphrase = hash.key?('passphrase') ? hash['passphrase'] : nil ssid = hash.key?('ssid') ? hash['ssid'] : nil admin_sso_id = hash.key?('admin_sso_id') ? hash['admin_sso_id'] : SKIP created_time = hash.key?('created_time') ? hash['created_time'] : SKIP email = hash.key?('email') ? hash['email'] : SKIP expire_time = hash.key?('expire_time') ? hash['expire_time'] : SKIP expiry_notification_time = hash.key?('expiry_notification_time') ? hash['expiry_notification_time'] : SKIP id = hash.key?('id') ? hash['id'] : SKIP mac = hash.key?('mac') ? hash['mac'] : SKIP macs = hash.key?('macs') ? hash['macs'] : SKIP max_usage = hash['max_usage'] ||= 0 modified_time = hash.key?('modified_time') ? hash['modified_time'] : SKIP note = hash.key?('note') ? hash['note'] : SKIP notify_expiry = hash['notify_expiry'] ||= false notify_on_create_or_edit = hash.key?('notify_on_create_or_edit') ? hash['notify_on_create_or_edit'] : SKIP old_passphrase = hash.key?('old_passphrase') ? hash['old_passphrase'] : SKIP org_id = hash.key?('org_id') ? hash['org_id'] : SKIP role = hash.key?('role') ? hash['role'] : SKIP site_id = hash.key?('site_id') ? hash['site_id'] : SKIP usage = hash['usage'] ||= PskUsageEnum::MULTI vlan_id = hash.key?('vlan_id') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:PskVlanId), hash['vlan_id'] ) : SKIP vlan_name = hash.key?('vlan_name') ? hash['vlan_name'] : 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. Psk.new(name, passphrase, ssid, admin_sso_id, created_time, email, expire_time, expiry_notification_time, id, mac, macs, max_usage, modified_time, note, notify_expiry, notify_on_create_or_edit, old_passphrase, org_id, role, site_id, usage, vlan_id, vlan_name, additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/mist_api/models/psk.rb', line 112 def self.names @_hash = {} if @_hash.nil? @_hash['admin_sso_id'] = 'admin_sso_id' @_hash['created_time'] = 'created_time' @_hash['email'] = 'email' @_hash['expire_time'] = 'expire_time' @_hash['expiry_notification_time'] = 'expiry_notification_time' @_hash['id'] = 'id' @_hash['mac'] = 'mac' @_hash['macs'] = 'macs' @_hash['max_usage'] = 'max_usage' @_hash['modified_time'] = 'modified_time' @_hash['name'] = 'name' @_hash['note'] = 'note' @_hash['notify_expiry'] = 'notify_expiry' @_hash['notify_on_create_or_edit'] = 'notify_on_create_or_edit' @_hash['old_passphrase'] = 'old_passphrase' @_hash['org_id'] = 'org_id' @_hash['passphrase'] = 'passphrase' @_hash['role'] = 'role' @_hash['site_id'] = 'site_id' @_hash['ssid'] = 'ssid' @_hash['usage'] = 'usage' @_hash['vlan_id'] = 'vlan_id' @_hash['vlan_name'] = 'vlan_name' @_hash end |
.nullables ⇒ Object
An array for nullable fields
167 168 169 170 171 |
# File 'lib/mist_api/models/psk.rb', line 167 def self.nullables %w[ expire_time ] end |
.optionals ⇒ Object
An array for optional fields
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
# File 'lib/mist_api/models/psk.rb', line 141 def self.optionals %w[ admin_sso_id created_time email expire_time expiry_notification_time id mac macs max_usage modified_time note notify_expiry notify_on_create_or_edit old_passphrase org_id role site_id usage vlan_id vlan_name ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
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.rb', line 281 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.passphrase, ->(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['passphrase'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['ssid'], ->(val) { val.instance_of? String }) ) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
319 320 321 322 323 324 325 326 327 328 329 330 331 |
# File 'lib/mist_api/models/psk.rb', line 319 def inspect class_name = self.class.name.split('::').last "<#{class_name} admin_sso_id: #{@admin_sso_id.inspect}, created_time:"\ " #{@created_time.inspect}, email: #{@email.inspect}, expire_time: #{@expire_time.inspect},"\ " expiry_notification_time: #{@expiry_notification_time.inspect}, id: #{@id.inspect}, mac:"\ " #{@mac.inspect}, macs: #{@macs.inspect}, max_usage: #{@max_usage.inspect}, modified_time:"\ " #{@modified_time.inspect}, name: #{@name.inspect}, note: #{@note.inspect}, notify_expiry:"\ " #{@notify_expiry.inspect}, notify_on_create_or_edit: #{@notify_on_create_or_edit.inspect},"\ " old_passphrase: #{@old_passphrase.inspect}, org_id: #{@org_id.inspect}, passphrase:"\ " #{@passphrase.inspect}, role: #{@role.inspect}, site_id: #{@site_id.inspect}, ssid:"\ " #{@ssid.inspect}, usage: #{@usage.inspect}, vlan_id: #{@vlan_id.inspect}, vlan_name:"\ " #{@vlan_name.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
306 307 308 309 310 311 312 313 314 315 316 |
# File 'lib/mist_api/models/psk.rb', line 306 def to_s class_name = self.class.name.split('::').last "<#{class_name} admin_sso_id: #{@admin_sso_id}, created_time: #{@created_time}, email:"\ " #{@email}, expire_time: #{@expire_time}, expiry_notification_time:"\ " #{@expiry_notification_time}, id: #{@id}, mac: #{@mac}, macs: #{@macs}, max_usage:"\ " #{@max_usage}, modified_time: #{@modified_time}, name: #{@name}, note: #{@note},"\ " notify_expiry: #{@notify_expiry}, notify_on_create_or_edit: #{@notify_on_create_or_edit},"\ " old_passphrase: #{@old_passphrase}, org_id: #{@org_id}, passphrase: #{@passphrase}, role:"\ " #{@role}, site_id: #{@site_id}, ssid: #{@ssid}, usage: #{@usage}, vlan_id: #{@vlan_id},"\ " vlan_name: #{@vlan_name}, additional_properties: #{@additional_properties}>" end |