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 17 #pragma once 18 #include <alibabacloud/oss/Export.h> 19 #include <alibabacloud/oss/OssRequest.h> 20 #include <list> 21 22 namespace AlibabaCloud 23 { 24 namespace OSS 25 { 26 class ALIBABACLOUD_OSS_EXPORT ObjectIdentifier 27 { 28 public: ObjectIdentifier()29 ObjectIdentifier() {}; ObjectIdentifier(const std::string & key)30 ObjectIdentifier(const std::string& key) : key_(key) {}; ObjectIdentifier(const std::string & key,const std::string & versionId)31 ObjectIdentifier(const std::string& key, const std::string& versionId) : key_(key), versionId_(versionId) {}; setKey(const std::string & key)32 void setKey(const std::string& key) { key_ = key; }; setVersionId(const std::string & versionId)33 void setVersionId(const std::string& versionId) { versionId_ = versionId; }; Key()34 const std::string& Key() const { return key_; } VersionId()35 const std::string& VersionId() const { return versionId_; } 36 private: 37 std::string key_; 38 std::string versionId_; 39 }; 40 41 using ObjectIdentifierList = std::vector<ObjectIdentifier>; 42 43 class ALIBABACLOUD_OSS_EXPORT DeleteObjectVersionsRequest : public OssBucketRequest 44 { 45 public: 46 DeleteObjectVersionsRequest(const std::string& bucket); 47 bool Quiet() const; 48 const std::string& EncodingType() const; 49 void setQuiet(bool quiet); 50 void setEncodingType(const std::string& value); 51 52 void addObject(const ObjectIdentifier& object); 53 void setObjects(const ObjectIdentifierList& objects); 54 const ObjectIdentifierList& Objects() const; 55 void clearObjects(); 56 57 void setRequestPayer(RequestPayer value); 58 protected: 59 virtual std::string payload() const; 60 virtual ParameterCollection specialParameters() const; 61 virtual HeaderCollection specialHeaders() const; 62 private: 63 bool quiet_; 64 std::string encodingType_; 65 ObjectIdentifierList objects_; 66 RequestPayer requestPayer_; 67 }; 68 } 69 } 70