DescribeRouteTables.go 4.5 KB

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