DescribeVpcs.go 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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 DescribeVpcsRequest 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. /* vpcIds - vpc ID列表,支持多个
  31. vpcNames - vpc名称列表,支持多个
  32. (Optional) */
  33. Filters []common.Filter `json:"filters"`
  34. }
  35. /*
  36. * param regionId: Region ID (Required)
  37. *
  38. * @Deprecated, not compatible when mandatory parameters changed
  39. */
  40. func NewDescribeVpcsRequest(
  41. regionId string,
  42. ) *DescribeVpcsRequest {
  43. return &DescribeVpcsRequest{
  44. JDCloudRequest: core.JDCloudRequest{
  45. URL: "/regions/{regionId}/vpcs/",
  46. Method: "GET",
  47. Header: nil,
  48. Version: "v1",
  49. },
  50. RegionId: regionId,
  51. }
  52. }
  53. /*
  54. * param regionId: Region ID (Required)
  55. * param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional)
  56. * param pageSize: 分页大小,默认为20,取值范围:[10,100] (Optional)
  57. * param filters: vpcIds - vpc ID列表,支持多个
  58. vpcNames - vpc名称列表,支持多个
  59. (Optional)
  60. */
  61. func NewDescribeVpcsRequestWithAllParams(
  62. regionId string,
  63. pageNumber *int,
  64. pageSize *int,
  65. filters []common.Filter,
  66. ) *DescribeVpcsRequest {
  67. return &DescribeVpcsRequest{
  68. JDCloudRequest: core.JDCloudRequest{
  69. URL: "/regions/{regionId}/vpcs/",
  70. Method: "GET",
  71. Header: nil,
  72. Version: "v1",
  73. },
  74. RegionId: regionId,
  75. PageNumber: pageNumber,
  76. PageSize: pageSize,
  77. Filters: filters,
  78. }
  79. }
  80. /* This constructor has better compatible ability when API parameters changed */
  81. func NewDescribeVpcsRequestWithoutParam() *DescribeVpcsRequest {
  82. return &DescribeVpcsRequest{
  83. JDCloudRequest: core.JDCloudRequest{
  84. URL: "/regions/{regionId}/vpcs/",
  85. Method: "GET",
  86. Header: nil,
  87. Version: "v1",
  88. },
  89. }
  90. }
  91. /* param regionId: Region ID(Required) */
  92. func (r *DescribeVpcsRequest) SetRegionId(regionId string) {
  93. r.RegionId = regionId
  94. }
  95. /* param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页(Optional) */
  96. func (r *DescribeVpcsRequest) SetPageNumber(pageNumber int) {
  97. r.PageNumber = &pageNumber
  98. }
  99. /* param pageSize: 分页大小,默认为20,取值范围:[10,100](Optional) */
  100. func (r *DescribeVpcsRequest) SetPageSize(pageSize int) {
  101. r.PageSize = &pageSize
  102. }
  103. /* param filters: vpcIds - vpc ID列表,支持多个
  104. vpcNames - vpc名称列表,支持多个
  105. (Optional) */
  106. func (r *DescribeVpcsRequest) SetFilters(filters []common.Filter) {
  107. r.Filters = filters
  108. }
  109. // GetRegionId returns path parameter 'regionId' if exist,
  110. // otherwise return empty string
  111. func (r DescribeVpcsRequest) GetRegionId() string {
  112. return r.RegionId
  113. }
  114. type DescribeVpcsResponse struct {
  115. RequestID string `json:"requestId"`
  116. Error core.ErrorResponse `json:"error"`
  117. Result DescribeVpcsResult `json:"result"`
  118. }
  119. type DescribeVpcsResult struct {
  120. Vpcs []vpc.Vpc `json:"vpcs"`
  121. TotalCount int `json:"totalCount"`
  122. }