Browse Source

Generated 2018-10-12 for alimt.

sdk-team 5 years ago
parent
commit
1acefd8ca7

+ 4 - 0
ChangeLog.txt

@@ -1,3 +1,7 @@
+2020-02-28 Version: v1.61.14
+- Generated 2018-10-12 for `alimt`.
+- Add translate api.
+
 2020-02-27 Version: v1.61.13
 - Generated 2018-07-13 for `Ft`.
 - Release Ft SDK.

+ 53 - 5
services/alimt/client.go

@@ -16,8 +16,11 @@ package alimt
 // Changes may cause incorrect behavior and will be lost if the code is regenerated.
 
 import (
+	"reflect"
+
 	"github.com/aliyun/alibaba-cloud-sdk-go/sdk"
 	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider"
 )
 
 // Client is the sdk client struct, each func corresponds to an OpenAPI
@@ -25,10 +28,40 @@ type Client struct {
 	sdk.Client
 }
 
+// SetClientProperty Set Property by Reflect
+func SetClientProperty(client *Client, propertyName string, propertyValue interface{}) {
+	v := reflect.ValueOf(client).Elem()
+	if v.FieldByName(propertyName).IsValid() && v.FieldByName(propertyName).CanSet() {
+		v.FieldByName(propertyName).Set(reflect.ValueOf(propertyValue))
+	}
+}
+
+// SetEndpointDataToClient Set EndpointMap and ENdpointType
+func SetEndpointDataToClient(client *Client) {
+	SetClientProperty(client, "EndpointMap", GetEndpointMap())
+	SetClientProperty(client, "EndpointType", GetEndpointType())
+}
+
 // NewClient creates a sdk client with environment variables
 func NewClient() (client *Client, err error) {
 	client = &Client{}
 	err = client.Init()
+	SetEndpointDataToClient(client)
+	return
+}
+
+// NewClientWithProvider creates a sdk client with providers
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
+func NewClientWithProvider(regionId string, providers ...provider.Provider) (client *Client, err error) {
+	client = &Client{}
+	var pc provider.Provider
+	if len(providers) == 0 {
+		pc = provider.DefaultChain
+	} else {
+		pc = provider.NewProviderChain(providers)
+	}
+	err = client.InitWithProviderChain(regionId, pc)
+	SetEndpointDataToClient(client)
 	return
 }
 
@@ -37,45 +70,60 @@ func NewClient() (client *Client, err error) {
 func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.Credential) (client *Client, err error) {
 	client = &Client{}
 	err = client.InitWithOptions(regionId, config, credential)
+	SetEndpointDataToClient(client)
 	return
 }
 
 // NewClientWithAccessKey is a shortcut to create sdk client with accesskey
-// usage: https://help.aliyun.com/document_detail/66217.html
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
 func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error) {
 	client = &Client{}
 	err = client.InitWithAccessKey(regionId, accessKeyId, accessKeySecret)
+	SetEndpointDataToClient(client)
 	return
 }
 
 // NewClientWithStsToken is a shortcut to create sdk client with sts token
-// usage: https://help.aliyun.com/document_detail/66222.html
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
 func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error) {
 	client = &Client{}
 	err = client.InitWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken)
+	SetEndpointDataToClient(client)
 	return
 }
 
 // NewClientWithRamRoleArn is a shortcut to create sdk client with ram roleArn
-// usage: https://help.aliyun.com/document_detail/66222.html
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
 func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) {
 	client = &Client{}
 	err = client.InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName)
+	SetEndpointDataToClient(client)
+	return
+}
+
+// NewClientWithRamRoleArn is a shortcut to create sdk client with ram roleArn and policy
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
+func NewClientWithRamRoleArnAndPolicy(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithRamRoleArnAndPolicy(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy)
+	SetEndpointDataToClient(client)
 	return
 }
 
 // NewClientWithEcsRamRole is a shortcut to create sdk client with ecs ram role
-// usage: https://help.aliyun.com/document_detail/66223.html
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
 func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error) {
 	client = &Client{}
 	err = client.InitWithEcsRamRole(regionId, roleName)
+	SetEndpointDataToClient(client)
 	return
 }
 
 // NewClientWithRsaKeyPair is a shortcut to create sdk client with rsa key pair
-// attention: rsa key pair auth is only Japan regions available
+// usage: https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md
 func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error) {
 	client = &Client{}
 	err = client.InitWithRsaKeyPair(regionId, publicKeyId, privateKey, sessionExpiration)
+	SetEndpointDataToClient(client)
 	return
 }

