Browse Source

Generated 2018-10-12 for alimt.

sdk-team 5 years ago
parent
commit
2f09d877bb

+ 4 - 0
ChangeLog.txt

@@ -1,3 +1,7 @@
+2020-03-11 Version: v1.61.46
+- Generated 2018-10-12 for `alimt`.
+- Support certificate translate.
+
 2020-03-10 Version: v1.61.45
 - Generated 2020-02-06 for `acms-open`.
 - ACM POP SDK.

+ 1 - 1
services/alimt/create_doc_translate_task.go

@@ -97,7 +97,7 @@ func CreateCreateDocTranslateTaskRequest() (request *CreateDocTranslateTaskReque
 	request = &CreateDocTranslateTaskRequest{
 		RpcRequest: &requests.RpcRequest{},
 	}
-	request.InitWithApiInfo("alimt", "2018-10-12", "CreateDocTranslateTask", "alimt", "openAPI")
+	request.InitWithApiInfo("alimt", "2018-10-12", "CreateDocTranslateTask", "alimtct", "openAPI")
 	return
 }
 

+ 1 - 1
services/alimt/get_doc_translate_task.go

@@ -93,7 +93,7 @@ func CreateGetDocTranslateTaskRequest() (request *GetDocTranslateTaskRequest) {
 	request = &GetDocTranslateTaskRequest{
 		RpcRequest: &requests.RpcRequest{},
 	}
-	request.InitWithApiInfo("alimt", "2018-10-12", "GetDocTranslateTask", "alimt", "openAPI")
+	request.InitWithApiInfo("alimt", "2018-10-12", "GetDocTranslateTask", "alimtct", "openAPI")
 	return
 }
 

+ 24 - 0
services/alimt/struct_certificate_translate_item_dto.go

@@ -0,0 +1,24 @@
+package alimt
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// CertificateTranslateItemDTO is a nested struct in alimt response
+type CertificateTranslateItemDTO struct {
+	Key              string `json:"Key" xml:"Key"`
+	Value            string `json:"Value" xml:"Value"`
+	ValueTranslation string `json:"ValueTranslation" xml:"ValueTranslation"`
+	KeyTranslation   string `json:"KeyTranslation" xml:"KeyTranslation"`
+}

+ 2 - 1
services/alimt/struct_data.go

@@ -17,5 +17,6 @@ package alimt
 
 // Data is a nested struct in alimt response
 type Data struct {
-	Translated string `json:"Translated" xml:"Translated"`
+	Translated       string                        `json:"Translated" xml:"Translated"`
+	TranslatedValues []CertificateTranslateItemDTO `json:"TranslatedValues" xml:"TranslatedValues"`
 }

+ 21 - 0
services/alimt/struct_translated_values.go

@@ -0,0 +1,21 @@
+package alimt
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+// TranslatedValues is a nested struct in alimt response
+type TranslatedValues struct {
+	CertificateTranslateItemDTO []CertificateTranslateItemDTO `json:"CertificateTranslateItemDTO" xml:"CertificateTranslateItemDTO"`
+}

+ 1 - 1
services/alimt/translate.go

@@ -97,7 +97,7 @@ func CreateTranslateRequest() (request *TranslateRequest) {
 	request = &TranslateRequest{
 		RpcRequest: &requests.RpcRequest{},
 	}
-	request.InitWithApiInfo("alimt", "2018-10-12", "Translate", "alimt", "openAPI")
+	request.InitWithApiInfo("alimt", "2018-10-12", "Translate", "alimtct", "openAPI")
 	return
 }
 

+ 108 - 0
services/alimt/translate_certificate.go

@@ -0,0 +1,108 @@
+package alimt
+
+//Licensed under the Apache License, Version 2.0 (the "License");
+//you may not use this file except in compliance with the License.
+//You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing, software
+//distributed under the License is distributed on an "AS IS" BASIS,
+//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//See the License for the specific language governing permissions and
+//limitations under the License.
+//
+// Code generated by Alibaba Cloud SDK Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+// TranslateCertificate invokes the alimt.TranslateCertificate API synchronously
+// api document: https://help.aliyun.com/api/alimt/translatecertificate.html
+func (client *Client) TranslateCertificate(request *TranslateCertificateRequest) (response *TranslateCertificateResponse, err error) {
+	response = CreateTranslateCertificateResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// TranslateCertificateWithChan invokes the alimt.TranslateCertificate API asynchronously
+// api document: https://help.aliyun.com/api/alimt/translatecertificate.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) TranslateCertificateWithChan(request *TranslateCertificateRequest) (<-chan *TranslateCertificateResponse, <-chan error) {
+	responseChan := make(chan *TranslateCertificateResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.TranslateCertificate(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// TranslateCertificateWithCallback invokes the alimt.TranslateCertificate API asynchronously
+// api document: https://help.aliyun.com/api/alimt/translatecertificate.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) TranslateCertificateWithCallback(request *TranslateCertificateRequest, callback func(response *TranslateCertificateResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *TranslateCertificateResponse
+		var err error
+		defer close(result)
+		response, err = client.TranslateCertificate(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// TranslateCertificateRequest is the request struct for api TranslateCertificate
+type TranslateCertificateRequest struct {
+	*requests.RpcRequest
+	SourceLanguage  string `position:"Body" name:"SourceLanguage"`
+	CertificateType string `position:"Body" name:"CertificateType"`
+	ResultType      string `position:"Body" name:"ResultType"`
+	ImageUrl        string `position:"Body" name:"ImageUrl"`
+	TargetLanguage  string `position:"Body" name:"TargetLanguage"`
+}
+
+// TranslateCertificateResponse is the response struct for api TranslateCertificate
+type TranslateCertificateResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+	Data      Data   `json:"Data" xml:"Data"`
+}
+
+// CreateTranslateCertificateRequest creates a request to invoke TranslateCertificate API
+func CreateTranslateCertificateRequest() (request *TranslateCertificateRequest) {
+	request = &TranslateCertificateRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("alimt", "2018-10-12", "TranslateCertificate", "alimtct", "openAPI")
+	return
+}
+
+// CreateTranslateCertificateResponse creates a response to parse from TranslateCertificate response
+func CreateTranslateCertificateResponse() (response *TranslateCertificateResponse) {
+	response = &TranslateCertificateResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 1 - 1
services/alimt/translate_e_commerce.go

@@ -97,7 +97,7 @@ func CreateTranslateECommerceRequest() (request *TranslateECommerceRequest) {
 	request = &TranslateECommerceRequest{
 		RpcRequest: &requests.RpcRequest{},
 	}
-	request.InitWithApiInfo("alimt", "2018-10-12", "TranslateECommerce", "alimt", "openAPI")
+	request.InitWithApiInfo("alimt", "2018-10-12", "TranslateECommerce", "alimtct", "openAPI")
 	return
 }
 

+ 1 - 1
services/alimt/translate_general.go

@@ -97,7 +97,7 @@ func CreateTranslateGeneralRequest() (request *TranslateGeneralRequest) {
 	request = &TranslateGeneralRequest{
 		RpcRequest: &requests.RpcRequest{},
 	}
-	request.InitWithApiInfo("alimt", "2018-10-12", "TranslateGeneral", "alimt", "openAPI")
+	request.InitWithApiInfo("alimt", "2018-10-12", "TranslateGeneral", "alimtct", "openAPI")
 	return
 }