DescribeVpcPeerings.go 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. // Copyright 2018 JDCLOUD.COM
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. //
  15. // NOTE: This class is auto generated by the jdcloud code generator program.
  16. package apis
  17. import (
  18. "github.com/jdcloud-api/jdcloud-sdk-go/core"
  19. vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models"
  20. common "github.com/jdcloud-api/jdcloud-sdk-go/services/common/models"
  21. )
  22. type DescribeVpcPeeringsRequest struct {
  23. core.JDCloudRequest
  24. /* Region ID */
  25. RegionId string `json:"regionId"`
  26. /* 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) */
  27. PageNumber *int `json:"pageNumber"`
  28. /* 分页大小,默认为20,取值范围:[10,100] (Optional) */
  29. PageSize *int `json:"pageSize"`
  30. /* vpcPeeringIds - vpcPeering ID,支持多个
  31. vpcPeeringNames - vpcPeering名称列表,支持多个
  32. vpcId - vpcPeering本端Vpc Id,支持单个
  33. remoteVpcId - vpcPeering对端Vpc Id,支持单个
  34. (Optional) */
  35. Filters []common.Filter `json:"filters"`
  36. }
  37. /*
  38. * param regionId: Region ID (Required)
  39. *
  40. * @Deprecated, not compatible when mandatory parameters changed
  41. */
  42. func NewDescribeVpcPeeringsRequest(
  43. regionId string,
  44. ) *DescribeVpcPeeringsRequest {
  45. return &DescribeVpcPeeringsRequest{
  46. JDCloudRequest: core.JDCloudRequest{
  47. URL: "/regions/{regionId}/vpcPeerings/",
  48. Method: "GET",
  49. Header: nil,
  50. Version: "v1",
  51. },
  52. RegionId: regionId,
  53. }
  54. }
  55. /*
  56. * param regionId: Region ID (Required)
  57. * param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional)
  58. * param pageSize: 分页大小,默认为20,取值范围:[10,100] (Optional)
  59. * param filters: vpcPeeringIds - vpcPeering ID,支持多个
  60. vpcPeeringNames - vpcPeering名称列表,支持多个
  61. vpcId - vpcPeering本端Vpc Id,支持单个
  62. remoteVpcId - vpcPeering对端Vpc Id,支持单个
  63. (Optional)
  64. */
  65. func NewDescribeVpcPeeringsRequestWithAllParams(
  66. regionId string,
  67. pageNumber *int,
  68. pageSize *int,
  69. filters []common.Filter,
  70. ) *DescribeVpcPeeringsRequest {
  71. return &DescribeVpcPeeringsRequest{
  72. JDCloudRequest: core.JDCloudRequest{
  73. URL: "/regions/{regionId}/vpcPeerings/",
  74. Method: "GET",
  75. Header: nil,
  76. Version: "v1",
  77. },
  78. RegionId: regionId,
  79. PageNumber: pageNumber,
  80. PageSize: pageSize,
  81. Filters: filters,
  82. }
  83. }
  84. /* This constructor has better compatible ability when API parameters changed */
  85. func NewDescribeVpcPeeringsRequestWithoutParam() *DescribeVpcPeeringsRequest {
  86. return &DescribeVpcPeeringsRequest{
  87. JDCloudRequest: core.JDCloudRequest{
  88. URL: "/regions/{regionId}/vpcPeerings/",
  89. Method: "GET",
  90. Header: nil,
  91. Version: "v1",
  92. },
  93. }
  94. }
  95. /* param regionId: Region ID(Required) */
  96. func (r *DescribeVpcPeeringsRequest) SetRegionId(regionId string) {
  97. r.RegionId = regionId
  98. }
  99. /* param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页(Optional) */
  100. func (r *DescribeVpcPeeringsRequest) SetPageNumber(pageNumber int) {
  101. r.PageNumber = &pageNumber
  102. }
  103. /* param pageSize: 分页大小,默认为20,取值范围:[10,100](Optional) */
  104. func (r *DescribeVpcPeeringsRequest) SetPageSize(pageSize int) {
  105. r.PageSize = &pageSize
  106. }
  107. /* param filters: vpcPeeringIds - vpcPeering ID,支持多个
  108. vpcPeeringNames - vpcPeering名称列表,支持多个
  109. vpcId - vpcPeering本端Vpc Id,支持单个
  110. remoteVpcId - vpcPeering对端Vpc Id,支持单个
  111. (Optional) */
  112. func (r *DescribeVpcPeeringsRequest) SetFilters(filters []common.Filter) {
  113. r.Filters = filters
  114. }
  115. // GetRegionId returns path parameter 'regionId' if exist,
  116. // otherwise return empty string
  117. func (r DescribeVpcPeeringsRequest) GetRegionId() string {
  118. return r.RegionId
  119. }
  120. type DescribeVpcPeeringsResponse struct {
  121. RequestID string `json:"requestId"`
  122. Error core.ErrorResponse `json:"error"`
  123. Result DescribeVpcPeeringsResult `json:"result"`
  124. }
  125. type DescribeVpcPeeringsResult struct {
  126. VpcPeerings []vpc.VpcPeering `json:"vpcPeerings"`
  127. TotalCount int `json:"totalCount"`
  128. }