# Google Cloud Vision Ai V1 Client - Class CreateCollectionRequest (0.3.0)

0.3.0 (latest) 0.2.0 0.1.0 Reference documentation and code samples for the Google Cloud Vision Ai V1 Client class CreateCollectionRequest.

Request message for CreateCollection.

Generated from protobuf message `google.cloud.visionai.v1.CreateCollectionRequest`

## Namespace

Google \\ Cloud \\ VisionAI \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ parent` | `string` Required. The parent resource where this collection will be created. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}` |
| `↳ collection` | `https://docs.cloud.google.com/php/docs/reference/cloud-visionai/latest/V1.Collection` Required. The collection resource to be created. |
| `↳ collection_id` | `string` Optional. The ID to use for the collection, which will become the final component of the resource name if user choose to specify. Otherwise, collection id will be generated by system. This value should be up to 55 characters, and valid characters are /\[a-z\]\[0-9\]-/. The first character must be a letter, the last could be a letter or a number. |

### getParent

Required. The parent resource where this collection will be created.

Format: `projects/{project_number}/locations/{location}/corpora/{corpus}`

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

### setParent

Required. The parent resource where this collection will be created.

Format: `projects/{project_number}/locations/{location}/corpora/{corpus}`

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

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

### getCollection

Required. The collection resource to be created.

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

### hasCollection

### clearCollection

### setCollection

Required. The collection resource to be created.

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

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

### getCollectionId

Optional. The ID to use for the collection, which will become the final
component of the resource name if user choose to specify. Otherwise,
collection id will be generated by system.

This value should be up to 55 characters, and valid characters
are /\[a-z\]\[0-9\]-/. The first character must be a letter, the last could be
a letter or a number.

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

### hasCollectionId

### clearCollectionId

### setCollectionId

Optional. The ID to use for the collection, which will become the final
component of the resource name if user choose to specify. Otherwise,
collection id will be generated by system.

This value should be up to 55 characters, and valid characters
are /\[a-z\]\[0-9\]-/. The first character must be a letter, the last could be
a letter or a number.

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

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

### static::build

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `string` Required. The parent resource where this collection will be created. Format: `projects/{project_number}/locations/{location}/corpora/{corpus}` Please see WarehouseClient::corpusName() for help formatting this field. |
| `collection` | `https://docs.cloud.google.com/php/docs/reference/cloud-visionai/latest/V1.Collection` Required. The collection resource to be created. |
| `collectionId` | `string` Optional. The ID to use for the collection, which will become the final component of the resource name if user choose to specify. Otherwise, collection id will be generated by system. This value should be up to 55 characters, and valid characters are /\[a-z\]\[0-9\]-/. The first character must be a letter, the last could be a letter or a number. |

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