alimt

package
v0.0.0-...-bbc24d0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	sdk.Client
}

Client is the sdk client struct, each func corresponds to an OpenAPI

func NewClient

func NewClient() (client *Client, err error)

NewClient creates a sdk client with environment variables

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

func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL