Browse Source

DYBASEAPI SDK Auto Released By pianzuo.zj,Version:1.40.1

Signed-off-by: yixiong.jxy <yixiong.jxy@alibaba-inc.com>
yixiong.jxy 7 years ago
parent
commit
827690103a

+ 4 - 0
ChangeLog.txt

@@ -1,3 +1,7 @@
+2018-11-20 Version: 1.40.1
+1, Add MNS STS Token Query API
+2, Add MNS Minimal Package
+
 2018-11-19 Version: 1.40.0
 1, Add field BargainSellerPrice and BargainSellerMobile
 

+ 81 - 0
services/dybaseapi/client.go

@@ -0,0 +1,81 @@
+package dybaseapi
+
+//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"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
+)
+
+// Client is the sdk client struct, each func corresponds to an OpenAPI
+type Client struct {
+	sdk.Client
+}
+
+// NewClient creates a sdk client with environment variables
+func NewClient() (client *Client, err error) {
+	client = &Client{}
+	err = client.Init()
+	return
+}
+
+// NewClientWithOptions creates a sdk client with regionId/sdkConfig/credential
+// this is the common api to create a sdk client
+func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.Credential) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithOptions(regionId, config, credential)
+	return
+}
+
+// NewClientWithAccessKey is a shortcut to create sdk client with accesskey
+// usage: https://help.aliyun.com/document_detail/66217.html
+func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithAccessKey(regionId, accessKeyId, accessKeySecret)
+	return
+}
+
+// NewClientWithStsToken is a shortcut to create sdk client with sts token
+// usage: https://help.aliyun.com/document_detail/66222.html
+func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken)
+	return
+}
+
+// NewClientWithRamRoleArn is a shortcut to create sdk client with ram roleArn
+// usage: https://help.aliyun.com/document_detail/66222.html
+func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName)
+	return
+}
+
+// NewClientWithEcsRamRole is a shortcut to create sdk client with ecs ram role
+// usage: https://help.aliyun.com/document_detail/66223.html
+func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithEcsRamRole(regionId, roleName)
+	return
+}
+
+// NewClientWithRsaKeyPair is a shortcut to create sdk client with rsa key pair
+// attention: rsa key pair auth is only Japan regions available
+func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithRsaKeyPair(regionId, publicKeyId, privateKey, sessionExpiration)
+	return
+}

+ 74 - 0
services/dybaseapi/mns/batch_delete_message.go

