# Google Cloud Network Security V1 Client - Class Destination (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 Destination.

Specification of traffic destination attributes.

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

## Namespace

Google \\ Cloud \\ NetworkSecurity \\ V1 \\ AuthorizationPolicy \\ Rule

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ hosts` | `string[]` Required. List of host names to match. Matched against the ":authority" header in http requests. At least one host should match. Each host can be an exact match, or a prefix match (example "mydomain.*") or a suffix match (example "*.myorg.com") or a presence (any) match "\*". |
| `↳ ports` | `int[]` Required. List of destination ports to match. At least one port should match. |
| `↳ methods` | `string[]` Optional. A list of HTTP methods to match. At least one method should match. Should not be set for gRPC services. |
| `↳ http_header_match` | `https://docs.cloud.google.com/php/docs/reference/cloud-network-security/latest/V1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch` Optional. Match against key:value pair in http header. Provides a flexible match based on HTTP headers, for potentially advanced use cases. At least one header should match. Avoid using header matches to make authorization decisions unless there is a strong guarantee that requests arrive through a trusted client or proxy. |

### getHosts

Required. List of host names to match. Matched against the ":authority"
header in http requests. At least one host should match. Each host can
be an exact match, or a prefix match (example "mydomain.*") or a suffix
match (example "*.myorg.com") or a presence (any) match "\*".

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setHosts

Required. List of host names to match. Matched against the ":authority"
header in http requests. At least one host should match. Each host can
be an exact match, or a prefix match (example "mydomain.*") or a suffix
match (example "*.myorg.com") or a presence (any) match "\*".

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

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

### getPorts

Required. List of destination ports to match. At least one port should
match.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<int>` |   |

### setPorts

Required. List of destination ports to match. At least one port should
match.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int[]` |

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

### getMethods

Optional. A list of HTTP methods to match. At least one method should
match. Should not be set for gRPC services.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setMethods

Optional. A list of HTTP methods to match. At least one method should
match. Should not be set for gRPC services.

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

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

### getHttpHeaderMatch

Optional. Match against key:value pair in http header. Provides a
flexible match based on HTTP headers, for potentially advanced use
cases. At least one header should match. Avoid using header matches to
make authorization decisions unless there is a strong guarantee that
requests arrive through a trusted client or proxy.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-network-security/latest/V1.AuthorizationPolicy.Rule.Destination.HttpHeaderMatch|null` |   |

### hasHttpHeaderMatch

### clearHttpHeaderMatch

### setHttpHeaderMatch

Optional. Match against key:value pair in http header. Provides a
flexible match based on HTTP headers, for potentially advanced use
cases. At least one header should match. Avoid using header matches to
make authorization decisions unless there is a strong guarantee that
requests arrive through a trusted client or proxy.

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

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