# Google Cloud Managed Kafka V1 Client - Class CreateTopicRequest (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 CreateTopicRequest.

Request for CreateTopic.

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

## Namespace

Google \\ Cloud \\ ManagedKafka \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ parent` | `string` Required. The parent cluster in which to create the topic. Structured like `projects/{project}/locations/{location}/clusters/{cluster}`. |
| `↳ topic_id` | `string` Required. The ID to use for the topic, which will become the final component of the topic's name. This value is structured like: `my-topic-name`. |
| `↳ topic` | `https://docs.cloud.google.com/php/docs/reference/cloud-managedkafka/latest/V1.Topic` Required. Configuration of the topic to create. Its `name` field is ignored. |

### getParent

Required. The parent cluster in which to create the topic.

Structured like
`projects/{project}/locations/{location}/clusters/{cluster}`.

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

### setParent

Required. The parent cluster in which to create the topic.

Structured like
`projects/{project}/locations/{location}/clusters/{cluster}`.

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

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

### getTopicId

Required. The ID to use for the topic, which will become the final
component of the topic's name.

This value is structured like: `my-topic-name`.

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

### setTopicId

Required. The ID to use for the topic, which will become the final
component of the topic's name.

This value is structured like: `my-topic-name`.

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

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

### getTopic

Required. Configuration of the topic to create. Its `name` field is
ignored.

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

### hasTopic

### clearTopic

### setTopic

Required. Configuration of the topic to create. Its `name` field is
ignored.

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

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

### static::build

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `string` Required. The parent cluster in which to create the topic. Structured like `projects/{project}/locations/{location}/clusters/{cluster}`. Please see ManagedKafkaClient::clusterName() for help formatting this field. |
| `topic` | `https://docs.cloud.google.com/php/docs/reference/cloud-managedkafka/latest/V1.Topic` Required. Configuration of the topic to create. Its `name` field is ignored. |
| `topicId` | `string` Required. The ID to use for the topic, which will become the final component of the topic's name. This value is structured like: `my-topic-name`. |

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