Class: OCI::Identity::Models::PasswordPolicy
- Inherits:
-
Object
- Object
- OCI::Identity::Models::PasswordPolicy
- Defined in:
- lib/oci/identity/models/password_policy.rb
Overview
Password policy, currently set for the given compartment.
Instance Attribute Summary collapse
-
#is_lowercase_characters_required ⇒ BOOLEAN
At least one lower case character required.
-
#is_numeric_characters_required ⇒ BOOLEAN
At least one numeric character required.
-
#is_special_characters_required ⇒ BOOLEAN
At least one special character required.
-
#is_uppercase_characters_required ⇒ BOOLEAN
At least one uppercase character required.
-
#is_username_containment_allowed ⇒ BOOLEAN
User name is allowed to be part of the password.
-
#minimum_password_length ⇒ Integer
Minimum password length required.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ PasswordPolicy
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ PasswordPolicy
Initializes the object
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/oci/identity/models/password_policy.rb', line 74 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.minimum_password_length = attributes[:'minimumPasswordLength'] if attributes[:'minimumPasswordLength'] raise 'You cannot provide both :minimumPasswordLength and :minimum_password_length' if attributes.key?(:'minimumPasswordLength') && attributes.key?(:'minimum_password_length') self.minimum_password_length = attributes[:'minimum_password_length'] if attributes[:'minimum_password_length'] self.is_uppercase_characters_required = attributes[:'isUppercaseCharactersRequired'] unless attributes[:'isUppercaseCharactersRequired'].nil? self.is_uppercase_characters_required = true if is_uppercase_characters_required.nil? && !attributes.key?(:'isUppercaseCharactersRequired') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :isUppercaseCharactersRequired and :is_uppercase_characters_required' if attributes.key?(:'isUppercaseCharactersRequired') && attributes.key?(:'is_uppercase_characters_required') self.is_uppercase_characters_required = attributes[:'is_uppercase_characters_required'] unless attributes[:'is_uppercase_characters_required'].nil? self.is_uppercase_characters_required = true if is_uppercase_characters_required.nil? && !attributes.key?(:'isUppercaseCharactersRequired') && !attributes.key?(:'is_uppercase_characters_required') # rubocop:disable Style/StringLiterals self.is_lowercase_characters_required = attributes[:'isLowercaseCharactersRequired'] unless attributes[:'isLowercaseCharactersRequired'].nil? self.is_lowercase_characters_required = true if is_lowercase_characters_required.nil? && !attributes.key?(:'isLowercaseCharactersRequired') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :isLowercaseCharactersRequired and :is_lowercase_characters_required' if attributes.key?(:'isLowercaseCharactersRequired') && attributes.key?(:'is_lowercase_characters_required') self.is_lowercase_characters_required = attributes[:'is_lowercase_characters_required'] unless attributes[:'is_lowercase_characters_required'].nil? self.is_lowercase_characters_required = true if is_lowercase_characters_required.nil? && !attributes.key?(:'isLowercaseCharactersRequired') && !attributes.key?(:'is_lowercase_characters_required') # rubocop:disable Style/StringLiterals self.is_numeric_characters_required = attributes[:'isNumericCharactersRequired'] unless attributes[:'isNumericCharactersRequired'].nil? self.is_numeric_characters_required = true if is_numeric_characters_required.nil? && !attributes.key?(:'isNumericCharactersRequired') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :isNumericCharactersRequired and :is_numeric_characters_required' if attributes.key?(:'isNumericCharactersRequired') && attributes.key?(:'is_numeric_characters_required') self.is_numeric_characters_required = attributes[:'is_numeric_characters_required'] unless attributes[:'is_numeric_characters_required'].nil? self.is_numeric_characters_required = true if is_numeric_characters_required.nil? && !attributes.key?(:'isNumericCharactersRequired') && !attributes.key?(:'is_numeric_characters_required') # rubocop:disable Style/StringLiterals self.is_special_characters_required = attributes[:'isSpecialCharactersRequired'] unless attributes[:'isSpecialCharactersRequired'].nil? self.is_special_characters_required = true if is_special_characters_required.nil? && !attributes.key?(:'isSpecialCharactersRequired') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :isSpecialCharactersRequired and :is_special_characters_required' if attributes.key?(:'isSpecialCharactersRequired') && attributes.key?(:'is_special_characters_required') self.is_special_characters_required = attributes[:'is_special_characters_required'] unless attributes[:'is_special_characters_required'].nil? self.is_special_characters_required = true if is_special_characters_required.nil? && !attributes.key?(:'isSpecialCharactersRequired') && !attributes.key?(:'is_special_characters_required') # rubocop:disable Style/StringLiterals self.is_username_containment_allowed = attributes[:'isUsernameContainmentAllowed'] unless attributes[:'isUsernameContainmentAllowed'].nil? self.is_username_containment_allowed = false if is_username_containment_allowed.nil? && !attributes.key?(:'isUsernameContainmentAllowed') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :isUsernameContainmentAllowed and :is_username_containment_allowed' if attributes.key?(:'isUsernameContainmentAllowed') && attributes.key?(:'is_username_containment_allowed') self.is_username_containment_allowed = attributes[:'is_username_containment_allowed'] unless attributes[:'is_username_containment_allowed'].nil? self.is_username_containment_allowed = false if is_username_containment_allowed.nil? && !attributes.key?(:'isUsernameContainmentAllowed') && !attributes.key?(:'is_username_containment_allowed') # rubocop:disable Style/StringLiterals end |
Instance Attribute Details
#is_lowercase_characters_required ⇒ BOOLEAN
At least one lower case character required.
20 21 22 |
# File 'lib/oci/identity/models/password_policy.rb', line 20 def is_lowercase_characters_required @is_lowercase_characters_required end |
#is_numeric_characters_required ⇒ BOOLEAN
At least one numeric character required.
24 25 26 |
# File 'lib/oci/identity/models/password_policy.rb', line 24 def is_numeric_characters_required @is_numeric_characters_required end |
#is_special_characters_required ⇒ BOOLEAN
At least one special character required.
28 29 30 |
# File 'lib/oci/identity/models/password_policy.rb', line 28 def is_special_characters_required @is_special_characters_required end |
#is_uppercase_characters_required ⇒ BOOLEAN
At least one uppercase character required.
16 17 18 |
# File 'lib/oci/identity/models/password_policy.rb', line 16 def is_uppercase_characters_required @is_uppercase_characters_required end |
#is_username_containment_allowed ⇒ BOOLEAN
User name is allowed to be part of the password.
32 33 34 |
# File 'lib/oci/identity/models/password_policy.rb', line 32 def is_username_containment_allowed @is_username_containment_allowed end |
#minimum_password_length ⇒ Integer
Minimum password length required.
12 13 14 |
# File 'lib/oci/identity/models/password_policy.rb', line 12 def minimum_password_length @minimum_password_length end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/oci/identity/models/password_policy.rb', line 35 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'minimum_password_length': :'minimumPasswordLength', 'is_uppercase_characters_required': :'isUppercaseCharactersRequired', 'is_lowercase_characters_required': :'isLowercaseCharactersRequired', 'is_numeric_characters_required': :'isNumericCharactersRequired', 'is_special_characters_required': :'isSpecialCharactersRequired', 'is_username_containment_allowed': :'isUsernameContainmentAllowed' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/oci/identity/models/password_policy.rb', line 49 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'minimum_password_length': :'Integer', 'is_uppercase_characters_required': :'BOOLEAN', 'is_lowercase_characters_required': :'BOOLEAN', 'is_numeric_characters_required': :'BOOLEAN', 'is_special_characters_required': :'BOOLEAN', 'is_username_containment_allowed': :'BOOLEAN' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/oci/identity/models/password_policy.rb', line 134 def ==(other) return true if equal?(other) self.class == other.class && minimum_password_length == other.minimum_password_length && is_uppercase_characters_required == other.is_uppercase_characters_required && is_lowercase_characters_required == other.is_lowercase_characters_required && is_numeric_characters_required == other.is_numeric_characters_required && is_special_characters_required == other.is_special_characters_required && is_username_containment_allowed == other.is_username_containment_allowed end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 |
# File 'lib/oci/identity/models/password_policy.rb', line 169 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]) ) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
149 150 151 |
# File 'lib/oci/identity/models/password_policy.rb', line 149 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
158 159 160 |
# File 'lib/oci/identity/models/password_policy.rb', line 158 def hash [minimum_password_length, is_uppercase_characters_required, is_lowercase_characters_required, is_numeric_characters_required, is_special_characters_required, is_username_containment_allowed].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
202 203 204 205 206 207 208 209 210 211 |
# File 'lib/oci/identity/models/password_policy.rb', line 202 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
196 197 198 |
# File 'lib/oci/identity/models/password_policy.rb', line 196 def to_s to_hash.to_s end |