ListObjectsResult.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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/model/Bucket.h>
  18. #include <vector>
  19. #include <memory>
  20. #include <iostream>
  21. #include <alibabacloud/oss/OssResult.h>
  22. #include <alibabacloud/oss/model/Owner.h>
  23. namespace AlibabaCloud
  24. {
  25. namespace OSS
  26. {
  27. class ListObjectsResult;
  28. class ALIBABACLOUD_OSS_EXPORT ObjectSummary
  29. {
  30. public:
  31. ObjectSummary() = default;
  32. const std::string& Key() const { return key_; }
  33. const std::string& ETag()const { return eTag_; }
  34. int64_t Size() const { return size_; }
  35. const std::string& LastModified() const { return lastModified_; }
  36. const std::string& StorageClass() const { return storageClass_; }
  37. const std::string& Type() const { return type_; }
  38. const AlibabaCloud::OSS::Owner& Owner() const { return owner_; }
  39. private:
  40. friend class ListObjectsResult;
  41. std::string key_;
  42. std::string eTag_;
  43. int64_t size_;
  44. std::string lastModified_;
  45. std::string storageClass_;
  46. std::string type_;
  47. AlibabaCloud::OSS::Owner owner_;
  48. };
  49. using ObjectSummaryList = std::vector<ObjectSummary>;
  50. class ALIBABACLOUD_OSS_EXPORT ListObjectsResult : public OssResult
  51. {
  52. public:
  53. ListObjectsResult();
  54. ListObjectsResult(const std::string& data);
  55. ListObjectsResult(const std::shared_ptr<std::iostream>& data);
  56. ListObjectsResult& operator=(const std::string& data);
  57. const std::string& Name() const { return name_; }
  58. const std::string& Prefix() const { return prefix_; }
  59. const std::string& Marker() const { return marker_; }
  60. const std::string& NextMarker() const { return nextMarker_; }
  61. const std::string& Delimiter() const { return delimiter_; }
  62. const std::string& EncodingType() const { return encodingType_; }
  63. int MaxKeys() const { return maxKeys_; }
  64. bool IsTruncated() const { return isTruncated_; }
  65. const CommonPrefixeList& CommonPrefixes() const { return commonPrefixes_; }
  66. const ObjectSummaryList& ObjectSummarys() const { return objectSummarys_; }
  67. private:
  68. std::string name_;
  69. std::string prefix_;
  70. std::string marker_;
  71. std::string delimiter_;
  72. std::string nextMarker_;
  73. std::string encodingType_;
  74. bool isTruncated_;
  75. int maxKeys_;
  76. CommonPrefixeList commonPrefixes_;
  77. ObjectSummaryList objectSummarys_;
  78. };
  79. }
  80. }