|
| 1 | +/* |
| 2 | + * Licensed to the Apache Software Foundation (ASF) under one |
| 3 | + * or more contributor license agreements. See the NOTICE file |
| 4 | + * distributed with this work for additional information |
| 5 | + * regarding copyright ownership. The ASF licenses this file |
| 6 | + * to you under the Apache License, Version 2.0 (the |
| 7 | + * "License"); you may not use this file except in compliance |
| 8 | + * with the License. You may obtain a copy of the License at |
| 9 | + * |
| 10 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | + * |
| 12 | + * Unless required by applicable law or agreed to in writing, |
| 13 | + * software distributed under the License is distributed on an |
| 14 | + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | + * KIND, either express or implied. See the License for the |
| 16 | + * specific language governing permissions and limitations |
| 17 | + * under the License. |
| 18 | + */ |
| 19 | +using System.Collections.Generic; |
| 20 | +using Newtonsoft.Json; |
| 21 | + |
| 22 | +using Aliyun.Acs.Core; |
| 23 | +using Aliyun.Acs.Core.Http; |
| 24 | +using Aliyun.Acs.Core.Transform; |
| 25 | +using Aliyun.Acs.Core.Utils; |
| 26 | +using Aliyun.Acs.AnyTrans; |
| 27 | +using Aliyun.Acs.AnyTrans.Transform; |
| 28 | +using Aliyun.Acs.AnyTrans.Transform.V20250707; |
| 29 | + |
| 30 | +namespace Aliyun.Acs.AnyTrans.Model.V20250707 |
| 31 | +{ |
| 32 | + public class BatchTranslateRequest : RoaAcsRequest<BatchTranslateResponse> |
| 33 | + { |
| 34 | + public BatchTranslateRequest() |
| 35 | + : base("AnyTrans", "2025-07-07", "BatchTranslate") |
| 36 | + { |
| 37 | + Protocol = ProtocolType.HTTPS; |
| 38 | + UriPattern = "/anytrans/translate/batch"; |
| 39 | + Method = MethodType.POST; |
| 40 | + } |
| 41 | + |
| 42 | + private Ext ext_; |
| 43 | + |
| 44 | + private string sourceLanguage; |
| 45 | + |
| 46 | + private string format; |
| 47 | + |
| 48 | + private string scene; |
| 49 | + |
| 50 | + private string targetLanguage; |
| 51 | + |
| 52 | + private string text; |
| 53 | + |
| 54 | + private string workspaceId; |
| 55 | + |
| 56 | + [JsonProperty(PropertyName = "ext")] |
| 57 | + public Ext Ext_ |
| 58 | + { |
| 59 | + get |
| 60 | + { |
| 61 | + return ext_; |
| 62 | + } |
| 63 | + |
| 64 | + set |
| 65 | + { |
| 66 | + ext_ = value; |
| 67 | + DictionaryUtil.Add(BodyParameters, "ext", JsonConvert.SerializeObject(value)); |
| 68 | + |
| 69 | + } |
| 70 | + } |
| 71 | + |
| 72 | + [JsonProperty(PropertyName = "sourceLanguage")] |
| 73 | + public string SourceLanguage |
| 74 | + { |
| 75 | + get |
| 76 | + { |
| 77 | + return sourceLanguage; |
| 78 | + } |
| 79 | + set |
| 80 | + { |
| 81 | + sourceLanguage = value; |
| 82 | + DictionaryUtil.Add(BodyParameters, "sourceLanguage", value); |
| 83 | + } |
| 84 | + } |
| 85 | + |
| 86 | + [JsonProperty(PropertyName = "format")] |
| 87 | + public string Format |
| 88 | + { |
| 89 | + get |
| 90 | + { |
| 91 | + return format; |
| 92 | + } |
| 93 | + set |
| 94 | + { |
| 95 | + format = value; |
| 96 | + DictionaryUtil.Add(BodyParameters, "format", value); |
| 97 | + } |
| 98 | + } |
| 99 | + |
| 100 | + [JsonProperty(PropertyName = "scene")] |
| 101 | + public string Scene |
| 102 | + { |
| 103 | + get |
| 104 | + { |
| 105 | + return scene; |
| 106 | + } |
| 107 | + set |
| 108 | + { |
| 109 | + scene = value; |
| 110 | + DictionaryUtil.Add(BodyParameters, "scene", value); |
| 111 | + } |
| 112 | + } |
| 113 | + |
| 114 | + [JsonProperty(PropertyName = "targetLanguage")] |
| 115 | + public string TargetLanguage |
| 116 | + { |
| 117 | + get |
| 118 | + { |
| 119 | + return targetLanguage; |
| 120 | + } |
| 121 | + set |
| 122 | + { |
| 123 | + targetLanguage = value; |
| 124 | + DictionaryUtil.Add(BodyParameters, "targetLanguage", value); |
| 125 | + } |
| 126 | + } |
| 127 | + |
| 128 | + [JsonProperty(PropertyName = "text")] |
| 129 | + public string Text |
| 130 | + { |
| 131 | + get |
| 132 | + { |
| 133 | + return text; |
| 134 | + } |
| 135 | + set |
| 136 | + { |
| 137 | + text = value; |
| 138 | + DictionaryUtil.Add(BodyParameters, "text", value.ToString()); |
| 139 | + } |
| 140 | + } |
| 141 | + |
| 142 | + [JsonProperty(PropertyName = "workspaceId")] |
| 143 | + public string WorkspaceId |
| 144 | + { |
| 145 | + get |
| 146 | + { |
| 147 | + return workspaceId; |
| 148 | + } |
| 149 | + set |
| 150 | + { |
| 151 | + workspaceId = value; |
| 152 | + DictionaryUtil.Add(BodyParameters, "workspaceId", value); |
| 153 | + } |
| 154 | + } |
| 155 | + |
| 156 | + public class Ext |
| 157 | + { |
| 158 | + |
| 159 | + private List<string> sensitives = new List<string>(){ }; |
| 160 | + |
| 161 | + private List<TerminologiesItem> terminologies = new List<TerminologiesItem>(){ }; |
| 162 | + |
| 163 | + private TextTransform textTransform_; |
| 164 | + |
| 165 | + private List<ExamplesItem> examples = new List<ExamplesItem>(){ }; |
| 166 | + |
| 167 | + private string domainHint; |
| 168 | + |
| 169 | + [JsonProperty(PropertyName = "sensitives")] |
| 170 | + public List<string> Sensitives |
| 171 | + { |
| 172 | + get |
| 173 | + { |
| 174 | + return sensitives; |
| 175 | + } |
| 176 | + set |
| 177 | + { |
| 178 | + sensitives = value; |
| 179 | + } |
| 180 | + } |
| 181 | + |
| 182 | + [JsonProperty(PropertyName = "terminologies")] |
| 183 | + public List<TerminologiesItem> Terminologies |
| 184 | + { |
| 185 | + get |
| 186 | + { |
| 187 | + return terminologies; |
| 188 | + } |
| 189 | + set |
| 190 | + { |
| 191 | + terminologies = value; |
| 192 | + } |
| 193 | + } |
| 194 | + |
| 195 | + [JsonProperty(PropertyName = "textTransform")] |
| 196 | + public TextTransform TextTransform_ |
| 197 | + { |
| 198 | + get |
| 199 | + { |
| 200 | + return textTransform_; |
| 201 | + } |
| 202 | + set |
| 203 | + { |
| 204 | + textTransform_ = value; |
| 205 | + } |
| 206 | + } |
| 207 | + |
| 208 | + [JsonProperty(PropertyName = "examples")] |
| 209 | + public List<ExamplesItem> Examples |
| 210 | + { |
| 211 | + get |
| 212 | + { |
| 213 | + return examples; |
| 214 | + } |
| 215 | + set |
| 216 | + { |
| 217 | + examples = value; |
| 218 | + } |
| 219 | + } |
| 220 | + |
| 221 | + [JsonProperty(PropertyName = "domainHint")] |
| 222 | + public string DomainHint |
| 223 | + { |
| 224 | + get |
| 225 | + { |
| 226 | + return domainHint; |
| 227 | + } |
| 228 | + set |
| 229 | + { |
| 230 | + domainHint = value; |
| 231 | + } |
| 232 | + } |
| 233 | + |
| 234 | + public class TerminologiesItem |
| 235 | + { |
| 236 | + |
| 237 | + private string tgt; |
| 238 | + |
| 239 | + private string src; |
| 240 | + |
| 241 | + [JsonProperty(PropertyName = "tgt")] |
| 242 | + public string Tgt |
| 243 | + { |
| 244 | + get |
| 245 | + { |
| 246 | + return tgt; |
| 247 | + } |
| 248 | + set |
| 249 | + { |
| 250 | + tgt = value; |
| 251 | + } |
| 252 | + } |
| 253 | + |
| 254 | + [JsonProperty(PropertyName = "src")] |
| 255 | + public string Src |
| 256 | + { |
| 257 | + get |
| 258 | + { |
| 259 | + return src; |
| 260 | + } |
| 261 | + set |
| 262 | + { |
| 263 | + src = value; |
| 264 | + } |
| 265 | + } |
| 266 | + } |
| 267 | + |
| 268 | + public class TextTransform |
| 269 | + { |
| 270 | + |
| 271 | + private bool? toLower; |
| 272 | + |
| 273 | + private bool? toUpper; |
| 274 | + |
| 275 | + private bool? toTitle; |
| 276 | + |
| 277 | + [JsonProperty(PropertyName = "toLower")] |
| 278 | + public bool? ToLower |
| 279 | + { |
| 280 | + get |
| 281 | + { |
| 282 | + return toLower; |
| 283 | + } |
| 284 | + set |
| 285 | + { |
| 286 | + toLower = value; |
| 287 | + } |
| 288 | + } |
| 289 | + |
| 290 | + [JsonProperty(PropertyName = "toUpper")] |
| 291 | + public bool? ToUpper |
| 292 | + { |
| 293 | + get |
| 294 | + { |
| 295 | + return toUpper; |
| 296 | + } |
| 297 | + set |
| 298 | + { |
| 299 | + toUpper = value; |
| 300 | + } |
| 301 | + } |
| 302 | + |
| 303 | + [JsonProperty(PropertyName = "toTitle")] |
| 304 | + public bool? ToTitle |
| 305 | + { |
| 306 | + get |
| 307 | + { |
| 308 | + return toTitle; |
| 309 | + } |
| 310 | + set |
| 311 | + { |
| 312 | + toTitle = value; |
| 313 | + } |
| 314 | + } |
| 315 | + } |
| 316 | + |
| 317 | + public class ExamplesItem |
| 318 | + { |
| 319 | + |
| 320 | + private string tgt; |
| 321 | + |
| 322 | + private string src; |
| 323 | + |
| 324 | + [JsonProperty(PropertyName = "tgt")] |
| 325 | + public string Tgt |
| 326 | + { |
| 327 | + get |
| 328 | + { |
| 329 | + return tgt; |
| 330 | + } |
| 331 | + set |
| 332 | + { |
| 333 | + tgt = value; |
| 334 | + } |
| 335 | + } |
| 336 | + |
| 337 | + [JsonProperty(PropertyName = "src")] |
| 338 | + public string Src |
| 339 | + { |
| 340 | + get |
| 341 | + { |
| 342 | + return src; |
| 343 | + } |
| 344 | + set |
| 345 | + { |
| 346 | + src = value; |
| 347 | + } |
| 348 | + } |
| 349 | + } |
| 350 | + } |
| 351 | + |
| 352 | + public override bool CheckShowJsonItemName() |
| 353 | + { |
| 354 | + return false; |
| 355 | + } |
| 356 | + |
| 357 | + public override BatchTranslateResponse GetResponse(UnmarshallerContext unmarshallerContext) |
| 358 | + { |
| 359 | + return BatchTranslateResponseUnmarshaller.Unmarshall(unmarshallerContext); |
| 360 | + } |
| 361 | + } |
| 362 | +} |
0 commit comments