Documentation ¶
Index ¶
- type Client
- func NewClient() (client *Client, err error)
- func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error)
- func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error)
- func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.Credential) (client *Client, err error)
- func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error)
- func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error)
- func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error)
- func (client *Client) TranslateECommerce(request *TranslateECommerceRequest) (response *TranslateECommerceResponse, err error)
- func (client *Client) TranslateECommerceWithCallback(request *TranslateECommerceRequest, ...) <-chan int
- func (client *Client) TranslateECommerceWithChan(request *TranslateECommerceRequest) (<-chan *TranslateECommerceResponse, <-chan error)
- func (client *Client) TranslateGeneral(request *TranslateGeneralRequest) (response *TranslateGeneralResponse, err error)
- func (client *Client) TranslateGeneralWithCallback(request *TranslateGeneralRequest, ...) <-chan int
- func (client *Client) TranslateGeneralWithChan(request *TranslateGeneralRequest) (<-chan *TranslateGeneralResponse, <-chan error)
- type Data
- type TranslateECommerceRequest
- type TranslateECommerceResponse
- type TranslateGeneralRequest
- type TranslateGeneralResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is the sdk client struct, each func corresponds to an OpenAPI
func NewClientWithAccessKey ¶
func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error)
NewClientWithAccessKey is a shortcut to create sdk client with accesskey usage: https://help.aliyun.com/document_detail/66217.html
func NewClientWithEcsRamRole ¶
NewClientWithEcsRamRole is a shortcut to create sdk client with ecs ram role usage: https://help.aliyun.com/document_detail/66223.html
func NewClientWithOptions ¶
func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.Credential) (client *Client, err error)
NewClientWithOptions creates a sdk client with regionId/sdkConfig/credential this is the common api to create a sdk client
func NewClientWithRamRoleArn ¶
func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error)
NewClientWithRamRoleArn is a shortcut to create sdk client with ram roleArn usage: https://help.aliyun.com/document_detail/66222.html
func NewClientWithRsaKeyPair ¶
func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error)
NewClientWithRsaKeyPair is a shortcut to create sdk client with rsa key pair attention: rsa key pair auth is only Japan regions available
func NewClientWithStsToken ¶
func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error)
NewClientWithStsToken is a shortcut to create sdk client with sts token usage: https://help.aliyun.com/document_detail/66222.html
func (*Client) TranslateECommerce ¶
func (client *Client) TranslateECommerce(request *TranslateECommerceRequest) (response *TranslateECommerceResponse, err error)
TranslateECommerce invokes the alimt.TranslateECommerce API synchronously api document: https://help.aliyun.com/api/alimt/translateecommerce.html
func (*Client) TranslateECommerceWithCallback ¶
func (client *Client) TranslateECommerceWithCallback(request *TranslateECommerceRequest, callback func(response *TranslateECommerceResponse, err error)) <-chan int
TranslateECommerceWithCallback invokes the alimt.TranslateECommerce API asynchronously api document: https://help.aliyun.com/api/alimt/translateecommerce.html asynchronous document: https://help.aliyun.com/document_detail/66220.html
func (*Client) TranslateECommerceWithChan ¶
func (client *Client) TranslateECommerceWithChan(request *TranslateECommerceRequest) (<-chan *TranslateECommerceResponse, <-chan error)
TranslateECommerceWithChan invokes the alimt.TranslateECommerce API asynchronously api document: https://help.aliyun.com/api/alimt/translateecommerce.html asynchronous document: https://help.aliyun.com/document_detail/66220.html
func (*Client) TranslateGeneral ¶
func (client *Client) TranslateGeneral(request *TranslateGeneralRequest) (response *TranslateGeneralResponse, err error)
TranslateGeneral invokes the alimt.TranslateGeneral API synchronously api document: https://help.aliyun.com/api/alimt/translategeneral.html
func (*Client) TranslateGeneralWithCallback ¶
func (client *Client) TranslateGeneralWithCallback(request *TranslateGeneralRequest, callback func(response *TranslateGeneralResponse, err error)) <-chan int
TranslateGeneralWithCallback invokes the alimt.TranslateGeneral API asynchronously api document: https://help.aliyun.com/api/alimt/translategeneral.html asynchronous document: https://help.aliyun.com/document_detail/66220.html
func (*Client) TranslateGeneralWithChan ¶
func (client *Client) TranslateGeneralWithChan(request *TranslateGeneralRequest) (<-chan *TranslateGeneralResponse, <-chan error)
TranslateGeneralWithChan invokes the alimt.TranslateGeneral API asynchronously api document: https://help.aliyun.com/api/alimt/translategeneral.html asynchronous document: https://help.aliyun.com/document_detail/66220.html
type Data ¶
type Data struct {
Translated string `json:"Translated" xml:"Translated"`
}
Data is a nested struct in alimt response
type TranslateECommerceRequest ¶
type TranslateECommerceRequest struct { *requests.RpcRequest 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"` }
TranslateECommerceRequest is the request struct for api TranslateECommerce
func CreateTranslateECommerceRequest ¶
func CreateTranslateECommerceRequest() (request *TranslateECommerceRequest)
CreateTranslateECommerceRequest creates a request to invoke TranslateECommerce API
type TranslateECommerceResponse ¶
type TranslateECommerceResponse 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"` }
TranslateECommerceResponse is the response struct for api TranslateECommerce
func CreateTranslateECommerceResponse ¶
func CreateTranslateECommerceResponse() (response *TranslateECommerceResponse)
CreateTranslateECommerceResponse creates a response to parse from TranslateECommerce response
type TranslateGeneralRequest ¶
type TranslateGeneralRequest struct { *requests.RpcRequest 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"` }
TranslateGeneralRequest is the request struct for api TranslateGeneral
func CreateTranslateGeneralRequest ¶
func CreateTranslateGeneralRequest() (request *TranslateGeneralRequest)
CreateTranslateGeneralRequest creates a request to invoke TranslateGeneral API
type TranslateGeneralResponse ¶
type TranslateGeneralResponse 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"` }
TranslateGeneralResponse is the response struct for api TranslateGeneral
func CreateTranslateGeneralResponse ¶
func CreateTranslateGeneralResponse() (response *TranslateGeneralResponse)
CreateTranslateGeneralResponse creates a response to parse from TranslateGeneral response