UploadPartCopyRequest.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Copyright 2009-2018 Alibaba Cloud All rights reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #pragma once
  17. #include <alibabacloud/oss/Export.h>
  18. #include <alibabacloud/oss/OssRequest.h>
  19. #include <sstream>
  20. #include <iostream>
  21. namespace AlibabaCloud
  22. {
  23. namespace OSS
  24. {
  25. class ALIBABACLOUD_OSS_EXPORT UploadPartCopyRequest: public OssObjectRequest
  26. {
  27. public:
  28. UploadPartCopyRequest(const std::string& bucket, const std::string& key);
  29. UploadPartCopyRequest(const std::string& bucket, const std::string& key,
  30. const std::string& srcBucket, const std::string& srcKey);
  31. UploadPartCopyRequest(const std::string& bucket, const std::string& key,
  32. const std::string& srcBucket, const std::string& srcKey,
  33. const std::string& uploadId, int partNumber);
  34. UploadPartCopyRequest(const std::string& bucket, const std::string& key,
  35. const std::string& srcBucket, const std::string& srcKey,
  36. const std::string& uploadId, int partNumber,
  37. const std::string& sourceIfMatchETag,
  38. const std::string& sourceIfNotMatchETag,
  39. const std::string& sourceIfModifiedSince,
  40. const std::string& sourceIfUnModifiedSince);
  41. void setPartNumber(uint32_t partNumber);
  42. void setUploadId(const std::string& uploadId);
  43. void SetCopySource(const std::string& srcBucket, const std::string& srcKey);
  44. void setCopySourceRange(uint64_t begin, uint64_t end);
  45. void SetSourceIfMatchETag(const std::string& value);
  46. void SetSourceIfNotMatchETag(const std::string& value);
  47. void SetSourceIfModifiedSince(const std::string& value);
  48. void SetSourceIfUnModifiedSince(const std::string& value);
  49. void setTrafficLimit(uint64_t value);
  50. protected:
  51. virtual ParameterCollection specialParameters() const;
  52. virtual HeaderCollection specialHeaders() const;
  53. virtual int validate() const;
  54. private:
  55. std::string uploadId_;
  56. std::string sourceBucket_;
  57. std::string sourceKey_;
  58. uint32_t partNumber_;
  59. uint64_t sourceRange_[2];
  60. bool sourceRangeIsSet_;
  61. std::string sourceIfMatchETag_;
  62. bool sourceIfMatchETagIsSet_;
  63. std::string sourceIfNotMatchETag_;
  64. bool sourceIfNotMatchETagIsSet_;
  65. std::string sourceIfModifiedSince_;
  66. bool sourceIfModifiedSinceIsSet_;
  67. std::string sourceIfUnModifiedSince_;
  68. bool sourceIfUnModifiedSinceIsSet_;
  69. uint64_t trafficLimit_;
  70. };
  71. }
  72. }