0.5.3 (latest) 0.4.4 0.3.0 0.2.1 0.1.4 Reference documentation and code samples for the Google Cloud Api Hub V1 Client class CreateApiRequest.

The [CreateApi](https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.Client.ApiHubClient#_Google_Cloud_ApiHub_V1_Client_ApiHubClient__createApi__) method's request.

Generated from protobuf message `google.cloud.apihub.v1.CreateApiRequest`

## Namespace

Google \\ Cloud \\ ApiHub \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ parent` | `string` Required. The parent resource for the API resource. Format: `projects/{project}/locations/{location}` |
| `↳ api_id` | `string` Optional. The ID to use for the API resource, which will become the final component of the API's resource name. This field is optional. \* \* If provided, the same will be used. The service will throw an error if the specified id is already used by another API resource in the API hub. \* \* If not provided, a system generated id will be used. This value should be 4-500 characters, and valid characters are /\[a-z\]\[A-Z\]\[0-9\]-_/. |
| `↳ api` | `https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.Api` Required. The API resource to create. |

### getParent

Required. The parent resource for the API resource.

Format: `projects/{project}/locations/{location}`

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

### setParent

Required. The parent resource for the API resource.

Format: `projects/{project}/locations/{location}`

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

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

### getApiId

Optional. The ID to use for the API resource, which will become the final
component of the API's resource name. This field is optional.

- If provided, the same will be used. The service will throw an error if the specified id is already used by another API resource in the API hub.
- If not provided, a system generated id will be used. This value should be 4-500 characters, and valid characters are /\[a-z\]\[A-Z\]\[0-9\]-_/.

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

### setApiId

Optional. The ID to use for the API resource, which will become the final
component of the API's resource name. This field is optional.

- If provided, the same will be used. The service will throw an error if the specified id is already used by another API resource in the API hub.
- If not provided, a system generated id will be used. This value should be 4-500 characters, and valid characters are /\[a-z\]\[A-Z\]\[0-9\]-_/.

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

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

### getApi

Required. The API resource to create.

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

### hasApi

### clearApi

### setApi

Required. The API resource to create.

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

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

### static::build

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `string` Required. The parent resource for the API resource. Format: `projects/{project}/locations/{location}` Please see ApiHubClient::locationName() for help formatting this field. |
| `api` | `https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.Api` Required. The API resource to create. |
| `apiId` | `string` Optional. The ID to use for the API resource, which will become the final component of the API's resource name. This field is optional. - - If provided, the same will be used. The service will throw an error if the specified id is already used by another API resource in the API hub. - - If not provided, a system generated id will be used. This value should be 4-500 characters, and valid characters are /\[a-z\]\[A-Z\]\[0-9\]-_/. |

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