# Cloud Vision V1 Client - Class CreateReferenceImageRequest (2.2.1)

2.2.1 (latest) 2.2.0 2.1.3 2.0.3 1.10.3 1.9.4 1.8.0 1.7.6 1.6.8 Reference documentation and code samples for the Cloud Vision V1 Client class CreateReferenceImageRequest.

Request message for the `CreateReferenceImage` method.

Generated from protobuf message `google.cloud.vision.v1.CreateReferenceImageRequest`

## Namespace

Google \\ Cloud \\ Vision \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ parent` | `string` Required. Resource name of the product in which to create the reference image. Format is `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. |
| `↳ reference_image` | `https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.ReferenceImage` Required. The reference image to create. If an image ID is specified, it is ignored. |
| `↳ reference_image_id` | `string` A user-supplied resource id for the ReferenceImage to be added. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character `/`. |

### getParent

Required. Resource name of the product in which to create the reference
image.

Format is
`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.

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

### setParent

Required. Resource name of the product in which to create the reference
image.

Format is
`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.

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

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

### getReferenceImage

Required. The reference image to create.

If an image ID is specified, it is ignored.

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

### hasReferenceImage

### clearReferenceImage

### setReferenceImage

Required. The reference image to create.

If an image ID is specified, it is ignored.

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

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

### getReferenceImageId

A user-supplied resource id for the ReferenceImage to be added. If set,
the server will attempt to use this value as the resource id. If it is
already in use, an error is returned with code ALREADY_EXISTS. Must be at
most 128 characters long. It cannot contain the character `/`.

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

### setReferenceImageId

A user-supplied resource id for the ReferenceImage to be added. If set,
the server will attempt to use this value as the resource id. If it is
already in use, an error is returned with code ALREADY_EXISTS. Must be at
most 128 characters long. It cannot contain the character `/`.

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

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

### static::build

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `string` Required. Resource name of the product in which to create the reference image. Format is `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. Please see ProductSearchClient::productName() for help formatting this field. |
| `referenceImage` | `https://docs.cloud.google.com/php/docs/reference/cloud-vision/latest/V1.ReferenceImage` Required. The reference image to create. If an image ID is specified, it is ignored. |
| `referenceImageId` | `string` A user-supplied resource id for the ReferenceImage to be added. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character `/`. |

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