0.17.0 (latest) 0.16.0 0.15.1 0.14.1 0.8.0 0.7.0 0.6.2 0.5.0 0.4.1 0.3.1 0.2.0 0.1.3 Reference documentation and code samples for the Google Ads Ad Manager V1 Client class ListStringCreativeTemplateVariable.

Represents a list variable defined in a creative template. This is similar
to
[StringCreativeTemplateVariable](https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.CreativeTemplateVariable.StringCreativeTemplateVariable.md.txt),
except that there are possible choices to choose from.

Use StringCreativeTemplateVariableValue to specify the value
for this variable when creating a TemplateCreative from a
[CreativeTemplate](https://docs.cloud.google.com/php/docs/reference/ad-manager/latest/V1.CreativeTemplate.md.txt).

Generated from protobuf message `google.ads.admanager.v1.CreativeTemplateVariable.ListStringCreativeTemplateVariable`

## Namespace

Google \\ Ads \\ AdManager \\ V1 \\ CreativeTemplateVariable

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ default_value` | `string` Optional. Default value to be filled in when creating creatives from the creative template. |
| `↳ sample_value` | `string` Optional. Sample value that is used when previewing the template in the UI. |
| `↳ choices` | `array<ListStringCreativeTemplateVariable\VariableChoice>` Optional. The selectable values that the user can choose from. |
| `↳ allow_other_choice` | `bool` Optional. `True` if a user can specify an 'other' value. For example, if a variable called backgroundColor is defined as a list with values: red, green, blue, this boolean can be set to allow a user to enter a value not on the list such as purple. |

### getDefaultValue

Optional. Default value to be filled in when creating creatives from the
creative template.

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

### hasDefaultValue

### clearDefaultValue

### setDefaultValue

Optional. Default value to be filled in when creating creatives from the
creative template.

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

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

### getSampleValue

Optional. Sample value that is used when previewing the template in the
UI.

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

### hasSampleValue

### clearSampleValue

### setSampleValue

Optional. Sample value that is used when previewing the template in the
UI.

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

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

### getChoices

Optional. The selectable values that the user can choose from.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\RepeatedField<ListStringCreativeTemplateVariable\VariableChoice>` |   |

### setChoices

Optional. The selectable values that the user can choose from.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<ListStringCreativeTemplateVariable\VariableChoice>` |

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

### getAllowOtherChoice

Optional. `True` if a user can specify an 'other' value. For example, if
a variable called backgroundColor is defined as a list with values: red,
green, blue, this boolean can be set to allow a user to enter a value not
on the list such as purple.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### hasAllowOtherChoice

### clearAllowOtherChoice

### setAllowOtherChoice

Optional. `True` if a user can specify an 'other' value. For example, if
a variable called backgroundColor is defined as a list with values: red,
green, blue, this boolean can be set to allow a user to enter a value not
on the list such as purple.

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

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