|
| 1 | +/* |
| 2 | + * Copyright 2025 Google LLC |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * https://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +// Auto-generated code. Do not edit. |
| 18 | + |
| 19 | +package com.google.genai.types; |
| 20 | + |
| 21 | +import com.fasterxml.jackson.annotation.JsonCreator; |
| 22 | +import com.fasterxml.jackson.annotation.JsonProperty; |
| 23 | +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; |
| 24 | +import com.google.auto.value.AutoValue; |
| 25 | +import com.google.errorprone.annotations.CanIgnoreReturnValue; |
| 26 | +import com.google.genai.JsonSerializable; |
| 27 | +import java.util.Optional; |
| 28 | + |
| 29 | +/** Config for stream translation. */ |
| 30 | +@AutoValue |
| 31 | +@JsonDeserialize(builder = StreamTranslationConfig.Builder.class) |
| 32 | +public abstract class StreamTranslationConfig extends JsonSerializable { |
| 33 | + /** |
| 34 | + * If true, the model will generate audio when the target language is spoken, essentially it will |
| 35 | + * parrot the input. If false, we will not produce audio for the target language. |
| 36 | + */ |
| 37 | + @JsonProperty("echoTargetLanguage") |
| 38 | + public abstract Optional<Boolean> echoTargetLanguage(); |
| 39 | + |
| 40 | + /** |
| 41 | + * The target language for translation. Supported values are BCP-47 language codes (e.g. "en", |
| 42 | + * "es", "fr"). |
| 43 | + */ |
| 44 | + @JsonProperty("targetLanguageCode") |
| 45 | + public abstract Optional<String> targetLanguageCode(); |
| 46 | + |
| 47 | + /** Instantiates a builder for StreamTranslationConfig. */ |
| 48 | + @ExcludeFromGeneratedCoverageReport |
| 49 | + public static Builder builder() { |
| 50 | + return new AutoValue_StreamTranslationConfig.Builder(); |
| 51 | + } |
| 52 | + |
| 53 | + /** Creates a builder with the same values as this instance. */ |
| 54 | + public abstract Builder toBuilder(); |
| 55 | + |
| 56 | + /** Builder for StreamTranslationConfig. */ |
| 57 | + @AutoValue.Builder |
| 58 | + public abstract static class Builder { |
| 59 | + /** For internal usage. Please use `StreamTranslationConfig.builder()` for instantiation. */ |
| 60 | + @JsonCreator |
| 61 | + private static Builder create() { |
| 62 | + return new AutoValue_StreamTranslationConfig.Builder(); |
| 63 | + } |
| 64 | + |
| 65 | + /** |
| 66 | + * Setter for echoTargetLanguage. |
| 67 | + * |
| 68 | + * <p>echoTargetLanguage: If true, the model will generate audio when the target language is |
| 69 | + * spoken, essentially it will parrot the input. If false, we will not produce audio for the |
| 70 | + * target language. |
| 71 | + */ |
| 72 | + @JsonProperty("echoTargetLanguage") |
| 73 | + public abstract Builder echoTargetLanguage(boolean echoTargetLanguage); |
| 74 | + |
| 75 | + @ExcludeFromGeneratedCoverageReport |
| 76 | + abstract Builder echoTargetLanguage(Optional<Boolean> echoTargetLanguage); |
| 77 | + |
| 78 | + /** Clears the value of echoTargetLanguage field. */ |
| 79 | + @ExcludeFromGeneratedCoverageReport |
| 80 | + @CanIgnoreReturnValue |
| 81 | + public Builder clearEchoTargetLanguage() { |
| 82 | + return echoTargetLanguage(Optional.empty()); |
| 83 | + } |
| 84 | + |
| 85 | + /** |
| 86 | + * Setter for targetLanguageCode. |
| 87 | + * |
| 88 | + * <p>targetLanguageCode: The target language for translation. Supported values are BCP-47 |
| 89 | + * language codes (e.g. "en", "es", "fr"). |
| 90 | + */ |
| 91 | + @JsonProperty("targetLanguageCode") |
| 92 | + public abstract Builder targetLanguageCode(String targetLanguageCode); |
| 93 | + |
| 94 | + @ExcludeFromGeneratedCoverageReport |
| 95 | + abstract Builder targetLanguageCode(Optional<String> targetLanguageCode); |
| 96 | + |
| 97 | + /** Clears the value of targetLanguageCode field. */ |
| 98 | + @ExcludeFromGeneratedCoverageReport |
| 99 | + @CanIgnoreReturnValue |
| 100 | + public Builder clearTargetLanguageCode() { |
| 101 | + return targetLanguageCode(Optional.empty()); |
| 102 | + } |
| 103 | + |
| 104 | + public abstract StreamTranslationConfig build(); |
| 105 | + } |
| 106 | + |
| 107 | + /** Deserializes a JSON string to a StreamTranslationConfig object. */ |
| 108 | + @ExcludeFromGeneratedCoverageReport |
| 109 | + public static StreamTranslationConfig fromJson(String jsonString) { |
| 110 | + return JsonSerializable.fromJsonString(jsonString, StreamTranslationConfig.class); |
| 111 | + } |
| 112 | +} |
0 commit comments