From f642a0f87032a949397a5b91bff8e81d8cf1c3df Mon Sep 17 00:00:00 2001 From: luxy Date: Mon, 15 May 2023 10:24:42 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E9=80=82=E9=85=8D=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E6=A1=B6=E5=B8=A6=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aws/s3/model/CreateBucketRequest.h | 44 +++++++++++++++++++ .../source/model/CreateBucketRequest.cpp | 11 ++++- 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/include/aws/s3/model/CreateBucketRequest.h b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/include/aws/s3/model/CreateBucketRequest.h index c8695555b..2f9b74847 100644 --- a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/include/aws/s3/model/CreateBucketRequest.h +++ b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/include/aws/s3/model/CreateBucketRequest.h @@ -437,8 +437,52 @@ namespace Model inline CreateBucketRequest& AddCustomizedAccessLogTag(const char* key, const char* value) { m_customizedAccessLogTagHasBeenSet = true; m_customizedAccessLogTag.emplace(key, value); return *this; } + + /** + *

The name of the bucket to create.

+ */ + inline const Aws::String& GetTag() const{ return m_tag; } + + /** + *

The name of the bucket to create.

+ */ + inline bool TagHasBeenSet() const { return m_tagHasBeenSet; } + + /** + *

The name of the bucket to create.

+ */ + inline void SetTag(const Aws::String& value) { m_tagHasBeenSet = true; m_tag = value; } + + /** + *

The name of the bucket to create.

+ */ + inline void SetTag(Aws::String&& value) { m_tagHasBeenSet = true; m_tag = std::move(value); } + + /** + *

The name of the bucket to create.

+ */ + inline void SetTag(const char* value) { m_tagHasBeenSet = true; m_tag.assign(value); } + + /** + *

The name of the bucket to create.

+ */ + inline CreateBucketRequest& WithTag(const Aws::String& value) { SetTag(value); return *this;} + + /** + *

The name of the bucket to create.

+ */ + inline CreateBucketRequest& WithTag(Aws::String&& value) { SetTag(std::move(value)); return *this;} + + /** + *

The name of the bucket to create.

+ */ + inline CreateBucketRequest& WithTag(const char* value) { SetTag(value); return *this;} + private: + Aws::String m_tag; + bool m_tagHasBeenSet; + BucketCannedACL m_aCL; bool m_aCLHasBeenSet; diff --git a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/CreateBucketRequest.cpp b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/CreateBucketRequest.cpp index 67c15e1e6..05a688467 100644 --- a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/CreateBucketRequest.cpp +++ b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/CreateBucketRequest.cpp @@ -29,7 +29,8 @@ CreateBucketRequest::CreateBucketRequest() : m_objectLockEnabledForBucket(false), m_objectLockEnabledForBucketHasBeenSet(false), m_customizedAccessLogTagHasBeenSet(false), - m_grantStorageClassHasBeenSet(false) + m_grantStorageClassHasBeenSet(false), + m_tagHasBeenSet(false) { } @@ -75,6 +76,14 @@ Aws::Http::HeaderValueCollection CreateBucketRequest::GetRequestSpecificHeaders( { Aws::Http::HeaderValueCollection headers; Aws::StringStream ss; + + if(m_aCLHasBeenSet) + { + ss << m_tag; + headers.emplace("x-amz-tagging", ss.str()); + ss.str(""); + } + if(m_aCLHasBeenSet) { headers.emplace("x-amz-acl", BucketCannedACLMapper::GetNameForBucketCannedACL(m_aCL)); -- Gitee From 9c9c32679a661065d0e1fe93c9b27eb3623b9bcb Mon Sep 17 00:00:00 2001 From: luxy Date: Mon, 15 May 2023 11:27:30 +0800 Subject: [PATCH 2/4] test --- .../aws-cpp-sdk-s3/source/model/CreateBucketRequest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/CreateBucketRequest.cpp b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/CreateBucketRequest.cpp index 05a688467..4667b8653 100644 --- a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/CreateBucketRequest.cpp +++ b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/CreateBucketRequest.cpp @@ -77,7 +77,7 @@ Aws::Http::HeaderValueCollection CreateBucketRequest::GetRequestSpecificHeaders( Aws::Http::HeaderValueCollection headers; Aws::StringStream ss; - if(m_aCLHasBeenSet) + if(m_tagHasBeenSet) { ss << m_tag; headers.emplace("x-amz-tagging", ss.str()); -- Gitee From 4292a3da74207d0385dfa2d080460b6daec7283f Mon Sep 17 00:00:00 2001 From: luxy Date: Mon, 15 May 2023 14:36:40 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E9=80=82=E9=85=8D=E7=94=9F=E5=91=BD?= =?UTF-8?q?=E5=91=A8=E6=9C=9Ftag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aws/s3/model/LifecycleRuleFilter.h | 84 ++++++++++--------- .../source/model/LifecycleRuleFilter.cpp | 33 +++++--- 2 files changed, 65 insertions(+), 52 deletions(-) diff --git a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/include/aws/s3/model/LifecycleRuleFilter.h b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/include/aws/s3/model/LifecycleRuleFilter.h index cad944e41..0ec359ca3 100644 --- a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/include/aws/s3/model/LifecycleRuleFilter.h +++ b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/include/aws/s3/model/LifecycleRuleFilter.h @@ -121,44 +121,6 @@ namespace Model */ inline LifecycleRuleFilter& WithPrefix(const char* value) { SetPrefix(value); return *this;} - - /** - *

This tag must exist in the object's tag set in order for the rule to - * apply.

- */ - inline const Tag& GetTag() const{ return m_tag; } - - /** - *

This tag must exist in the object's tag set in order for the rule to - * apply.

- */ - inline bool TagHasBeenSet() const { return m_tagHasBeenSet; } - - /** - *

This tag must exist in the object's tag set in order for the rule to - * apply.

- */ - inline void SetTag(const Tag& value) { m_tagHasBeenSet = true; m_tag = value; } - - /** - *

This tag must exist in the object's tag set in order for the rule to - * apply.

- */ - inline void SetTag(Tag&& value) { m_tagHasBeenSet = true; m_tag = std::move(value); } - - /** - *

This tag must exist in the object's tag set in order for the rule to - * apply.

- */ - inline LifecycleRuleFilter& WithTag(const Tag& value) { SetTag(value); return *this;} - - /** - *

This tag must exist in the object's tag set in order for the rule to - * apply.

- */ - inline LifecycleRuleFilter& WithTag(Tag&& value) { SetTag(std::move(value)); return *this;} - - inline const LifecycleRuleAndOperator& GetAnd() const{ return m_and; } @@ -733,6 +695,48 @@ namespace Model inline LifecycleRuleFilter& WithPrefixNotMatch(const char* value) { SetPrefixNotMatch(value); return *this;} + + /** + *

A lifecycle rule for individual objects in an Amazon S3 bucket.

+ */ + inline const Aws::Vector& GetTags() const{ return m_tags; } + + /** + *

A lifecycle rule for individual objects in an Amazon S3 bucket.

+ */ + inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; } + + /** + *

A lifecycle rule for individual objects in an Amazon S3 bucket.

+ */ + inline void SetTags(const Aws::Vector& value) { m_tagsHasBeenSet = true; m_tags = value; } + + /** + *

A lifecycle rule for individual objects in an Amazon S3 bucket.

+ */ + inline void SetTags(Aws::Vector&& value) { m_tagsHasBeenSet = true; m_tags = std::move(value); } + + /** + *

A lifecycle rule for individual objects in an Amazon S3 bucket.

+ */ + inline LifecycleRuleFilter& WithTags(const Aws::Vector& value) { SetTags(value); return *this;} + + /** + *

A lifecycle rule for individual objects in an Amazon S3 bucket.

+ */ + inline LifecycleRuleFilter& WithTags(Aws::Vector&& value) { SetTags(std::move(value)); return *this;} + + /** + *

A lifecycle rule for individual objects in an Amazon S3 bucket.

+ */ + inline LifecycleRuleFilter& AddTags(const Tag& value) { m_tagsHasBeenSet = true; m_tags.push_back(value); return *this; } + + /** + *

A lifecycle rule for individual objects in an Amazon S3 bucket.

+ */ + inline LifecycleRuleFilter& AddTags(Tag&& value) { m_tagsHasBeenSet = true; m_tags.push_back(std::move(value)); return *this; } + + private: Aws::String m_prefixNotMatch; @@ -774,8 +778,8 @@ namespace Model Aws::String m_prefix; bool m_prefixHasBeenSet; - Tag m_tag; - bool m_tagHasBeenSet; + Aws::Vector m_tags; + bool m_tagsHasBeenSet; LifecycleRuleAndOperator m_and; bool m_andHasBeenSet; diff --git a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/LifecycleRuleFilter.cpp b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/LifecycleRuleFilter.cpp index 9903dd524..bbddb3423 100644 --- a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/LifecycleRuleFilter.cpp +++ b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/LifecycleRuleFilter.cpp @@ -22,7 +22,7 @@ namespace Model LifecycleRuleFilter::LifecycleRuleFilter() : m_prefixHasBeenSet(false), - m_tagHasBeenSet(false), + m_tagsHasBeenSet(false), m_andHasBeenSet(false), m_objectSizeEqualToHasBeenSet(false), m_objectSizeLessThanOrEqualToHasBeenSet(false), @@ -41,7 +41,7 @@ LifecycleRuleFilter::LifecycleRuleFilter() : LifecycleRuleFilter::LifecycleRuleFilter(const XmlNode& xmlNode) : m_prefixHasBeenSet(false), - m_tagHasBeenSet(false), + m_tagsHasBeenSet(false), m_andHasBeenSet(false), m_objectSizeEqualToHasBeenSet(false), m_objectSizeLessThanOrEqualToHasBeenSet(false), @@ -159,12 +159,19 @@ LifecycleRuleFilter& LifecycleRuleFilter::operator =(const XmlNode& xmlNode) m_objectSizeBetweenEndHasBeenSet = true; } } - XmlNode tagNode = resultNode.FirstChild("Tag"); - if(!tagNode.IsNull()) - { - m_tag = tagNode; - m_tagHasBeenSet = true; - } + + XmlNode tagsNode = resultNode.FirstChild("Tag"); + if(!tagsNode.IsNull()) + { + XmlNode tagMember = tagsNode; + while(!tagMember.IsNull()) + { + m_tags.push_back(tagMember); + tagMember = tagMember.NextNode("Tag"); + } + m_tagsHasBeenSet = true; + } + } @@ -250,12 +257,14 @@ void LifecycleRuleFilter::AddToNode(XmlNode& parentNode) const EndNode.SetText(m_objectSizeBetweenEnd); } } - - if(m_tagHasBeenSet) + if(m_tagsHasBeenSet) { - XmlNode tagNode = parentNode.CreateChildElement("Tag"); - m_tag.AddToNode(tagNode); + for(const auto& item : m_tags) + { + XmlNode tagsNode = parentNode.CreateChildElement("Tag"); + item.AddToNode(tagsNode); + } } } -- Gitee From edacf8adcb13a1ad8e69d6b6f20aca520afeca9d Mon Sep 17 00:00:00 2001 From: luxy Date: Mon, 15 May 2023 17:05:00 +0800 Subject: [PATCH 4/4] a --- .../aws/s3/model/BucketOSCPConfiguration.h | 44 ++++++++++++++++ .../source/model/BucketOSCPConfiguration.cpp | 51 ++++++++++++++++++- 2 files changed, 93 insertions(+), 2 deletions(-) diff --git a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/include/aws/s3/model/BucketOSCPConfiguration.h b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/include/aws/s3/model/BucketOSCPConfiguration.h index 4a273b150..c68499137 100644 --- a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/include/aws/s3/model/BucketOSCPConfiguration.h +++ b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/include/aws/s3/model/BucketOSCPConfiguration.h @@ -7,6 +7,7 @@ #include #include #include +#include #include namespace Aws @@ -718,11 +719,54 @@ namespace Model inline bool PolicyFilterHasBeenSet() const { return m_policyFilterHasBeenSet; } inline void SetPolicyFilter(bool value) { m_policyFilterHasBeenSet = value; } + /** + *

