Skip to content

Commit f45e441

Browse files
committed
Add image batch translate API.
1 parent 4174e1d commit f45e441

11 files changed

+687
-1
lines changed

CHANGELOG

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2023-04-11 Version: 3.2.0
2+
- Add image batch translate API.
3+
14
2023-04-10 Version: 1.0.0
25
- DocumentInit.
36

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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+
21+
using Aliyun.Acs.Core;
22+
using Aliyun.Acs.Core.Http;
23+
using Aliyun.Acs.Core.Transform;
24+
using Aliyun.Acs.Core.Utils;
25+
using Aliyun.Acs.alimt;
26+
using Aliyun.Acs.alimt.Transform;
27+
using Aliyun.Acs.alimt.Transform.V20181012;
28+
29+
namespace Aliyun.Acs.alimt.Model.V20181012
30+
{
31+
public class GetTranslateImageBatchResultRequest : RpcAcsRequest<GetTranslateImageBatchResultResponse>
32+
{
33+
public GetTranslateImageBatchResultRequest()
34+
: base("alimt", "2018-10-12", "GetTranslateImageBatchResult")
35+
{
36+
if (this.GetType().GetProperty("ProductEndpointMap") != null && this.GetType().GetProperty("ProductEndpointType") != null)
37+
{
38+
this.GetType().GetProperty("ProductEndpointMap").SetValue(this, Aliyun.Acs.alimt.Endpoint.endpointMap, null);
39+
this.GetType().GetProperty("ProductEndpointType").SetValue(this, Aliyun.Acs.alimt.Endpoint.endpointRegionalType, null);
40+
}
41+
Method = MethodType.POST;
42+
}
43+
44+
private string taskId;
45+
46+
public string TaskId
47+
{
48+
get
49+
{
50+
return taskId;
51+
}
52+
set
53+
{
54+
taskId = value;
55+
DictionaryUtil.Add(BodyParameters, "TaskId", value);
56+
}
57+
}
58+
59+
public override bool CheckShowJsonItemName()
60+
{
61+
return false;
62+
}
63+
64+
public override GetTranslateImageBatchResultResponse GetResponse(UnmarshallerContext unmarshallerContext)
65+
{
66+
return GetTranslateImageBatchResultResponseUnmarshaller.Unmarshall(unmarshallerContext);
67+
}
68+
}
69+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
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+
using Aliyun.Acs.Core;
22+
23+
namespace Aliyun.Acs.alimt.Model.V20181012
24+
{
25+
public class GetTranslateImageBatchResultResponse : AcsResponse
26+
{
27+
28+
private int? code;
29+
30+
private string message;
31+
32+
private string requestId;
33+
34+
private GetTranslateImageBatchResult_Data data;
35+
36+
public int? Code
37+
{
38+
get
39+
{
40+
return code;
41+
}
42+
set
43+
{
44+
code = value;
45+
}
46+
}
47+
48+
public string Message
49+
{
50+
get
51+
{
52+
return message;
53+
}
54+
set
55+
{
56+
message = value;
57+
}
58+
}
59+
60+
public string RequestId
61+
{
62+
get
63+
{
64+
return requestId;
65+
}
66+
set
67+
{
68+
requestId = value;
69+
}
70+
}
71+
72+
public GetTranslateImageBatchResult_Data Data
73+
{
74+
get
75+
{
76+
return data;
77+
}
78+
set
79+
{
80+
data = value;
81+
}
82+
}
83+
84+
public class GetTranslateImageBatchResult_Data
85+
{
86+
87+
private string status;
88+
89+
private List<GetTranslateImageBatchResult_CertificateImageTranslateResult> result;
90+
91+
public string Status
92+
{
93+
get
94+
{
95+
return status;
96+
}
97+
set
98+
{
99+
status = value;
100+
}
101+
}
102+
103+
public List<GetTranslateImageBatchResult_CertificateImageTranslateResult> Result
104+
{
105+
get
106+
{
107+
return result;
108+
}
109+
set
110+
{
111+
result = value;
112+
}
113+
}
114+
115+
public class GetTranslateImageBatchResult_CertificateImageTranslateResult
116+
{
117+
118+
private string inPaintingUrl;
119+
120+
private string finalImageUrl;
121+
122+
private string templateJson;
123+
124+
private string sourceImageUrl;
125+
126+
private int? code;
127+
128+
private string message;
129+
130+
private bool? success;
131+
132+
public string InPaintingUrl
133+
{
134+
get
135+
{
136+
return inPaintingUrl;
137+
}
138+
set
139+
{
140+
inPaintingUrl = value;
141+
}
142+
}
143+
144+
public string FinalImageUrl
145+
{
146+
get
147+
{
148+
return finalImageUrl;
149+
}
150+
set
151+
{
152+
finalImageUrl = value;
153+
}
154+
}
155+
156+
public string TemplateJson
157+
{
158+
get
159+
{
160+
return templateJson;
161+
}
162+
set
163+
{
164+
templateJson = value;
165+
}
166+
}
167+
168+
public string SourceImageUrl
169+
{
170+
get
171+
{
172+
return sourceImageUrl;
173+
}
174+
set
175+
{
176+
sourceImageUrl = value;
177+
}
178+
}
179+
180+
public int? Code
181+
{
182+
get
183+
{
184+
return code;
185+
}
186+
set
187+
{
188+
code = value;
189+
}
190+
}
191+
192+
public string Message
193+
{
194+
get
195+
{
196+
return message;
197+
}
198+
set
199+
{
200+
message = value;
201+
}
202+
}
203+
204+
public bool? Success
205+
{
206+
get
207+
{
208+
return success;
209+
}
210+
set
211+
{
212+
success = value;
213+
}
214+
}
215+
}
216+
}
217+
}
218+
}

aliyun-net-sdk-alimt/Alimt/Model/V20181012/TranslateECommerceRequest.cs

+15
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ public TranslateECommerceRequest()
4949

5050
private string scene;
5151

52+
private string context;
53+
5254
private string targetLanguage;
5355

5456
public string SourceLanguage
@@ -103,6 +105,19 @@ public string Scene
103105
}
104106
}
105107

108+
public string Context
109+
{
110+
get
111+
{
112+
return context;
113+
}
114+
set
115+
{
116+
context = value;
117+
DictionaryUtil.Add(QueryParameters, "Context", value);
118+
}
119+
}
120+
106121
public string TargetLanguage
107122
{
108123
get

aliyun-net-sdk-alimt/Alimt/Model/V20181012/TranslateGeneralRequest.cs

+15
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ public TranslateGeneralRequest()
4949

5050
private string scene;
5151

52+
private string context;
53+
5254
private string targetLanguage;
5355

5456
public string SourceLanguage
@@ -103,6 +105,19 @@ public string Scene
103105
}
104106
}
105107

108+
public string Context
109+
{
110+
get
111+
{
112+
return context;
113+
}
114+
set
115+
{
116+
context = value;
117+
DictionaryUtil.Add(QueryParameters, "Context", value);
118+
}
119+
}
120+
106121
public string TargetLanguage
107122
{
108123
get

0 commit comments

Comments
 (0)