DescribeSnapshotPolicies.go 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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 DescribeSnapshotPoliciesRequest struct {
  22. core.JDCloudRequest
  23. /* 地域ID */
  24. RegionId string `json:"regionId"`
  25. /* 策略名称 (Optional) */
  26. Name *string `json:"name"`
  27. /* 策略ID (Optional) */
  28. PolicyId []string `json:"policyId"`
  29. /* 策略状态。1: 启用 2:禁用 (Optional) */
  30. Status []int `json:"status"`
  31. /* 排序字段,只支持create_time和update_time字段 (Optional) */
  32. Order *disk.OrderItem `json:"order"`
  33. /* 页码, 默认为1, 取值范围:[1,∞) (Optional) */
  34. PageNumber *int `json:"pageNumber"`
  35. /* 分页大小,默认为20,取值范围:[10,100] (Optional) */
  36. PageSize *int `json:"pageSize"`
  37. }
  38. /*
  39. * param regionId: 地域ID (Required)
  40. *
  41. * @Deprecated, not compatible when mandatory parameters changed
  42. */
  43. func NewDescribeSnapshotPoliciesRequest(
  44. regionId string,
  45. ) *DescribeSnapshotPoliciesRequest {
  46. return &DescribeSnapshotPoliciesRequest{
  47. JDCloudRequest: core.JDCloudRequest{
  48. URL: "/regions/{regionId}/snapshotPolicies:describe",
  49. Method: "POST",
  50. Header: nil,
  51. Version: "v1",
  52. },
  53. RegionId: regionId,
  54. }
  55. }
  56. /*
  57. * param regionId: 地域ID (Required)
  58. * param name: 策略名称 (Optional)
  59. * param policyId: 策略ID (Optional)
  60. * param status: 策略状态。1: 启用 2:禁用 (Optional)
  61. * param order: 排序字段,只支持create_time和update_time字段 (Optional)
  62. * param pageNumber: 页码, 默认为1, 取值范围:[1,∞) (Optional)
  63. * param pageSize: 分页大小,默认为20,取值范围:[10,100] (Optional)
  64. */
  65. func NewDescribeSnapshotPoliciesRequestWithAllParams(
  66. regionId string,
  67. name *string,
  68. policyId []string,
  69. status []int,
  70. order *disk.OrderItem,
  71. pageNumber *int,
  72. pageSize *int,
  73. ) *DescribeSnapshotPoliciesRequest {
  74. return &DescribeSnapshotPoliciesRequest{
  75. JDCloudRequest: core.JDCloudRequest{
  76. URL: "/regions/{regionId}/snapshotPolicies:describe",
  77. Method: "POST",
  78. Header: nil,
  79. Version: "v1",
  80. },
  81. RegionId: regionId,
  82. Name: name,
  83. PolicyId: policyId,
  84. Status: status,
  85. Order: order,
  86. PageNumber: pageNumber,
  87. PageSize: pageSize,
  88. }
  89. }
  90. /* This constructor has better compatible ability when API parameters changed */
  91. func NewDescribeSnapshotPoliciesRequestWithoutParam() *DescribeSnapshotPoliciesRequest {
  92. return &DescribeSnapshotPoliciesRequest{
  93. JDCloudRequest: core.JDCloudRequest{
  94. URL: "/regions/{regionId}/snapshotPolicies:describe",
  95. Method: "POST",
  96. Header: nil,
  97. Version: "v1",
  98. },
  99. }
  100. }
  101. /* param regionId: 地域ID(Required) */
  102. func (r *DescribeSnapshotPoliciesRequest) SetRegionId(regionId string) {
  103. r.RegionId = regionId
  104. }
  105. /* param name: 策略名称(Optional) */
  106. func (r *DescribeSnapshotPoliciesRequest) SetName(name string) {
  107. r.Name = &name
  108. }
  109. /* param policyId: 策略ID(Optional) */
  110. func (r *DescribeSnapshotPoliciesRequest) SetPolicyId(policyId []string) {
  111. r.PolicyId = policyId
  112. }
  113. /* param status: 策略状态。1: 启用 2:禁用(Optional) */
  114. func (r *DescribeSnapshotPoliciesRequest) SetStatus(status []int) {
  115. r.Status = status
  116. }
  117. /* param order: 排序字段,只支持create_time和update_time字段(Optional) */
  118. func (r *DescribeSnapshotPoliciesRequest) SetOrder(order *disk.OrderItem) {
  119. r.Order = order
  120. }
  121. /* param pageNumber: 页码, 默认为1, 取值范围:[1,∞)(Optional) */
  122. func (r *DescribeSnapshotPoliciesRequest) SetPageNumber(pageNumber int) {
  123. r.PageNumber = &pageNumber
  124. }
  125. /* param pageSize: 分页大小,默认为20,取值范围:[10,100](Optional) */
  126. func (r *DescribeSnapshotPoliciesRequest) SetPageSize(pageSize int) {
  127. r.PageSize = &pageSize
  128. }
  129. // GetRegionId returns path parameter 'regionId' if exist,
  130. // otherwise return empty string
  131. func (r DescribeSnapshotPoliciesRequest) GetRegionId() string {
  132. return r.RegionId
  133. }
  134. type DescribeSnapshotPoliciesResponse struct {
  135. RequestID string `json:"requestId"`
  136. Error core.ErrorResponse `json:"error"`
  137. Result DescribeSnapshotPoliciesResult `json:"result"`
  138. }
  139. type DescribeSnapshotPoliciesResult struct {
  140. Policies []disk.SnapshotPolicy `json:"policies"`
  141. TotalCount int `json:"totalCount"`
  142. }