# Cloud Text-to-Speech V1 Client - Class ListVoicesRequest (2.8.0)

2.8.0 (latest) 2.7.0 2.6.0 2.5.1 2.4.0 2.3.0 2.2.2 2.0.1 1.12.2 1.11.0 1.10.0 1.9.1 1.8.5 1.7.2 1.6.1 1.5.6 1.4.5 Reference documentation and code samples for the Cloud Text-to-Speech V1 Client class ListVoicesRequest.

The top-level message sent by the client for the `ListVoices` method.

Generated from protobuf message `google.cloud.texttospeech.v1.ListVoicesRequest`

## Namespace

Google \\ Cloud \\ TextToSpeech \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ language_code` | `string` Optional. Recommended. [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If not specified, the API will return all supported voices. If specified, the ListVoices call will only return voices that can be used to synthesize this language_code. For example, if you specify `"en-NZ"`, all `"en-NZ"` voices will be returned. If you specify `"no"`, both `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be returned. |

### getLanguageCode

Optional. Recommended.

[BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
If not specified, the API will return all supported voices.
If specified, the ListVoices call will only return voices that can be used
to synthesize this language_code. For example, if you specify `"en-NZ"`,
all `"en-NZ"` voices will be returned. If you specify `"no"`, both
`"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be
returned.

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

### setLanguageCode

Optional. Recommended.

[BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
If not specified, the API will return all supported voices.
If specified, the ListVoices call will only return voices that can be used
to synthesize this language_code. For example, if you specify `"en-NZ"`,
all `"en-NZ"` voices will be returned. If you specify `"no"`, both
`"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be
returned.

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

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

### static::build

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `languageCode` | `string` Optional. Recommended. [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If not specified, the API will return all supported voices. If specified, the ListVoices call will only return voices that can be used to synthesize this language_code. For example, if you specify `"en-NZ"`, all `"en-NZ"` voices will be returned. If you specify `"no"`, both `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be returned. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-text-to-speech/latest/V1.ListVoicesRequest` |   |