ApplySnapshotPolicies.go 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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 ApplySnapshotPoliciesRequest struct {
  22. core.JDCloudRequest
  23. /* 地域ID */
  24. RegionId string `json:"regionId"`
  25. /* 绑定/解绑操作 (Optional) */
  26. Relations []disk.PolicyDiskRelationOp `json:"relations"`
  27. }
  28. /*
  29. * param regionId: 地域ID (Required)
  30. *
  31. * @Deprecated, not compatible when mandatory parameters changed
  32. */
  33. func NewApplySnapshotPoliciesRequest(
  34. regionId string,
  35. ) *ApplySnapshotPoliciesRequest {
  36. return &ApplySnapshotPoliciesRequest{
  37. JDCloudRequest: core.JDCloudRequest{
  38. URL: "/regions/{regionId}/snapshotPolicies:apply",
  39. Method: "POST",
  40. Header: nil,
  41. Version: "v1",
  42. },
  43. RegionId: regionId,
  44. }
  45. }
  46. /*
  47. * param regionId: 地域ID (Required)
  48. * param relations: 绑定/解绑操作 (Optional)
  49. */
  50. func NewApplySnapshotPoliciesRequestWithAllParams(
  51. regionId string,
  52. relations []disk.PolicyDiskRelationOp,
  53. ) *ApplySnapshotPoliciesRequest {
  54. return &ApplySnapshotPoliciesRequest{
  55. JDCloudRequest: core.JDCloudRequest{
  56. URL: "/regions/{regionId}/snapshotPolicies:apply",
  57. Method: "POST",
  58. Header: nil,
  59. Version: "v1",
  60. },
  61. RegionId: regionId,
  62. Relations: relations,
  63. }
  64. }
  65. /* This constructor has better compatible ability when API parameters changed */
  66. func NewApplySnapshotPoliciesRequestWithoutParam() *ApplySnapshotPoliciesRequest {
  67. return &ApplySnapshotPoliciesRequest{
  68. JDCloudRequest: core.JDCloudRequest{
  69. URL: "/regions/{regionId}/snapshotPolicies:apply",
  70. Method: "POST",
  71. Header: nil,
  72. Version: "v1",
  73. },
  74. }
  75. }
  76. /* param regionId: 地域ID(Required) */
  77. func (r *ApplySnapshotPoliciesRequest) SetRegionId(regionId string) {
  78. r.RegionId = regionId
  79. }
  80. /* param relations: 绑定/解绑操作(Optional) */
  81. func (r *ApplySnapshotPoliciesRequest) SetRelations(relations []disk.PolicyDiskRelationOp) {
  82. r.Relations = relations
  83. }
  84. // GetRegionId returns path parameter 'regionId' if exist,
  85. // otherwise return empty string
  86. func (r ApplySnapshotPoliciesRequest) GetRegionId() string {
  87. return r.RegionId
  88. }
  89. type ApplySnapshotPoliciesResponse struct {
  90. RequestID string `json:"requestId"`
  91. Error core.ErrorResponse `json:"error"`
  92. Result ApplySnapshotPoliciesResult `json:"result"`
  93. }
  94. type ApplySnapshotPoliciesResult struct {
  95. OpResults []disk.PolicyDiskRelationOpResult `json:"opResults"`
  96. }