# Cloud Vision V1 Client - Class KeyValue (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 KeyValue.

A product label represented as a key-value pair.

Generated from protobuf message `google.cloud.vision.v1.Product.KeyValue`

## Namespace

Google \\ Cloud \\ Vision \\ V1 \\ Product

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ key` | `string` The key of the label attached to the product. Cannot be empty and cannot exceed 128 bytes. |
| `↳ value` | `string` The value of the label attached to the product. Cannot be empty and cannot exceed 128 bytes. |

### getKey

The key of the label attached to the product. Cannot be empty and cannot
exceed 128 bytes.

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

### setKey

The key of the label attached to the product. Cannot be empty and cannot
exceed 128 bytes.

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

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

### getValue

The value of the label attached to the product. Cannot be empty and
cannot exceed 128 bytes.

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

### setValue

The value of the label attached to the product. Cannot be empty and
cannot exceed 128 bytes.

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

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