Class: MistApi::OrgSettingPasswordPolicy
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- MistApi::OrgSettingPasswordPolicy
- Defined in:
- lib/mist_api/models/org_setting_password_policy.rb
Overview
password policy
Instance Attribute Summary collapse
-
#enabled ⇒ TrueClass | FalseClass
Whether the policy is enabled.
-
#expiry_in_days ⇒ Integer
Password expiry in days.
-
#min_length ⇒ Integer
Required password length.
-
#requires_special_char ⇒ TrueClass | FalseClass
Whether to require special character.
-
#requires_two_factor_auth ⇒ TrueClass | FalseClass
Whether to require two-factor auth.
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(enabled = false, expiry_in_days = SKIP, min_length = 8, requires_special_char = false, requires_two_factor_auth = false) ⇒ OrgSettingPasswordPolicy
constructor
A new instance of OrgSettingPasswordPolicy.
-
#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(enabled = false, expiry_in_days = SKIP, min_length = 8, requires_special_char = false, requires_two_factor_auth = false) ⇒ OrgSettingPasswordPolicy
Returns a new instance of OrgSettingPasswordPolicy.
60 61 62 63 64 65 66 67 68 |
# File 'lib/mist_api/models/org_setting_password_policy.rb', line 60 def initialize(enabled = false, expiry_in_days = SKIP, min_length = 8, requires_special_char = false, requires_two_factor_auth = false) @enabled = enabled unless enabled == SKIP @expiry_in_days = expiry_in_days unless expiry_in_days == SKIP @min_length = min_length unless min_length == SKIP @requires_special_char = requires_special_char unless requires_special_char == SKIP @requires_two_factor_auth = requires_two_factor_auth unless requires_two_factor_auth == SKIP end |
Instance Attribute Details
#enabled ⇒ TrueClass | FalseClass
Whether the policy is enabled
14 15 16 |
# File 'lib/mist_api/models/org_setting_password_policy.rb', line 14 def enabled @enabled end |
#expiry_in_days ⇒ Integer
Password expiry in days. Password Expiry Notice banner will display in the UI 14 days before expiration
19 20 21 |
# File 'lib/mist_api/models/org_setting_password_policy.rb', line 19 def expiry_in_days @expiry_in_days end |
#min_length ⇒ Integer
Required password length
23 24 25 |
# File 'lib/mist_api/models/org_setting_password_policy.rb', line 23 def min_length @min_length end |
#requires_special_char ⇒ TrueClass | FalseClass
Whether to require special character
27 28 29 |
# File 'lib/mist_api/models/org_setting_password_policy.rb', line 27 def requires_special_char @requires_special_char end |
#requires_two_factor_auth ⇒ TrueClass | FalseClass
Whether to require two-factor auth
31 32 33 |
# File 'lib/mist_api/models/org_setting_password_policy.rb', line 31 def requires_two_factor_auth @requires_two_factor_auth end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/mist_api/models/org_setting_password_policy.rb', line 71 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. enabled = hash['enabled'] ||= false expiry_in_days = hash.key?('expiry_in_days') ? hash['expiry_in_days'] : SKIP min_length = hash['min_length'] ||= 8 requires_special_char = hash['requires_special_char'] ||= false requires_two_factor_auth = hash['requires_two_factor_auth'] ||= false # Create object from extracted values. OrgSettingPasswordPolicy.new(enabled, expiry_in_days, min_length, requires_special_char, requires_two_factor_auth) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 41 42 |
# File 'lib/mist_api/models/org_setting_password_policy.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['enabled'] = 'enabled' @_hash['expiry_in_days'] = 'expiry_in_days' @_hash['min_length'] = 'min_length' @_hash['requires_special_char'] = 'requires_special_char' @_hash['requires_two_factor_auth'] = 'requires_two_factor_auth' @_hash end |
.nullables ⇒ Object
An array for nullable fields
56 57 58 |
# File 'lib/mist_api/models/org_setting_password_policy.rb', line 56 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
45 46 47 48 49 50 51 52 53 |
# File 'lib/mist_api/models/org_setting_password_policy.rb', line 45 def self.optionals %w[ enabled expiry_in_days min_length requires_special_char requires_two_factor_auth ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
99 100 101 102 103 104 105 |
# File 'lib/mist_api/models/org_setting_password_policy.rb', line 99 def inspect class_name = self.class.name.split('::').last "<#{class_name} enabled: #{@enabled.inspect}, expiry_in_days: #{@expiry_in_days.inspect},"\ " min_length: #{@min_length.inspect}, requires_special_char:"\ " #{@requires_special_char.inspect}, requires_two_factor_auth:"\ " #{@requires_two_factor_auth.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
91 92 93 94 95 96 |
# File 'lib/mist_api/models/org_setting_password_policy.rb', line 91 def to_s class_name = self.class.name.split('::').last "<#{class_name} enabled: #{@enabled}, expiry_in_days: #{@expiry_in_days}, min_length:"\ " #{@min_length}, requires_special_char: #{@requires_special_char},"\ " requires_two_factor_auth: #{@requires_two_factor_auth}>" end |