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

An intended audience of the [Product](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product) for
whom it's sold.

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

## Namespace

Google \\ Cloud \\ Retail \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ genders` | `string[]` The genders of the audience. Strongly encouraged to use the standard values: "male", "female", "unisex". At most 5 values are allowed. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Google Merchant Center property [gender](https://support.google.com/merchants/answer/6324479). Schema.org property [Product.audience.suggestedGender](https://schema.org/suggestedGender). |
| `↳ age_groups` | `string[]` The age groups of the audience. Strongly encouraged to use the standard values: "newborn" (up to 3 months old), "infant" (3--12 months old), "toddler" (1--5 years old), "kids" (5--13 years old), "adult" (typically teens or older). At most 5 values are allowed. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Google Merchant Center property [age_group](https://support.google.com/merchants/answer/6324463). Schema.org property [Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and [Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge). |

### getGenders

The genders of the audience. Strongly encouraged to use the standard
values: "male", "female", "unisex".

At most 5 values are allowed. Each value must be a UTF-8 encoded string
with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
is returned.
Google Merchant Center property
[gender](https://support.google.com/merchants/answer/6324479). Schema.org
property
[Product.audience.suggestedGender](https://schema.org/suggestedGender).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setGenders

The genders of the audience. Strongly encouraged to use the standard
values: "male", "female", "unisex".

At most 5 values are allowed. Each value must be a UTF-8 encoded string
with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
is returned.
Google Merchant Center property
[gender](https://support.google.com/merchants/answer/6324479). Schema.org
property
[Product.audience.suggestedGender](https://schema.org/suggestedGender).

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

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

### getAgeGroups

The age groups of the audience. Strongly encouraged to use the standard
values: "newborn" (up to 3 months old), "infant" (3--12 months old),
"toddler" (1--5 years old), "kids" (5--13 years old), "adult" (typically
teens or older).

At most 5 values are allowed. Each value must be a UTF-8 encoded string
with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
is returned.
Google Merchant Center property
[age_group](https://support.google.com/merchants/answer/6324463).
Schema.org property
[Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
[Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setAgeGroups

The age groups of the audience. Strongly encouraged to use the standard
values: "newborn" (up to 3 months old), "infant" (3--12 months old),
"toddler" (1--5 years old), "kids" (5--13 years old), "adult" (typically
teens or older).

At most 5 values are allowed. Each value must be a UTF-8 encoded string
with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
is returned.
Google Merchant Center property
[age_group](https://support.google.com/merchants/answer/6324463).
Schema.org property
[Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and
[Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).

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

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