CopyImages.go 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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. vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models"
  20. )
  21. type CopyImagesRequest struct {
  22. core.JDCloudRequest
  23. /* 地域ID */
  24. RegionId string `json:"regionId"`
  25. /* 源镜像ID */
  26. SourceImageIds []string `json:"sourceImageIds"`
  27. /* 目标区域 */
  28. DestinationRegion string `json:"destinationRegion"`
  29. }
  30. /*
  31. * param regionId: 地域ID (Required)
  32. * param sourceImageIds: 源镜像ID (Required)
  33. * param destinationRegion: 目标区域 (Required)
  34. *
  35. * @Deprecated, not compatible when mandatory parameters changed
  36. */
  37. func NewCopyImagesRequest(
  38. regionId string,
  39. sourceImageIds []string,
  40. destinationRegion string,
  41. ) *CopyImagesRequest {
  42. return &CopyImagesRequest{
  43. JDCloudRequest: core.JDCloudRequest{
  44. URL: "/regions/{regionId}/images:copyImages",
  45. Method: "POST",
  46. Header: nil,
  47. Version: "v1",
  48. },
  49. RegionId: regionId,
  50. SourceImageIds: sourceImageIds,
  51. DestinationRegion: destinationRegion,
  52. }
  53. }
  54. /*
  55. * param regionId: 地域ID (Required)
  56. * param sourceImageIds: 源镜像ID (Required)
  57. * param destinationRegion: 目标区域 (Required)
  58. */
  59. func NewCopyImagesRequestWithAllParams(
  60. regionId string,
  61. sourceImageIds []string,
  62. destinationRegion string,
  63. ) *CopyImagesRequest {
  64. return &CopyImagesRequest{
  65. JDCloudRequest: core.JDCloudRequest{
  66. URL: "/regions/{regionId}/images:copyImages",
  67. Method: "POST",
  68. Header: nil,
  69. Version: "v1",
  70. },
  71. RegionId: regionId,
  72. SourceImageIds: sourceImageIds,
  73. DestinationRegion: destinationRegion,
  74. }
  75. }
  76. /* This constructor has better compatible ability when API parameters changed */
  77. func NewCopyImagesRequestWithoutParam() *CopyImagesRequest {
  78. return &CopyImagesRequest{
  79. JDCloudRequest: core.JDCloudRequest{
  80. URL: "/regions/{regionId}/images:copyImages",
  81. Method: "POST",
  82. Header: nil,
  83. Version: "v1",
  84. },
  85. }
  86. }
  87. /* param regionId: 地域ID(Required) */
  88. func (r *CopyImagesRequest) SetRegionId(regionId string) {
  89. r.RegionId = regionId
  90. }
  91. /* param sourceImageIds: 源镜像ID(Required) */
  92. func (r *CopyImagesRequest) SetSourceImageIds(sourceImageIds []string) {
  93. r.SourceImageIds = sourceImageIds
  94. }
  95. /* param destinationRegion: 目标区域(Required) */
  96. func (r *CopyImagesRequest) SetDestinationRegion(destinationRegion string) {
  97. r.DestinationRegion = destinationRegion
  98. }
  99. // GetRegionId returns path parameter 'regionId' if exist,
  100. // otherwise return empty string
  101. func (r CopyImagesRequest) GetRegionId() string {
  102. return r.RegionId
  103. }
  104. type CopyImagesResponse struct {
  105. RequestID string `json:"requestId"`
  106. Error core.ErrorResponse `json:"error"`
  107. Result CopyImagesResult `json:"result"`
  108. }
  109. type CopyImagesResult struct {
  110. CopyImages []vm.CopyImage `json:"copyImages"`
  111. }