# Google Cloud Asset V1 Client - Class Constraint (2.3.3)

2.3.3 (latest) 2.3.2 2.2.3 2.1.3 2.0.1 1.16.4 1.14.1 1.13.2 1.12.2 1.11.3 1.10.2 1.9.2 Reference documentation and code samples for the Google Cloud Asset V1 Client class Constraint.

The definition of a constraint.

Generated from protobuf message `google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint`

## Namespace

Google \\ Cloud \\ Asset \\ V1 \\ AnalyzerOrgPolicyConstraint

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` The unique name of the constraint. Format of the name should be \* \* `constraints/{constraint_name}` For example, `constraints/compute.disableSerialPortAccess`. |
| `↳ display_name` | `string` The human readable name of the constraint. |
| `↳ description` | `string` Detailed description of what this `Constraint` controls as well as how and where it is enforced. |
| `↳ constraint_default` | `int` The evaluation behavior of this constraint in the absence of 'Policy'. |
| `↳ list_constraint` | `https://docs.cloud.google.com/php/docs/reference/cloud-asset/latest/V1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint` Defines this constraint as being a ListConstraint. |
| `↳ boolean_constraint` | `https://docs.cloud.google.com/php/docs/reference/cloud-asset/latest/V1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint` Defines this constraint as being a BooleanConstraint. |

### getName

The unique name of the constraint. Format of the name should be

- `constraints/{constraint_name}` For example, `constraints/compute.disableSerialPortAccess`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setName

The unique name of the constraint. Format of the name should be

- `constraints/{constraint_name}` For example, `constraints/compute.disableSerialPortAccess`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

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

### getDisplayName

The human readable name of the constraint.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setDisplayName

The human readable name of the constraint.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

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

### getDescription

Detailed description of what this `Constraint` controls as well as how
and where it is enforced.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setDescription

Detailed description of what this `Constraint` controls as well as how
and where it is enforced.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

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

### getConstraintDefault

The evaluation behavior of this constraint in the absence of 'Policy'.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [ConstraintDefault](https://docs.cloud.google.com/php/docs/reference/cloud-asset/latest/V1.AnalyzerOrgPolicyConstraint.Constraint.ConstraintDefault). |

### setConstraintDefault

The evaluation behavior of this constraint in the absence of 'Policy'.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [ConstraintDefault](https://docs.cloud.google.com/php/docs/reference/cloud-asset/latest/V1.AnalyzerOrgPolicyConstraint.Constraint.ConstraintDefault). |

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

### getListConstraint

Defines this constraint as being a ListConstraint.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-asset/latest/V1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint|null` |   |

### hasListConstraint

### setListConstraint

Defines this constraint as being a ListConstraint.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-asset/latest/V1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint` |

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

### getBooleanConstraint

Defines this constraint as being a BooleanConstraint.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-asset/latest/V1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint|null` |   |

### hasBooleanConstraint

### setBooleanConstraint

Defines this constraint as being a BooleanConstraint.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-asset/latest/V1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint` |

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

### getConstraintType

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |