# Google Cloud Build V2 Client - Class CreateRepositoryRequest (1.1.2)

1.1.2 (latest) 1.1.1 1.0.4 0.16.3 0.15.0 0.14.0 0.13.2 0.12.0 0.11.0 0.10.0 0.9.0 0.8.0 0.7.3 0.6.1 0.5.1 0.4.0 0.3.8 Reference documentation and code samples for the Google Cloud Build V2 Client class CreateRepositoryRequest.

Message for creating a Repository.

Generated from protobuf message `google.devtools.cloudbuild.v2.CreateRepositoryRequest`

## Namespace

Google \\ Cloud \\ Build \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ parent` | `string` Required. The connection to contain the repository. If the request is part of a BatchCreateRepositoriesRequest, this field should be empty or match the parent specified there. |
| `↳ repository` | `https://docs.cloud.google.com/php/docs/reference/cloud-build/latest/V2.Repository` Required. The repository to create. |
| `↳ repository_id` | `string` Required. The ID to use for the repository, which will become the final component of the repository's resource name. This ID should be unique in the connection. Allows alphanumeric characters and any of -._\~%!$\&'()\*+,;=@. |

### getParent

Required. The connection to contain the repository. If the request is part
of a BatchCreateRepositoriesRequest, this field should be empty or match
the parent specified there.

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

### setParent

Required. The connection to contain the repository. If the request is part
of a BatchCreateRepositoriesRequest, this field should be empty or match
the parent specified there.

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

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

### getRepository

Required. The repository to create.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-build/latest/V2.Repository|null` |   |

### hasRepository

### clearRepository

### setRepository

Required. The repository to create.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-build/latest/V2.Repository` |

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

### getRepositoryId

Required. The ID to use for the repository, which will become the final
component of the repository's resource name. This ID should be unique in
the connection. Allows alphanumeric characters and any of
-._\~%!$\&'()\*+,;=@.

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

### setRepositoryId

Required. The ID to use for the repository, which will become the final
component of the repository's resource name. This ID should be unique in
the connection. Allows alphanumeric characters and any of
-._\~%!$\&'()\*+,;=@.

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

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

### static::build

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `string` Required. The connection to contain the repository. If the request is part of a BatchCreateRepositoriesRequest, this field should be empty or match the parent specified there. Please see RepositoryManagerClient::connectionName() for help formatting this field. |
| `repository` | `https://docs.cloud.google.com/php/docs/reference/cloud-build/latest/V2.Repository` Required. The repository to create. |
| `repositoryId` | `string` Required. The ID to use for the repository, which will become the final component of the repository's resource name. This ID should be unique in the connection. Allows alphanumeric characters and any of -._\~%!$\&'()\*+,;=@. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-build/latest/V2.CreateRepositoryRequest` |   |