describe_api_doc.go 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. package cloudapi
  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. //
  14. // Code generated by Alibaba Cloud SDK Code Generator.
  15. // Changes may cause incorrect behavior and will be lost if the code is regenerated.
  16. import (
  17. "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
  18. "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
  19. )
  20. func (client *Client) DescribeApiDoc(request *DescribeApiDocRequest) (response *DescribeApiDocResponse, err error) {
  21. response = CreateDescribeApiDocResponse()
  22. err = client.DoAction(request, response)
  23. return
  24. }
  25. func (client *Client) DescribeApiDocWithChan(request *DescribeApiDocRequest) (<-chan *DescribeApiDocResponse, <-chan error) {
  26. responseChan := make(chan *DescribeApiDocResponse, 1)
  27. errChan := make(chan error, 1)
  28. err := client.AddAsyncTask(func() {
  29. defer close(responseChan)
  30. defer close(errChan)
  31. response, err := client.DescribeApiDoc(request)
  32. responseChan <- response
  33. errChan <- err
  34. })
  35. if err != nil {
  36. errChan <- err
  37. close(responseChan)
  38. close(errChan)
  39. }
  40. return responseChan, errChan
  41. }
  42. func (client *Client) DescribeApiDocWithCallback(request *DescribeApiDocRequest, callback func(response *DescribeApiDocResponse, err error)) <-chan int {
  43. result := make(chan int, 1)
  44. err := client.AddAsyncTask(func() {
  45. var response *DescribeApiDocResponse
  46. var err error
  47. defer close(result)
  48. response, err = client.DescribeApiDoc(request)
  49. callback(response, err)
  50. result <- 1
  51. })
  52. if err != nil {
  53. defer close(result)
  54. callback(nil, err)
  55. result <- 0
  56. }
  57. return result
  58. }
  59. type DescribeApiDocRequest struct {
  60. *requests.RpcRequest
  61. StageName string `position:"Query" name:"StageName"`
  62. GroupId string `position:"Query" name:"GroupId"`
  63. ApiId string `position:"Query" name:"ApiId"`
  64. }
  65. type DescribeApiDocResponse struct {
  66. *responses.BaseResponse
  67. RequestId string `json:"RequestId" xml:"RequestId"`
  68. RegionId string `json:"RegionId" xml:"RegionId"`
  69. GroupId string `json:"GroupId" xml:"GroupId"`
  70. GroupName string `json:"GroupName" xml:"GroupName"`
  71. StageName string `json:"StageName" xml:"StageName"`
  72. ApiId string `json:"ApiId" xml:"ApiId"`
  73. ApiName string `json:"ApiName" xml:"ApiName"`
  74. Description string `json:"Description" xml:"Description"`
  75. Visibility string `json:"Visibility" xml:"Visibility"`
  76. AuthType string `json:"AuthType" xml:"AuthType"`
  77. ResultType string `json:"ResultType" xml:"ResultType"`
  78. ResultSample string `json:"ResultSample" xml:"ResultSample"`
  79. FailResultSample string `json:"FailResultSample" xml:"FailResultSample"`
  80. DeployedTime string `json:"DeployedTime" xml:"DeployedTime"`
  81. RequestConfig struct {
  82. RequestProtocol string `json:"RequestProtocol" xml:"RequestProtocol"`
  83. RequestHttpMethod string `json:"RequestHttpMethod" xml:"RequestHttpMethod"`
  84. RequestPath string `json:"RequestPath" xml:"RequestPath"`
  85. BodyFormat string `json:"BodyFormat" xml:"BodyFormat"`
  86. PostBodyDescription string `json:"PostBodyDescription" xml:"PostBodyDescription"`
  87. RequestMode string `json:"RequestMode" xml:"RequestMode"`
  88. } `json:"RequestConfig" xml:"RequestConfig"`
  89. ErrorCodeSamples []struct {
  90. Code string `json:"Code" xml:"Code"`
  91. Message string `json:"Message" xml:"Message"`
  92. Description string `json:"Description" xml:"Description"`
  93. } `json:"ErrorCodeSamples" xml:"ErrorCodeSamples"`
  94. ResultDescriptions []struct {
  95. Id string `json:"Id" xml:"Id"`
  96. Pid string `json:"Pid" xml:"Pid"`
  97. HasChild bool `json:"HasChild" xml:"HasChild"`
  98. Key string `json:"Key" xml:"Key"`
  99. Name string `json:"Name" xml:"Name"`
  100. Mandatory bool `json:"Mandatory" xml:"Mandatory"`
  101. Type string `json:"Type" xml:"Type"`
  102. Description string `json:"Description" xml:"Description"`
  103. } `json:"ResultDescriptions" xml:"ResultDescriptions"`
  104. RequestParameters []struct {
  105. ApiParameterName string `json:"ApiParameterName" xml:"ApiParameterName"`
  106. Location string `json:"Location" xml:"Location"`
  107. ParameterType string `json:"ParameterType" xml:"ParameterType"`
  108. Required string `json:"Required" xml:"Required"`
  109. DefaultValue string `json:"DefaultValue" xml:"DefaultValue"`
  110. DemoValue string `json:"DemoValue" xml:"DemoValue"`
  111. MaxValue int64 `json:"MaxValue" xml:"MaxValue"`
  112. MinValue int64 `json:"MinValue" xml:"MinValue"`
  113. MaxLength int64 `json:"MaxLength" xml:"MaxLength"`
  114. MinLength int64 `json:"MinLength" xml:"MinLength"`
  115. RegularExpression string `json:"RegularExpression" xml:"RegularExpression"`
  116. JsonScheme string `json:"JsonScheme" xml:"JsonScheme"`
  117. EnumValue string `json:"EnumValue" xml:"EnumValue"`
  118. DocShow string `json:"DocShow" xml:"DocShow"`
  119. DocOrder int `json:"DocOrder" xml:"DocOrder"`
  120. Description string `json:"Description" xml:"Description"`
  121. } `json:"RequestParameters" xml:"RequestParameters"`
  122. }
  123. func CreateDescribeApiDocRequest() (request *DescribeApiDocRequest) {
  124. request = &DescribeApiDocRequest{
  125. RpcRequest: &requests.RpcRequest{},
  126. }
  127. request.InitWithApiInfo("CloudAPI", "2016-07-14", "DescribeApiDoc", "", "")
  128. return
  129. }
  130. func CreateDescribeApiDocResponse() (response *DescribeApiDocResponse) {
  131. response = &DescribeApiDocResponse{
  132. BaseResponse: &responses.BaseResponse{},
  133. }
  134. return
  135. }