A lifecycle rule for individual objects in an Amazon S3 bucket.

+ */ + inline const Aws::Vector& GetPolicyFilterTags() const{ return m_policyFiltertags; } + + /** + *

A lifecycle rule for individual objects in an Amazon S3 bucket.

+ */ + inline bool PolicyFilterTagsHasBeenSet() const { return m_policyFiltertagsHasBeenSet; } + + /** + *

A lifecycle rule for individual objects in an Amazon S3 bucket.

+ */ + inline void SetPolicyFilterTags(const Aws::Vector& value) { m_policyFiltertagsHasBeenSet = true; m_policyFiltertags = value; } + + /** + *

A lifecycle rule for individual objects in an Amazon S3 bucket.

+ */ + inline void SetPolicyFilterTags(Aws::Vector&& value) { m_policyFiltertagsHasBeenSet = true; m_policyFiltertags = std::move(value); } + + /** + *

A lifecycle rule for individual objects in an Amazon S3 bucket.

+ */ + inline BucketOSCPConfiguration& WithPolicyFilterTags(const Aws::Vector& value) { SetPolicyFilterTags(value); return *this;} + + /** + *

A lifecycle rule for individual objects in an Amazon S3 bucket.

+ */ + inline BucketOSCPConfiguration& WithPolicyFilterTags(Aws::Vector&& value) { SetPolicyFilterTags(std::move(value)); return *this;} + + /** + *

A lifecycle rule for individual objects in an Amazon S3 bucket.

+ */ + inline BucketOSCPConfiguration& AddPolicyFilterTags(const Tag& value) { m_policyFiltertagsHasBeenSet = true; m_policyFiltertags.push_back(value); return *this; } + + /** + *

A lifecycle rule for individual objects in an Amazon S3 bucket.

+ */ + inline BucketOSCPConfiguration& AddPolicyFilterTags(Tag&& value) { m_policyFiltertagsHasBeenSet = true; m_policyFiltertags.push_back(std::move(value)); return *this; } + private: + Aws::Vector m_policyFiltertags; + bool m_policyFiltertagsHasBeenSet; + bool m_policyFilterHasBeenSet; Aws::String m_policyFilterUserMetadataValue; diff --git a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/BucketOSCPConfiguration.cpp b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/BucketOSCPConfiguration.cpp index cb61601aa..2e7bb9ad1 100644 --- a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/BucketOSCPConfiguration.cpp +++ b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-s3/source/model/BucketOSCPConfiguration.cpp @@ -41,7 +41,8 @@ BucketOSCPConfiguration::BucketOSCPConfiguration() : m_policyFilterObjectSizeGreaterThanHasBeenSet(false), m_policyFilterUserMetadataKeyHasBeenSet(false), m_policyFilterUserMetadataValueHasBeenSet(false), - m_policyFilterHasBeenSet(false) + m_policyFilterHasBeenSet(false), + m_policyFiltertagsHasBeenSet(false) { } @@ -65,7 +66,8 @@ BucketOSCPConfiguration::BucketOSCPConfiguration(const XmlNode& xmlNode) : m_policyFilterObjectSizeGreaterThanHasBeenSet(false), m_policyFilterUserMetadataKeyHasBeenSet(false), m_policyFilterUserMetadataValueHasBeenSet(false), - m_policyFilterHasBeenSet(false) + m_policyFilterHasBeenSet(false), + m_policyFiltertagsHasBeenSet(false) { *this = xmlNode; } @@ -133,6 +135,18 @@ BucketOSCPConfiguration& BucketOSCPConfiguration::operator =(const XmlNode& xmlN m_policyFilterSuffixHasBeenSet = true; } + XmlNode tagsNode = andNode.FirstChild("Tag"); + if(!tagsNode.IsNull()) + { + XmlNode tagMember = tagsNode; + while(!tagMember.IsNull()) + { + m_policyFiltertags.push_back(tagMember); + tagMember = tagMember.NextNode("Tag"); + } + m_policyFiltertagsHasBeenSet = true; + } + XmlNode suffixNotMatchNode = andNode.FirstChild("SuffixNotMatch"); if(!suffixNotMatchNode.IsNull()) { @@ -235,6 +249,18 @@ BucketOSCPConfiguration& BucketOSCPConfiguration::operator =(const XmlNode& xmlN m_policyFilterSuffix = Aws::Utils::Xml::DecodeEscapedXmlText(suffixNode.GetText()); m_policyFilterSuffixHasBeenSet = true; } + + XmlNode tagsNode = orNode.FirstChild("Tag"); + if(!tagsNode.IsNull()) + { + XmlNode tagMember = tagsNode; + while(!tagMember.IsNull()) + { + m_policyFiltertags.push_back(tagMember); + tagMember = tagMember.NextNode("Tag"); + } + m_policyFiltertagsHasBeenSet = true; + } XmlNode suffixNotMatchNode = orNode.FirstChild("SuffixNotMatch"); if(!suffixNotMatchNode.IsNull()) @@ -337,6 +363,18 @@ BucketOSCPConfiguration& BucketOSCPConfiguration::operator =(const XmlNode& xmlN m_policyFilterSuffixHasBeenSet = true; } + XmlNode tagsNode = filterNode.FirstChild("Tag"); + if(!tagsNode.IsNull()) + { + XmlNode tagMember = tagsNode; + while(!tagMember.IsNull()) + { + m_policyFiltertags.push_back(tagMember); + tagMember = tagMember.NextNode("Tag"); + } + m_policyFiltertagsHasBeenSet = true; + } + XmlNode suffixNotMatchNode = filterNode.FirstChild("SuffixNotMatch"); if(!suffixNotMatchNode.IsNull()) { @@ -529,6 +567,15 @@ void BucketOSCPConfiguration::AddToNode(XmlNode& parentNode) const ObjectSizeGreaterThanNode.SetText(m_policyFilterObjectSizeGreaterThan); } + if(m_policyFiltertagsHasBeenSet) + { + for(const auto& item : m_policyFiltertags) + { + XmlNode tagsNode = parentNode.CreateChildElement("Tag"); + item.AddToNode(tagsNode); + } + } + if(m_policyFilterUserMetadataKeyHasBeenSet || m_policyFilterUserMetadataValueHasBeenSet) { XmlNode UserMetadataNode = parentNode.CreateChildElement("UserMetadata"); -- Gitee