+ 110 - 0
services/alimt/create_doc_translate_task.go

@@ -0,0 +1,110 @@
+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"
+)
+
+// CreateDocTranslateTask invokes the alimt.CreateDocTranslateTask API synchronously
+// api document: https://help.aliyun.com/api/alimt/createdoctranslatetask.html
+func (client *Client) CreateDocTranslateTask(request *CreateDocTranslateTaskRequest) (response *CreateDocTranslateTaskResponse, err error) {
+	response = CreateCreateDocTranslateTaskResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// CreateDocTranslateTaskWithChan invokes the alimt.CreateDocTranslateTask API asynchronously
+// api document: https://help.aliyun.com/api/alimt/createdoctranslatetask.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) CreateDocTranslateTaskWithChan(request *CreateDocTranslateTaskRequest) (<-chan *CreateDocTranslateTaskResponse, <-chan error) {
+	responseChan := make(chan *CreateDocTranslateTaskResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.CreateDocTranslateTask(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// CreateDocTranslateTaskWithCallback invokes the alimt.CreateDocTranslateTask API asynchronously
+// api document: https://help.aliyun.com/api/alimt/createdoctranslatetask.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) CreateDocTranslateTaskWithCallback(request *CreateDocTranslateTaskRequest, callback func(response *CreateDocTranslateTaskResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *CreateDocTranslateTaskResponse
+		var err error
+		defer close(result)
+		response, err = client.CreateDocTranslateTask(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// CreateDocTranslateTaskRequest is the request struct for api CreateDocTranslateTask
+type CreateDocTranslateTaskRequest struct {
+	*requests.RpcRequest
+	SourceLanguage string `position:"Body" name:"SourceLanguage"`
+	ClientToken    string `position:"Body" name:"ClientToken"`
+	Scene          string `position:"Body" name:"Scene"`
+	FileUrl        string `position:"Body" name:"FileUrl"`
+	TargetLanguage string `position:"Body" name:"TargetLanguage"`
+	CallbackUrl    string `position:"Body" name:"CallbackUrl"`
+}
+
+// CreateDocTranslateTaskResponse is the response struct for api CreateDocTranslateTask
+type CreateDocTranslateTaskResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+	TaskId    string `json:"TaskId" xml:"TaskId"`
+	Status    string `json:"Status" xml:"Status"`
+}
+
+// CreateCreateDocTranslateTaskRequest creates a request to invoke CreateDocTranslateTask API
+func CreateCreateDocTranslateTaskRequest() (request *CreateDocTranslateTaskRequest) {
+	request = &CreateDocTranslateTaskRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("alimt", "2018-10-12", "CreateDocTranslateTask", "alimt", "openAPI")
+	return
+}
+
+// CreateCreateDocTranslateTaskResponse creates a response to parse from CreateDocTranslateTask response
+func CreateCreateDocTranslateTaskResponse() (response *CreateDocTranslateTaskResponse) {
+	response = &CreateDocTranslateTaskResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 75 - 0
services/alimt/endpoint.go

@@ -0,0 +1,75 @@
+package alimt
+
+// EndpointMap Endpoint Data
+var EndpointMap map[string]string
+
+// EndpointType regional or central
+var EndpointType = "regional"
+
+// GetEndpointMap Get Endpoint Data Map
+func GetEndpointMap() map[string]string {
+	if EndpointMap == nil {
+		EndpointMap = map[string]string{
+			"cn-shanghai-internal-test-1": "mt.aliyuncs.com",
+			"cn-shenzhen-su18-b01":        "mt.aliyuncs.com",
+			"cn-beijing":                  "mt.aliyuncs.com",
+			"cn-shanghai-inner":           "mt.aliyuncs.com",
+			"cn-hangzhou-internal-prod-1": "mt.aliyuncs.com",
+			"cn-north-2-gov-1":            "mt.aliyuncs.com",
+			"cn-yushanfang":               "mt.aliyuncs.com",
+			"cn-qingdao-nebula":           "mt.aliyuncs.com",
+			"cn-beijing-finance-pop":      "mt.aliyuncs.com",
+			"cn-wuhan":                    "mt.aliyuncs.com",
+			"cn-zhangjiakou":              "mt.aliyuncs.com",
+			"us-west-1":                   "mt.aliyuncs.com",
+			"rus-west-1-pop":              "mt.aliyuncs.com",
+			"cn-shanghai-et15-b01":        "mt.aliyuncs.com",
+			"cn-hangzhou-bj-b01":          "mt.aliyuncs.com",
+			"cn-zhangbei-na61-b01":        "mt.aliyuncs.com",
+			"ap-northeast-1":              "mt.aliyuncs.com",
+			"cn-shanghai-et2-b01":         "mt.aliyuncs.com",
+			"ap-southeast-1":              "mt.ap-southeast-1.aliyuncs.com",
+			"ap-southeast-2":              "mt.aliyuncs.com",
+			"ap-southeast-3":              "mt.aliyuncs.com",
+			"ap-southeast-5":              "mt.aliyuncs.com",
+			"us-east-1":                   "mt.aliyuncs.com",
+			"cn-shenzhen-inner":           "mt.aliyuncs.com",
+			"cn-zhangjiakou-na62-a01":     "mt.aliyuncs.com",
+			"cn-beijing-gov-1":            "mt.aliyuncs.com",
+			"ap-south-1":                  "mt.aliyuncs.com",
+			"cn-shenzhen-st4-d01":         "mt.aliyuncs.com",
+			"cn-haidian-cm12-c01":         "mt.aliyuncs.com",
+			"cn-qingdao":                  "mt.aliyuncs.com",
+			"cn-hongkong-finance-pop":     "mt.aliyuncs.com",
+			"cn-shanghai":                 "mt.aliyuncs.com",
+			"cn-shanghai-finance-1":       "mt.aliyuncs.com",
+			"cn-hongkong":                 "mt.aliyuncs.com",
+			"eu-central-1":                "mt.aliyuncs.com",
+			"cn-shenzhen":                 "mt.aliyuncs.com",
+			"cn-zhengzhou-nebula-1":       "mt.aliyuncs.com",
+			"eu-west-1":                   "mt.aliyuncs.com",
+			"cn-hangzhou-internal-test-1": "mt.aliyuncs.com",
+			"eu-west-1-oxs":               "mt.aliyuncs.com",
+			"cn-beijing-finance-1":        "mt.aliyuncs.com",
+			"cn-hangzhou-internal-test-3": "mt.aliyuncs.com",
+			"cn-hangzhou-internal-test-2": "mt.aliyuncs.com",
+			"cn-shenzhen-finance-1":       "mt.aliyuncs.com",
+			"me-east-1":                   "mt.aliyuncs.com",
+			"cn-chengdu":                  "mt.aliyuncs.com",
+			"cn-hangzhou-test-306":        "mt.aliyuncs.com",
+			"cn-hangzhou-finance":         "mt.aliyuncs.com",
+			"cn-beijing-nu16-b01":         "mt.aliyuncs.com",
+			"cn-edge-1":                   "mt.aliyuncs.com",
+			"cn-huhehaote":                "mt.aliyuncs.com",
+			"cn-fujian":                   "mt.aliyuncs.com",
+			"ap-northeast-2-pop":          "mt.aliyuncs.com",
+			"cn-hangzhou":                 "mt.cn-hangzhou.aliyuncs.com",
+		}
+	}
+	return EndpointMap
+}
+
+// GetEndpointType Get Endpoint Type Value
+func GetEndpointType() string {
+	return EndpointType
+}

+ 106 - 0
services/alimt/get_doc_translate_task.go

@@ -0,0 +1,106 @@
+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"
+)
+
+// GetDocTranslateTask invokes the alimt.GetDocTranslateTask API synchronously
+// api document: https://help.aliyun.com/api/alimt/getdoctranslatetask.html
+func (client *Client) GetDocTranslateTask(request *GetDocTranslateTaskRequest) (response *GetDocTranslateTaskResponse, err error) {
+	response = CreateGetDocTranslateTaskResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// GetDocTranslateTaskWithChan invokes the alimt.GetDocTranslateTask API asynchronously
+// api document: https://help.aliyun.com/api/alimt/getdoctranslatetask.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) GetDocTranslateTaskWithChan(request *GetDocTranslateTaskRequest) (<-chan *GetDocTranslateTaskResponse, <-chan error) {
+	responseChan := make(chan *GetDocTranslateTaskResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.GetDocTranslateTask(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// GetDocTranslateTaskWithCallback invokes the alimt.GetDocTranslateTask API asynchronously
+// api document: https://help.aliyun.com/api/alimt/getdoctranslatetask.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) GetDocTranslateTaskWithCallback(request *GetDocTranslateTaskRequest, callback func(response *GetDocTranslateTaskResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *GetDocTranslateTaskResponse
+		var err error
+		defer close(result)
+		response, err = client.GetDocTranslateTask(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// GetDocTranslateTaskRequest is the request struct for api GetDocTranslateTask
+type GetDocTranslateTaskRequest struct {
+	*requests.RpcRequest
+	TaskId string `position:"Query" name:"TaskId"`
+}
+
+// GetDocTranslateTaskResponse is the response struct for api GetDocTranslateTask
+type GetDocTranslateTaskResponse struct {
+	*responses.BaseResponse
+	RequestId        string `json:"RequestId" xml:"RequestId"`
+	TaskId           string `json:"TaskId" xml:"TaskId"`
+	Status           string `json:"Status" xml:"Status"`
+	TranslateFileUrl string `json:"TranslateFileUrl" xml:"TranslateFileUrl"`
+}
+
+// CreateGetDocTranslateTaskRequest creates a request to invoke GetDocTranslateTask API
+func CreateGetDocTranslateTaskRequest() (request *GetDocTranslateTaskRequest) {
+	request = &GetDocTranslateTaskRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("alimt", "2018-10-12", "GetDocTranslateTask", "alimt", "openAPI")
+	return
+}
+
+// CreateGetDocTranslateTaskResponse creates a response to parse from GetDocTranslateTask response
+func CreateGetDocTranslateTaskResponse() (response *GetDocTranslateTaskResponse) {
+	response = &GetDocTranslateTaskResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 110 - 0
services/alimt/translate.go

@@ -0,0 +1,110 @@
+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"
+)
+
+// Translate invokes the alimt.Translate API synchronously
+// api document: https://help.aliyun.com/api/alimt/translate.html
+func (client *Client) Translate(request *TranslateRequest) (response *TranslateResponse, err error) {
+	response = CreateTranslateResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// TranslateWithChan invokes the alimt.Translate API asynchronously
+// api document: https://help.aliyun.com/api/alimt/translate.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) TranslateWithChan(request *TranslateRequest) (<-chan *TranslateResponse, <-chan error) {
+	responseChan := make(chan *TranslateResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.Translate(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// TranslateWithCallback invokes the alimt.Translate API asynchronously
+// api document: https://help.aliyun.com/api/alimt/translate.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) TranslateWithCallback(request *TranslateRequest, callback func(response *TranslateResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *TranslateResponse
+		var err error
+		defer close(result)
+		response, err = client.Translate(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// TranslateRequest is the request struct for api Translate
+type TranslateRequest struct {
+	*requests.RpcRequest
+	SourceLanguage string `position:"Body" name:"SourceLanguage"`
+	SourceText     string `position:"Body" name:"SourceText"`
+	FormatType     string `position:"Body" name:"FormatType"`
+	Scene          string `position:"Body" name:"Scene"`
+	TargetLanguage string `position:"Body" name:"TargetLanguage"`
+}
+
+// TranslateResponse is the response struct for api Translate
+type TranslateResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+	Code      int    `json:"Code" xml:"Code"`
+	Message   string `json:"Message" xml:"Message"`
+	Data      Data   `json:"Data" xml:"Data"`
+}
+
+// CreateTranslateRequest creates a request to invoke Translate API
+func CreateTranslateRequest() (request *TranslateRequest) {
+	request = &TranslateRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("alimt", "2018-10-12", "Translate", "alimt", "openAPI")
+	return
+}
+
+// CreateTranslateResponse creates a response to parse from Translate response
+func CreateTranslateResponse() (response *TranslateResponse) {
+	response = &TranslateResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 1 - 1
services/alimt/translate_e_commerce.go

@@ -79,8 +79,8 @@ type TranslateECommerceRequest struct {
 	SourceLanguage string `position:"Body" name:"SourceLanguage"`
 	SourceText     string `position:"Body" name:"SourceText"`
 	FormatType     string `position:"Body" name:"FormatType"`
-	TargetLanguage string `position:"Body" name:"TargetLanguage"`
 	Scene          string `position:"Body" name:"Scene"`
+	TargetLanguage string `position:"Body" name:"TargetLanguage"`
 }
 
 // TranslateECommerceResponse is the response struct for api TranslateECommerce

+ 1 - 1
services/alimt/translate_general.go

@@ -79,8 +79,8 @@ type TranslateGeneralRequest struct {
 	SourceLanguage string `position:"Body" name:"SourceLanguage"`
 	SourceText     string `position:"Body" name:"SourceText"`
 	FormatType     string `position:"Body" name:"FormatType"`
-	TargetLanguage string `position:"Body" name:"TargetLanguage"`
 	Scene          string `position:"Body" name:"Scene"`
+	TargetLanguage string `position:"Body" name:"TargetLanguage"`
 }
 
 // TranslateGeneralResponse is the response struct for api TranslateGeneral