Class CreateVoiceRequest

java.lang.Object
com.google.genai.gaos.models.voices.CreateVoiceRequest

public class CreateVoiceRequest extends Object
CreateVoiceRequest

Request message for `VoicesService.CreateVoice`.

  • Constructor Details

    • CreateVoiceRequest

      public CreateVoiceRequest(@Nullable Boolean store, @Nonnull VoiceInput voice)
    • CreateVoiceRequest

      public CreateVoiceRequest(@Nonnull VoiceInput voice)
  • Method Details

    • store

      public Optional<Boolean> store()
      Optional. Whether the created voice is persisted and managed by Google.

      * When `true`, Google stores the voice and returns `Voice.id` (for example, `voice_abc123def456`), which can be managed via `GetVoice`, `ListVoices`, and `DeleteVoice` and referenced by ID in synthesis requests. Stored voices expire after 1 year of inactivity; using a stored voice in speech synthesis or as a `base_voice` in `CreateVoice` extends its `expire_time`. Projects are subject to a maximum active stored voice quota; exceeding the quota returns `RESOURCE_EXHAUSTED`. * When `false` (default), the voice is not stored by Google and `Voice.key` (for example, `voicekey_...`) is returned for client-side storage and synthesis. Optional discovery metadata fields on `voice` are not persisted or returned when `store` is `false`. * Required to be `true` when `voice.type` is `"prompted"` (otherwise fails with `INVALID_ARGUMENT`).

    • voice

      public Optional<VoiceInput> voice()
      A voice resource representing either a custom voice (created via `CreateVoice`) or a prebuilt system voice (returned by `ListVoices`).
    • builder

      public static CreateVoiceRequest.Builder builder()
    • withStore

      public CreateVoiceRequest withStore(@Nullable Boolean store)
      Optional. Whether the created voice is persisted and managed by Google.

      * When `true`, Google stores the voice and returns `Voice.id` (for example, `voice_abc123def456`), which can be managed via `GetVoice`, `ListVoices`, and `DeleteVoice` and referenced by ID in synthesis requests. Stored voices expire after 1 year of inactivity; using a stored voice in speech synthesis or as a `base_voice` in `CreateVoice` extends its `expire_time`. Projects are subject to a maximum active stored voice quota; exceeding the quota returns `RESOURCE_EXHAUSTED`. * When `false` (default), the voice is not stored by Google and `Voice.key` (for example, `voicekey_...`) is returned for client-side storage and synthesis. Optional discovery metadata fields on `voice` are not persisted or returned when `store` is `false`. * Required to be `true` when `voice.type` is `"prompted"` (otherwise fails with `INVALID_ARGUMENT`).

    • withVoice

      public CreateVoiceRequest withVoice(@Nonnull VoiceInput voice)
      A voice resource representing either a custom voice (created via `CreateVoice`) or a prebuilt system voice (returned by `ListVoices`).
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object