public final class AudioConfig extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.texttospeech.v1.AudioConfig)
    AudioConfigOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use AudioConfig.newBuilder() to construct.
  private AudioConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private AudioConfig() {
    audioEncoding_ = 0;
    effectsProfileId_ = com.google.protobuf.LazyStringArrayList.EMPTY;
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    return new AudioConfig();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  private AudioConfig(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 8:
            {
              int rawValue = input.readEnum();

              audioEncoding_ = rawValue;
              break;
            }
          case 17:
            {
              speakingRate_ = input.readDouble();
              break;
            }
          case 25:
            {
              pitch_ = input.readDouble();
              break;
            }
          case 33:
            {
              volumeGainDb_ = input.readDouble();
              break;
            }
          case 40:
            {
              sampleRateHertz_ = input.readInt32();
              break;
            }
          case 50:
            {
              java.lang.String s = input.readStringRequireUtf8();
              if (!((mutable_bitField0_ & 0x00000001) != 0)) {
                effectsProfileId_ = new com.google.protobuf.LazyStringArrayList();
                mutable_bitField0_ |= 0x00000001;
              }
              effectsProfileId_.add(s);
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      if (((mutable_bitField0_ & 0x00000001) != 0)) {
        effectsProfileId_ = effectsProfileId_.getUnmodifiableView();
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.texttospeech.v1.TextToSpeechProto
        .internal_static_google_cloud_texttospeech_v1_AudioConfig_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.texttospeech.v1.TextToSpeechProto
        .internal_static_google_cloud_texttospeech_v1_AudioConfig_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.texttospeech.v1.AudioConfig.class,
            com.google.cloud.texttospeech.v1.AudioConfig.Builder.class);
  }

  public static final int AUDIO_ENCODING_FIELD_NUMBER = 1;
  private int audioEncoding_;
  /**
   *
   *
   * <pre>
   * Required. The format of the audio byte stream.
   * </pre>
   *
   * <code>
   * .google.cloud.texttospeech.v1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   *
   * @return The enum numeric value on the wire for audioEncoding.
   */
  @java.lang.Override
  public int getAudioEncodingValue() {
    return audioEncoding_;
  }
  /**
   *
   *
   * <pre>
   * Required. The format of the audio byte stream.
   * </pre>
   *
   * <code>
   * .google.cloud.texttospeech.v1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED];
   * </code>
   *
   * @return The audioEncoding.
   */
  @java.lang.Override
  public com.google.cloud.texttospeech.v1.AudioEncoding getAudioEncoding() {
    @SuppressWarnings("deprecation")
    com.google.cloud.texttospeech.v1.AudioEncoding result =
        com.google.cloud.texttospeech.v1.AudioEncoding.valueOf(audioEncoding_);
    return result == null ? com.google.cloud.texttospeech.v1.AudioEncoding.UNRECOGNIZED : result;
  }

  public static final int SPEAKING_RATE_FIELD_NUMBER = 2;
  private double speakingRate_;
  /**
   *
   *
   * <pre>
   * Optional. Input only. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is
   * the normal native speed supported by the specific voice. 2.0 is twice as
   * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0
   * speed. Any other values &lt; 0.25 or &gt; 4.0 will return an error.
   * </pre>
   *
   * <code>
   * double speaking_rate = 2 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return The speakingRate.
   */
  @java.lang.Override
  public double getSpeakingRate() {
    return speakingRate_;
  }

  public static final int PITCH_FIELD_NUMBER = 3;
  private double pitch_;
  /**
   *
   *
   * <pre>
   * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means
   * increase 20 semitones from the original pitch. -20 means decrease 20
   * semitones from the original pitch.
   * </pre>
   *
   * <code>
   * double pitch = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return The pitch.
   */
  @java.lang.Override
  public double getPitch() {
    return pitch_;
  }

  public static final int VOLUME_GAIN_DB_FIELD_NUMBER = 4;
  private double volumeGainDb_;
  /**
   *
   *
   * <pre>
   * Optional. Input only. Volume gain (in dB) of the normal native volume
   * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or
   * set to a value of 0.0 (dB), will play at normal native signal amplitude. A
   * value of -6.0 (dB) will play at approximately half the amplitude of the
   * normal native signal amplitude. A value of +6.0 (dB) will play at
   * approximately twice the amplitude of the normal native signal amplitude.
   * Strongly recommend not to exceed +10 (dB) as there's usually no effective
   * increase in loudness for any value greater than that.
   * </pre>
   *
   * <code>
   * double volume_gain_db = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return The volumeGainDb.
   */
  @java.lang.Override
  public double getVolumeGainDb() {
    return volumeGainDb_;
  }

  public static final int SAMPLE_RATE_HERTZ_FIELD_NUMBER = 5;
  private int sampleRateHertz_;
  /**
   *
   *
   * <pre>
   * Optional. The synthesis sample rate (in hertz) for this audio. When this is
   * specified in SynthesizeSpeechRequest, if this is different from the voice's
   * natural sample rate, then the synthesizer will honor this request by
   * converting to the desired sample rate (which might result in worse audio
   * quality), unless the specified sample rate is not supported for the
   * encoding chosen, in which case it will fail the request and return
   * [google.rpc.Code.INVALID_ARGUMENT][].
   * </pre>
   *
   * <code>int32 sample_rate_hertz = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The sampleRateHertz.
   */
  @java.lang.Override
  public int getSampleRateHertz() {
    return sampleRateHertz_;
  }

  public static final int EFFECTS_PROFILE_ID_FIELD_NUMBER = 6;
  private com.google.protobuf.LazyStringList effectsProfileId_;
  /**
   *
   *
   * <pre>
   * Optional. Input only. An identifier which selects 'audio effects' profiles
   * that are applied on (post synthesized) text to speech. Effects are applied
   * on top of each other in the order they are given. See
   * [audio
   * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for
   * current supported profile ids.
   * </pre>
   *
   * <code>
   * repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return A list containing the effectsProfileId.
   */
  public com.google.protobuf.ProtocolStringList getEffectsProfileIdList() {
    return effectsProfileId_;
  }
  /**
   *
   *
   * <pre>
   * Optional. Input only. An identifier which selects 'audio effects' profiles
   * that are applied on (post synthesized) text to speech. Effects are applied
   * on top of each other in the order they are given. See
   * [audio
   * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for
   * current supported profile ids.
   * </pre>
   *
   * <code>
   * repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return The count of effectsProfileId.
   */
  public int getEffectsProfileIdCount() {
    return effectsProfileId_.size();
  }
  /**
   *
   *
   * <pre>
   * Optional. Input only. An identifier which selects 'audio effects' profiles
   * that are applied on (post synthesized) text to speech. Effects are applied
   * on top of each other in the order they are given. See
   * [audio
   * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for
   * current supported profile ids.
   * </pre>
   *
   * <code>
   * repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @param index The index of the element to return.
   * @return The effectsProfileId at the given index.
   */
  public java.lang.String getEffectsProfileId(int index) {
    return effectsProfileId_.get(index);
  }
  /**
   *
   *
   * <pre>
   * Optional. Input only. An identifier which selects 'audio effects' profiles
   * that are applied on (post synthesized) text to speech. Effects are applied
   * on top of each other in the order they are given. See
   * [audio
   * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for
   * current supported profile ids.
   * </pre>
   *
   * <code>
   * repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @param index The index of the value to return.
   * @return The bytes of the effectsProfileId at the given index.
   */
  public com.google.protobuf.ByteString getEffectsProfileIdBytes(int index) {
    return effectsProfileId_.getByteString(index);
  }

  private byte memoizedIsInitialized = -1;

  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (audioEncoding_
        != com.google.cloud.texttospeech.v1.AudioEncoding.AUDIO_ENCODING_UNSPECIFIED.getNumber()) {
      output.writeEnum(1, audioEncoding_);
    }
    if (speakingRate_ != 0D) {
      output.writeDouble(2, speakingRate_);
    }
    if (pitch_ != 0D) {
      output.writeDouble(3, pitch_);
    }
    if (volumeGainDb_ != 0D) {
      output.writeDouble(4, volumeGainDb_);
    }
    if (sampleRateHertz_ != 0) {
      output.writeInt32(5, sampleRateHertz_);
    }
    for (int i = 0; i < effectsProfileId_.size(); i++) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 6, effectsProfileId_.getRaw(i));
    }
    unknownFields.writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (audioEncoding_
        != com.google.cloud.texttospeech.v1.AudioEncoding.AUDIO_ENCODING_UNSPECIFIED.getNumber()) {
      size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, audioEncoding_);
    }
    if (speakingRate_ != 0D) {
      size += com.google.protobuf.CodedOutputStream.computeDoubleSize(2, speakingRate_);
    }
    if (pitch_ != 0D) {
      size += com.google.protobuf.CodedOutputStream.computeDoubleSize(3, pitch_);
    }
    if (volumeGainDb_ != 0D) {
      size += com.google.protobuf.CodedOutputStream.computeDoubleSize(4, volumeGainDb_);
    }
    if (sampleRateHertz_ != 0) {
      size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, sampleRateHertz_);
    }
    {
      int dataSize = 0;
      for (int i = 0; i < effectsProfileId_.size(); i++) {
        dataSize += computeStringSizeNoTag(effectsProfileId_.getRaw(i));
      }
      size += dataSize;
      size += 1 * getEffectsProfileIdList().size();
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof com.google.cloud.texttospeech.v1.AudioConfig)) {
      return super.equals(obj);
    }
    com.google.cloud.texttospeech.v1.AudioConfig other =
        (com.google.cloud.texttospeech.v1.AudioConfig) obj;

    if (audioEncoding_ != other.audioEncoding_) return false;
    if (java.lang.Double.doubleToLongBits(getSpeakingRate())
        != java.lang.Double.doubleToLongBits(other.getSpeakingRate())) return false;
    if (java.lang.Double.doubleToLongBits(getPitch())
        != java.lang.Double.doubleToLongBits(other.getPitch())) return false;
    if (java.lang.Double.doubleToLongBits(getVolumeGainDb())
        != java.lang.Double.doubleToLongBits(other.getVolumeGainDb())) return false;
    if (getSampleRateHertz() != other.getSampleRateHertz()) return false;
    if (!getEffectsProfileIdList().equals(other.getEffectsProfileIdList())) return false;
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + AUDIO_ENCODING_FIELD_NUMBER;
    hash = (53 * hash) + audioEncoding_;
    hash = (37 * hash) + SPEAKING_RATE_FIELD_NUMBER;
    hash =
        (53 * hash)
            + com.google.protobuf.Internal.hashLong(
                java.lang.Double.doubleToLongBits(getSpeakingRate()));
    hash = (37 * hash) + PITCH_FIELD_NUMBER;
    hash =
        (53 * hash)
            + com.google.protobuf.Internal.hashLong(java.lang.Double.doubleToLongBits(getPitch()));
    hash = (37 * hash) + VOLUME_GAIN_DB_FIELD_NUMBER;
    hash =
        (53 * hash)
            + com.google.protobuf.Internal.hashLong(
                java.lang.Double.doubleToLongBits(getVolumeGainDb()));
    hash = (37 * hash) + SAMPLE_RATE_HERTZ_FIELD_NUMBER;
    hash = (53 * hash) + getSampleRateHertz();
    if (getEffectsProfileIdCount() > 0) {
      hash = (37 * hash) + EFFECTS_PROFILE_ID_FIELD_NUMBER;
      hash = (53 * hash) + getEffectsProfileIdList().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.texttospeech.v1.AudioConfig parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.texttospeech.v1.AudioConfig parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.AudioConfig parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.texttospeech.v1.AudioConfig parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.AudioConfig parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.texttospeech.v1.AudioConfig parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.AudioConfig parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.texttospeech.v1.AudioConfig parseFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.AudioConfig parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloud.texttospeech.v1.AudioConfig parseDelimitedFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.AudioConfig parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.texttospeech.v1.AudioConfig parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() {
    return newBuilder();
  }

  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }

  public static Builder newBuilder(com.google.cloud.texttospeech.v1.AudioConfig prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *
   *
   * <pre>
   * Description of audio data to be synthesized.
   * </pre>
   *
   * Protobuf type {@code google.cloud.texttospeech.v1.AudioConfig}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.texttospeech.v1.AudioConfig)
      com.google.cloud.texttospeech.v1.AudioConfigOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.texttospeech.v1.TextToSpeechProto
          .internal_static_google_cloud_texttospeech_v1_AudioConfig_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.texttospeech.v1.TextToSpeechProto
          .internal_static_google_cloud_texttospeech_v1_AudioConfig_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.texttospeech.v1.AudioConfig.class,
              com.google.cloud.texttospeech.v1.AudioConfig.Builder.class);
    }

    // Construct using com.google.cloud.texttospeech.v1.AudioConfig.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      audioEncoding_ = 0;

      speakingRate_ = 0D;

      pitch_ = 0D;

      volumeGainDb_ = 0D;

      sampleRateHertz_ = 0;

      effectsProfileId_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000001);
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.texttospeech.v1.TextToSpeechProto
          .internal_static_google_cloud_texttospeech_v1_AudioConfig_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.texttospeech.v1.AudioConfig getDefaultInstanceForType() {
      return com.google.cloud.texttospeech.v1.AudioConfig.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.texttospeech.v1.AudioConfig build() {
      com.google.cloud.texttospeech.v1.AudioConfig result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.texttospeech.v1.AudioConfig buildPartial() {
      com.google.cloud.texttospeech.v1.AudioConfig result =
          new com.google.cloud.texttospeech.v1.AudioConfig(this);
      int from_bitField0_ = bitField0_;
      result.audioEncoding_ = audioEncoding_;
      result.speakingRate_ = speakingRate_;
      result.pitch_ = pitch_;
      result.volumeGainDb_ = volumeGainDb_;
      result.sampleRateHertz_ = sampleRateHertz_;
      if (((bitField0_ & 0x00000001) != 0)) {
        effectsProfileId_ = effectsProfileId_.getUnmodifiableView();
        bitField0_ = (bitField0_ & ~0x00000001);
      }
      result.effectsProfileId_ = effectsProfileId_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.texttospeech.v1.AudioConfig) {
        return mergeFrom((com.google.cloud.texttospeech.v1.AudioConfig) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.texttospeech.v1.AudioConfig other) {
      if (other == com.google.cloud.texttospeech.v1.AudioConfig.getDefaultInstance()) return this;
      if (other.audioEncoding_ != 0) {
        setAudioEncodingValue(other.getAudioEncodingValue());
      }
      if (other.getSpeakingRate() != 0D) {
        setSpeakingRate(other.getSpeakingRate());
      }
      if (other.getPitch() != 0D) {
        setPitch(other.getPitch());
      }
      if (other.getVolumeGainDb() != 0D) {
        setVolumeGainDb(other.getVolumeGainDb());
      }
      if (other.getSampleRateHertz() != 0) {
        setSampleRateHertz(other.getSampleRateHertz());
      }
      if (!other.effectsProfileId_.isEmpty()) {
        if (effectsProfileId_.isEmpty()) {
          effectsProfileId_ = other.effectsProfileId_;
          bitField0_ = (bitField0_ & ~0x00000001);
        } else {
          ensureEffectsProfileIdIsMutable();
          effectsProfileId_.addAll(other.effectsProfileId_);
        }
        onChanged();
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      com.google.cloud.texttospeech.v1.AudioConfig parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.cloud.texttospeech.v1.AudioConfig) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int bitField0_;

    private int audioEncoding_ = 0;
    /**
     *
     *
     * <pre>
     * Required. The format of the audio byte stream.
     * </pre>
     *
     * <code>
     * .google.cloud.texttospeech.v1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return The enum numeric value on the wire for audioEncoding.
     */
    @java.lang.Override
    public int getAudioEncodingValue() {
      return audioEncoding_;
    }
    /**
     *
     *
     * <pre>
     * Required. The format of the audio byte stream.
     * </pre>
     *
     * <code>
     * .google.cloud.texttospeech.v1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @param value The enum numeric value on the wire for audioEncoding to set.
     * @return This builder for chaining.
     */
    public Builder setAudioEncodingValue(int value) {

      audioEncoding_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The format of the audio byte stream.
     * </pre>
     *
     * <code>
     * .google.cloud.texttospeech.v1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return The audioEncoding.
     */
    @java.lang.Override
    public com.google.cloud.texttospeech.v1.AudioEncoding getAudioEncoding() {
      @SuppressWarnings("deprecation")
      com.google.cloud.texttospeech.v1.AudioEncoding result =
          com.google.cloud.texttospeech.v1.AudioEncoding.valueOf(audioEncoding_);
      return result == null ? com.google.cloud.texttospeech.v1.AudioEncoding.UNRECOGNIZED : result;
    }
    /**
     *
     *
     * <pre>
     * Required. The format of the audio byte stream.
     * </pre>
     *
     * <code>
     * .google.cloud.texttospeech.v1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @param value The audioEncoding to set.
     * @return This builder for chaining.
     */
    public Builder setAudioEncoding(com.google.cloud.texttospeech.v1.AudioEncoding value) {
      if (value == null) {
        throw new NullPointerException();
      }

      audioEncoding_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The format of the audio byte stream.
     * </pre>
     *
     * <code>
     * .google.cloud.texttospeech.v1.AudioEncoding audio_encoding = 1 [(.google.api.field_behavior) = REQUIRED];
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearAudioEncoding() {

      audioEncoding_ = 0;
      onChanged();
      return this;
    }

    private double speakingRate_;
    /**
     *
     *
     * <pre>
     * Optional. Input only. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is
     * the normal native speed supported by the specific voice. 2.0 is twice as
     * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0
     * speed. Any other values &lt; 0.25 or &gt; 4.0 will return an error.
     * </pre>
     *
     * <code>
     * double speaking_rate = 2 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The speakingRate.
     */
    @java.lang.Override
    public double getSpeakingRate() {
      return speakingRate_;
    }
    /**
     *
     *
     * <pre>
     * Optional. Input only. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is
     * the normal native speed supported by the specific voice. 2.0 is twice as
     * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0
     * speed. Any other values &lt; 0.25 or &gt; 4.0 will return an error.
     * </pre>
     *
     * <code>
     * double speaking_rate = 2 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @param value The speakingRate to set.
     * @return This builder for chaining.
     */
    public Builder setSpeakingRate(double value) {

      speakingRate_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Input only. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is
     * the normal native speed supported by the specific voice. 2.0 is twice as
     * fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0
     * speed. Any other values &lt; 0.25 or &gt; 4.0 will return an error.
     * </pre>
     *
     * <code>
     * double speaking_rate = 2 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearSpeakingRate() {

      speakingRate_ = 0D;
      onChanged();
      return this;
    }

    private double pitch_;
    /**
     *
     *
     * <pre>
     * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means
     * increase 20 semitones from the original pitch. -20 means decrease 20
     * semitones from the original pitch.
     * </pre>
     *
     * <code>
     * double pitch = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The pitch.
     */
    @java.lang.Override
    public double getPitch() {
      return pitch_;
    }
    /**
     *
     *
     * <pre>
     * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means
     * increase 20 semitones from the original pitch. -20 means decrease 20
     * semitones from the original pitch.
     * </pre>
     *
     * <code>
     * double pitch = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @param value The pitch to set.
     * @return This builder for chaining.
     */
    public Builder setPitch(double value) {

      pitch_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means
     * increase 20 semitones from the original pitch. -20 means decrease 20
     * semitones from the original pitch.
     * </pre>
     *
     * <code>
     * double pitch = 3 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearPitch() {

      pitch_ = 0D;
      onChanged();
      return this;
    }

    private double volumeGainDb_;
    /**
     *
     *
     * <pre>
     * Optional. Input only. Volume gain (in dB) of the normal native volume
     * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or
     * set to a value of 0.0 (dB), will play at normal native signal amplitude. A
     * value of -6.0 (dB) will play at approximately half the amplitude of the
     * normal native signal amplitude. A value of +6.0 (dB) will play at
     * approximately twice the amplitude of the normal native signal amplitude.
     * Strongly recommend not to exceed +10 (dB) as there's usually no effective
     * increase in loudness for any value greater than that.
     * </pre>
     *
     * <code>
     * double volume_gain_db = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The volumeGainDb.
     */
    @java.lang.Override
    public double getVolumeGainDb() {
      return volumeGainDb_;
    }
    /**
     *
     *
     * <pre>
     * Optional. Input only. Volume gain (in dB) of the normal native volume
     * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or
     * set to a value of 0.0 (dB), will play at normal native signal amplitude. A
     * value of -6.0 (dB) will play at approximately half the amplitude of the
     * normal native signal amplitude. A value of +6.0 (dB) will play at
     * approximately twice the amplitude of the normal native signal amplitude.
     * Strongly recommend not to exceed +10 (dB) as there's usually no effective
     * increase in loudness for any value greater than that.
     * </pre>
     *
     * <code>
     * double volume_gain_db = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @param value The volumeGainDb to set.
     * @return This builder for chaining.
     */
    public Builder setVolumeGainDb(double value) {

      volumeGainDb_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Input only. Volume gain (in dB) of the normal native volume
     * supported by the specific voice, in the range [-96.0, 16.0]. If unset, or
     * set to a value of 0.0 (dB), will play at normal native signal amplitude. A
     * value of -6.0 (dB) will play at approximately half the amplitude of the
     * normal native signal amplitude. A value of +6.0 (dB) will play at
     * approximately twice the amplitude of the normal native signal amplitude.
     * Strongly recommend not to exceed +10 (dB) as there's usually no effective
     * increase in loudness for any value greater than that.
     * </pre>
     *
     * <code>
     * double volume_gain_db = 4 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearVolumeGainDb() {

      volumeGainDb_ = 0D;
      onChanged();
      return this;
    }

    private int sampleRateHertz_;
    /**
     *
     *
     * <pre>
     * Optional. The synthesis sample rate (in hertz) for this audio. When this is
     * specified in SynthesizeSpeechRequest, if this is different from the voice's
     * natural sample rate, then the synthesizer will honor this request by
     * converting to the desired sample rate (which might result in worse audio
     * quality), unless the specified sample rate is not supported for the
     * encoding chosen, in which case it will fail the request and return
     * [google.rpc.Code.INVALID_ARGUMENT][].
     * </pre>
     *
     * <code>int32 sample_rate_hertz = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The sampleRateHertz.
     */
    @java.lang.Override
    public int getSampleRateHertz() {
      return sampleRateHertz_;
    }
    /**
     *
     *
     * <pre>
     * Optional. The synthesis sample rate (in hertz) for this audio. When this is
     * specified in SynthesizeSpeechRequest, if this is different from the voice's
     * natural sample rate, then the synthesizer will honor this request by
     * converting to the desired sample rate (which might result in worse audio
     * quality), unless the specified sample rate is not supported for the
     * encoding chosen, in which case it will fail the request and return
     * [google.rpc.Code.INVALID_ARGUMENT][].
     * </pre>
     *
     * <code>int32 sample_rate_hertz = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The sampleRateHertz to set.
     * @return This builder for chaining.
     */
    public Builder setSampleRateHertz(int value) {

      sampleRateHertz_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The synthesis sample rate (in hertz) for this audio. When this is
     * specified in SynthesizeSpeechRequest, if this is different from the voice's
     * natural sample rate, then the synthesizer will honor this request by
     * converting to the desired sample rate (which might result in worse audio
     * quality), unless the specified sample rate is not supported for the
     * encoding chosen, in which case it will fail the request and return
     * [google.rpc.Code.INVALID_ARGUMENT][].
     * </pre>
     *
     * <code>int32 sample_rate_hertz = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearSampleRateHertz() {

      sampleRateHertz_ = 0;
      onChanged();
      return this;
    }

    private com.google.protobuf.LazyStringList effectsProfileId_ =
        com.google.protobuf.LazyStringArrayList.EMPTY;

    private void ensureEffectsProfileIdIsMutable() {
      if (!((bitField0_ & 0x00000001) != 0)) {
        effectsProfileId_ = new com.google.protobuf.LazyStringArrayList(effectsProfileId_);
        bitField0_ |= 0x00000001;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. Input only. An identifier which selects 'audio effects' profiles
     * that are applied on (post synthesized) text to speech. Effects are applied
     * on top of each other in the order they are given. See
     * [audio
     * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for
     * current supported profile ids.
     * </pre>
     *
     * <code>
     * repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return A list containing the effectsProfileId.
     */
    public com.google.protobuf.ProtocolStringList getEffectsProfileIdList() {
      return effectsProfileId_.getUnmodifiableView();
    }
    /**
     *
     *
     * <pre>
     * Optional. Input only. An identifier which selects 'audio effects' profiles
     * that are applied on (post synthesized) text to speech. Effects are applied
     * on top of each other in the order they are given. See
     * [audio
     * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for
     * current supported profile ids.
     * </pre>
     *
     * <code>
     * repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The count of effectsProfileId.
     */
    public int getEffectsProfileIdCount() {
      return effectsProfileId_.size();
    }
    /**
     *
     *
     * <pre>
     * Optional. Input only. An identifier which selects 'audio effects' profiles
     * that are applied on (post synthesized) text to speech. Effects are applied
     * on top of each other in the order they are given. See
     * [audio
     * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for
     * current supported profile ids.
     * </pre>
     *
     * <code>
     * repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @param index The index of the element to return.
     * @return The effectsProfileId at the given index.
     */
    public java.lang.String getEffectsProfileId(int index) {
      return effectsProfileId_.get(index);
    }
    /**
     *
     *
     * <pre>
     * Optional. Input only. An identifier which selects 'audio effects' profiles
     * that are applied on (post synthesized) text to speech. Effects are applied
     * on top of each other in the order they are given. See
     * [audio
     * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for
     * current supported profile ids.
     * </pre>
     *
     * <code>
     * repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @param index The index of the value to return.
     * @return The bytes of the effectsProfileId at the given index.
     */
    public com.google.protobuf.ByteString getEffectsProfileIdBytes(int index) {
      return effectsProfileId_.getByteString(index);
    }
    /**
     *
     *
     * <pre>
     * Optional. Input only. An identifier which selects 'audio effects' profiles
     * that are applied on (post synthesized) text to speech. Effects are applied
     * on top of each other in the order they are given. See
     * [audio
     * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for
     * current supported profile ids.
     * </pre>
     *
     * <code>
     * repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @param index The index to set the value at.
     * @param value The effectsProfileId to set.
     * @return This builder for chaining.
     */
    public Builder setEffectsProfileId(int index, java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureEffectsProfileIdIsMutable();
      effectsProfileId_.set(index, value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Input only. An identifier which selects 'audio effects' profiles
     * that are applied on (post synthesized) text to speech. Effects are applied
     * on top of each other in the order they are given. See
     * [audio
     * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for
     * current supported profile ids.
     * </pre>
     *
     * <code>
     * repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @param value The effectsProfileId to add.
     * @return This builder for chaining.
     */
    public Builder addEffectsProfileId(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureEffectsProfileIdIsMutable();
      effectsProfileId_.add(value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Input only. An identifier which selects 'audio effects' profiles
     * that are applied on (post synthesized) text to speech. Effects are applied
     * on top of each other in the order they are given. See
     * [audio
     * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for
     * current supported profile ids.
     * </pre>
     *
     * <code>
     * repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @param values The effectsProfileId to add.
     * @return This builder for chaining.
     */
    public Builder addAllEffectsProfileId(java.lang.Iterable<java.lang.String> values) {
      ensureEffectsProfileIdIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(values, effectsProfileId_);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Input only. An identifier which selects 'audio effects' profiles
     * that are applied on (post synthesized) text to speech. Effects are applied
     * on top of each other in the order they are given. See
     * [audio
     * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for
     * current supported profile ids.
     * </pre>
     *
     * <code>
     * repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearEffectsProfileId() {
      effectsProfileId_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Input only. An identifier which selects 'audio effects' profiles
     * that are applied on (post synthesized) text to speech. Effects are applied
     * on top of each other in the order they are given. See
     * [audio
     * profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for
     * current supported profile ids.
     * </pre>
     *
     * <code>
     * repeated string effects_profile_id = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @param value The bytes of the effectsProfileId to add.
     * @return This builder for chaining.
     */
    public Builder addEffectsProfileIdBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      ensureEffectsProfileIdIsMutable();
      effectsProfileId_.add(value);
      onChanged();
      return this;
    }

    @java.lang.Override
    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:google.cloud.texttospeech.v1.AudioConfig)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.texttospeech.v1.AudioConfig)
  private static final com.google.cloud.texttospeech.v1.AudioConfig DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.texttospeech.v1.AudioConfig();
  }

  public static com.google.cloud.texttospeech.v1.AudioConfig getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<AudioConfig> PARSER =
      new com.google.protobuf.AbstractParser<AudioConfig>() {
        @java.lang.Override
        public AudioConfig parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new AudioConfig(input, extensionRegistry);
        }
      };

  public static com.google.protobuf.Parser<AudioConfig> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<AudioConfig> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.cloud.texttospeech.v1.AudioConfig getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
} public enum AudioEncoding implements com.google.protobuf.ProtocolMessageEnum {
  /**
   *
   *
   * <pre>
   * Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][].
   * </pre>
   *
   * <code>AUDIO_ENCODING_UNSPECIFIED = 0;</code>
   */
  AUDIO_ENCODING_UNSPECIFIED(0),
  /**
   *
   *
   * <pre>
   * Uncompressed 16-bit signed little-endian samples (Linear PCM).
   * Audio content returned as LINEAR16 also contains a WAV header.
   * </pre>
   *
   * <code>LINEAR16 = 1;</code>
   */
  LINEAR16(1),
  /**
   *
   *
   * <pre>
   * MP3 audio at 32kbps.
   * </pre>
   *
   * <code>MP3 = 2;</code>
   */
  MP3(2),
  /**
   *
   *
   * <pre>
   * Opus encoded audio wrapped in an ogg container. The result will be a
   * file which can be played natively on Android, and in browsers (at least
   * Chrome and Firefox). The quality of the encoding is considerably higher
   * than MP3 while using approximately the same bitrate.
   * </pre>
   *
   * <code>OGG_OPUS = 3;</code>
   */
  OGG_OPUS(3),
  /**
   *
   *
   * <pre>
   * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
   * Audio content returned as MULAW also contains a WAV header.
   * </pre>
   *
   * <code>MULAW = 5;</code>
   */
  MULAW(5),
  /**
   *
   *
   * <pre>
   * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/A-law.
   * Audio content returned as ALAW also contains a WAV header.
   * </pre>
   *
   * <code>ALAW = 6;</code>
   */
  ALAW(6),
  UNRECOGNIZED(-1),
  ;

  /**
   *
   *
   * <pre>
   * Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][].
   * </pre>
   *
   * <code>AUDIO_ENCODING_UNSPECIFIED = 0;</code>
   */
  public static final int AUDIO_ENCODING_UNSPECIFIED_VALUE = 0;
  /**
   *
   *
   * <pre>
   * Uncompressed 16-bit signed little-endian samples (Linear PCM).
   * Audio content returned as LINEAR16 also contains a WAV header.
   * </pre>
   *
   * <code>LINEAR16 = 1;</code>
   */
  public static final int LINEAR16_VALUE = 1;
  /**
   *
   *
   * <pre>
   * MP3 audio at 32kbps.
   * </pre>
   *
   * <code>MP3 = 2;</code>
   */
  public static final int MP3_VALUE = 2;
  /**
   *
   *
   * <pre>
   * Opus encoded audio wrapped in an ogg container. The result will be a
   * file which can be played natively on Android, and in browsers (at least
   * Chrome and Firefox). The quality of the encoding is considerably higher
   * than MP3 while using approximately the same bitrate.
   * </pre>
   *
   * <code>OGG_OPUS = 3;</code>
   */
  public static final int OGG_OPUS_VALUE = 3;
  /**
   *
   *
   * <pre>
   * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
   * Audio content returned as MULAW also contains a WAV header.
   * </pre>
   *
   * <code>MULAW = 5;</code>
   */
  public static final int MULAW_VALUE = 5;
  /**
   *
   *
   * <pre>
   * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/A-law.
   * Audio content returned as ALAW also contains a WAV header.
   * </pre>
   *
   * <code>ALAW = 6;</code>
   */
  public static final int ALAW_VALUE = 6;

  public final int getNumber() {
    if (this == UNRECOGNIZED) {
      throw new java.lang.IllegalArgumentException(
          "Can't get the number of an unknown enum value.");
    }
    return value;
  }

  /**
   * @param value The numeric wire value of the corresponding enum entry.
   * @return The enum associated with the given numeric wire value.
   * @deprecated Use {@link #forNumber(int)} instead.
   */
  @java.lang.Deprecated
  public static AudioEncoding valueOf(int value) {
    return forNumber(value);
  }

  /**
   * @param value The numeric wire value of the corresponding enum entry.
   * @return The enum associated with the given numeric wire value.
   */
  public static AudioEncoding forNumber(int value) {
    switch (value) {
      case 0:
        return AUDIO_ENCODING_UNSPECIFIED;
      case 1:
        return LINEAR16;
      case 2:
        return MP3;
      case 3:
        return OGG_OPUS;
      case 5:
        return MULAW;
      case 6:
        return ALAW;
      default:
        return null;
    }
  }

  public static com.google.protobuf.Internal.EnumLiteMap<AudioEncoding> internalGetValueMap() {
    return internalValueMap;
  }

  private static final com.google.protobuf.Internal.EnumLiteMap<AudioEncoding> internalValueMap =
      new com.google.protobuf.Internal.EnumLiteMap<AudioEncoding>() {
        public AudioEncoding findValueByNumber(int number) {
          return AudioEncoding.forNumber(number);
        }
      };

  public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
    if (this == UNRECOGNIZED) {
      throw new java.lang.IllegalStateException(
          "Can't get the descriptor of an unrecognized enum value.");
    }
    return getDescriptor().getValues().get(ordinal());
  }

  public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
    return getDescriptor();
  }

  public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
    return com.google.cloud.texttospeech.v1.TextToSpeechProto.getDescriptor().getEnumTypes().get(1);
  }

  private static final AudioEncoding[] VALUES = values();

  public static AudioEncoding valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
    if (desc.getType() != getDescriptor()) {
      throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
    }
    if (desc.getIndex() == -1) {
      return UNRECOGNIZED;
    }
    return VALUES[desc.getIndex()];
  }

  private final int value;

  private AudioEncoding(int value) {
    this.value = value;
  }

  // @@protoc_insertion_point(enum_scope:google.cloud.texttospeech.v1.AudioEncoding)
} public final class ListVoicesRequest extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.texttospeech.v1.ListVoicesRequest)
    ListVoicesRequestOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use ListVoicesRequest.newBuilder() to construct.
  private ListVoicesRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private ListVoicesRequest() {
    languageCode_ = "";
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    return new ListVoicesRequest();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  private ListVoicesRequest(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              java.lang.String s = input.readStringRequireUtf8();

              languageCode_ = s;
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.texttospeech.v1.TextToSpeechProto
        .internal_static_google_cloud_texttospeech_v1_ListVoicesRequest_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.texttospeech.v1.TextToSpeechProto
        .internal_static_google_cloud_texttospeech_v1_ListVoicesRequest_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.texttospeech.v1.ListVoicesRequest.class,
            com.google.cloud.texttospeech.v1.ListVoicesRequest.Builder.class);
  }

  public static final int LANGUAGE_CODE_FIELD_NUMBER = 1;
  private volatile java.lang.Object languageCode_;
  /**
   *
   *
   * <pre>
   * 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-&#92;*"` (Norwegian) and `"nb-&#92;*"` (Norwegian Bokmal) voices will be
   * returned.
   * </pre>
   *
   * <code>string language_code = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The languageCode.
   */
  @java.lang.Override
  public java.lang.String getLanguageCode() {
    java.lang.Object ref = languageCode_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      languageCode_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * 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-&#92;*"` (Norwegian) and `"nb-&#92;*"` (Norwegian Bokmal) voices will be
   * returned.
   * </pre>
   *
   * <code>string language_code = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
   *
   * @return The bytes for languageCode.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getLanguageCodeBytes() {
    java.lang.Object ref = languageCode_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      languageCode_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  private byte memoizedIsInitialized = -1;

  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, languageCode_);
    }
    unknownFields.writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, languageCode_);
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof com.google.cloud.texttospeech.v1.ListVoicesRequest)) {
      return super.equals(obj);
    }
    com.google.cloud.texttospeech.v1.ListVoicesRequest other =
        (com.google.cloud.texttospeech.v1.ListVoicesRequest) obj;

    if (!getLanguageCode().equals(other.getLanguageCode())) return false;
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER;
    hash = (53 * hash) + getLanguageCode().hashCode();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.texttospeech.v1.ListVoicesRequest parseFrom(
      java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.texttospeech.v1.ListVoicesRequest parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.ListVoicesRequest parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.texttospeech.v1.ListVoicesRequest parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.ListVoicesRequest parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.texttospeech.v1.ListVoicesRequest parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.ListVoicesRequest parseFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.texttospeech.v1.ListVoicesRequest parseFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.ListVoicesRequest parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloud.texttospeech.v1.ListVoicesRequest parseDelimitedFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.ListVoicesRequest parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.texttospeech.v1.ListVoicesRequest parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() {
    return newBuilder();
  }

  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }

  public static Builder newBuilder(com.google.cloud.texttospeech.v1.ListVoicesRequest prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *
   *
   * <pre>
   * The top-level message sent by the client for the `ListVoices` method.
   * </pre>
   *
   * Protobuf type {@code google.cloud.texttospeech.v1.ListVoicesRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.texttospeech.v1.ListVoicesRequest)
      com.google.cloud.texttospeech.v1.ListVoicesRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.texttospeech.v1.TextToSpeechProto
          .internal_static_google_cloud_texttospeech_v1_ListVoicesRequest_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.texttospeech.v1.TextToSpeechProto
          .internal_static_google_cloud_texttospeech_v1_ListVoicesRequest_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.texttospeech.v1.ListVoicesRequest.class,
              com.google.cloud.texttospeech.v1.ListVoicesRequest.Builder.class);
    }

    // Construct using com.google.cloud.texttospeech.v1.ListVoicesRequest.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      languageCode_ = "";

      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.texttospeech.v1.TextToSpeechProto
          .internal_static_google_cloud_texttospeech_v1_ListVoicesRequest_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.texttospeech.v1.ListVoicesRequest getDefaultInstanceForType() {
      return com.google.cloud.texttospeech.v1.ListVoicesRequest.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.texttospeech.v1.ListVoicesRequest build() {
      com.google.cloud.texttospeech.v1.ListVoicesRequest result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.texttospeech.v1.ListVoicesRequest buildPartial() {
      com.google.cloud.texttospeech.v1.ListVoicesRequest result =
          new com.google.cloud.texttospeech.v1.ListVoicesRequest(this);
      result.languageCode_ = languageCode_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.texttospeech.v1.ListVoicesRequest) {
        return mergeFrom((com.google.cloud.texttospeech.v1.ListVoicesRequest) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.texttospeech.v1.ListVoicesRequest other) {
      if (other == com.google.cloud.texttospeech.v1.ListVoicesRequest.getDefaultInstance())
        return this;
      if (!other.getLanguageCode().isEmpty()) {
        languageCode_ = other.languageCode_;
        onChanged();
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      com.google.cloud.texttospeech.v1.ListVoicesRequest parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage =
            (com.google.cloud.texttospeech.v1.ListVoicesRequest) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private java.lang.Object languageCode_ = "";
    /**
     *
     *
     * <pre>
     * 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-&#92;*"` (Norwegian) and `"nb-&#92;*"` (Norwegian Bokmal) voices will be
     * returned.
     * </pre>
     *
     * <code>string language_code = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The languageCode.
     */
    public java.lang.String getLanguageCode() {
      java.lang.Object ref = languageCode_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        languageCode_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * 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-&#92;*"` (Norwegian) and `"nb-&#92;*"` (Norwegian Bokmal) voices will be
     * returned.
     * </pre>
     *
     * <code>string language_code = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for languageCode.
     */
    public com.google.protobuf.ByteString getLanguageCodeBytes() {
      java.lang.Object ref = languageCode_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        languageCode_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * 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-&#92;*"` (Norwegian) and `"nb-&#92;*"` (Norwegian Bokmal) voices will be
     * returned.
     * </pre>
     *
     * <code>string language_code = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The languageCode to set.
     * @return This builder for chaining.
     */
    public Builder setLanguageCode(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      languageCode_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * 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-&#92;*"` (Norwegian) and `"nb-&#92;*"` (Norwegian Bokmal) voices will be
     * returned.
     * </pre>
     *
     * <code>string language_code = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearLanguageCode() {

      languageCode_ = getDefaultInstance().getLanguageCode();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * 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-&#92;*"` (Norwegian) and `"nb-&#92;*"` (Norwegian Bokmal) voices will be
     * returned.
     * </pre>
     *
     * <code>string language_code = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @param value The bytes for languageCode to set.
     * @return This builder for chaining.
     */
    public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      languageCode_ = value;
      onChanged();
      return this;
    }

    @java.lang.Override
    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:google.cloud.texttospeech.v1.ListVoicesRequest)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.texttospeech.v1.ListVoicesRequest)
  private static final com.google.cloud.texttospeech.v1.ListVoicesRequest DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.texttospeech.v1.ListVoicesRequest();
  }

  public static com.google.cloud.texttospeech.v1.ListVoicesRequest getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<ListVoicesRequest> PARSER =
      new com.google.protobuf.AbstractParser<ListVoicesRequest>() {
        @java.lang.Override
        public ListVoicesRequest parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new ListVoicesRequest(input, extensionRegistry);
        }
      };

  public static com.google.protobuf.Parser<ListVoicesRequest> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<ListVoicesRequest> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.cloud.texttospeech.v1.ListVoicesRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
} public final class ListVoicesResponse extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.texttospeech.v1.ListVoicesResponse)
    ListVoicesResponseOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use ListVoicesResponse.newBuilder() to construct.
  private ListVoicesResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private ListVoicesResponse() {
    voices_ = java.util.Collections.emptyList();
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    return new ListVoicesResponse();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  private ListVoicesResponse(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              if (!((mutable_bitField0_ & 0x00000001) != 0)) {
                voices_ = new java.util.ArrayList<com.google.cloud.texttospeech.v1.Voice>();
                mutable_bitField0_ |= 0x00000001;
              }
              voices_.add(
                  input.readMessage(
                      com.google.cloud.texttospeech.v1.Voice.parser(), extensionRegistry));
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      if (((mutable_bitField0_ & 0x00000001) != 0)) {
        voices_ = java.util.Collections.unmodifiableList(voices_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.texttospeech.v1.TextToSpeechProto
        .internal_static_google_cloud_texttospeech_v1_ListVoicesResponse_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.texttospeech.v1.TextToSpeechProto
        .internal_static_google_cloud_texttospeech_v1_ListVoicesResponse_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.texttospeech.v1.ListVoicesResponse.class,
            com.google.cloud.texttospeech.v1.ListVoicesResponse.Builder.class);
  }

  public static final int VOICES_FIELD_NUMBER = 1;
  private java.util.List<com.google.cloud.texttospeech.v1.Voice> voices_;
  /**
   *
   *
   * <pre>
   * The list of voices.
   * </pre>
   *
   * <code>repeated .google.cloud.texttospeech.v1.Voice voices = 1;</code>
   */
  @java.lang.Override
  public java.util.List<com.google.cloud.texttospeech.v1.Voice> getVoicesList() {
    return voices_;
  }
  /**
   *
   *
   * <pre>
   * The list of voices.
   * </pre>
   *
   * <code>repeated .google.cloud.texttospeech.v1.Voice voices = 1;</code>
   */
  @java.lang.Override
  public java.util.List<? extends com.google.cloud.texttospeech.v1.VoiceOrBuilder>
      getVoicesOrBuilderList() {
    return voices_;
  }
  /**
   *
   *
   * <pre>
   * The list of voices.
   * </pre>
   *
   * <code>repeated .google.cloud.texttospeech.v1.Voice voices = 1;</code>
   */
  @java.lang.Override
  public int getVoicesCount() {
    return voices_.size();
  }
  /**
   *
   *
   * <pre>
   * The list of voices.
   * </pre>
   *
   * <code>repeated .google.cloud.texttospeech.v1.Voice voices = 1;</code>
   */
  @java.lang.Override
  public com.google.cloud.texttospeech.v1.Voice getVoices(int index) {
    return voices_.get(index);
  }
  /**
   *
   *
   * <pre>
   * The list of voices.
   * </pre>
   *
   * <code>repeated .google.cloud.texttospeech.v1.Voice voices = 1;</code>
   */
  @java.lang.Override
  public com.google.cloud.texttospeech.v1.VoiceOrBuilder getVoicesOrBuilder(int index) {
    return voices_.get(index);
  }

  private byte memoizedIsInitialized = -1;

  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    for (int i = 0; i < voices_.size(); i++) {
      output.writeMessage(1, voices_.get(i));
    }
    unknownFields.writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    for (int i = 0; i < voices_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, voices_.get(i));
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof com.google.cloud.texttospeech.v1.ListVoicesResponse)) {
      return super.equals(obj);
    }
    com.google.cloud.texttospeech.v1.ListVoicesResponse other =
        (com.google.cloud.texttospeech.v1.ListVoicesResponse) obj;

    if (!getVoicesList().equals(other.getVoicesList())) return false;
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (getVoicesCount() > 0) {
      hash = (37 * hash) + VOICES_FIELD_NUMBER;
      hash = (53 * hash) + getVoicesList().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.texttospeech.v1.ListVoicesResponse parseFrom(
      java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.texttospeech.v1.ListVoicesResponse parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.ListVoicesResponse parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.texttospeech.v1.ListVoicesResponse parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.ListVoicesResponse parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.texttospeech.v1.ListVoicesResponse parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.ListVoicesResponse parseFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.texttospeech.v1.ListVoicesResponse parseFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.ListVoicesResponse parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloud.texttospeech.v1.ListVoicesResponse parseDelimitedFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.ListVoicesResponse parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.texttospeech.v1.ListVoicesResponse parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() {
    return newBuilder();
  }

  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }

  public static Builder newBuilder(com.google.cloud.texttospeech.v1.ListVoicesResponse prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *
   *
   * <pre>
   * The message returned to the client by the `ListVoices` method.
   * </pre>
   *
   * Protobuf type {@code google.cloud.texttospeech.v1.ListVoicesResponse}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.texttospeech.v1.ListVoicesResponse)
      com.google.cloud.texttospeech.v1.ListVoicesResponseOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.texttospeech.v1.TextToSpeechProto
          .internal_static_google_cloud_texttospeech_v1_ListVoicesResponse_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.texttospeech.v1.TextToSpeechProto
          .internal_static_google_cloud_texttospeech_v1_ListVoicesResponse_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.texttospeech.v1.ListVoicesResponse.class,
              com.google.cloud.texttospeech.v1.ListVoicesResponse.Builder.class);
    }

    // Construct using com.google.cloud.texttospeech.v1.ListVoicesResponse.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
        getVoicesFieldBuilder();
      }
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      if (voicesBuilder_ == null) {
        voices_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
      } else {
        voicesBuilder_.clear();
      }
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.texttospeech.v1.TextToSpeechProto
          .internal_static_google_cloud_texttospeech_v1_ListVoicesResponse_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.texttospeech.v1.ListVoicesResponse getDefaultInstanceForType() {
      return com.google.cloud.texttospeech.v1.ListVoicesResponse.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.texttospeech.v1.ListVoicesResponse build() {
      com.google.cloud.texttospeech.v1.ListVoicesResponse result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.texttospeech.v1.ListVoicesResponse buildPartial() {
      com.google.cloud.texttospeech.v1.ListVoicesResponse result =
          new com.google.cloud.texttospeech.v1.ListVoicesResponse(this);
      int from_bitField0_ = bitField0_;
      if (voicesBuilder_ == null) {
        if (((bitField0_ & 0x00000001) != 0)) {
          voices_ = java.util.Collections.unmodifiableList(voices_);
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.voices_ = voices_;
      } else {
        result.voices_ = voicesBuilder_.build();
      }
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.texttospeech.v1.ListVoicesResponse) {
        return mergeFrom((com.google.cloud.texttospeech.v1.ListVoicesResponse) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.texttospeech.v1.ListVoicesResponse other) {
      if (other == com.google.cloud.texttospeech.v1.ListVoicesResponse.getDefaultInstance())
        return this;
      if (voicesBuilder_ == null) {
        if (!other.voices_.isEmpty()) {
          if (voices_.isEmpty()) {
            voices_ = other.voices_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureVoicesIsMutable();
            voices_.addAll(other.voices_);
          }
          onChanged();
        }
      } else {
        if (!other.voices_.isEmpty()) {
          if (voicesBuilder_.isEmpty()) {
            voicesBuilder_.dispose();
            voicesBuilder_ = null;
            voices_ = other.voices_;
            bitField0_ = (bitField0_ & ~0x00000001);
            voicesBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getVoicesFieldBuilder()
                    : null;
          } else {
            voicesBuilder_.addAllMessages(other.voices_);
          }
        }
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      com.google.cloud.texttospeech.v1.ListVoicesResponse parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage =
            (com.google.cloud.texttospeech.v1.ListVoicesResponse) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int bitField0_;

    private java.util.List<com.google.cloud.texttospeech.v1.Voice> voices_ =
        java.util.Collections.emptyList();

    private void ensureVoicesIsMutable() {
      if (!((bitField0_ & 0x00000001) != 0)) {
        voices_ = new java.util.ArrayList<com.google.cloud.texttospeech.v1.Voice>(voices_);
        bitField0_ |= 0x00000001;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.texttospeech.v1.Voice,
            com.google.cloud.texttospeech.v1.Voice.Builder,
            com.google.cloud.texttospeech.v1.VoiceOrBuilder>
        voicesBuilder_;

    /**
     *
     *
     * <pre>
     * The list of voices.
     * </pre>
     *
     * <code>repeated .google.cloud.texttospeech.v1.Voice voices = 1;</code>
     */
    public java.util.List<com.google.cloud.texttospeech.v1.Voice> getVoicesList() {
      if (voicesBuilder_ == null) {
        return java.util.Collections.unmodifiableList(voices_);
      } else {
        return voicesBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     * <pre>
     * The list of voices.
     * </pre>
     *
     * <code>repeated .google.cloud.texttospeech.v1.Voice voices = 1;</code>
     */
    public int getVoicesCount() {
      if (voicesBuilder_ == null) {
        return voices_.size();
      } else {
        return voicesBuilder_.getCount();
      }
    }
    /**
     *
     *
     * <pre>
     * The list of voices.
     * </pre>
     *
     * <code>repeated .google.cloud.texttospeech.v1.Voice voices = 1;</code>
     */
    public com.google.cloud.texttospeech.v1.Voice getVoices(int index) {
      if (voicesBuilder_ == null) {
        return voices_.get(index);
      } else {
        return voicesBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     * <pre>
     * The list of voices.
     * </pre>
     *
     * <code>repeated .google.cloud.texttospeech.v1.Voice voices = 1;</code>
     */
    public Builder setVoices(int index, com.google.cloud.texttospeech.v1.Voice value) {
      if (voicesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureVoicesIsMutable();
        voices_.set(index, value);
        onChanged();
      } else {
        voicesBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of voices.
     * </pre>
     *
     * <code>repeated .google.cloud.texttospeech.v1.Voice voices = 1;</code>
     */
    public Builder setVoices(
        int index, com.google.cloud.texttospeech.v1.Voice.Builder builderForValue) {
      if (voicesBuilder_ == null) {
        ensureVoicesIsMutable();
        voices_.set(index, builderForValue.build());
        onChanged();
      } else {
        voicesBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of voices.
     * </pre>
     *
     * <code>repeated .google.cloud.texttospeech.v1.Voice voices = 1;</code>
     */
    public Builder addVoices(com.google.cloud.texttospeech.v1.Voice value) {
      if (voicesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureVoicesIsMutable();
        voices_.add(value);
        onChanged();
      } else {
        voicesBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of voices.
     * </pre>
     *
     * <code>repeated .google.cloud.texttospeech.v1.Voice voices = 1;</code>
     */
    public Builder addVoices(int index, com.google.cloud.texttospeech.v1.Voice value) {
      if (voicesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureVoicesIsMutable();
        voices_.add(index, value);
        onChanged();
      } else {
        voicesBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of voices.
     * </pre>
     *
     * <code>repeated .google.cloud.texttospeech.v1.Voice voices = 1;</code>
     */
    public Builder addVoices(com.google.cloud.texttospeech.v1.Voice.Builder builderForValue) {
      if (voicesBuilder_ == null) {
        ensureVoicesIsMutable();
        voices_.add(builderForValue.build());
        onChanged();
      } else {
        voicesBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of voices.
     * </pre>
     *
     * <code>repeated .google.cloud.texttospeech.v1.Voice voices = 1;</code>
     */
    public Builder addVoices(
        int index, com.google.cloud.texttospeech.v1.Voice.Builder builderForValue) {
      if (voicesBuilder_ == null) {
        ensureVoicesIsMutable();
        voices_.add(index, builderForValue.build());
        onChanged();
      } else {
        voicesBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of voices.
     * </pre>
     *
     * <code>repeated .google.cloud.texttospeech.v1.Voice voices = 1;</code>
     */
    public Builder addAllVoices(
        java.lang.Iterable<? extends com.google.cloud.texttospeech.v1.Voice> values) {
      if (voicesBuilder_ == null) {
        ensureVoicesIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, voices_);
        onChanged();
      } else {
        voicesBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of voices.
     * </pre>
     *
     * <code>repeated .google.cloud.texttospeech.v1.Voice voices = 1;</code>
     */
    public Builder clearVoices() {
      if (voicesBuilder_ == null) {
        voices_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
      } else {
        voicesBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of voices.
     * </pre>
     *
     * <code>repeated .google.cloud.texttospeech.v1.Voice voices = 1;</code>
     */
    public Builder removeVoices(int index) {
      if (voicesBuilder_ == null) {
        ensureVoicesIsMutable();
        voices_.remove(index);
        onChanged();
      } else {
        voicesBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The list of voices.
     * </pre>
     *
     * <code>repeated .google.cloud.texttospeech.v1.Voice voices = 1;</code>
     */
    public com.google.cloud.texttospeech.v1.Voice.Builder getVoicesBuilder(int index) {
      return getVoicesFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     * <pre>
     * The list of voices.
     * </pre>
     *
     * <code>repeated .google.cloud.texttospeech.v1.Voice voices = 1;</code>
     */
    public com.google.cloud.texttospeech.v1.VoiceOrBuilder getVoicesOrBuilder(int index) {
      if (voicesBuilder_ == null) {
        return voices_.get(index);
      } else {
        return voicesBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     * <pre>
     * The list of voices.
     * </pre>
     *
     * <code>repeated .google.cloud.texttospeech.v1.Voice voices = 1;</code>
     */
    public java.util.List<? extends com.google.cloud.texttospeech.v1.VoiceOrBuilder>
        getVoicesOrBuilderList() {
      if (voicesBuilder_ != null) {
        return voicesBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(voices_);
      }
    }
    /**
     *
     *
     * <pre>
     * The list of voices.
     * </pre>
     *
     * <code>repeated .google.cloud.texttospeech.v1.Voice voices = 1;</code>
     */
    public com.google.cloud.texttospeech.v1.Voice.Builder addVoicesBuilder() {
      return getVoicesFieldBuilder()
          .addBuilder(com.google.cloud.texttospeech.v1.Voice.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * The list of voices.
     * </pre>
     *
     * <code>repeated .google.cloud.texttospeech.v1.Voice voices = 1;</code>
     */
    public com.google.cloud.texttospeech.v1.Voice.Builder addVoicesBuilder(int index) {
      return getVoicesFieldBuilder()
          .addBuilder(index, com.google.cloud.texttospeech.v1.Voice.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * The list of voices.
     * </pre>
     *
     * <code>repeated .google.cloud.texttospeech.v1.Voice voices = 1;</code>
     */
    public java.util.List<com.google.cloud.texttospeech.v1.Voice.Builder> getVoicesBuilderList() {
      return getVoicesFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.texttospeech.v1.Voice,
            com.google.cloud.texttospeech.v1.Voice.Builder,
            com.google.cloud.texttospeech.v1.VoiceOrBuilder>
        getVoicesFieldBuilder() {
      if (voicesBuilder_ == null) {
        voicesBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.cloud.texttospeech.v1.Voice,
                com.google.cloud.texttospeech.v1.Voice.Builder,
                com.google.cloud.texttospeech.v1.VoiceOrBuilder>(
                voices_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean());
        voices_ = null;
      }
      return voicesBuilder_;
    }

    @java.lang.Override
    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:google.cloud.texttospeech.v1.ListVoicesResponse)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.texttospeech.v1.ListVoicesResponse)
  private static final com.google.cloud.texttospeech.v1.ListVoicesResponse DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.texttospeech.v1.ListVoicesResponse();
  }

  public static com.google.cloud.texttospeech.v1.ListVoicesResponse getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<ListVoicesResponse> PARSER =
      new com.google.protobuf.AbstractParser<ListVoicesResponse>() {
        @java.lang.Override
        public ListVoicesResponse parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new ListVoicesResponse(input, extensionRegistry);
        }
      };

  public static com.google.protobuf.Parser<ListVoicesResponse> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<ListVoicesResponse> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.cloud.texttospeech.v1.ListVoicesResponse getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
} public enum SsmlVoiceGender implements com.google.protobuf.ProtocolMessageEnum {
  /**
   *
   *
   * <pre>
   * An unspecified gender.
   * In VoiceSelectionParams, this means that the client doesn't care which
   * gender the selected voice will have. In the Voice field of
   * ListVoicesResponse, this may mean that the voice doesn't fit any of the
   * other categories in this enum, or that the gender of the voice isn't known.
   * </pre>
   *
   * <code>SSML_VOICE_GENDER_UNSPECIFIED = 0;</code>
   */
  SSML_VOICE_GENDER_UNSPECIFIED(0),
  /**
   *
   *
   * <pre>
   * A male voice.
   * </pre>
   *
   * <code>MALE = 1;</code>
   */
  MALE(1),
  /**
   *
   *
   * <pre>
   * A female voice.
   * </pre>
   *
   * <code>FEMALE = 2;</code>
   */
  FEMALE(2),
  /**
   *
   *
   * <pre>
   * A gender-neutral voice. This voice is not yet supported.
   * </pre>
   *
   * <code>NEUTRAL = 3;</code>
   */
  NEUTRAL(3),
  UNRECOGNIZED(-1),
  ;

  /**
   *
   *
   * <pre>
   * An unspecified gender.
   * In VoiceSelectionParams, this means that the client doesn't care which
   * gender the selected voice will have. In the Voice field of
   * ListVoicesResponse, this may mean that the voice doesn't fit any of the
   * other categories in this enum, or that the gender of the voice isn't known.
   * </pre>
   *
   * <code>SSML_VOICE_GENDER_UNSPECIFIED = 0;</code>
   */
  public static final int SSML_VOICE_GENDER_UNSPECIFIED_VALUE = 0;
  /**
   *
   *
   * <pre>
   * A male voice.
   * </pre>
   *
   * <code>MALE = 1;</code>
   */
  public static final int MALE_VALUE = 1;
  /**
   *
   *
   * <pre>
   * A female voice.
   * </pre>
   *
   * <code>FEMALE = 2;</code>
   */
  public static final int FEMALE_VALUE = 2;
  /**
   *
   *
   * <pre>
   * A gender-neutral voice. This voice is not yet supported.
   * </pre>
   *
   * <code>NEUTRAL = 3;</code>
   */
  public static final int NEUTRAL_VALUE = 3;

  public final int getNumber() {
    if (this == UNRECOGNIZED) {
      throw new java.lang.IllegalArgumentException(
          "Can't get the number of an unknown enum value.");
    }
    return value;
  }

  /**
   * @param value The numeric wire value of the corresponding enum entry.
   * @return The enum associated with the given numeric wire value.
   * @deprecated Use {@link #forNumber(int)} instead.
   */
  @java.lang.Deprecated
  public static SsmlVoiceGender valueOf(int value) {
    return forNumber(value);
  }

  /**
   * @param value The numeric wire value of the corresponding enum entry.
   * @return The enum associated with the given numeric wire value.
   */
  public static SsmlVoiceGender forNumber(int value) {
    switch (value) {
      case 0:
        return SSML_VOICE_GENDER_UNSPECIFIED;
      case 1:
        return MALE;
      case 2:
        return FEMALE;
      case 3:
        return NEUTRAL;
      default:
        return null;
    }
  }

  public static com.google.protobuf.Internal.EnumLiteMap<SsmlVoiceGender> internalGetValueMap() {
    return internalValueMap;
  }

  private static final com.google.protobuf.Internal.EnumLiteMap<SsmlVoiceGender> internalValueMap =
      new com.google.protobuf.Internal.EnumLiteMap<SsmlVoiceGender>() {
        public SsmlVoiceGender findValueByNumber(int number) {
          return SsmlVoiceGender.forNumber(number);
        }
      };

  public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
    if (this == UNRECOGNIZED) {
      throw new java.lang.IllegalStateException(
          "Can't get the descriptor of an unrecognized enum value.");
    }
    return getDescriptor().getValues().get(ordinal());
  }

  public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
    return getDescriptor();
  }

  public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
    return com.google.cloud.texttospeech.v1.TextToSpeechProto.getDescriptor().getEnumTypes().get(0);
  }

  private static final SsmlVoiceGender[] VALUES = values();

  public static SsmlVoiceGender valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
    if (desc.getType() != getDescriptor()) {
      throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
    }
    if (desc.getIndex() == -1) {
      return UNRECOGNIZED;
    }
    return VALUES[desc.getIndex()];
  }

  private final int value;

  private SsmlVoiceGender(int value) {
    this.value = value;
  }

  // @@protoc_insertion_point(enum_scope:google.cloud.texttospeech.v1.SsmlVoiceGender)
} public final class SynthesisInput extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.texttospeech.v1.SynthesisInput)
    SynthesisInputOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use SynthesisInput.newBuilder() to construct.
  private SynthesisInput(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private SynthesisInput() {}

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    return new SynthesisInput();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  private SynthesisInput(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              java.lang.String s = input.readStringRequireUtf8();
              inputSourceCase_ = 1;
              inputSource_ = s;
              break;
            }
          case 18:
            {
              java.lang.String s = input.readStringRequireUtf8();
              inputSourceCase_ = 2;
              inputSource_ = s;
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.texttospeech.v1.TextToSpeechProto
        .internal_static_google_cloud_texttospeech_v1_SynthesisInput_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.texttospeech.v1.TextToSpeechProto
        .internal_static_google_cloud_texttospeech_v1_SynthesisInput_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.texttospeech.v1.SynthesisInput.class,
            com.google.cloud.texttospeech.v1.SynthesisInput.Builder.class);
  }

  private int inputSourceCase_ = 0;
  private java.lang.Object inputSource_;

  public enum InputSourceCase
      implements
          com.google.protobuf.Internal.EnumLite,
          com.google.protobuf.AbstractMessage.InternalOneOfEnum {
    TEXT(1),
    SSML(2),
    INPUTSOURCE_NOT_SET(0);
    private final int value;

    private InputSourceCase(int value) {
      this.value = value;
    }
    /**
     * @param value The number of the enum to look for.
     * @return The enum associated with the given number.
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static InputSourceCase valueOf(int value) {
      return forNumber(value);
    }

    public static InputSourceCase forNumber(int value) {
      switch (value) {
        case 1:
          return TEXT;
        case 2:
          return SSML;
        case 0:
          return INPUTSOURCE_NOT_SET;
        default:
          return null;
      }
    }

    public int getNumber() {
      return this.value;
    }
  };

  public InputSourceCase getInputSourceCase() {
    return InputSourceCase.forNumber(inputSourceCase_);
  }

  public static final int TEXT_FIELD_NUMBER = 1;
  /**
   *
   *
   * <pre>
   * The raw text to be synthesized.
   * </pre>
   *
   * <code>string text = 1;</code>
   *
   * @return Whether the text field is set.
   */
  public boolean hasText() {
    return inputSourceCase_ == 1;
  }
  /**
   *
   *
   * <pre>
   * The raw text to be synthesized.
   * </pre>
   *
   * <code>string text = 1;</code>
   *
   * @return The text.
   */
  public java.lang.String getText() {
    java.lang.Object ref = "";
    if (inputSourceCase_ == 1) {
      ref = inputSource_;
    }
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      if (inputSourceCase_ == 1) {
        inputSource_ = s;
      }
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The raw text to be synthesized.
   * </pre>
   *
   * <code>string text = 1;</code>
   *
   * @return The bytes for text.
   */
  public com.google.protobuf.ByteString getTextBytes() {
    java.lang.Object ref = "";
    if (inputSourceCase_ == 1) {
      ref = inputSource_;
    }
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      if (inputSourceCase_ == 1) {
        inputSource_ = b;
      }
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int SSML_FIELD_NUMBER = 2;
  /**
   *
   *
   * <pre>
   * The SSML document to be synthesized. The SSML document must be valid
   * and well-formed. Otherwise the RPC will fail and return
   * [google.rpc.Code.INVALID_ARGUMENT][]. For more information, see
   * [SSML](https://cloud.google.com/text-to-speech/docs/ssml).
   * </pre>
   *
   * <code>string ssml = 2;</code>
   *
   * @return Whether the ssml field is set.
   */
  public boolean hasSsml() {
    return inputSourceCase_ == 2;
  }
  /**
   *
   *
   * <pre>
   * The SSML document to be synthesized. The SSML document must be valid
   * and well-formed. Otherwise the RPC will fail and return
   * [google.rpc.Code.INVALID_ARGUMENT][]. For more information, see
   * [SSML](https://cloud.google.com/text-to-speech/docs/ssml).
   * </pre>
   *
   * <code>string ssml = 2;</code>
   *
   * @return The ssml.
   */
  public java.lang.String getSsml() {
    java.lang.Object ref = "";
    if (inputSourceCase_ == 2) {
      ref = inputSource_;
    }
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      if (inputSourceCase_ == 2) {
        inputSource_ = s;
      }
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The SSML document to be synthesized. The SSML document must be valid
   * and well-formed. Otherwise the RPC will fail and return
   * [google.rpc.Code.INVALID_ARGUMENT][]. For more information, see
   * [SSML](https://cloud.google.com/text-to-speech/docs/ssml).
   * </pre>
   *
   * <code>string ssml = 2;</code>
   *
   * @return The bytes for ssml.
   */
  public com.google.protobuf.ByteString getSsmlBytes() {
    java.lang.Object ref = "";
    if (inputSourceCase_ == 2) {
      ref = inputSource_;
    }
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      if (inputSourceCase_ == 2) {
        inputSource_ = b;
      }
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  private byte memoizedIsInitialized = -1;

  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (inputSourceCase_ == 1) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, inputSource_);
    }
    if (inputSourceCase_ == 2) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, inputSource_);
    }
    unknownFields.writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (inputSourceCase_ == 1) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, inputSource_);
    }
    if (inputSourceCase_ == 2) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, inputSource_);
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof com.google.cloud.texttospeech.v1.SynthesisInput)) {
      return super.equals(obj);
    }
    com.google.cloud.texttospeech.v1.SynthesisInput other =
        (com.google.cloud.texttospeech.v1.SynthesisInput) obj;

    if (!getInputSourceCase().equals(other.getInputSourceCase())) return false;
    switch (inputSourceCase_) {
      case 1:
        if (!getText().equals(other.getText())) return false;
        break;
      case 2:
        if (!getSsml().equals(other.getSsml())) return false;
        break;
      case 0:
      default:
    }
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    switch (inputSourceCase_) {
      case 1:
        hash = (37 * hash) + TEXT_FIELD_NUMBER;
        hash = (53 * hash) + getText().hashCode();
        break;
      case 2:
        hash = (37 * hash) + SSML_FIELD_NUMBER;
        hash = (53 * hash) + getSsml().hashCode();
        break;
      case 0:
      default:
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.texttospeech.v1.SynthesisInput parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.texttospeech.v1.SynthesisInput parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.SynthesisInput parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.texttospeech.v1.SynthesisInput parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.SynthesisInput parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.texttospeech.v1.SynthesisInput parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.SynthesisInput parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.texttospeech.v1.SynthesisInput parseFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.SynthesisInput parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloud.texttospeech.v1.SynthesisInput parseDelimitedFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.SynthesisInput parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.texttospeech.v1.SynthesisInput parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() {
    return newBuilder();
  }

  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }

  public static Builder newBuilder(com.google.cloud.texttospeech.v1.SynthesisInput prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *
   *
   * <pre>
   * Contains text input to be synthesized. Either `text` or `ssml` must be
   * supplied. Supplying both or neither returns
   * [google.rpc.Code.INVALID_ARGUMENT][]. The input size is limited to 5000
   * characters.
   * </pre>
   *
   * Protobuf type {@code google.cloud.texttospeech.v1.SynthesisInput}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.texttospeech.v1.SynthesisInput)
      com.google.cloud.texttospeech.v1.SynthesisInputOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.texttospeech.v1.TextToSpeechProto
          .internal_static_google_cloud_texttospeech_v1_SynthesisInput_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.texttospeech.v1.TextToSpeechProto
          .internal_static_google_cloud_texttospeech_v1_SynthesisInput_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.texttospeech.v1.SynthesisInput.class,
              com.google.cloud.texttospeech.v1.SynthesisInput.Builder.class);
    }

    // Construct using com.google.cloud.texttospeech.v1.SynthesisInput.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      inputSourceCase_ = 0;
      inputSource_ = null;
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.texttospeech.v1.TextToSpeechProto
          .internal_static_google_cloud_texttospeech_v1_SynthesisInput_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.texttospeech.v1.SynthesisInput getDefaultInstanceForType() {
      return com.google.cloud.texttospeech.v1.SynthesisInput.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.texttospeech.v1.SynthesisInput build() {
      com.google.cloud.texttospeech.v1.SynthesisInput result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.texttospeech.v1.SynthesisInput buildPartial() {
      com.google.cloud.texttospeech.v1.SynthesisInput result =
          new com.google.cloud.texttospeech.v1.SynthesisInput(this);
      if (inputSourceCase_ == 1) {
        result.inputSource_ = inputSource_;
      }
      if (inputSourceCase_ == 2) {
        result.inputSource_ = inputSource_;
      }
      result.inputSourceCase_ = inputSourceCase_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.texttospeech.v1.SynthesisInput) {
        return mergeFrom((com.google.cloud.texttospeech.v1.SynthesisInput) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.texttospeech.v1.SynthesisInput other) {
      if (other == com.google.cloud.texttospeech.v1.SynthesisInput.getDefaultInstance())
        return this;
      switch (other.getInputSourceCase()) {
        case TEXT:
          {
            inputSourceCase_ = 1;
            inputSource_ = other.inputSource_;
            onChanged();
            break;
          }
        case SSML:
          {
            inputSourceCase_ = 2;
            inputSource_ = other.inputSource_;
            onChanged();
            break;
          }
        case INPUTSOURCE_NOT_SET:
          {
            break;
          }
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      com.google.cloud.texttospeech.v1.SynthesisInput parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.cloud.texttospeech.v1.SynthesisInput) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int inputSourceCase_ = 0;
    private java.lang.Object inputSource_;

    public InputSourceCase getInputSourceCase() {
      return InputSourceCase.forNumber(inputSourceCase_);
    }

    public Builder clearInputSource() {
      inputSourceCase_ = 0;
      inputSource_ = null;
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * The raw text to be synthesized.
     * </pre>
     *
     * <code>string text = 1;</code>
     *
     * @return Whether the text field is set.
     */
    @java.lang.Override
    public boolean hasText() {
      return inputSourceCase_ == 1;
    }
    /**
     *
     *
     * <pre>
     * The raw text to be synthesized.
     * </pre>
     *
     * <code>string text = 1;</code>
     *
     * @return The text.
     */
    @java.lang.Override
    public java.lang.String getText() {
      java.lang.Object ref = "";
      if (inputSourceCase_ == 1) {
        ref = inputSource_;
      }
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (inputSourceCase_ == 1) {
          inputSource_ = s;
        }
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The raw text to be synthesized.
     * </pre>
     *
     * <code>string text = 1;</code>
     *
     * @return The bytes for text.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getTextBytes() {
      java.lang.Object ref = "";
      if (inputSourceCase_ == 1) {
        ref = inputSource_;
      }
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        if (inputSourceCase_ == 1) {
          inputSource_ = b;
        }
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The raw text to be synthesized.
     * </pre>
     *
     * <code>string text = 1;</code>
     *
     * @param value The text to set.
     * @return This builder for chaining.
     */
    public Builder setText(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      inputSourceCase_ = 1;
      inputSource_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The raw text to be synthesized.
     * </pre>
     *
     * <code>string text = 1;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearText() {
      if (inputSourceCase_ == 1) {
        inputSourceCase_ = 0;
        inputSource_ = null;
        onChanged();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The raw text to be synthesized.
     * </pre>
     *
     * <code>string text = 1;</code>
     *
     * @param value The bytes for text to set.
     * @return This builder for chaining.
     */
    public Builder setTextBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      inputSourceCase_ = 1;
      inputSource_ = value;
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * The SSML document to be synthesized. The SSML document must be valid
     * and well-formed. Otherwise the RPC will fail and return
     * [google.rpc.Code.INVALID_ARGUMENT][]. For more information, see
     * [SSML](https://cloud.google.com/text-to-speech/docs/ssml).
     * </pre>
     *
     * <code>string ssml = 2;</code>
     *
     * @return Whether the ssml field is set.
     */
    @java.lang.Override
    public boolean hasSsml() {
      return inputSourceCase_ == 2;
    }
    /**
     *
     *
     * <pre>
     * The SSML document to be synthesized. The SSML document must be valid
     * and well-formed. Otherwise the RPC will fail and return
     * [google.rpc.Code.INVALID_ARGUMENT][]. For more information, see
     * [SSML](https://cloud.google.com/text-to-speech/docs/ssml).
     * </pre>
     *
     * <code>string ssml = 2;</code>
     *
     * @return The ssml.
     */
    @java.lang.Override
    public java.lang.String getSsml() {
      java.lang.Object ref = "";
      if (inputSourceCase_ == 2) {
        ref = inputSource_;
      }
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (inputSourceCase_ == 2) {
          inputSource_ = s;
        }
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The SSML document to be synthesized. The SSML document must be valid
     * and well-formed. Otherwise the RPC will fail and return
     * [google.rpc.Code.INVALID_ARGUMENT][]. For more information, see
     * [SSML](https://cloud.google.com/text-to-speech/docs/ssml).
     * </pre>
     *
     * <code>string ssml = 2;</code>
     *
     * @return The bytes for ssml.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getSsmlBytes() {
      java.lang.Object ref = "";
      if (inputSourceCase_ == 2) {
        ref = inputSource_;
      }
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        if (inputSourceCase_ == 2) {
          inputSource_ = b;
        }
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The SSML document to be synthesized. The SSML document must be valid
     * and well-formed. Otherwise the RPC will fail and return
     * [google.rpc.Code.INVALID_ARGUMENT][]. For more information, see
     * [SSML](https://cloud.google.com/text-to-speech/docs/ssml).
     * </pre>
     *
     * <code>string ssml = 2;</code>
     *
     * @param value The ssml to set.
     * @return This builder for chaining.
     */
    public Builder setSsml(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      inputSourceCase_ = 2;
      inputSource_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The SSML document to be synthesized. The SSML document must be valid
     * and well-formed. Otherwise the RPC will fail and return
     * [google.rpc.Code.INVALID_ARGUMENT][]. For more information, see
     * [SSML](https://cloud.google.com/text-to-speech/docs/ssml).
     * </pre>
     *
     * <code>string ssml = 2;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearSsml() {
      if (inputSourceCase_ == 2) {
        inputSourceCase_ = 0;
        inputSource_ = null;
        onChanged();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The SSML document to be synthesized. The SSML document must be valid
     * and well-formed. Otherwise the RPC will fail and return
     * [google.rpc.Code.INVALID_ARGUMENT][]. For more information, see
     * [SSML](https://cloud.google.com/text-to-speech/docs/ssml).
     * </pre>
     *
     * <code>string ssml = 2;</code>
     *
     * @param value The bytes for ssml to set.
     * @return This builder for chaining.
     */
    public Builder setSsmlBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      inputSourceCase_ = 2;
      inputSource_ = value;
      onChanged();
      return this;
    }

    @java.lang.Override
    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:google.cloud.texttospeech.v1.SynthesisInput)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.texttospeech.v1.SynthesisInput)
  private static final com.google.cloud.texttospeech.v1.SynthesisInput DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.texttospeech.v1.SynthesisInput();
  }

  public static com.google.cloud.texttospeech.v1.SynthesisInput getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<SynthesisInput> PARSER =
      new com.google.protobuf.AbstractParser<SynthesisInput>() {
        @java.lang.Override
        public SynthesisInput parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new SynthesisInput(input, extensionRegistry);
        }
      };

  public static com.google.protobuf.Parser<SynthesisInput> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<SynthesisInput> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.cloud.texttospeech.v1.SynthesisInput getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
} public final class SynthesizeSpeechResponse extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.texttospeech.v1.SynthesizeSpeechResponse)
    SynthesizeSpeechResponseOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use SynthesizeSpeechResponse.newBuilder() to construct.
  private SynthesizeSpeechResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private SynthesizeSpeechResponse() {
    audioContent_ = com.google.protobuf.ByteString.EMPTY;
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    return new SynthesizeSpeechResponse();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  private SynthesizeSpeechResponse(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              audioContent_ = input.readBytes();
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.texttospeech.v1.TextToSpeechProto
        .internal_static_google_cloud_texttospeech_v1_SynthesizeSpeechResponse_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.texttospeech.v1.TextToSpeechProto
        .internal_static_google_cloud_texttospeech_v1_SynthesizeSpeechResponse_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse.class,
            com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse.Builder.class);
  }

  public static final int AUDIO_CONTENT_FIELD_NUMBER = 1;
  private com.google.protobuf.ByteString audioContent_;
  /**
   *
   *
   * <pre>
   * The audio data bytes encoded as specified in the request, including the
   * header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS).
   * For LINEAR16 audio, we include the WAV header. Note: as
   * with all bytes fields, protobuffers use a pure binary representation,
   * whereas JSON representations use base64.
   * </pre>
   *
   * <code>bytes audio_content = 1;</code>
   *
   * @return The audioContent.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getAudioContent() {
    return audioContent_;
  }

  private byte memoizedIsInitialized = -1;

  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (!audioContent_.isEmpty()) {
      output.writeBytes(1, audioContent_);
    }
    unknownFields.writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (!audioContent_.isEmpty()) {
      size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, audioContent_);
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse)) {
      return super.equals(obj);
    }
    com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse other =
        (com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse) obj;

    if (!getAudioContent().equals(other.getAudioContent())) return false;
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + AUDIO_CONTENT_FIELD_NUMBER;
    hash = (53 * hash) + getAudioContent().hashCode();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse parseFrom(
      java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse parseFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse parseFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse parseDelimitedFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() {
    return newBuilder();
  }

  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }

  public static Builder newBuilder(
      com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *
   *
   * <pre>
   * The message returned to the client by the `SynthesizeSpeech` method.
   * </pre>
   *
   * Protobuf type {@code google.cloud.texttospeech.v1.SynthesizeSpeechResponse}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.texttospeech.v1.SynthesizeSpeechResponse)
      com.google.cloud.texttospeech.v1.SynthesizeSpeechResponseOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.texttospeech.v1.TextToSpeechProto
          .internal_static_google_cloud_texttospeech_v1_SynthesizeSpeechResponse_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.texttospeech.v1.TextToSpeechProto
          .internal_static_google_cloud_texttospeech_v1_SynthesizeSpeechResponse_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse.class,
              com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse.Builder.class);
    }

    // Construct using com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      audioContent_ = com.google.protobuf.ByteString.EMPTY;

      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.texttospeech.v1.TextToSpeechProto
          .internal_static_google_cloud_texttospeech_v1_SynthesizeSpeechResponse_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse getDefaultInstanceForType() {
      return com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse build() {
      com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse buildPartial() {
      com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse result =
          new com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse(this);
      result.audioContent_ = audioContent_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse) {
        return mergeFrom((com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse other) {
      if (other == com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse.getDefaultInstance())
        return this;
      if (other.getAudioContent() != com.google.protobuf.ByteString.EMPTY) {
        setAudioContent(other.getAudioContent());
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage =
            (com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private com.google.protobuf.ByteString audioContent_ = com.google.protobuf.ByteString.EMPTY;
    /**
     *
     *
     * <pre>
     * The audio data bytes encoded as specified in the request, including the
     * header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS).
     * For LINEAR16 audio, we include the WAV header. Note: as
     * with all bytes fields, protobuffers use a pure binary representation,
     * whereas JSON representations use base64.
     * </pre>
     *
     * <code>bytes audio_content = 1;</code>
     *
     * @return The audioContent.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getAudioContent() {
      return audioContent_;
    }
    /**
     *
     *
     * <pre>
     * The audio data bytes encoded as specified in the request, including the
     * header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS).
     * For LINEAR16 audio, we include the WAV header. Note: as
     * with all bytes fields, protobuffers use a pure binary representation,
     * whereas JSON representations use base64.
     * </pre>
     *
     * <code>bytes audio_content = 1;</code>
     *
     * @param value The audioContent to set.
     * @return This builder for chaining.
     */
    public Builder setAudioContent(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }

      audioContent_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The audio data bytes encoded as specified in the request, including the
     * header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS).
     * For LINEAR16 audio, we include the WAV header. Note: as
     * with all bytes fields, protobuffers use a pure binary representation,
     * whereas JSON representations use base64.
     * </pre>
     *
     * <code>bytes audio_content = 1;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearAudioContent() {

      audioContent_ = getDefaultInstance().getAudioContent();
      onChanged();
      return this;
    }

    @java.lang.Override
    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:google.cloud.texttospeech.v1.SynthesizeSpeechResponse)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.texttospeech.v1.SynthesizeSpeechResponse)
  private static final com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse();
  }

  public static com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<SynthesizeSpeechResponse> PARSER =
      new com.google.protobuf.AbstractParser<SynthesizeSpeechResponse>() {
        @java.lang.Override
        public SynthesizeSpeechResponse parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new SynthesizeSpeechResponse(input, extensionRegistry);
        }
      };

  public static com.google.protobuf.Parser<SynthesizeSpeechResponse> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<SynthesizeSpeechResponse> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
} @Generated("by gapic-generator-java")
public class TextToSpeechClient implements BackgroundResource {
  private final TextToSpeechSettings settings;
  private final TextToSpeechStub stub;

  /** Constructs an instance of TextToSpeechClient with default settings. */
  public static final TextToSpeechClient create() throws IOException {
    return create(TextToSpeechSettings.newBuilder().build());
  }

  /**
   * Constructs an instance of TextToSpeechClient, using the given settings. The channels are
   * created based on the settings passed in, or defaults for any settings that are not set.
   */
  public static final TextToSpeechClient create(TextToSpeechSettings settings) throws IOException {
    return new TextToSpeechClient(settings);
  }

  /**
   * Constructs an instance of TextToSpeechClient, using the given stub for making calls. This is
   * for advanced usage - prefer using create(TextToSpeechSettings).
   */
  @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
  public static final TextToSpeechClient create(TextToSpeechStub stub) {
    return new TextToSpeechClient(stub);
  }

  /**
   * Constructs an instance of TextToSpeechClient, using the given settings. This is protected so
   * that it is easy to make a subclass, but otherwise, the static factory methods should be
   * preferred.
   */
  protected TextToSpeechClient(TextToSpeechSettings settings) throws IOException {
    this.settings = settings;
    this.stub = ((TextToSpeechStubSettings) settings.getStubSettings()).createStub();
  }

  @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
  protected TextToSpeechClient(TextToSpeechStub stub) {
    this.settings = null;
    this.stub = stub;
  }

  public final TextToSpeechSettings getSettings() {
    return settings;
  }

  @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
  public TextToSpeechStub getStub() {
    return stub;
  }

  // AUTO-GENERATED DOCUMENTATION AND METHOD.
  /**
   * Returns a list of Voice supported for synthesis.
   *
   * <p>Sample code:
   *
   * <pre>{@code
   * try (TextToSpeechClient textToSpeechClient = TextToSpeechClient.create()) {
   *   String languageCode = "languageCode-2092349083";
   *   ListVoicesResponse response = textToSpeechClient.listVoices(languageCode);
   * }
   * }</pre>
   *
   * @param languageCode 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-\\&#42;"` (Norwegian) and `"nb-\\&#42;"` (Norwegian Bokmal) voices will be returned.
   * @throws com.google.api.gax.rpc.ApiException if the remote call fails
   */
  public final ListVoicesResponse listVoices(String languageCode) {
    ListVoicesRequest request =
        ListVoicesRequest.newBuilder().setLanguageCode(languageCode).build();
    return listVoices(request);
  }

  // AUTO-GENERATED DOCUMENTATION AND METHOD.
  /**
   * Returns a list of Voice supported for synthesis.
   *
   * <p>Sample code:
   *
   * <pre>{@code
   * try (TextToSpeechClient textToSpeechClient = TextToSpeechClient.create()) {
   *   ListVoicesRequest request =
   *       ListVoicesRequest.newBuilder().setLanguageCode("languageCode-2092349083").build();
   *   ListVoicesResponse response = textToSpeechClient.listVoices(request);
   * }
   * }</pre>
   *
   * @param request The request object containing all of the parameters for the API call.
   * @throws com.google.api.gax.rpc.ApiException if the remote call fails
   */
  public final ListVoicesResponse listVoices(ListVoicesRequest request) {
    return listVoicesCallable().call(request);
  }

  // AUTO-GENERATED DOCUMENTATION AND METHOD.
  /**
   * Returns a list of Voice supported for synthesis.
   *
   * <p>Sample code:
   *
   * <pre>{@code
   * try (TextToSpeechClient textToSpeechClient = TextToSpeechClient.create()) {
   *   ListVoicesRequest request =
   *       ListVoicesRequest.newBuilder().setLanguageCode("languageCode-2092349083").build();
   *   ApiFuture<ListVoicesResponse> future =
   *       textToSpeechClient.listVoicesCallable().futureCall(request);
   *   // Do something.
   *   ListVoicesResponse response = future.get();
   * }
   * }</pre>
   */
  public final UnaryCallable<ListVoicesRequest, ListVoicesResponse> listVoicesCallable() {
    return stub.listVoicesCallable();
  }

  // AUTO-GENERATED DOCUMENTATION AND METHOD.
  /**
   * Synthesizes speech synchronously: receive results after all text input has been processed.
   *
   * <p>Sample code:
   *
   * <pre>{@code
   * try (TextToSpeechClient textToSpeechClient = TextToSpeechClient.create()) {
   *   SynthesisInput input = SynthesisInput.newBuilder().build();
   *   VoiceSelectionParams voice = VoiceSelectionParams.newBuilder().build();
   *   AudioConfig audioConfig = AudioConfig.newBuilder().build();
   *   SynthesizeSpeechResponse response =
   *       textToSpeechClient.synthesizeSpeech(input, voice, audioConfig);
   * }
   * }</pre>
   *
   * @param input Required. The Synthesizer requires either plain text or SSML as input.
   * @param voice Required. The desired voice of the synthesized audio.
   * @param audioConfig Required. The configuration of the synthesized audio.
   * @throws com.google.api.gax.rpc.ApiException if the remote call fails
   */
  public final SynthesizeSpeechResponse synthesizeSpeech(
      SynthesisInput input, VoiceSelectionParams voice, AudioConfig audioConfig) {
    SynthesizeSpeechRequest request =
        SynthesizeSpeechRequest.newBuilder()
            .setInput(input)
            .setVoice(voice)
            .setAudioConfig(audioConfig)
            .build();
    return synthesizeSpeech(request);
  }

  // AUTO-GENERATED DOCUMENTATION AND METHOD.
  /**
   * Synthesizes speech synchronously: receive results after all text input has been processed.
   *
   * <p>Sample code:
   *
   * <pre>{@code
   * try (TextToSpeechClient textToSpeechClient = TextToSpeechClient.create()) {
   *   SynthesizeSpeechRequest request =
   *       SynthesizeSpeechRequest.newBuilder()
   *           .setInput(SynthesisInput.newBuilder().build())
   *           .setVoice(VoiceSelectionParams.newBuilder().build())
   *           .setAudioConfig(AudioConfig.newBuilder().build())
   *           .build();
   *   SynthesizeSpeechResponse response = textToSpeechClient.synthesizeSpeech(request);
   * }
   * }</pre>
   *
   * @param request The request object containing all of the parameters for the API call.
   * @throws com.google.api.gax.rpc.ApiException if the remote call fails
   */
  public final SynthesizeSpeechResponse synthesizeSpeech(SynthesizeSpeechRequest request) {
    return synthesizeSpeechCallable().call(request);
  }

  // AUTO-GENERATED DOCUMENTATION AND METHOD.
  /**
   * Synthesizes speech synchronously: receive results after all text input has been processed.
   *
   * <p>Sample code:
   *
   * <pre>{@code
   * try (TextToSpeechClient textToSpeechClient = TextToSpeechClient.create()) {
   *   SynthesizeSpeechRequest request =
   *       SynthesizeSpeechRequest.newBuilder()
   *           .setInput(SynthesisInput.newBuilder().build())
   *           .setVoice(VoiceSelectionParams.newBuilder().build())
   *           .setAudioConfig(AudioConfig.newBuilder().build())
   *           .build();
   *   ApiFuture<SynthesizeSpeechResponse> future =
   *       textToSpeechClient.synthesizeSpeechCallable().futureCall(request);
   *   // Do something.
   *   SynthesizeSpeechResponse response = future.get();
   * }
   * }</pre>
   */
  public final UnaryCallable<SynthesizeSpeechRequest, SynthesizeSpeechResponse>
      synthesizeSpeechCallable() {
    return stub.synthesizeSpeechCallable();
  }

  @Override
  public final void close() {
    stub.close();
  }

  @Override
  public void shutdown() {
    stub.shutdown();
  }

  @Override
  public boolean isShutdown() {
    return stub.isShutdown();
  }

  @Override
  public boolean isTerminated() {
    return stub.isTerminated();
  }

  @Override
  public void shutdownNow() {
    stub.shutdownNow();
  }

  @Override
  public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
    return stub.awaitTermination(duration, unit);
  }
} public final class Voice extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.texttospeech.v1.Voice)
    VoiceOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use Voice.newBuilder() to construct.
  private Voice(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private Voice() {
    languageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY;
    name_ = "";
    ssmlGender_ = 0;
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    return new Voice();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  private Voice(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              java.lang.String s = input.readStringRequireUtf8();
              if (!((mutable_bitField0_ & 0x00000001) != 0)) {
                languageCodes_ = new com.google.protobuf.LazyStringArrayList();
                mutable_bitField0_ |= 0x00000001;
              }
              languageCodes_.add(s);
              break;
            }
          case 18:
            {
              java.lang.String s = input.readStringRequireUtf8();

              name_ = s;
              break;
            }
          case 24:
            {
              int rawValue = input.readEnum();

              ssmlGender_ = rawValue;
              break;
            }
          case 32:
            {
              naturalSampleRateHertz_ = input.readInt32();
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      if (((mutable_bitField0_ & 0x00000001) != 0)) {
        languageCodes_ = languageCodes_.getUnmodifiableView();
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.texttospeech.v1.TextToSpeechProto
        .internal_static_google_cloud_texttospeech_v1_Voice_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.texttospeech.v1.TextToSpeechProto
        .internal_static_google_cloud_texttospeech_v1_Voice_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.texttospeech.v1.Voice.class,
            com.google.cloud.texttospeech.v1.Voice.Builder.class);
  }

  public static final int LANGUAGE_CODES_FIELD_NUMBER = 1;
  private com.google.protobuf.LazyStringList languageCodes_;
  /**
   *
   *
   * <pre>
   * The languages that this voice supports, expressed as
   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g.
   * "en-US", "es-419", "cmn-tw").
   * </pre>
   *
   * <code>repeated string language_codes = 1;</code>
   *
   * @return A list containing the languageCodes.
   */
  public com.google.protobuf.ProtocolStringList getLanguageCodesList() {
    return languageCodes_;
  }
  /**
   *
   *
   * <pre>
   * The languages that this voice supports, expressed as
   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g.
   * "en-US", "es-419", "cmn-tw").
   * </pre>
   *
   * <code>repeated string language_codes = 1;</code>
   *
   * @return The count of languageCodes.
   */
  public int getLanguageCodesCount() {
    return languageCodes_.size();
  }
  /**
   *
   *
   * <pre>
   * The languages that this voice supports, expressed as
   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g.
   * "en-US", "es-419", "cmn-tw").
   * </pre>
   *
   * <code>repeated string language_codes = 1;</code>
   *
   * @param index The index of the element to return.
   * @return The languageCodes at the given index.
   */
  public java.lang.String getLanguageCodes(int index) {
    return languageCodes_.get(index);
  }
  /**
   *
   *
   * <pre>
   * The languages that this voice supports, expressed as
   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g.
   * "en-US", "es-419", "cmn-tw").
   * </pre>
   *
   * <code>repeated string language_codes = 1;</code>
   *
   * @param index The index of the value to return.
   * @return The bytes of the languageCodes at the given index.
   */
  public com.google.protobuf.ByteString getLanguageCodesBytes(int index) {
    return languageCodes_.getByteString(index);
  }

  public static final int NAME_FIELD_NUMBER = 2;
  private volatile java.lang.Object name_;
  /**
   *
   *
   * <pre>
   * The name of this voice.  Each distinct voice has a unique name.
   * </pre>
   *
   * <code>string name = 2;</code>
   *
   * @return The name.
   */
  @java.lang.Override
  public java.lang.String getName() {
    java.lang.Object ref = name_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      name_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The name of this voice.  Each distinct voice has a unique name.
   * </pre>
   *
   * <code>string name = 2;</code>
   *
   * @return The bytes for name.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getNameBytes() {
    java.lang.Object ref = name_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      name_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int SSML_GENDER_FIELD_NUMBER = 3;
  private int ssmlGender_;
  /**
   *
   *
   * <pre>
   * The gender of this voice.
   * </pre>
   *
   * <code>.google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3;</code>
   *
   * @return The enum numeric value on the wire for ssmlGender.
   */
  @java.lang.Override
  public int getSsmlGenderValue() {
    return ssmlGender_;
  }
  /**
   *
   *
   * <pre>
   * The gender of this voice.
   * </pre>
   *
   * <code>.google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3;</code>
   *
   * @return The ssmlGender.
   */
  @java.lang.Override
  public com.google.cloud.texttospeech.v1.SsmlVoiceGender getSsmlGender() {
    @SuppressWarnings("deprecation")
    com.google.cloud.texttospeech.v1.SsmlVoiceGender result =
        com.google.cloud.texttospeech.v1.SsmlVoiceGender.valueOf(ssmlGender_);
    return result == null ? com.google.cloud.texttospeech.v1.SsmlVoiceGender.UNRECOGNIZED : result;
  }

  public static final int NATURAL_SAMPLE_RATE_HERTZ_FIELD_NUMBER = 4;
  private int naturalSampleRateHertz_;
  /**
   *
   *
   * <pre>
   * The natural sample rate (in hertz) for this voice.
   * </pre>
   *
   * <code>int32 natural_sample_rate_hertz = 4;</code>
   *
   * @return The naturalSampleRateHertz.
   */
  @java.lang.Override
  public int getNaturalSampleRateHertz() {
    return naturalSampleRateHertz_;
  }

  private byte memoizedIsInitialized = -1;

  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    for (int i = 0; i < languageCodes_.size(); i++) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, languageCodes_.getRaw(i));
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_);
    }
    if (ssmlGender_
        != com.google.cloud.texttospeech.v1.SsmlVoiceGender.SSML_VOICE_GENDER_UNSPECIFIED
            .getNumber()) {
      output.writeEnum(3, ssmlGender_);
    }
    if (naturalSampleRateHertz_ != 0) {
      output.writeInt32(4, naturalSampleRateHertz_);
    }
    unknownFields.writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    {
      int dataSize = 0;
      for (int i = 0; i < languageCodes_.size(); i++) {
        dataSize += computeStringSizeNoTag(languageCodes_.getRaw(i));
      }
      size += dataSize;
      size += 1 * getLanguageCodesList().size();
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_);
    }
    if (ssmlGender_
        != com.google.cloud.texttospeech.v1.SsmlVoiceGender.SSML_VOICE_GENDER_UNSPECIFIED
            .getNumber()) {
      size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, ssmlGender_);
    }
    if (naturalSampleRateHertz_ != 0) {
      size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, naturalSampleRateHertz_);
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof com.google.cloud.texttospeech.v1.Voice)) {
      return super.equals(obj);
    }
    com.google.cloud.texttospeech.v1.Voice other = (com.google.cloud.texttospeech.v1.Voice) obj;

    if (!getLanguageCodesList().equals(other.getLanguageCodesList())) return false;
    if (!getName().equals(other.getName())) return false;
    if (ssmlGender_ != other.ssmlGender_) return false;
    if (getNaturalSampleRateHertz() != other.getNaturalSampleRateHertz()) return false;
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (getLanguageCodesCount() > 0) {
      hash = (37 * hash) + LANGUAGE_CODES_FIELD_NUMBER;
      hash = (53 * hash) + getLanguageCodesList().hashCode();
    }
    hash = (37 * hash) + NAME_FIELD_NUMBER;
    hash = (53 * hash) + getName().hashCode();
    hash = (37 * hash) + SSML_GENDER_FIELD_NUMBER;
    hash = (53 * hash) + ssmlGender_;
    hash = (37 * hash) + NATURAL_SAMPLE_RATE_HERTZ_FIELD_NUMBER;
    hash = (53 * hash) + getNaturalSampleRateHertz();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.texttospeech.v1.Voice parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.texttospeech.v1.Voice parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.Voice parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.texttospeech.v1.Voice parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.Voice parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.texttospeech.v1.Voice parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.Voice parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.texttospeech.v1.Voice parseFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.Voice parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloud.texttospeech.v1.Voice parseDelimitedFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.Voice parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.texttospeech.v1.Voice parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() {
    return newBuilder();
  }

  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }

  public static Builder newBuilder(com.google.cloud.texttospeech.v1.Voice prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *
   *
   * <pre>
   * Description of a voice supported by the TTS service.
   * </pre>
   *
   * Protobuf type {@code google.cloud.texttospeech.v1.Voice}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.texttospeech.v1.Voice)
      com.google.cloud.texttospeech.v1.VoiceOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.texttospeech.v1.TextToSpeechProto
          .internal_static_google_cloud_texttospeech_v1_Voice_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.texttospeech.v1.TextToSpeechProto
          .internal_static_google_cloud_texttospeech_v1_Voice_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.texttospeech.v1.Voice.class,
              com.google.cloud.texttospeech.v1.Voice.Builder.class);
    }

    // Construct using com.google.cloud.texttospeech.v1.Voice.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      languageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000001);
      name_ = "";

      ssmlGender_ = 0;

      naturalSampleRateHertz_ = 0;

      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.texttospeech.v1.TextToSpeechProto
          .internal_static_google_cloud_texttospeech_v1_Voice_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.texttospeech.v1.Voice getDefaultInstanceForType() {
      return com.google.cloud.texttospeech.v1.Voice.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.texttospeech.v1.Voice build() {
      com.google.cloud.texttospeech.v1.Voice result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.texttospeech.v1.Voice buildPartial() {
      com.google.cloud.texttospeech.v1.Voice result =
          new com.google.cloud.texttospeech.v1.Voice(this);
      int from_bitField0_ = bitField0_;
      if (((bitField0_ & 0x00000001) != 0)) {
        languageCodes_ = languageCodes_.getUnmodifiableView();
        bitField0_ = (bitField0_ & ~0x00000001);
      }
      result.languageCodes_ = languageCodes_;
      result.name_ = name_;
      result.ssmlGender_ = ssmlGender_;
      result.naturalSampleRateHertz_ = naturalSampleRateHertz_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.texttospeech.v1.Voice) {
        return mergeFrom((com.google.cloud.texttospeech.v1.Voice) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.texttospeech.v1.Voice other) {
      if (other == com.google.cloud.texttospeech.v1.Voice.getDefaultInstance()) return this;
      if (!other.languageCodes_.isEmpty()) {
        if (languageCodes_.isEmpty()) {
          languageCodes_ = other.languageCodes_;
          bitField0_ = (bitField0_ & ~0x00000001);
        } else {
          ensureLanguageCodesIsMutable();
          languageCodes_.addAll(other.languageCodes_);
        }
        onChanged();
      }
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        onChanged();
      }
      if (other.ssmlGender_ != 0) {
        setSsmlGenderValue(other.getSsmlGenderValue());
      }
      if (other.getNaturalSampleRateHertz() != 0) {
        setNaturalSampleRateHertz(other.getNaturalSampleRateHertz());
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      com.google.cloud.texttospeech.v1.Voice parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.cloud.texttospeech.v1.Voice) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int bitField0_;

    private com.google.protobuf.LazyStringList languageCodes_ =
        com.google.protobuf.LazyStringArrayList.EMPTY;

    private void ensureLanguageCodesIsMutable() {
      if (!((bitField0_ & 0x00000001) != 0)) {
        languageCodes_ = new com.google.protobuf.LazyStringArrayList(languageCodes_);
        bitField0_ |= 0x00000001;
      }
    }
    /**
     *
     *
     * <pre>
     * The languages that this voice supports, expressed as
     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g.
     * "en-US", "es-419", "cmn-tw").
     * </pre>
     *
     * <code>repeated string language_codes = 1;</code>
     *
     * @return A list containing the languageCodes.
     */
    public com.google.protobuf.ProtocolStringList getLanguageCodesList() {
      return languageCodes_.getUnmodifiableView();
    }
    /**
     *
     *
     * <pre>
     * The languages that this voice supports, expressed as
     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g.
     * "en-US", "es-419", "cmn-tw").
     * </pre>
     *
     * <code>repeated string language_codes = 1;</code>
     *
     * @return The count of languageCodes.
     */
    public int getLanguageCodesCount() {
      return languageCodes_.size();
    }
    /**
     *
     *
     * <pre>
     * The languages that this voice supports, expressed as
     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g.
     * "en-US", "es-419", "cmn-tw").
     * </pre>
     *
     * <code>repeated string language_codes = 1;</code>
     *
     * @param index The index of the element to return.
     * @return The languageCodes at the given index.
     */
    public java.lang.String getLanguageCodes(int index) {
      return languageCodes_.get(index);
    }
    /**
     *
     *
     * <pre>
     * The languages that this voice supports, expressed as
     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g.
     * "en-US", "es-419", "cmn-tw").
     * </pre>
     *
     * <code>repeated string language_codes = 1;</code>
     *
     * @param index The index of the value to return.
     * @return The bytes of the languageCodes at the given index.
     */
    public com.google.protobuf.ByteString getLanguageCodesBytes(int index) {
      return languageCodes_.getByteString(index);
    }
    /**
     *
     *
     * <pre>
     * The languages that this voice supports, expressed as
     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g.
     * "en-US", "es-419", "cmn-tw").
     * </pre>
     *
     * <code>repeated string language_codes = 1;</code>
     *
     * @param index The index to set the value at.
     * @param value The languageCodes to set.
     * @return This builder for chaining.
     */
    public Builder setLanguageCodes(int index, java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureLanguageCodesIsMutable();
      languageCodes_.set(index, value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The languages that this voice supports, expressed as
     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g.
     * "en-US", "es-419", "cmn-tw").
     * </pre>
     *
     * <code>repeated string language_codes = 1;</code>
     *
     * @param value The languageCodes to add.
     * @return This builder for chaining.
     */
    public Builder addLanguageCodes(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureLanguageCodesIsMutable();
      languageCodes_.add(value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The languages that this voice supports, expressed as
     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g.
     * "en-US", "es-419", "cmn-tw").
     * </pre>
     *
     * <code>repeated string language_codes = 1;</code>
     *
     * @param values The languageCodes to add.
     * @return This builder for chaining.
     */
    public Builder addAllLanguageCodes(java.lang.Iterable<java.lang.String> values) {
      ensureLanguageCodesIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(values, languageCodes_);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The languages that this voice supports, expressed as
     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g.
     * "en-US", "es-419", "cmn-tw").
     * </pre>
     *
     * <code>repeated string language_codes = 1;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearLanguageCodes() {
      languageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The languages that this voice supports, expressed as
     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g.
     * "en-US", "es-419", "cmn-tw").
     * </pre>
     *
     * <code>repeated string language_codes = 1;</code>
     *
     * @param value The bytes of the languageCodes to add.
     * @return This builder for chaining.
     */
    public Builder addLanguageCodesBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      ensureLanguageCodesIsMutable();
      languageCodes_.add(value);
      onChanged();
      return this;
    }

    private java.lang.Object name_ = "";
    /**
     *
     *
     * <pre>
     * The name of this voice.  Each distinct voice has a unique name.
     * </pre>
     *
     * <code>string name = 2;</code>
     *
     * @return The name.
     */
    public java.lang.String getName() {
      java.lang.Object ref = name_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        name_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The name of this voice.  Each distinct voice has a unique name.
     * </pre>
     *
     * <code>string name = 2;</code>
     *
     * @return The bytes for name.
     */
    public com.google.protobuf.ByteString getNameBytes() {
      java.lang.Object ref = name_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        name_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The name of this voice.  Each distinct voice has a unique name.
     * </pre>
     *
     * <code>string name = 2;</code>
     *
     * @param value The name to set.
     * @return This builder for chaining.
     */
    public Builder setName(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      name_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The name of this voice.  Each distinct voice has a unique name.
     * </pre>
     *
     * <code>string name = 2;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearName() {

      name_ = getDefaultInstance().getName();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The name of this voice.  Each distinct voice has a unique name.
     * </pre>
     *
     * <code>string name = 2;</code>
     *
     * @param value The bytes for name to set.
     * @return This builder for chaining.
     */
    public Builder setNameBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      name_ = value;
      onChanged();
      return this;
    }

    private int ssmlGender_ = 0;
    /**
     *
     *
     * <pre>
     * The gender of this voice.
     * </pre>
     *
     * <code>.google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3;</code>
     *
     * @return The enum numeric value on the wire for ssmlGender.
     */
    @java.lang.Override
    public int getSsmlGenderValue() {
      return ssmlGender_;
    }
    /**
     *
     *
     * <pre>
     * The gender of this voice.
     * </pre>
     *
     * <code>.google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3;</code>
     *
     * @param value The enum numeric value on the wire for ssmlGender to set.
     * @return This builder for chaining.
     */
    public Builder setSsmlGenderValue(int value) {

      ssmlGender_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The gender of this voice.
     * </pre>
     *
     * <code>.google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3;</code>
     *
     * @return The ssmlGender.
     */
    @java.lang.Override
    public com.google.cloud.texttospeech.v1.SsmlVoiceGender getSsmlGender() {
      @SuppressWarnings("deprecation")
      com.google.cloud.texttospeech.v1.SsmlVoiceGender result =
          com.google.cloud.texttospeech.v1.SsmlVoiceGender.valueOf(ssmlGender_);
      return result == null
          ? com.google.cloud.texttospeech.v1.SsmlVoiceGender.UNRECOGNIZED
          : result;
    }
    /**
     *
     *
     * <pre>
     * The gender of this voice.
     * </pre>
     *
     * <code>.google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3;</code>
     *
     * @param value The ssmlGender to set.
     * @return This builder for chaining.
     */
    public Builder setSsmlGender(com.google.cloud.texttospeech.v1.SsmlVoiceGender value) {
      if (value == null) {
        throw new NullPointerException();
      }

      ssmlGender_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The gender of this voice.
     * </pre>
     *
     * <code>.google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearSsmlGender() {

      ssmlGender_ = 0;
      onChanged();
      return this;
    }

    private int naturalSampleRateHertz_;
    /**
     *
     *
     * <pre>
     * The natural sample rate (in hertz) for this voice.
     * </pre>
     *
     * <code>int32 natural_sample_rate_hertz = 4;</code>
     *
     * @return The naturalSampleRateHertz.
     */
    @java.lang.Override
    public int getNaturalSampleRateHertz() {
      return naturalSampleRateHertz_;
    }
    /**
     *
     *
     * <pre>
     * The natural sample rate (in hertz) for this voice.
     * </pre>
     *
     * <code>int32 natural_sample_rate_hertz = 4;</code>
     *
     * @param value The naturalSampleRateHertz to set.
     * @return This builder for chaining.
     */
    public Builder setNaturalSampleRateHertz(int value) {

      naturalSampleRateHertz_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The natural sample rate (in hertz) for this voice.
     * </pre>
     *
     * <code>int32 natural_sample_rate_hertz = 4;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearNaturalSampleRateHertz() {

      naturalSampleRateHertz_ = 0;
      onChanged();
      return this;
    }

    @java.lang.Override
    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:google.cloud.texttospeech.v1.Voice)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.texttospeech.v1.Voice)
  private static final com.google.cloud.texttospeech.v1.Voice DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.texttospeech.v1.Voice();
  }

  public static com.google.cloud.texttospeech.v1.Voice getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<Voice> PARSER =
      new com.google.protobuf.AbstractParser<Voice>() {
        @java.lang.Override
        public Voice parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new Voice(input, extensionRegistry);
        }
      };

  public static com.google.protobuf.Parser<Voice> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<Voice> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.cloud.texttospeech.v1.Voice getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
} public final class VoiceSelectionParams extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.texttospeech.v1.VoiceSelectionParams)
    VoiceSelectionParamsOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use VoiceSelectionParams.newBuilder() to construct.
  private VoiceSelectionParams(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private VoiceSelectionParams() {
    languageCode_ = "";
    name_ = "";
    ssmlGender_ = 0;
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    return new VoiceSelectionParams();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  private VoiceSelectionParams(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              java.lang.String s = input.readStringRequireUtf8();

              languageCode_ = s;
              break;
            }
          case 18:
            {
              java.lang.String s = input.readStringRequireUtf8();

              name_ = s;
              break;
            }
          case 24:
            {
              int rawValue = input.readEnum();

              ssmlGender_ = rawValue;
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.texttospeech.v1.TextToSpeechProto
        .internal_static_google_cloud_texttospeech_v1_VoiceSelectionParams_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.texttospeech.v1.TextToSpeechProto
        .internal_static_google_cloud_texttospeech_v1_VoiceSelectionParams_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.texttospeech.v1.VoiceSelectionParams.class,
            com.google.cloud.texttospeech.v1.VoiceSelectionParams.Builder.class);
  }

  public static final int LANGUAGE_CODE_FIELD_NUMBER = 1;
  private volatile java.lang.Object languageCode_;
  /**
   *
   *
   * <pre>
   * Required. The language (and potentially also the region) of the voice expressed as a
   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag, e.g.
   * "en-US". This should not include a script tag (e.g. use
   * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred
   * from the input provided in the SynthesisInput.  The TTS service
   * will use this parameter to help choose an appropriate voice.  Note that
   * the TTS service may choose a voice with a slightly different language code
   * than the one selected; it may substitute a different region
   * (e.g. using en-US rather than en-CA if there isn't a Canadian voice
   * available), or even a different language, e.g. using "nb" (Norwegian
   * Bokmal) instead of "no" (Norwegian)".
   * </pre>
   *
   * <code>string language_code = 1 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The languageCode.
   */
  @java.lang.Override
  public java.lang.String getLanguageCode() {
    java.lang.Object ref = languageCode_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      languageCode_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Required. The language (and potentially also the region) of the voice expressed as a
   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag, e.g.
   * "en-US". This should not include a script tag (e.g. use
   * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred
   * from the input provided in the SynthesisInput.  The TTS service
   * will use this parameter to help choose an appropriate voice.  Note that
   * the TTS service may choose a voice with a slightly different language code
   * than the one selected; it may substitute a different region
   * (e.g. using en-US rather than en-CA if there isn't a Canadian voice
   * available), or even a different language, e.g. using "nb" (Norwegian
   * Bokmal) instead of "no" (Norwegian)".
   * </pre>
   *
   * <code>string language_code = 1 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The bytes for languageCode.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getLanguageCodeBytes() {
    java.lang.Object ref = languageCode_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      languageCode_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int NAME_FIELD_NUMBER = 2;
  private volatile java.lang.Object name_;
  /**
   *
   *
   * <pre>
   * The name of the voice. If not set, the service will choose a
   * voice based on the other parameters such as language_code and gender.
   * </pre>
   *
   * <code>string name = 2;</code>
   *
   * @return The name.
   */
  @java.lang.Override
  public java.lang.String getName() {
    java.lang.Object ref = name_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      name_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The name of the voice. If not set, the service will choose a
   * voice based on the other parameters such as language_code and gender.
   * </pre>
   *
   * <code>string name = 2;</code>
   *
   * @return The bytes for name.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getNameBytes() {
    java.lang.Object ref = name_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      name_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int SSML_GENDER_FIELD_NUMBER = 3;
  private int ssmlGender_;
  /**
   *
   *
   * <pre>
   * The preferred gender of the voice. If not set, the service will
   * choose a voice based on the other parameters such as language_code and
   * name. Note that this is only a preference, not requirement; if a
   * voice of the appropriate gender is not available, the synthesizer should
   * substitute a voice with a different gender rather than failing the request.
   * </pre>
   *
   * <code>.google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3;</code>
   *
   * @return The enum numeric value on the wire for ssmlGender.
   */
  @java.lang.Override
  public int getSsmlGenderValue() {
    return ssmlGender_;
  }
  /**
   *
   *
   * <pre>
   * The preferred gender of the voice. If not set, the service will
   * choose a voice based on the other parameters such as language_code and
   * name. Note that this is only a preference, not requirement; if a
   * voice of the appropriate gender is not available, the synthesizer should
   * substitute a voice with a different gender rather than failing the request.
   * </pre>
   *
   * <code>.google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3;</code>
   *
   * @return The ssmlGender.
   */
  @java.lang.Override
  public com.google.cloud.texttospeech.v1.SsmlVoiceGender getSsmlGender() {
    @SuppressWarnings("deprecation")
    com.google.cloud.texttospeech.v1.SsmlVoiceGender result =
        com.google.cloud.texttospeech.v1.SsmlVoiceGender.valueOf(ssmlGender_);
    return result == null ? com.google.cloud.texttospeech.v1.SsmlVoiceGender.UNRECOGNIZED : result;
  }

  private byte memoizedIsInitialized = -1;

  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, languageCode_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_);
    }
    if (ssmlGender_
        != com.google.cloud.texttospeech.v1.SsmlVoiceGender.SSML_VOICE_GENDER_UNSPECIFIED
            .getNumber()) {
      output.writeEnum(3, ssmlGender_);
    }
    unknownFields.writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, languageCode_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_);
    }
    if (ssmlGender_
        != com.google.cloud.texttospeech.v1.SsmlVoiceGender.SSML_VOICE_GENDER_UNSPECIFIED
            .getNumber()) {
      size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, ssmlGender_);
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof com.google.cloud.texttospeech.v1.VoiceSelectionParams)) {
      return super.equals(obj);
    }
    com.google.cloud.texttospeech.v1.VoiceSelectionParams other =
        (com.google.cloud.texttospeech.v1.VoiceSelectionParams) obj;

    if (!getLanguageCode().equals(other.getLanguageCode())) return false;
    if (!getName().equals(other.getName())) return false;
    if (ssmlGender_ != other.ssmlGender_) return false;
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER;
    hash = (53 * hash) + getLanguageCode().hashCode();
    hash = (37 * hash) + NAME_FIELD_NUMBER;
    hash = (53 * hash) + getName().hashCode();
    hash = (37 * hash) + SSML_GENDER_FIELD_NUMBER;
    hash = (53 * hash) + ssmlGender_;
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.texttospeech.v1.VoiceSelectionParams parseFrom(
      java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.texttospeech.v1.VoiceSelectionParams parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.VoiceSelectionParams parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.texttospeech.v1.VoiceSelectionParams parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.VoiceSelectionParams parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.texttospeech.v1.VoiceSelectionParams parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.VoiceSelectionParams parseFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.texttospeech.v1.VoiceSelectionParams parseFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.VoiceSelectionParams parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloud.texttospeech.v1.VoiceSelectionParams parseDelimitedFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.texttospeech.v1.VoiceSelectionParams parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.texttospeech.v1.VoiceSelectionParams parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() {
    return newBuilder();
  }

  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }

  public static Builder newBuilder(
      com.google.cloud.texttospeech.v1.VoiceSelectionParams prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *
   *
   * <pre>
   * Description of which voice to use for a synthesis request.
   * </pre>
   *
   * Protobuf type {@code google.cloud.texttospeech.v1.VoiceSelectionParams}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.texttospeech.v1.VoiceSelectionParams)
      com.google.cloud.texttospeech.v1.VoiceSelectionParamsOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.texttospeech.v1.TextToSpeechProto
          .internal_static_google_cloud_texttospeech_v1_VoiceSelectionParams_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.texttospeech.v1.TextToSpeechProto
          .internal_static_google_cloud_texttospeech_v1_VoiceSelectionParams_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.texttospeech.v1.VoiceSelectionParams.class,
              com.google.cloud.texttospeech.v1.VoiceSelectionParams.Builder.class);
    }

    // Construct using com.google.cloud.texttospeech.v1.VoiceSelectionParams.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      languageCode_ = "";

      name_ = "";

      ssmlGender_ = 0;

      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.texttospeech.v1.TextToSpeechProto
          .internal_static_google_cloud_texttospeech_v1_VoiceSelectionParams_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.texttospeech.v1.VoiceSelectionParams getDefaultInstanceForType() {
      return com.google.cloud.texttospeech.v1.VoiceSelectionParams.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.texttospeech.v1.VoiceSelectionParams build() {
      com.google.cloud.texttospeech.v1.VoiceSelectionParams result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.texttospeech.v1.VoiceSelectionParams buildPartial() {
      com.google.cloud.texttospeech.v1.VoiceSelectionParams result =
          new com.google.cloud.texttospeech.v1.VoiceSelectionParams(this);
      result.languageCode_ = languageCode_;
      result.name_ = name_;
      result.ssmlGender_ = ssmlGender_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.texttospeech.v1.VoiceSelectionParams) {
        return mergeFrom((com.google.cloud.texttospeech.v1.VoiceSelectionParams) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.texttospeech.v1.VoiceSelectionParams other) {
      if (other == com.google.cloud.texttospeech.v1.VoiceSelectionParams.getDefaultInstance())
        return this;
      if (!other.getLanguageCode().isEmpty()) {
        languageCode_ = other.languageCode_;
        onChanged();
      }
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        onChanged();
      }
      if (other.ssmlGender_ != 0) {
        setSsmlGenderValue(other.getSsmlGenderValue());
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      com.google.cloud.texttospeech.v1.VoiceSelectionParams parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage =
            (com.google.cloud.texttospeech.v1.VoiceSelectionParams) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private java.lang.Object languageCode_ = "";
    /**
     *
     *
     * <pre>
     * Required. The language (and potentially also the region) of the voice expressed as a
     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag, e.g.
     * "en-US". This should not include a script tag (e.g. use
     * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred
     * from the input provided in the SynthesisInput.  The TTS service
     * will use this parameter to help choose an appropriate voice.  Note that
     * the TTS service may choose a voice with a slightly different language code
     * than the one selected; it may substitute a different region
     * (e.g. using en-US rather than en-CA if there isn't a Canadian voice
     * available), or even a different language, e.g. using "nb" (Norwegian
     * Bokmal) instead of "no" (Norwegian)".
     * </pre>
     *
     * <code>string language_code = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The languageCode.
     */
    public java.lang.String getLanguageCode() {
      java.lang.Object ref = languageCode_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        languageCode_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The language (and potentially also the region) of the voice expressed as a
     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag, e.g.
     * "en-US". This should not include a script tag (e.g. use
     * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred
     * from the input provided in the SynthesisInput.  The TTS service
     * will use this parameter to help choose an appropriate voice.  Note that
     * the TTS service may choose a voice with a slightly different language code
     * than the one selected; it may substitute a different region
     * (e.g. using en-US rather than en-CA if there isn't a Canadian voice
     * available), or even a different language, e.g. using "nb" (Norwegian
     * Bokmal) instead of "no" (Norwegian)".
     * </pre>
     *
     * <code>string language_code = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The bytes for languageCode.
     */
    public com.google.protobuf.ByteString getLanguageCodeBytes() {
      java.lang.Object ref = languageCode_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        languageCode_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The language (and potentially also the region) of the voice expressed as a
     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag, e.g.
     * "en-US". This should not include a script tag (e.g. use
     * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred
     * from the input provided in the SynthesisInput.  The TTS service
     * will use this parameter to help choose an appropriate voice.  Note that
     * the TTS service may choose a voice with a slightly different language code
     * than the one selected; it may substitute a different region
     * (e.g. using en-US rather than en-CA if there isn't a Canadian voice
     * available), or even a different language, e.g. using "nb" (Norwegian
     * Bokmal) instead of "no" (Norwegian)".
     * </pre>
     *
     * <code>string language_code = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param value The languageCode to set.
     * @return This builder for chaining.
     */
    public Builder setLanguageCode(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      languageCode_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The language (and potentially also the region) of the voice expressed as a
     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag, e.g.
     * "en-US". This should not include a script tag (e.g. use
     * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred
     * from the input provided in the SynthesisInput.  The TTS service
     * will use this parameter to help choose an appropriate voice.  Note that
     * the TTS service may choose a voice with a slightly different language code
     * than the one selected; it may substitute a different region
     * (e.g. using en-US rather than en-CA if there isn't a Canadian voice
     * available), or even a different language, e.g. using "nb" (Norwegian
     * Bokmal) instead of "no" (Norwegian)".
     * </pre>
     *
     * <code>string language_code = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearLanguageCode() {

      languageCode_ = getDefaultInstance().getLanguageCode();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The language (and potentially also the region) of the voice expressed as a
     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag, e.g.
     * "en-US". This should not include a script tag (e.g. use
     * "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred
     * from the input provided in the SynthesisInput.  The TTS service
     * will use this parameter to help choose an appropriate voice.  Note that
     * the TTS service may choose a voice with a slightly different language code
     * than the one selected; it may substitute a different region
     * (e.g. using en-US rather than en-CA if there isn't a Canadian voice
     * available), or even a different language, e.g. using "nb" (Norwegian
     * Bokmal) instead of "no" (Norwegian)".
     * </pre>
     *
     * <code>string language_code = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param value The bytes for languageCode to set.
     * @return This builder for chaining.
     */
    public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      languageCode_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object name_ = "";
    /**
     *
     *
     * <pre>
     * The name of the voice. If not set, the service will choose a
     * voice based on the other parameters such as language_code and gender.
     * </pre>
     *
     * <code>string name = 2;</code>
     *
     * @return The name.
     */
    public java.lang.String getName() {
      java.lang.Object ref = name_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        name_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The name of the voice. If not set, the service will choose a
     * voice based on the other parameters such as language_code and gender.
     * </pre>
     *
     * <code>string name = 2;</code>
     *
     * @return The bytes for name.
     */
    public com.google.protobuf.ByteString getNameBytes() {
      java.lang.Object ref = name_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        name_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The name of the voice. If not set, the service will choose a
     * voice based on the other parameters such as language_code and gender.
     * </pre>
     *
     * <code>string name = 2;</code>
     *
     * @param value The name to set.
     * @return This builder for chaining.
     */
    public Builder setName(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      name_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The name of the voice. If not set, the service will choose a
     * voice based on the other parameters such as language_code and gender.
     * </pre>
     *
     * <code>string name = 2;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearName() {

      name_ = getDefaultInstance().getName();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The name of the voice. If not set, the service will choose a
     * voice based on the other parameters such as language_code and gender.
     * </pre>
     *
     * <code>string name = 2;</code>
     *
     * @param value The bytes for name to set.
     * @return This builder for chaining.
     */
    public Builder setNameBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      name_ = value;
      onChanged();
      return this;
    }

    private int ssmlGender_ = 0;
    /**
     *
     *
     * <pre>
     * The preferred gender of the voice. If not set, the service will
     * choose a voice based on the other parameters such as language_code and
     * name. Note that this is only a preference, not requirement; if a
     * voice of the appropriate gender is not available, the synthesizer should
     * substitute a voice with a different gender rather than failing the request.
     * </pre>
     *
     * <code>.google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3;</code>
     *
     * @return The enum numeric value on the wire for ssmlGender.
     */
    @java.lang.Override
    public int getSsmlGenderValue() {
      return ssmlGender_;
    }
    /**
     *
     *
     * <pre>
     * The preferred gender of the voice. If not set, the service will
     * choose a voice based on the other parameters such as language_code and
     * name. Note that this is only a preference, not requirement; if a
     * voice of the appropriate gender is not available, the synthesizer should
     * substitute a voice with a different gender rather than failing the request.
     * </pre>
     *
     * <code>.google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3;</code>
     *
     * @param value The enum numeric value on the wire for ssmlGender to set.
     * @return This builder for chaining.
     */
    public Builder setSsmlGenderValue(int value) {

      ssmlGender_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The preferred gender of the voice. If not set, the service will
     * choose a voice based on the other parameters such as language_code and
     * name. Note that this is only a preference, not requirement; if a
     * voice of the appropriate gender is not available, the synthesizer should
     * substitute a voice with a different gender rather than failing the request.
     * </pre>
     *
     * <code>.google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3;</code>
     *
     * @return The ssmlGender.
     */
    @java.lang.Override
    public com.google.cloud.texttospeech.v1.SsmlVoiceGender getSsmlGender() {
      @SuppressWarnings("deprecation")
      com.google.cloud.texttospeech.v1.SsmlVoiceGender result =
          com.google.cloud.texttospeech.v1.SsmlVoiceGender.valueOf(ssmlGender_);
      return result == null
          ? com.google.cloud.texttospeech.v1.SsmlVoiceGender.UNRECOGNIZED
          : result;
    }
    /**
     *
     *
     * <pre>
     * The preferred gender of the voice. If not set, the service will
     * choose a voice based on the other parameters such as language_code and
     * name. Note that this is only a preference, not requirement; if a
     * voice of the appropriate gender is not available, the synthesizer should
     * substitute a voice with a different gender rather than failing the request.
     * </pre>
     *
     * <code>.google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3;</code>
     *
     * @param value The ssmlGender to set.
     * @return This builder for chaining.
     */
    public Builder setSsmlGender(com.google.cloud.texttospeech.v1.SsmlVoiceGender value) {
      if (value == null) {
        throw new NullPointerException();
      }

      ssmlGender_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The preferred gender of the voice. If not set, the service will
     * choose a voice based on the other parameters such as language_code and
     * name. Note that this is only a preference, not requirement; if a
     * voice of the appropriate gender is not available, the synthesizer should
     * substitute a voice with a different gender rather than failing the request.
     * </pre>
     *
     * <code>.google.cloud.texttospeech.v1.SsmlVoiceGender ssml_gender = 3;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearSsmlGender() {

      ssmlGender_ = 0;
      onChanged();
      return this;
    }

    @java.lang.Override
    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:google.cloud.texttospeech.v1.VoiceSelectionParams)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.texttospeech.v1.VoiceSelectionParams)
  private static final com.google.cloud.texttospeech.v1.VoiceSelectionParams DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.texttospeech.v1.VoiceSelectionParams();
  }

  public static com.google.cloud.texttospeech.v1.VoiceSelectionParams getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<VoiceSelectionParams> PARSER =
      new com.google.protobuf.AbstractParser<VoiceSelectionParams>() {
        @java.lang.Override
        public VoiceSelectionParams parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new VoiceSelectionParams(input, extensionRegistry);
        }
      };

  public static com.google.protobuf.Parser<VoiceSelectionParams> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<VoiceSelectionParams> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.cloud.texttospeech.v1.VoiceSelectionParams getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
import java.util.List;
import org.junit.Test;
import static org.junit.Assert.assertTrue;
import com.google.cloud.texttospeech.v1.AudioConfig;
import com.google.cloud.texttospeech.v1.AudioEncoding;
import com.google.cloud.texttospeech.v1.ListVoicesRequest;
import com.google.cloud.texttospeech.v1.ListVoicesResponse;
import com.google.cloud.texttospeech.v1.SsmlVoiceGender;
import com.google.cloud.texttospeech.v1.SynthesisInput;
import com.google.cloud.texttospeech.v1.SynthesizeSpeechResponse;
import com.google.cloud.texttospeech.v1.TextToSpeechClient;
import com.google.cloud.texttospeech.v1.Voice;
import com.google.cloud.texttospeech.v1.VoiceSelectionParams;
import com.google.protobuf.ByteString;
import java.io.IOException;
/*
 * Copyright 2019 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.cloud.texttospeech.v1.it;



public class ITSystemTest {

  @Test
  public void synthesizeSpeechTest() throws IOException {
    try (TextToSpeechClient textToSpeechClient = TextToSpeechClient.create()) {
      SynthesisInput input = SynthesisInput.newBuilder().setText("Hello, World!").build();

      VoiceSelectionParams voice =
          VoiceSelectionParams.newBuilder()
              .setLanguageCode("en-US")
              .setSsmlGender(SsmlVoiceGender.NEUTRAL)