|
| 1 | +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. |
| 2 | +// SPDX-License-Identifier: Apache-2.0 |
| 3 | + |
| 4 | +/* |
| 5 | + * Ark Audio Generation API |
| 6 | + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) |
| 7 | + * |
| 8 | + * The version of the OpenAPI document: 0.1.0 |
| 9 | + * |
| 10 | + * |
| 11 | + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). |
| 12 | + * https://openapi-generator.tech |
| 13 | + * Do not edit the class manually. |
| 14 | + */ |
| 15 | + |
| 16 | + |
| 17 | +package com.volcengine.ark.runtime.models.audio_generation; |
| 18 | + |
| 19 | +import com.fasterxml.jackson.annotation.JsonInclude; |
| 20 | +import com.fasterxml.jackson.annotation.JsonProperty; |
| 21 | +import com.fasterxml.jackson.annotation.JsonPropertyOrder; |
| 22 | +import java.util.Objects; |
| 23 | + |
| 24 | +/** |
| 25 | + * AudioConfig |
| 26 | + */ |
| 27 | +@JsonPropertyOrder({ |
| 28 | + AudioConfig.JSON_PROPERTY_SAMPLE_RATE, |
| 29 | + AudioConfig.JSON_PROPERTY_SPEECH_RATE, |
| 30 | + AudioConfig.JSON_PROPERTY_LOUDNESS_RATE, |
| 31 | + AudioConfig.JSON_PROPERTY_PITCH_RATE |
| 32 | +}) |
| 33 | +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") |
| 34 | +public class AudioConfig { |
| 35 | + public static final String JSON_PROPERTY_SAMPLE_RATE = "sample_rate"; |
| 36 | + @javax.annotation.Nullable |
| 37 | + private SampleRate sampleRate; |
| 38 | + |
| 39 | + public static final String JSON_PROPERTY_SPEECH_RATE = "speech_rate"; |
| 40 | + @javax.annotation.Nullable |
| 41 | + private Integer speechRate; |
| 42 | + |
| 43 | + public static final String JSON_PROPERTY_LOUDNESS_RATE = "loudness_rate"; |
| 44 | + @javax.annotation.Nullable |
| 45 | + private Integer loudnessRate; |
| 46 | + |
| 47 | + public static final String JSON_PROPERTY_PITCH_RATE = "pitch_rate"; |
| 48 | + @javax.annotation.Nullable |
| 49 | + private Integer pitchRate; |
| 50 | + |
| 51 | + public AudioConfig() { |
| 52 | + } |
| 53 | + |
| 54 | + public AudioConfig sampleRate(@javax.annotation.Nullable SampleRate sampleRate) { |
| 55 | + |
| 56 | + this.sampleRate = sampleRate; |
| 57 | + return this; |
| 58 | + } |
| 59 | + |
| 60 | + /** |
| 61 | + * Get sampleRate |
| 62 | + * @return sampleRate |
| 63 | + */ |
| 64 | + @javax.annotation.Nullable |
| 65 | + @JsonProperty(value = JSON_PROPERTY_SAMPLE_RATE, required = false) |
| 66 | + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) |
| 67 | + |
| 68 | + public SampleRate getSampleRate() { |
| 69 | + return sampleRate; |
| 70 | + } |
| 71 | + |
| 72 | + |
| 73 | + @JsonProperty(value = JSON_PROPERTY_SAMPLE_RATE, required = false) |
| 74 | + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) |
| 75 | + public void setSampleRate(@javax.annotation.Nullable SampleRate sampleRate) { |
| 76 | + this.sampleRate = sampleRate; |
| 77 | + } |
| 78 | + |
| 79 | + public AudioConfig speechRate(@javax.annotation.Nullable Integer speechRate) { |
| 80 | + |
| 81 | + this.speechRate = speechRate; |
| 82 | + return this; |
| 83 | + } |
| 84 | + |
| 85 | + /** |
| 86 | + * Get speechRate |
| 87 | + * minimum: -50 |
| 88 | + * maximum: 100 |
| 89 | + * @return speechRate |
| 90 | + */ |
| 91 | + @javax.annotation.Nullable |
| 92 | + @JsonProperty(value = JSON_PROPERTY_SPEECH_RATE, required = false) |
| 93 | + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) |
| 94 | + |
| 95 | + public Integer getSpeechRate() { |
| 96 | + return speechRate; |
| 97 | + } |
| 98 | + |
| 99 | + |
| 100 | + @JsonProperty(value = JSON_PROPERTY_SPEECH_RATE, required = false) |
| 101 | + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) |
| 102 | + public void setSpeechRate(@javax.annotation.Nullable Integer speechRate) { |
| 103 | + this.speechRate = speechRate; |
| 104 | + } |
| 105 | + |
| 106 | + public AudioConfig loudnessRate(@javax.annotation.Nullable Integer loudnessRate) { |
| 107 | + |
| 108 | + this.loudnessRate = loudnessRate; |
| 109 | + return this; |
| 110 | + } |
| 111 | + |
| 112 | + /** |
| 113 | + * Get loudnessRate |
| 114 | + * minimum: -50 |
| 115 | + * maximum: 100 |
| 116 | + * @return loudnessRate |
| 117 | + */ |
| 118 | + @javax.annotation.Nullable |
| 119 | + @JsonProperty(value = JSON_PROPERTY_LOUDNESS_RATE, required = false) |
| 120 | + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) |
| 121 | + |
| 122 | + public Integer getLoudnessRate() { |
| 123 | + return loudnessRate; |
| 124 | + } |
| 125 | + |
| 126 | + |
| 127 | + @JsonProperty(value = JSON_PROPERTY_LOUDNESS_RATE, required = false) |
| 128 | + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) |
| 129 | + public void setLoudnessRate(@javax.annotation.Nullable Integer loudnessRate) { |
| 130 | + this.loudnessRate = loudnessRate; |
| 131 | + } |
| 132 | + |
| 133 | + public AudioConfig pitchRate(@javax.annotation.Nullable Integer pitchRate) { |
| 134 | + |
| 135 | + this.pitchRate = pitchRate; |
| 136 | + return this; |
| 137 | + } |
| 138 | + |
| 139 | + /** |
| 140 | + * Get pitchRate |
| 141 | + * minimum: -12 |
| 142 | + * maximum: 12 |
| 143 | + * @return pitchRate |
| 144 | + */ |
| 145 | + @javax.annotation.Nullable |
| 146 | + @JsonProperty(value = JSON_PROPERTY_PITCH_RATE, required = false) |
| 147 | + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) |
| 148 | + |
| 149 | + public Integer getPitchRate() { |
| 150 | + return pitchRate; |
| 151 | + } |
| 152 | + |
| 153 | + |
| 154 | + @JsonProperty(value = JSON_PROPERTY_PITCH_RATE, required = false) |
| 155 | + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) |
| 156 | + public void setPitchRate(@javax.annotation.Nullable Integer pitchRate) { |
| 157 | + this.pitchRate = pitchRate; |
| 158 | + } |
| 159 | + |
| 160 | + |
| 161 | + @Override |
| 162 | + public boolean equals(Object o) { |
| 163 | + if (this == o) { |
| 164 | + return true; |
| 165 | + } |
| 166 | + if (o == null || getClass() != o.getClass()) { |
| 167 | + return false; |
| 168 | + } |
| 169 | + AudioConfig audioConfig = (AudioConfig) o; |
| 170 | + return Objects.equals(this.sampleRate, audioConfig.sampleRate) && |
| 171 | + Objects.equals(this.speechRate, audioConfig.speechRate) && |
| 172 | + Objects.equals(this.loudnessRate, audioConfig.loudnessRate) && |
| 173 | + Objects.equals(this.pitchRate, audioConfig.pitchRate); |
| 174 | + } |
| 175 | + |
| 176 | + @Override |
| 177 | + public int hashCode() { |
| 178 | + return Objects.hash(sampleRate, speechRate, loudnessRate, pitchRate); |
| 179 | + } |
| 180 | + |
| 181 | + @Override |
| 182 | + public String toString() { |
| 183 | + StringBuilder sb = new StringBuilder(); |
| 184 | + sb.append("class AudioConfig {\n"); |
| 185 | + sb.append(" sampleRate: ").append(toIndentedString(sampleRate)).append("\n"); |
| 186 | + sb.append(" speechRate: ").append(toIndentedString(speechRate)).append("\n"); |
| 187 | + sb.append(" loudnessRate: ").append(toIndentedString(loudnessRate)).append("\n"); |
| 188 | + sb.append(" pitchRate: ").append(toIndentedString(pitchRate)).append("\n"); |
| 189 | + sb.append("}"); |
| 190 | + return sb.toString(); |
| 191 | + } |
| 192 | + |
| 193 | + /** |
| 194 | + * Convert the given object to string with each line indented by 4 spaces |
| 195 | + * (except the first line). |
| 196 | + */ |
| 197 | + private String toIndentedString(Object o) { |
| 198 | + return o == null ? "null" : o.toString().replace("\n", "\n "); |
| 199 | + } |
| 200 | + |
| 201 | + public static class Builder { |
| 202 | + |
| 203 | + private AudioConfig instance; |
| 204 | + |
| 205 | + public Builder() { |
| 206 | + this(new AudioConfig()); |
| 207 | + } |
| 208 | + |
| 209 | + protected Builder(AudioConfig instance) { |
| 210 | + this.instance = instance; |
| 211 | + } |
| 212 | + |
| 213 | + public AudioConfig.Builder sampleRate(SampleRate sampleRate) { |
| 214 | + this.instance.sampleRate = sampleRate; |
| 215 | + return this; |
| 216 | + } |
| 217 | + public AudioConfig.Builder speechRate(Integer speechRate) { |
| 218 | + this.instance.speechRate = speechRate; |
| 219 | + return this; |
| 220 | + } |
| 221 | + public AudioConfig.Builder loudnessRate(Integer loudnessRate) { |
| 222 | + this.instance.loudnessRate = loudnessRate; |
| 223 | + return this; |
| 224 | + } |
| 225 | + public AudioConfig.Builder pitchRate(Integer pitchRate) { |
| 226 | + this.instance.pitchRate = pitchRate; |
| 227 | + return this; |
| 228 | + } |
| 229 | + |
| 230 | + |
| 231 | + /** |
| 232 | + * returns a built AudioConfig instance. |
| 233 | + * |
| 234 | + * The builder is not reusable. |
| 235 | + */ |
| 236 | + public AudioConfig build() { |
| 237 | + try { |
| 238 | + return this.instance; |
| 239 | + } finally { |
| 240 | + // ensure that this.instance is not reused |
| 241 | + this.instance = null; |
| 242 | + } |
| 243 | + } |
| 244 | + |
| 245 | + @Override |
| 246 | + public String toString() { |
| 247 | + return getClass() + "=(" + instance + ")"; |
| 248 | + } |
| 249 | + } |
| 250 | + |
| 251 | + /** |
| 252 | + * Create a builder with no initialized field. |
| 253 | + */ |
| 254 | + public static AudioConfig.Builder builder() { |
| 255 | + return new AudioConfig.Builder(); |
| 256 | + } |
| 257 | + |
| 258 | + /** |
| 259 | + * Create a builder with a shallow copy of this instance. |
| 260 | + */ |
| 261 | + public AudioConfig.Builder toBuilder() { |
| 262 | + return new AudioConfig.Builder() |
| 263 | + .sampleRate(getSampleRate()) |
| 264 | + .speechRate(getSpeechRate()) |
| 265 | + .loudnessRate(getLoudnessRate()) |
| 266 | + .pitchRate(getPitchRate()); |
| 267 | + } |
| 268 | + |
| 269 | + |
| 270 | +} |
0 commit comments