# Google Cloud Managed Kafka V1 Client - Class Connector (0.8.0)

0.8.0 (latest) 0.7.2 0.6.1 0.5.0 0.4.1 0.3.1 0.2.3 0.1.3 Reference documentation and code samples for the Google Cloud Managed Kafka V1 Client class Connector.

A Kafka Connect connector in a given ConnectCluster.

Generated from protobuf message `google.cloud.managedkafka.v1.Connector`

## Namespace

Google \\ Cloud \\ ManagedKafka \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ task_restart_policy` | `https://docs.cloud.google.com/php/docs/reference/cloud-managedkafka/latest/V1.TaskRetryPolicy` Optional. Restarts the individual tasks of a Connector. |
| `↳ name` | `string` Identifier. The name of the connector. Structured like: projects/{project}/locations/{location}/connectClusters/{connect_cluster}/connectors/{connector} |
| `↳ configs` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Optional. Connector config as keys/values. The keys of the map are connector property names, for example: `connector.class`, `tasks.max`, `key.converter`. |
| `↳ state` | `int` Output only. The current state of the connector. |

### getTaskRestartPolicy

Optional. Restarts the individual tasks of a Connector.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-managedkafka/latest/V1.TaskRetryPolicy|null` |   |

### hasTaskRestartPolicy

### setTaskRestartPolicy

Optional. Restarts the individual tasks of a Connector.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-managedkafka/latest/V1.TaskRetryPolicy` |

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

### getName

Identifier. The name of the connector.

Structured like:
projects/{project}/locations/{location}/connectClusters/{connect_cluster}/connectors/{connector}

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

### setName

Identifier. The name of the connector.

Structured like:
projects/{project}/locations/{location}/connectClusters/{connect_cluster}/connectors/{connector}

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

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

### getConfigs

Optional. Connector config as keys/values.

The keys of the map are connector property names, for example:
`connector.class`, `tasks.max`, `key.converter`.

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

### setConfigs

Optional. Connector config as keys/values.

The keys of the map are connector property names, for example:
`connector.class`, `tasks.max`, `key.converter`.

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

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

### getState

Output only. The current state of the connector.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-managedkafka/latest/V1.Connector.State). |

### setState

Output only. The current state of the connector.

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

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

### getRestartPolicy

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