# Google Cloud Functions V2 Client - Class CreateFunctionRequest (2.1.3)

2.1.3 (latest) 2.1.2 2.0.6 1.7.0 1.6.5 1.5.0 1.4.2 1.3.1 1.2.0 1.1.2 1.0.3 Reference documentation and code samples for the Google Cloud Functions V2 Client class CreateFunctionRequest.

Request for the `CreateFunction` method.

Generated from protobuf message `google.cloud.functions.v2.CreateFunctionRequest`

## Namespace

Google \\ Cloud \\ Functions \\ V2

## Methods

### __construct

Constructor.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `data` | `mixed` |

### getParent

Required. The project and location in which the function should be created,
specified in the format `projects/*/locations/*`

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

### setParent

Required. The project and location in which the function should be created,
specified in the format `projects/*/locations/*`

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

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

### getFunction

Required. Function to be created.

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

### hasFunction

### clearFunction

### setFunction

Required. Function to be created.

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

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

### getFunctionId

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

This value should be 4-63 characters, and valid characters
are /\[a-z\]\[0-9\]-/.

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

### setFunctionId

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

This value should be 4-63 characters, and valid characters
are /\[a-z\]\[0-9\]-/.

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

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

### static::build

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `string` Required. The project and location in which the function should be created, specified in the format `projects/*/locations/*` Please see FunctionServiceClient::locationName() for help formatting this field. |
| `function` | `https://docs.cloud.google.com/php/docs/reference/cloud-functions/latest/V2.PBFunction` Required. Function to be created. |
| `functionId` | `string` The ID to use for the function, which will become the final component of the function's resource name. This value should be 4-63 characters, and valid characters are /\[a-z\]\[0-9\]-/. |

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