DescribeQuota.go 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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 DescribeQuotaRequest struct {
  22. core.JDCloudRequest
  23. /* 地域ID */
  24. RegionId string `json:"regionId"`
  25. /* 资源类型 disk:用户能创建的云盘的配额 snapshot: 用户能创建的快照的配额 snapshot_policy: 用户能创建的快照策略的配额 */
  26. Type string `json:"type"`
  27. }
  28. /*
  29. * param regionId: 地域ID (Required)
  30. * param type_: 资源类型 disk:用户能创建的云盘的配额 snapshot: 用户能创建的快照的配额 snapshot_policy: 用户能创建的快照策略的配额 (Required)
  31. *
  32. * @Deprecated, not compatible when mandatory parameters changed
  33. */
  34. func NewDescribeQuotaRequest(
  35. regionId string,
  36. type_ string,
  37. ) *DescribeQuotaRequest {
  38. return &DescribeQuotaRequest{
  39. JDCloudRequest: core.JDCloudRequest{
  40. URL: "/regions/{regionId}/quotas",
  41. Method: "GET",
  42. Header: nil,
  43. Version: "v1",
  44. },
  45. RegionId: regionId,
  46. Type: type_,
  47. }
  48. }
  49. /*
  50. * param regionId: 地域ID (Required)
  51. * param type_: 资源类型 disk:用户能创建的云盘的配额 snapshot: 用户能创建的快照的配额 snapshot_policy: 用户能创建的快照策略的配额 (Required)
  52. */
  53. func NewDescribeQuotaRequestWithAllParams(
  54. regionId string,
  55. type_ string,
  56. ) *DescribeQuotaRequest {
  57. return &DescribeQuotaRequest{
  58. JDCloudRequest: core.JDCloudRequest{
  59. URL: "/regions/{regionId}/quotas",
  60. Method: "GET",
  61. Header: nil,
  62. Version: "v1",
  63. },
  64. RegionId: regionId,
  65. Type: type_,
  66. }
  67. }
  68. /* This constructor has better compatible ability when API parameters changed */
  69. func NewDescribeQuotaRequestWithoutParam() *DescribeQuotaRequest {
  70. return &DescribeQuotaRequest{
  71. JDCloudRequest: core.JDCloudRequest{
  72. URL: "/regions/{regionId}/quotas",
  73. Method: "GET",
  74. Header: nil,
  75. Version: "v1",
  76. },
  77. }
  78. }
  79. /* param regionId: 地域ID(Required) */
  80. func (r *DescribeQuotaRequest) SetRegionId(regionId string) {
  81. r.RegionId = regionId
  82. }
  83. /* param type_: 资源类型 disk:用户能创建的云盘的配额 snapshot: 用户能创建的快照的配额 snapshot_policy: 用户能创建的快照策略的配额(Required) */
  84. func (r *DescribeQuotaRequest) SetType(type_ string) {
  85. r.Type = type_
  86. }
  87. // GetRegionId returns path parameter 'regionId' if exist,
  88. // otherwise return empty string
  89. func (r DescribeQuotaRequest) GetRegionId() string {
  90. return r.RegionId
  91. }
  92. type DescribeQuotaResponse struct {
  93. RequestID string `json:"requestId"`
  94. Error core.ErrorResponse `json:"error"`
  95. Result DescribeQuotaResult `json:"result"`
  96. }
  97. type DescribeQuotaResult struct {
  98. Quota disk.Quota `json:"quota"`
  99. }