# Google Cloud Retail V2 Client - Class Promotion (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 Promotion.

Promotion information.

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

## Namespace

Google \\ Cloud \\ Retail \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ promotion_id` | `string` ID of the promotion. For example, "free gift". The value must be a UTF-8 encoded string with a length limit of 128 characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example, id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is returned. Corresponds to Google Merchant Center property [promotion_id](https://support.google.com/merchants/answer/7050148). |

### getPromotionId

ID of the promotion. For example, "free gift".

The value must be a UTF-8 encoded string with a length limit of 128
characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example,
id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is
returned.
Corresponds to Google Merchant Center property
[promotion_id](https://support.google.com/merchants/answer/7050148).

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

### setPromotionId

ID of the promotion. For example, "free gift".

The value must be a UTF-8 encoded string with a length limit of 128
characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example,
id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is
returned.
Corresponds to Google Merchant Center property
[promotion_id](https://support.google.com/merchants/answer/7050148).

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

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