# Google Cloud Retail V2 Client - Class CreateModelRequest (2.5.3)

2.5.3 (latest) 2.5.2 2.4.0 2.3.1 2.2.1 2.1.3 2.0.0 1.7.0 1.6.4 1.5.0 1.4.2 1.3.1 1.2.1 1.1.1 1.0.1 Reference documentation and code samples for the Google Cloud Retail V2 Client class CreateModelRequest.

Request for creating a model.

Generated from protobuf message `google.cloud.retail.v2.CreateModelRequest`

## Namespace

Google \\ Cloud \\ Retail \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ parent` | `string` Required. The parent resource under which to create the model. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` |
| `↳ model` | `https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Model` Required. The payload of the [Model](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Model) to create. |
| `↳ dry_run` | `bool` Optional. Whether to run a dry run to validate the request (without actually creating the model). |

### getParent

Required. The parent resource under which to create the model. Format:
`projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`

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

### setParent

Required. The parent resource under which to create the model. Format:
`projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`

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

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

### getModel

Required. The payload of the [Model](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Model) to
create.

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

### hasModel

### clearModel

### setModel

Required. The payload of the [Model](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Model) to
create.

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

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

### getDryRun

Optional. Whether to run a dry run to validate the request (without
actually creating the model).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setDryRun

Optional. Whether to run a dry run to validate the request (without
actually creating the model).

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

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

### static::build

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `string` Required. The parent resource under which to create the model. Format: `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` Please see ModelServiceClient::catalogName() for help formatting this field. |
| `model` | `https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Model` Required. The payload of the [Model](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Model) to create. |

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