GetObjectRequest.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Copyright 2009-2017 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 <alibabacloud/oss/Types.h>
  20. #include <vector>
  21. #include <map>
  22. namespace AlibabaCloud
  23. {
  24. namespace OSS
  25. {
  26. class ALIBABACLOUD_OSS_EXPORT GetObjectRequest: public OssObjectRequest
  27. {
  28. public:
  29. GetObjectRequest(const std::string& bucket, const std::string& key);
  30. GetObjectRequest(const std::string& bucket, const std::string& key,
  31. const std::string& process);
  32. GetObjectRequest(const std::string &bucket, const std::string &key,
  33. const std::string &modifiedSince, const std::string &unmodifiedSince,
  34. const std::vector<std::string> &matchingETags, const std::vector<std::string> &nonmatchingETags,
  35. const std::map<std::string, std::string> &responseHeaderParameters_);
  36. void setRange(int64_t start, int64_t end);
  37. void setModifiedSinceConstraint(const std::string& gmt);
  38. void setUnmodifiedSinceConstraint(const std::string& gmt);
  39. void setMatchingETagConstraints(const std::vector<std::string>& match);
  40. void addMatchingETagConstraint(const std::string& match);
  41. void setNonmatchingETagConstraints(const std::vector<std::string>& match);
  42. void addNonmatchingETagConstraint(const std::string& match);
  43. void setProcess(const std::string& process);
  44. void addResponseHeaders(RequestResponseHeader header, const std::string& value);
  45. void setTrafficLimit(uint64_t value);
  46. protected:
  47. virtual HeaderCollection specialHeaders() const ;
  48. virtual ParameterCollection specialParameters() const;
  49. virtual int validate() const;
  50. private:
  51. int64_t range_[2];
  52. bool rangeIsSet_;
  53. std::string modifiedSince_;
  54. std::string unmodifiedSince_;
  55. std::vector<std::string> matchingETags_;
  56. std::vector<std::string> nonmatchingETags_;
  57. std::string process_;
  58. std::map<std::string, std::string> responseHeaderParameters_;
  59. uint64_t trafficLimit_;
  60. };
  61. }
  62. }