# Google Cloud Network Security V1 Client - Class AuthorizationPolicy (1.4.0)

1.4.0 (latest) 1.3.0 1.2.3 1.1.0 1.0.4 0.6.5 0.5.2 0.4.1 0.3.7 Reference documentation and code samples for the Google Cloud Network Security V1 Client class AuthorizationPolicy.

AuthorizationPolicy is a resource that specifies how a server
should authorize incoming connections. This resource in itself does
not change the configuration unless it's attached to a target https
proxy or endpoint config selector resource.

Generated from protobuf message `google.cloud.networksecurity.v1.AuthorizationPolicy`

## Namespace

Google \\ Cloud \\ NetworkSecurity \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Required. Name of the AuthorizationPolicy resource. It matches pattern `projects/{project}/locations/{location}/authorizationPolicies/<authorization_policy>`. |
| `↳ description` | `string` Optional. Free-text description of the resource. |
| `↳ create_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The timestamp when the resource was created. |
| `↳ update_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The timestamp when the resource was updated. |
| `↳ labels` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Optional. Set of label tags associated with the AuthorizationPolicy resource. |
| `↳ action` | `int` Required. The action to take when a rule match is found. Possible values are "ALLOW" or "DENY". |
| `↳ rules` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-network-security/latest/V1.AuthorizationPolicy.Rule>` Optional. List of rules to match. Note that at least one of the rules must match in order for the action specified in the 'action' field to be taken. A rule is a match if there is a matching source and destination. If left blank, the action specified in the `action` field will be applied on every request. |

### getName

Required. Name of the AuthorizationPolicy resource. It matches pattern
`projects/{project}/locations/{location}/authorizationPolicies/<authorization_policy>`.

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

### setName

Required. Name of the AuthorizationPolicy resource. It matches pattern
`projects/{project}/locations/{location}/authorizationPolicies/<authorization_policy>`.

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

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

### getDescription

Optional. Free-text description of the resource.

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

### setDescription

Optional. Free-text description of the resource.

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

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

### getCreateTime

Output only. The timestamp when the resource was created.

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

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. The timestamp when the resource was created.

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

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

### getUpdateTime

Output only. The timestamp when the resource was updated.

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

### hasUpdateTime

### clearUpdateTime

### setUpdateTime

Output only. The timestamp when the resource was updated.

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

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

### getLabels

Optional. Set of label tags associated with the AuthorizationPolicy
resource.

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

### setLabels

Optional. Set of label tags associated with the AuthorizationPolicy
resource.

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

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

### getAction

Required. The action to take when a rule match is found. Possible values
are "ALLOW" or "DENY".

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Action](https://docs.cloud.google.com/php/docs/reference/cloud-network-security/latest/V1.AuthorizationPolicy.Action). |

### setAction

Required. The action to take when a rule match is found. Possible values
are "ALLOW" or "DENY".

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Action](https://docs.cloud.google.com/php/docs/reference/cloud-network-security/latest/V1.AuthorizationPolicy.Action). |

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

### getRules

Optional. List of rules to match. Note that at least one of the rules must
match in order for the action specified in the 'action' field to be taken.

A rule is a match if there is a matching source and destination. If left
blank, the action specified in the `action` field will be applied on every
request.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-network-security/latest/V1.AuthorizationPolicy.Rule>` |   |

### setRules

Optional. List of rules to match. Note that at least one of the rules must
match in order for the action specified in the 'action' field to be taken.

A rule is a match if there is a matching source and destination. If left
blank, the action specified in the `action` field will be applied on every
request.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-network-security/latest/V1.AuthorizationPolicy.Rule>` |

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