DescribeSubnets.go 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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 DescribeSubnetsRequest 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. /* subnetIds - subnet ID列表,支持多个
  31. subnetNames - subnet名称列表,支持多个
  32. routeTableId - 子网关联路由表Id,支持单个
  33. aclId - 子网关联acl Id,支持单个
  34. vpcId - 子网所属VPC Id,支持单个
  35. subnetType - 子网类型,取值:all(全部类型),standard(标准子网),edge(边缘子网),默认standard ,支持单个
  36. azs - 可用区,支持多个
  37. (Optional) */
  38. Filters []common.Filter `json:"filters"`
  39. }
  40. /*
  41. * param regionId: Region ID (Required)
  42. *
  43. * @Deprecated, not compatible when mandatory parameters changed
  44. */
  45. func NewDescribeSubnetsRequest(
  46. regionId string,
  47. ) *DescribeSubnetsRequest {
  48. return &DescribeSubnetsRequest{
  49. JDCloudRequest: core.JDCloudRequest{
  50. URL: "/regions/{regionId}/subnets/",
  51. Method: "GET",
  52. Header: nil,
  53. Version: "v1",
  54. },
  55. RegionId: regionId,
  56. }
  57. }
  58. /*
  59. * param regionId: Region ID (Required)
  60. * param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional)
  61. * param pageSize: 分页大小,默认为20,取值范围:[10,100] (Optional)
  62. * param filters: subnetIds - subnet ID列表,支持多个
  63. subnetNames - subnet名称列表,支持多个
  64. routeTableId - 子网关联路由表Id,支持单个
  65. aclId - 子网关联acl Id,支持单个
  66. vpcId - 子网所属VPC Id,支持单个
  67. subnetType - 子网类型,取值:all(全部类型),standard(标准子网),edge(边缘子网),默认standard ,支持单个
  68. azs - 可用区,支持多个
  69. (Optional)
  70. */
  71. func NewDescribeSubnetsRequestWithAllParams(
  72. regionId string,
  73. pageNumber *int,
  74. pageSize *int,
  75. filters []common.Filter,
  76. ) *DescribeSubnetsRequest {
  77. return &DescribeSubnetsRequest{
  78. JDCloudRequest: core.JDCloudRequest{
  79. URL: "/regions/{regionId}/subnets/",
  80. Method: "GET",
  81. Header: nil,
  82. Version: "v1",
  83. },
  84. RegionId: regionId,
  85. PageNumber: pageNumber,
  86. PageSize: pageSize,
  87. Filters: filters,
  88. }
  89. }
  90. /* This constructor has better compatible ability when API parameters changed */
  91. func NewDescribeSubnetsRequestWithoutParam() *DescribeSubnetsRequest {
  92. return &DescribeSubnetsRequest{
  93. JDCloudRequest: core.JDCloudRequest{
  94. URL: "/regions/{regionId}/subnets/",
  95. Method: "GET",
  96. Header: nil,
  97. Version: "v1",
  98. },
  99. }
  100. }
  101. /* param regionId: Region ID(Required) */
  102. func (r *DescribeSubnetsRequest) SetRegionId(regionId string) {
  103. r.RegionId = regionId
  104. }
  105. /* param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页(Optional) */
  106. func (r *DescribeSubnetsRequest) SetPageNumber(pageNumber int) {
  107. r.PageNumber = &pageNumber
  108. }
  109. /* param pageSize: 分页大小,默认为20,取值范围:[10,100](Optional) */
  110. func (r *DescribeSubnetsRequest) SetPageSize(pageSize int) {
  111. r.PageSize = &pageSize
  112. }
  113. /* param filters: subnetIds - subnet ID列表,支持多个
  114. subnetNames - subnet名称列表,支持多个
  115. routeTableId - 子网关联路由表Id,支持单个
  116. aclId - 子网关联acl Id,支持单个
  117. vpcId - 子网所属VPC Id,支持单个
  118. subnetType - 子网类型,取值:all(全部类型),standard(标准子网),edge(边缘子网),默认standard ,支持单个
  119. azs - 可用区,支持多个
  120. (Optional) */
  121. func (r *DescribeSubnetsRequest) SetFilters(filters []common.Filter) {
  122. r.Filters = filters
  123. }
  124. // GetRegionId returns path parameter 'regionId' if exist,
  125. // otherwise return empty string
  126. func (r DescribeSubnetsRequest) GetRegionId() string {
  127. return r.RegionId
  128. }
  129. type DescribeSubnetsResponse struct {
  130. RequestID string `json:"requestId"`
  131. Error core.ErrorResponse `json:"error"`
  132. Result DescribeSubnetsResult `json:"result"`
  133. }
  134. type DescribeSubnetsResult struct {
  135. Subnets []vpc.Subnet `json:"subnets"`
  136. TotalCount int `json:"totalCount"`
  137. }