@@ -0,0 +1,74 @@
+package mns
+
+//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.
+
+import (
+	"encoding/xml"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+
+func (client *Queue) BatchDeleteMessage(request *BatchDeleteMessageRequest) (response *BatchDeleteMessageResponse, err error) {
+	response = CreateBatchDeleteMessageResponse()
+	err = client.DoActionWithSigner(request, response)
+	return
+}
+
+type BatchDeleteMessageRequest struct {
+	*requests.RoaRequest
+	QueueName		string 			`position:"Path" name:"QueueName"`
+}
+
+type BatchDeleteMessageResponse struct {
+	*responses.BaseResponse
+	RequestId       string          `json:"RequestId" xml:"RequestId"`
+	Code            string          `json:"Code" xml:"Code"`
+}
+
+type ReceiptHandles struct {
+	XMLName xml.Name 				`xml:"ReceiptHandles"`
+	Xmlns 	string   				`xml:"xmlns,attr"`
+	Handles []string				`xml:"ReceiptHandle"`
+}
+
+func (request *BatchDeleteMessageRequest) SetReceiptHandles(receiptHandles []string) {
+	receiptHandlesObj := &ReceiptHandles{
+		Xmlns: "http://mns.aliyuncs.com/doc/v1/",
+		Handles: receiptHandles,
+	}
+	content, err := xml.Marshal(receiptHandlesObj)
+	if err != nil {
+		panic(err)
+	}
+	request.SetContent([]byte(xml.Header + string(content)))
+}
+
+func CreateBatchDeleteMessageRequest() (request *BatchDeleteMessageRequest) {
+	request = &BatchDeleteMessageRequest{
+		RoaRequest: &requests.RoaRequest{
+		},
+	}
+	request.InitWithApiInfo("MNS", "2015-06-06","BatchDeleteMessage","/queues/[QueueName]/messages", "", "")
+	request.Method = "DELETE"
+	request.Headers["x-mns-version"] = "2015-06-06"
+	request.AcceptFormat = "XML"
+	return
+}
+
+func CreateBatchDeleteMessageResponse() (response *BatchDeleteMessageResponse) {
+	response = &BatchDeleteMessageResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 57 - 0
services/dybaseapi/mns/batch_receive_message.go

@@ -0,0 +1,57 @@
+package mns
+
+//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.
+
+import (
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+)
+
+
+func (client *Queue) BatchReceiveMessage(request *BatchReceiveMessageRequest) (response *BatchReceiveMessageResponse, err error) {
+	response = CreateBatchReceiveMessageResponse()
+	err = client.DoActionWithSigner(request, response)
+	return
+}
+
+type BatchReceiveMessageRequest struct {
+	*requests.RoaRequest
+	QueueName			string 			 `position:"Path" name:"QueueName"`
+	NumOfMessages		requests.Integer `position:"Query" name:"NumOfMessages"`
+	WaitSeconds			requests.Integer `position:"Query" name:"WaitSeconds"`
+}
+
+type BatchReceiveMessageResponse struct {
+	*responses.BaseResponse
+	RequestId       	string          `json:"RequestId" xml:"RequestId"`
+	Code            	string          `json:"Code" xml:"Code"`
+	Message         	[]Message 		`json:"Message" xml:"Message"`
+}
+
+func CreateBatchReceiveMessageRequest() (request *BatchReceiveMessageRequest) {
+	request = &BatchReceiveMessageRequest{
+		RoaRequest: &requests.RoaRequest{},
+	}
+	request.InitWithApiInfo("MNS", "2015-06-06","BatchReceiveMessage","/queues/[QueueName]/messages", "", "")
+	request.Method = "GET"
+	request.Headers["x-mns-version"] = "2015-06-06"
+	request.AcceptFormat = "XML"
+	return
+}
+
+func CreateBatchReceiveMessageResponse() (response *BatchReceiveMessageResponse) {
+	response = &BatchReceiveMessageResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 110 - 0
services/dybaseapi/mns/mns_roa_signature_composer.go

@@ -0,0 +1,110 @@
+package mns
+
+import (
+	"bytes"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils"
+	"sort"
+	"strings"
+)
+
+/*
+ * 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.
+ */
+
+
+func signMnsRoaRequest(request requests.AcsRequest, signer auth.Signer) (err error) {
+	completeROASignParams(request, signer)
+	stringToSign := buildRoaStringToSign(request)
+	request.SetStringToSign(stringToSign)
+	signature := signer.Sign(stringToSign, "")
+	accessKeyId, err := signer.GetAccessKeyId()
+	if err != nil {
+		return nil
+	}
+
+	request.GetHeaders()["Authorization"] = "MNS " + accessKeyId + ":" + signature
+
+	return
+}
+
+func completeROASignParams(request requests.AcsRequest, signer auth.Signer) {
+	headerParams := request.GetHeaders()
+
+	// complete query params
+	queryParams := request.GetQueryParams()
+	if extraParam := signer.GetExtraParam(); extraParam != nil {
+		for key, value := range extraParam {
+			if key == "SecurityToken" {
+				headerParams["security-token"] = value
+				continue
+			}
+
+			queryParams[key] = value
+		}
+	}
+
+	// complete header params
+	headerParams["Date"] = utils.GetTimeInFormatRFC2616()
+	if request.GetFormParams() != nil && len(request.GetFormParams()) > 0 {
+		formString := utils.GetUrlFormedMap(request.GetFormParams())
+		request.SetContent([]byte(formString))
+		headerParams["Content-Type"] = requests.Form
+	}
+	contentMD5 := utils.GetMD5Base64(request.GetContent())
+	headerParams["Content-MD5"] = contentMD5
+	if _, contains := headerParams["Content-Type"]; !contains {
+		headerParams["Content-Type"] = "text/xml"
+	}
+}
+
+func buildRoaStringToSign(request requests.AcsRequest) (stringToSign string) {
+
+	headers := request.GetHeaders()
+
+	stringToSignBuilder := bytes.Buffer{}
+	stringToSignBuilder.WriteString(request.GetMethod())
+	stringToSignBuilder.WriteString(requests.HeaderSeparator)
+
+	// append header keys for sign
+	appendIfContain(headers, &stringToSignBuilder, "Content-MD5", requests.HeaderSeparator)
+	appendIfContain(headers, &stringToSignBuilder, "Content-Type", requests.HeaderSeparator)
+	appendIfContain(headers, &stringToSignBuilder, "Date", requests.HeaderSeparator)
+
+	// sort and append headers witch starts with 'x-mns-'
+	var acsHeaders []string
+	for key := range headers {
+		if strings.HasPrefix(key, "x-mns-") {
+			acsHeaders = append(acsHeaders, key)
+		}
+	}
+	sort.Strings(acsHeaders)
+	for _, key := range acsHeaders {
+		stringToSignBuilder.WriteString(key + ":" + headers[key])
+		stringToSignBuilder.WriteString(requests.HeaderSeparator)
+	}
+
+	// append query params
+	stringToSignBuilder.WriteString(request.BuildQueries())
+	stringToSign = stringToSignBuilder.String()
+	return
+}
+
+func appendIfContain(sourceMap map[string]string, target *bytes.Buffer, key, separator string) {
+	if value, contain := sourceMap[key]; contain && len(value) > 0 {
+		target.WriteString(sourceMap[key])
+		target.WriteString(separator)
+	}
+}
+

+ 165 - 0
services/dybaseapi/mns/queue.go

@@ -0,0 +1,165 @@
+package mns
+
+import (
+	"fmt"
+	"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"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
+	"net/http"
+	"strconv"
+)
+
+type Queue struct {
+	credential *credentials.StsTokenCredential
+	httpClient *http.Client
+	isRunning bool
+	config *sdk.Config
+	signer auth.Signer
+}
+
+func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (queue *Queue, err error) {
+	queue = &Queue{}
+	err = queue.InitWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken)
+	return
+}
+
+
+func (queue *Queue) InitWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (err error) {
+	credential := &credentials.StsTokenCredential{
+		AccessKeyId:       stsAccessKeyId,
+		AccessKeySecret:   stsAccessKeySecret,
+		AccessKeyStsToken: stsToken,
+	}
+	queue.signer = signers.NewStsTokenSigner(credential)
+	config := queue.InitClientConfig()
+	return queue.InitWithOptions(config, credential)
+}
+
+func (queue *Queue) InitClientConfig() (config *sdk.Config) {
+	if queue.config != nil {
+		return queue.config
+	} else {
+		return sdk.NewConfig()
+	}
+}
+
+
+func (queue *Queue) InitWithOptions(config *sdk.Config, credential auth.Credential) (err error) {
+	queue.isRunning = true
+	queue.config = config
+	if err != nil {
+		return
+	}
+	queue.httpClient = &http.Client{}
+
+	if config.HttpTransport != nil {
+		queue.httpClient.Transport = config.HttpTransport
+	}
+
+	if config.Timeout > 0 {
+		queue.httpClient.Timeout = config.Timeout
+	}
+
+	return
+}
+
+
+func (queue *Queue) DoActionWithSigner(request requests.AcsRequest, response responses.AcsResponse) (err error) {
+
+	// add clientVersion
+	request.GetHeaders()["x-sdk-core-version"] = sdk.Version
+
+	if request.GetScheme() == "" {
+		request.SetScheme("HTTP")
+	}
+	// init request params
+	err = requests.InitParams(request)
+	if err != nil {
+		return
+	}
+	// signature
+
+
+	httpRequest, err := buildHttpRequest(request, queue.signer)
+	if err != nil {
+		return
+	}
+	if queue.config.UserAgent != "" {
+		httpRequest.Header.Set("User-Agent", queue.config.UserAgent)
+	}
+	var httpResponse *http.Response
+	for retryTimes := 0; retryTimes <= queue.config.MaxRetryTime; retryTimes++ {
+		httpResponse, err = queue.httpClient.Do(httpRequest)
+
+		//var timeout bool
+		// receive error
+		if err != nil {
+			if !queue.config.AutoRetry {
+				return
+				//} else if timeout = isTimeout(err); !timeout {
+				//	// if not timeout error, return
+				//	return
+			} else if retryTimes >= queue.config.MaxRetryTime {
+				// timeout but reached the max retry times, return
+				timeoutErrorMsg := fmt.Sprintf(errors.TimeoutErrorMessage, strconv.Itoa(retryTimes+1), strconv.Itoa(retryTimes+1))
+				err = errors.NewClientError(errors.TimeoutErrorCode, timeoutErrorMsg, err)
+				return
+			}
+		}
+		//  if status code >= 500 or timeout, will trigger retry
+		if queue.config.AutoRetry && (err != nil || isServerError(httpResponse)) {
+			// rewrite signatureNonce and signature
+			httpRequest, err = buildHttpRequest(request, queue.signer)
+			if err != nil {
+				return
+			}
+			continue
+		}
+		break
+	}
+	err = responses.Unmarshal(response, httpResponse, request.GetAcceptFormat())
+	// wrap server errors
+	if serverErr, ok := err.(*errors.ServerError); ok {
+		var wrapInfo = map[string]string{}
+		wrapInfo["StringToSign"] = request.GetStringToSign()
+		err = errors.WrapServerError(serverErr, wrapInfo)
+	}
+	return
+}
+
+
+func isServerError(httpResponse *http.Response) bool {
+	return httpResponse.StatusCode >= http.StatusInternalServerError
+}
+
+func buildHttpRequest(request requests.AcsRequest, singer auth.Signer) (httpRequest *http.Request, err error) {
+	err = signMnsRoaRequest(request, singer)
+
+	if err != nil {
+		return
+	}
+	requestMethod := request.GetMethod()
+	requestUrl := request.BuildUrl()
+	body := request.GetBodyReader()
+	httpRequest, err = http.NewRequest(requestMethod, requestUrl, body)
+	if err != nil {
+		return
+	}
+	for key, value := range request.GetHeaders() {
+		httpRequest.Header[key] = []string{value}
+	}
+	// host is a special case
+	if host, containsHost := request.GetHeaders()["Host"]; containsHost {
+		httpRequest.Host = host
+	}
+	return
+}
+
+func (queue *Queue) Shutdown() {
+	queue.signer.Shutdown()
+	queue.isRunning = false
+}

+ 13 - 0
services/dybaseapi/mns/struct_message.go

@@ -0,0 +1,13 @@
+package mns
+
+type Message struct {
+	MessageId string 		`json:"MessageId" xml:"MessageId"`
+	MessageBodyMD5 string 	`json:"MessageBodyMD5" xml:"MessageBodyMD5"`
+	MessageBody string 		`json:"MessageBody" xml:"MessageBody"`
+	ReceiptHandle string 	`json:"ReceiptHandle" xml:"ReceiptHandle"`
+	EnqueueTime int 		`json:"EnqueueTime" xml:"EnqueueTime"`
+	FirstDequeueTime int 	`json:"FirstDequeueTime" xml:"FirstDequeueTime"`
+	NextVisibleTime int 	`json:"NextVisibleTime" xml:"NextVisibleTime"`
+	DequeueCount int 		`json:"DequeueCount" xml:"DequeueCount"`
+	Priority int 			`json:"Priority" xml:"Priority"`
+}

+ 110 - 0
services/dybaseapi/query_token_for_mns_queue.go

@@ -0,0 +1,110 @@
+package dybaseapi
+
+//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"
+)
+
+// QueryTokenForMnsQueue invokes the dybaseapi.QueryTokenForMnsQueue API synchronously
+// api document: https://help.aliyun.com/api/dybaseapi/querytokenformnsqueue.html
+func (client *Client) QueryTokenForMnsQueue(request *QueryTokenForMnsQueueRequest) (response *QueryTokenForMnsQueueResponse, err error) {
+	response = CreateQueryTokenForMnsQueueResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// QueryTokenForMnsQueueWithChan invokes the dybaseapi.QueryTokenForMnsQueue API asynchronously
+// api document: https://help.aliyun.com/api/dybaseapi/querytokenformnsqueue.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) QueryTokenForMnsQueueWithChan(request *QueryTokenForMnsQueueRequest) (<-chan *QueryTokenForMnsQueueResponse, <-chan error) {
+	responseChan := make(chan *QueryTokenForMnsQueueResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.QueryTokenForMnsQueue(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// QueryTokenForMnsQueueWithCallback invokes the dybaseapi.QueryTokenForMnsQueue API asynchronously
+// api document: https://help.aliyun.com/api/dybaseapi/querytokenformnsqueue.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) QueryTokenForMnsQueueWithCallback(request *QueryTokenForMnsQueueRequest, callback func(response *QueryTokenForMnsQueueResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *QueryTokenForMnsQueueResponse
+		var err error
+		defer close(result)
+		response, err = client.QueryTokenForMnsQueue(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// QueryTokenForMnsQueueRequest is the request struct for api QueryTokenForMnsQueue
+type QueryTokenForMnsQueueRequest struct {
+	*requests.RpcRequest
+	QueueName            string           `position:"Query" name:"QueueName"`
+	ResourceOwnerId      requests.Integer `position:"Query" name:"ResourceOwnerId"`
+	ResourceOwnerAccount string           `position:"Query" name:"ResourceOwnerAccount"`
+	MessageType          string           `position:"Query" name:"MessageType"`
+	OwnerId              requests.Integer `position:"Query" name:"OwnerId"`
+}
+
+// QueryTokenForMnsQueueResponse is the response struct for api QueryTokenForMnsQueue
+type QueryTokenForMnsQueueResponse struct {
+	*responses.BaseResponse
+	RequestId       string          `json:"RequestId" xml:"RequestId"`
+	Code            string          `json:"Code" xml:"Code"`
+	Message         string          `json:"Message" xml:"Message"`
+	MessageTokenDTO MessageTokenDTO `json:"MessageTokenDTO" xml:"MessageTokenDTO"`
+}
+
+// CreateQueryTokenForMnsQueueRequest creates a request to invoke QueryTokenForMnsQueue API
+func CreateQueryTokenForMnsQueueRequest() (request *QueryTokenForMnsQueueRequest) {
+	request = &QueryTokenForMnsQueueRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Dybaseapi", "2017-05-25", "QueryTokenForMnsQueue", "dybaseapi", "openAPI")
+	return
+}
+
+// CreateQueryTokenForMnsQueueResponse creates a response to parse from QueryTokenForMnsQueue response
+func CreateQueryTokenForMnsQueueResponse() (response *QueryTokenForMnsQueueResponse) {
+	response = &QueryTokenForMnsQueueResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 25 - 0
services/dybaseapi/struct_message_token_dto.go

@@ -0,0 +1,25 @@
+package dybaseapi
+
+//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.
+
+// MessageTokenDTO is a nested struct in dybaseapi response
+type MessageTokenDTO struct {
+	AccessKeyId     string `json:"AccessKeyId" xml:"AccessKeyId"`
+	AccessKeySecret string `json:"AccessKeySecret" xml:"AccessKeySecret"`
+	SecurityToken   string `json:"SecurityToken" xml:"SecurityToken"`
+	CreateTime      string `json:"CreateTime" xml:"CreateTime"`
+	ExpireTime      string `json:"ExpireTime" xml:"ExpireTime"`
+}