ModifySnapshotAttribute.go 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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. )
  20. type ModifySnapshotAttributeRequest struct {
  21. core.JDCloudRequest
  22. /* 地域ID */
  23. RegionId string `json:"regionId"`
  24. /* 快照ID */
  25. SnapshotId string `json:"snapshotId"`
  26. /* 快照名称 (Optional) */
  27. Name *string `json:"name"`
  28. /* 快照描述 (Optional) */
  29. Description *string `json:"description"`
  30. /* 快照过期时间,三者至少指定一个 (Optional) */
  31. ExpireTime *string `json:"expireTime"`
  32. }
  33. /*
  34. * param regionId: 地域ID (Required)
  35. * param snapshotId: 快照ID (Required)
  36. *
  37. * @Deprecated, not compatible when mandatory parameters changed
  38. */
  39. func NewModifySnapshotAttributeRequest(
  40. regionId string,
  41. snapshotId string,
  42. ) *ModifySnapshotAttributeRequest {
  43. return &ModifySnapshotAttributeRequest{
  44. JDCloudRequest: core.JDCloudRequest{
  45. URL: "/regions/{regionId}/snapshots/{snapshotId}",
  46. Method: "PATCH",
  47. Header: nil,
  48. Version: "v1",
  49. },
  50. RegionId: regionId,
  51. SnapshotId: snapshotId,
  52. }
  53. }
  54. /*
  55. * param regionId: 地域ID (Required)
  56. * param snapshotId: 快照ID (Required)
  57. * param name: 快照名称 (Optional)
  58. * param description: 快照描述 (Optional)
  59. * param expireTime: 快照过期时间,三者至少指定一个 (Optional)
  60. */
  61. func NewModifySnapshotAttributeRequestWithAllParams(
  62. regionId string,
  63. snapshotId string,
  64. name *string,
  65. description *string,
  66. expireTime *string,
  67. ) *ModifySnapshotAttributeRequest {
  68. return &ModifySnapshotAttributeRequest{
  69. JDCloudRequest: core.JDCloudRequest{
  70. URL: "/regions/{regionId}/snapshots/{snapshotId}",
  71. Method: "PATCH",
  72. Header: nil,
  73. Version: "v1",
  74. },
  75. RegionId: regionId,
  76. SnapshotId: snapshotId,
  77. Name: name,
  78. Description: description,
  79. ExpireTime: expireTime,
  80. }
  81. }
  82. /* This constructor has better compatible ability when API parameters changed */
  83. func NewModifySnapshotAttributeRequestWithoutParam() *ModifySnapshotAttributeRequest {
  84. return &ModifySnapshotAttributeRequest{
  85. JDCloudRequest: core.JDCloudRequest{
  86. URL: "/regions/{regionId}/snapshots/{snapshotId}",
  87. Method: "PATCH",
  88. Header: nil,
  89. Version: "v1",
  90. },
  91. }
  92. }
  93. /* param regionId: 地域ID(Required) */
  94. func (r *ModifySnapshotAttributeRequest) SetRegionId(regionId string) {
  95. r.RegionId = regionId
  96. }
  97. /* param snapshotId: 快照ID(Required) */
  98. func (r *ModifySnapshotAttributeRequest) SetSnapshotId(snapshotId string) {
  99. r.SnapshotId = snapshotId
  100. }
  101. /* param name: 快照名称(Optional) */
  102. func (r *ModifySnapshotAttributeRequest) SetName(name string) {
  103. r.Name = &name
  104. }
  105. /* param description: 快照描述(Optional) */
  106. func (r *ModifySnapshotAttributeRequest) SetDescription(description string) {
  107. r.Description = &description
  108. }
  109. /* param expireTime: 快照过期时间,三者至少指定一个(Optional) */
  110. func (r *ModifySnapshotAttributeRequest) SetExpireTime(expireTime string) {
  111. r.ExpireTime = &expireTime
  112. }
  113. // GetRegionId returns path parameter 'regionId' if exist,
  114. // otherwise return empty string
  115. func (r ModifySnapshotAttributeRequest) GetRegionId() string {
  116. return r.RegionId
  117. }
  118. type ModifySnapshotAttributeResponse struct {
  119. RequestID string `json:"requestId"`
  120. Error core.ErrorResponse `json:"error"`
  121. Result ModifySnapshotAttributeResult `json:"result"`
  122. }
  123. type ModifySnapshotAttributeResult struct {
  124. }