ListObjectsResult.h 3.2 KB

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