# Google Cloud Discovery Engine V1 Client - Class Condition (1.11.1)

1.11.1 (latest) 1.11.0 1.10.1 1.9.1 1.8.0 1.7.0 1.6.1 1.5.1 1.4.0 1.3.3 1.2.0 1.1.0 1.0.0 0.11.3 0.8.0 0.7.1 0.6.0 0.5.0 0.4.0 0.3.0 0.2.0 0.1.1 Reference documentation and code samples for the Google Cloud Discovery Engine V1 Client class Condition.

Defines circumstances to be checked before allowing a behavior

Generated from protobuf message `google.cloud.discoveryengine.v1.Condition`

## Namespace

Google \\ Cloud \\ DiscoveryEngine \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ query_terms` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Condition.QueryTerm>` Search only A list of terms to match the query on. Cannot be set when [Condition.query_regex](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Condition#_Google_Cloud_DiscoveryEngine_V1_Condition__getQueryRegex__) is set. Maximum of 10 query terms. |
| `↳ active_time_range` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Condition.TimeRange>` Range of time(s) specifying when condition is active. Maximum of 10 time ranges. |
| `↳ query_regex` | `string` Optional. Query regex to match the whole search query. Cannot be set when [Condition.query_terms](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Condition#_Google_Cloud_DiscoveryEngine_V1_Condition__getQueryTerms__) is set. Only supported for Basic Site Search promotion serving controls. |

### getQueryTerms

Search only
A list of terms to match the query on.

Cannot be set when
[Condition.query_regex](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Condition#_Google_Cloud_DiscoveryEngine_V1_Condition__getQueryRegex__)
is set.
Maximum of 10 query terms.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Condition.QueryTerm>` |   |

### setQueryTerms

Search only
A list of terms to match the query on.

Cannot be set when
[Condition.query_regex](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Condition#_Google_Cloud_DiscoveryEngine_V1_Condition__getQueryRegex__)
is set.
Maximum of 10 query terms.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Condition.QueryTerm>` |

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

### getActiveTimeRange

Range of time(s) specifying when condition is active.

Maximum of 10 time ranges.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Condition.TimeRange>` |   |

### setActiveTimeRange

Range of time(s) specifying when condition is active.

Maximum of 10 time ranges.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Condition.TimeRange>` |

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

### getQueryRegex

Optional. Query regex to match the whole search query.

Cannot be set when
[Condition.query_terms](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Condition#_Google_Cloud_DiscoveryEngine_V1_Condition__getQueryTerms__)
is set. Only supported for Basic Site Search promotion serving controls.

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

### setQueryRegex

Optional. Query regex to match the whole search query.

Cannot be set when
[Condition.query_terms](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.Condition#_Google_Cloud_DiscoveryEngine_V1_Condition__getQueryTerms__)
is set. Only supported for Basic Site Search promotion serving controls.

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

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