batch_receive_message.go 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package mns
  2. //Licensed under the Apache License, Version 2.0 (the "License");
  3. //you may not use this file except in compliance with the License.
  4. //You may obtain a copy of the License at
  5. //
  6. //http://www.apache.org/licenses/LICENSE-2.0
  7. //
  8. //Unless required by applicable law or agreed to in writing, software
  9. //distributed under the License is distributed on an "AS IS" BASIS,
  10. //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. //See the License for the specific language governing permissions and
  12. //limitations under the License.
  13. import (
  14. "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
  15. "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
  16. )
  17. func (client *Queue) BatchReceiveMessage(request *BatchReceiveMessageRequest) (response *BatchReceiveMessageResponse, err error) {
  18. response = CreateBatchReceiveMessageResponse()
  19. err = client.DoActionWithSigner(request, response)
  20. return
  21. }
  22. type BatchReceiveMessageRequest struct {
  23. *requests.RoaRequest
  24. QueueName string `position:"Path" name:"QueueName"`
  25. NumOfMessages requests.Integer `position:"Query" name:"NumOfMessages"`
  26. WaitSeconds requests.Integer `position:"Query" name:"WaitSeconds"`
  27. }
  28. type BatchReceiveMessageResponse struct {
  29. *responses.BaseResponse
  30. RequestId string `json:"RequestId" xml:"RequestId"`
  31. Code string `json:"Code" xml:"Code"`
  32. Message []Message `json:"Message" xml:"Message"`
  33. }
  34. func CreateBatchReceiveMessageRequest() (request *BatchReceiveMessageRequest) {
  35. request = &BatchReceiveMessageRequest{
  36. RoaRequest: &requests.RoaRequest{},
  37. }
  38. request.InitWithApiInfo("MNS", "2015-06-06","BatchReceiveMessage","/queues/[QueueName]/messages", "", "")
  39. request.Method = "GET"
  40. request.Headers["x-mns-version"] = "2015-06-06"
  41. request.AcceptFormat = "XML"
  42. return
  43. }
  44. func CreateBatchReceiveMessageResponse() (response *BatchReceiveMessageResponse) {
  45. response = &BatchReceiveMessageResponse{
  46. BaseResponse: &responses.BaseResponse{},
  47. }
  48. return
  49. }