DescribeSnapshotsCapacity.go 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. disk "github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models"
  20. )
  21. type DescribeSnapshotsCapacityRequest struct {
  22. core.JDCloudRequest
  23. /* 地域ID */
  24. RegionId string `json:"regionId"`
  25. }
  26. /*
  27. * param regionId: 地域ID (Required)
  28. *
  29. * @Deprecated, not compatible when mandatory parameters changed
  30. */
  31. func NewDescribeSnapshotsCapacityRequest(
  32. regionId string,
  33. ) *DescribeSnapshotsCapacityRequest {
  34. return &DescribeSnapshotsCapacityRequest{
  35. JDCloudRequest: core.JDCloudRequest{
  36. URL: "/regions/{regionId}/snapshots:capacity",
  37. Method: "GET",
  38. Header: nil,
  39. Version: "v1",
  40. },
  41. RegionId: regionId,
  42. }
  43. }
  44. /*
  45. * param regionId: 地域ID (Required)
  46. */
  47. func NewDescribeSnapshotsCapacityRequestWithAllParams(
  48. regionId string,
  49. ) *DescribeSnapshotsCapacityRequest {
  50. return &DescribeSnapshotsCapacityRequest{
  51. JDCloudRequest: core.JDCloudRequest{
  52. URL: "/regions/{regionId}/snapshots:capacity",
  53. Method: "GET",
  54. Header: nil,
  55. Version: "v1",
  56. },
  57. RegionId: regionId,
  58. }
  59. }
  60. /* This constructor has better compatible ability when API parameters changed */
  61. func NewDescribeSnapshotsCapacityRequestWithoutParam() *DescribeSnapshotsCapacityRequest {
  62. return &DescribeSnapshotsCapacityRequest{
  63. JDCloudRequest: core.JDCloudRequest{
  64. URL: "/regions/{regionId}/snapshots:capacity",
  65. Method: "GET",
  66. Header: nil,
  67. Version: "v1",
  68. },
  69. }
  70. }
  71. /* param regionId: 地域ID(Required) */
  72. func (r *DescribeSnapshotsCapacityRequest) SetRegionId(regionId string) {
  73. r.RegionId = regionId
  74. }
  75. // GetRegionId returns path parameter 'regionId' if exist,
  76. // otherwise return empty string
  77. func (r DescribeSnapshotsCapacityRequest) GetRegionId() string {
  78. return r.RegionId
  79. }
  80. type DescribeSnapshotsCapacityResponse struct {
  81. RequestID string `json:"requestId"`
  82. Error core.ErrorResponse `json:"error"`
  83. Result DescribeSnapshotsCapacityResult `json:"result"`
  84. }
  85. type DescribeSnapshotsCapacityResult struct {
  86. Capacities []disk.SnapshotCapacity `json:"capacities"`
  87. }