# Google Cloud Sql Admin V1 Client - Class PasswordValidationPolicy (1.9.0)

1.9.0 (latest) 1.8.0 1.7.0 1.6.0 1.5.0 1.4.0 1.3.1 1.2.6 1.1.0 1.0.0 0.19.0 0.18.0 0.17.1 0.16.1 0.12.0 0.11.0 0.10.0 0.9.0 0.8.0 0.7.0 0.6.0 0.5.0 0.4.1 0.3.1 0.2.12 Reference documentation and code samples for the Google Cloud Sql Admin V1 Client class PasswordValidationPolicy.

Database instance local user password validation policy.

This message defines the password policy for local database users.
When enabled, it enforces constraints on password complexity, length,
and reuse. Keep this policy enabled to help prevent unauthorized access.

Generated from protobuf message `google.cloud.sql.v1.PasswordValidationPolicy`

## Namespace

Google \\ Cloud \\ Sql \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ min_length` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Int32Value` Minimum number of characters allowed. |
| `↳ complexity` | `int` The complexity of the password. |
| `↳ reuse_interval` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Int32Value` Number of previous passwords that cannot be reused. |
| `↳ disallow_username_substring` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/BoolValue` Disallow username as a part of the password. |
| `↳ password_change_interval` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` Minimum interval after which the password can be changed. This flag is only supported for PostgreSQL. |
| `↳ enable_password_policy` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/BoolValue` Whether to enable the password policy or not. When enabled, passwords must meet complexity requirements. Keep this policy enabled to help prevent unauthorized access. Disabling this policy allows weak passwords. |
| `↳ disallow_compromised_credentials` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/BoolValue` This field is deprecated and will be removed in a future version of the API. |

### getMinLength

Minimum number of characters allowed.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Int32Value|null` |   |

### hasMinLength

### clearMinLength

### getMinLengthUnwrapped

Returns the unboxed value from `getMinLength()`

Minimum number of characters allowed.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int|null` |   |

### setMinLength

Minimum number of characters allowed.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Int32Value` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### setMinLengthUnwrapped

Sets the field by wrapping a primitive type in a Google\\Protobuf\\Int32Value object.

Minimum number of characters allowed.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int|null` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getComplexity

The complexity of the password.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Complexity](https://docs.cloud.google.com/php/docs/reference/cloud-sql-admin/latest/V1.PasswordValidationPolicy.Complexity). |

### setComplexity

The complexity of the password.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Complexity](https://docs.cloud.google.com/php/docs/reference/cloud-sql-admin/latest/V1.PasswordValidationPolicy.Complexity). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getReuseInterval

Number of previous passwords that cannot be reused.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Int32Value|null` |   |

### hasReuseInterval

### clearReuseInterval

### getReuseIntervalUnwrapped

Returns the unboxed value from `getReuseInterval()`

Number of previous passwords that cannot be reused.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int|null` |   |

### setReuseInterval

Number of previous passwords that cannot be reused.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Int32Value` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### setReuseIntervalUnwrapped

Sets the field by wrapping a primitive type in a Google\\Protobuf\\Int32Value object.

Number of previous passwords that cannot be reused.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int|null` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDisallowUsernameSubstring

Disallow username as a part of the password.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/BoolValue|null` |   |

### hasDisallowUsernameSubstring

### clearDisallowUsernameSubstring

### getDisallowUsernameSubstringUnwrapped

Returns the unboxed value from `getDisallowUsernameSubstring()`

Disallow username as a part of the password.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool|null` |   |

### setDisallowUsernameSubstring

Disallow username as a part of the password.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/BoolValue` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### setDisallowUsernameSubstringUnwrapped

Sets the field by wrapping a primitive type in a Google\\Protobuf\\BoolValue object.

Disallow username as a part of the password.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool|null` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getPasswordChangeInterval

Minimum interval after which the password can be changed. This flag is only
supported for PostgreSQL.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration|null` |   |

### hasPasswordChangeInterval

### clearPasswordChangeInterval

### setPasswordChangeInterval

Minimum interval after which the password can be changed. This flag is only
supported for PostgreSQL.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getEnablePasswordPolicy

Whether to enable the password policy or not. When enabled, passwords must
meet complexity requirements. Keep this policy enabled to help prevent
unauthorized access. Disabling this policy allows weak passwords.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/BoolValue|null` |   |

### hasEnablePasswordPolicy

### clearEnablePasswordPolicy

### getEnablePasswordPolicyUnwrapped

Returns the unboxed value from `getEnablePasswordPolicy()`

Whether to enable the password policy or not. When enabled, passwords must
meet complexity requirements. Keep this policy enabled to help prevent
unauthorized access. Disabling this policy allows weak passwords.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool|null` |   |

### setEnablePasswordPolicy

Whether to enable the password policy or not. When enabled, passwords must
meet complexity requirements. Keep this policy enabled to help prevent
unauthorized access. Disabling this policy allows weak passwords.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/BoolValue` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### setEnablePasswordPolicyUnwrapped

Sets the field by wrapping a primitive type in a Google\\Protobuf\\BoolValue object.

Whether to enable the password policy or not. When enabled, passwords must
meet complexity requirements. Keep this policy enabled to help prevent
unauthorized access. Disabling this policy allows weak passwords.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool|null` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDisallowCompromisedCredentials

This field is deprecated and will be removed in a future version of the
API.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/BoolValue|null` |   |

### hasDisallowCompromisedCredentials

### clearDisallowCompromisedCredentials

### getDisallowCompromisedCredentialsUnwrapped

Returns the unboxed value from `getDisallowCompromisedCredentials()`

This field is deprecated and will be removed in a future version of the
API.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool|null` |   |

### setDisallowCompromisedCredentials

This field is deprecated and will be removed in a future version of the
API.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/BoolValue` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### setDisallowCompromisedCredentialsUnwrapped

Sets the field by wrapping a primitive type in a Google\\Protobuf\\BoolValue object.

This field is deprecated and will be removed in a future version of the
API.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool|null` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |