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

A DNS threat detector sends DNS query logs to a *provider* that then
analyzes the logs to identify threat events in the DNS queries.

By default, all VPC networks in your projects are included. You can exclude
specific networks by supplying `excluded_networks`.

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

## Namespace

Google \\ Cloud \\ NetworkSecurity \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Immutable. Identifier. Name of the DnsThreatDetector resource. |
| `↳ create_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. Create time stamp. |
| `↳ update_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. Update time stamp. |
| `↳ labels` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Optional. Any labels associated with the DnsThreatDetector, listed as key value pairs. |
| `↳ excluded_networks` | `string[]` Optional. A list of network resource names which aren't monitored by this DnsThreatDetector. Example: `projects/PROJECT_ID/global/networks/NETWORK_NAME`. |
| `↳ provider` | `int` Required. The provider used for DNS threat analysis. |

### getName

Immutable. Identifier. Name of the DnsThreatDetector resource.

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

### setName

Immutable. Identifier. Name of the DnsThreatDetector resource.

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

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

### getCreateTime

Output only. Create time stamp.

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

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. Create time stamp.

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

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

### getUpdateTime

Output only. Update time stamp.

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

### hasUpdateTime

### clearUpdateTime

### setUpdateTime

Output only. Update time stamp.

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

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

### getLabels

Optional. Any labels associated with the DnsThreatDetector, listed as key
value pairs.

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

### setLabels

Optional. Any labels associated with the DnsThreatDetector, listed as key
value pairs.

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

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

### getExcludedNetworks

Optional. A list of network resource names which aren't monitored by this
DnsThreatDetector.

Example:
`projects/PROJECT_ID/global/networks/NETWORK_NAME`.

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

### setExcludedNetworks

Optional. A list of network resource names which aren't monitored by this
DnsThreatDetector.

Example:
`projects/PROJECT_ID/global/networks/NETWORK_NAME`.

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

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

### getProvider

Required. The provider used for DNS threat analysis.

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

### setProvider

Required. The provider used for DNS threat analysis.

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

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