# Google Cloud Redis V1 Client - Class CreateInstanceRequest (2.2.3)

2.2.3 (latest) 2.2.2 2.1.6 2.0.0 1.9.5 1.8.4 1.7.0 1.6.12 Reference documentation and code samples for the Google Cloud Redis V1 Client class CreateInstanceRequest.

Request for
[CreateInstance](https://docs.cloud.google.com/php/docs/reference/cloud-redis/latest/V1.Client.CloudRedisClient#_Google_Cloud_Redis_V1_Client_CloudRedisClient__createInstance__).

Generated from protobuf message `google.cloud.redis.v1.CreateInstanceRequest`

## Namespace

Google \\ Cloud \\ Redis \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ parent` | `string` Required. The resource name of the instance location using the form: `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region. |
| `↳ instance_id` | `string` Required. The logical name of the Redis instance in the customer project with the following restrictions: \* \* Must contain only lowercase letters, numbers, and hyphens. \* \* Must start with a letter. \* \* Must be between 1-40 characters. \* \* Must end with a number or a letter. \* \* Must be unique within the customer project / location |
| `↳ instance` | `https://docs.cloud.google.com/php/docs/reference/cloud-redis/latest/V1.Instance` Required. A Redis \[Instance\] resource |

### getParent

Required. The resource name of the instance location using the form:
`projects/{project_id}/locations/{location_id}`
where `location_id` refers to a GCP region.

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

### setParent

Required. The resource name of the instance location using the form:
`projects/{project_id}/locations/{location_id}`
where `location_id` refers to a GCP region.

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

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

### getInstanceId

Required. The logical name of the Redis instance in the customer project
with the following restrictions:

- Must contain only lowercase letters, numbers, and hyphens.

- Must start with a letter.

- Must be between 1-40 characters.
- Must end with a number or a letter.
- Must be unique within the customer project / location

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

### setInstanceId

Required. The logical name of the Redis instance in the customer project
with the following restrictions:

- Must contain only lowercase letters, numbers, and hyphens.

- Must start with a letter.

- Must be between 1-40 characters.
- Must end with a number or a letter.
- Must be unique within the customer project / location

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

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

### getInstance

Required. A Redis \[Instance\] resource

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

### hasInstance

### clearInstance

### setInstance

Required. A Redis \[Instance\] resource

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

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

### static::build

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `string` Required. The resource name of the instance location using the form: `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region. Please see CloudRedisClient::locationName() for help formatting this field. |
| `instanceId` | `string` Required. The logical name of the Redis instance in the customer project with the following restrictions: - - Must contain only lowercase letters, numbers, and hyphens. - - Must start with a letter. - - Must be between 1-40 characters. - - Must end with a number or a letter. - - Must be unique within the customer project / location |
| `instance` | `https://docs.cloud.google.com/php/docs/reference/cloud-redis/latest/V1.Instance` Required. A Redis \[Instance\] resource |

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