|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# |
| 10 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +# |
| 12 | +# |
| 13 | +# Unless required by applicable law or agreed to in writing, |
| 14 | +# software distributed under the License is distributed on an |
| 15 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 16 | +# KIND, either express or implied. See the License for the |
| 17 | +# specific language governing permissions and limitations |
| 18 | +# under the License. |
| 19 | + |
| 20 | +from aliyunsdkcore.request import RoaRequest |
| 21 | +import json |
| 22 | + |
| 23 | +class BatchTranslateRequest(RoaRequest): |
| 24 | + |
| 25 | + def __init__(self): |
| 26 | + RoaRequest.__init__(self, 'AnyTrans', '2025-07-07', 'BatchTranslate') |
| 27 | + self.set_protocol_type('https') |
| 28 | + self.set_uri_pattern('/anytrans/translate/batch') |
| 29 | + self.set_method('POST') |
| 30 | + |
| 31 | + def get_ext(self): # Struct |
| 32 | + return self.get_body_params().get('ext') |
| 33 | + |
| 34 | + def set_ext(self, ext): # Struct |
| 35 | + self.add_body_params("ext", json.dumps(ext)) |
| 36 | + def get_sourceLanguage(self): # String |
| 37 | + return self.get_body_params().get('sourceLanguage') |
| 38 | + |
| 39 | + def set_sourceLanguage(self, sourceLanguage): # String |
| 40 | + self.add_body_params('sourceLanguage', sourceLanguage) |
| 41 | + def get_format(self): # String |
| 42 | + return self.get_body_params().get('format') |
| 43 | + |
| 44 | + def set_format(self, format): # String |
| 45 | + self.add_body_params('format', format) |
| 46 | + def get_scene(self): # String |
| 47 | + return self.get_body_params().get('scene') |
| 48 | + |
| 49 | + def set_scene(self, scene): # String |
| 50 | + self.add_body_params('scene', scene) |
| 51 | + def get_targetLanguage(self): # String |
| 52 | + return self.get_body_params().get('targetLanguage') |
| 53 | + |
| 54 | + def set_targetLanguage(self, targetLanguage): # String |
| 55 | + self.add_body_params('targetLanguage', targetLanguage) |
| 56 | + def get_text(self): # Map |
| 57 | + return self.get_body_params().get('text') |
| 58 | + |
| 59 | + def set_text(self, text): # Map |
| 60 | + self.add_body_params("text", json.dumps(text)) |
| 61 | + def get_workspaceId(self): # String |
| 62 | + return self.get_body_params().get('workspaceId') |
| 63 | + |
| 64 | + def set_workspaceId(self, workspaceId): # String |
| 65 | + self.add_body_params('workspaceId', workspaceId) |
0 commit comments