diff --git a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-iam/include/aws/iam/model/DeletePolicyRequest.h b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-iam/include/aws/iam/model/DeletePolicyRequest.h index 78717a2c32baa73bbe3309eccf18598bb7a82e8c..5bf828841ac3852aa008471a9abb3a24a1b76658 100644 --- a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-iam/include/aws/iam/model/DeletePolicyRequest.h +++ b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-iam/include/aws/iam/model/DeletePolicyRequest.h @@ -42,7 +42,7 @@ namespace Model * href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon * Resource Names (ARNs) in the AWS General Reference.

*/ - inline const Aws::String& GetPolicyArn() const{ return m_policyArn; } + inline const Aws::String& GetPolicyName() const{ return m_policyName; } /** *

The Amazon Resource Name (ARN) of the IAM policy you want to delete.

@@ -50,7 +50,7 @@ namespace Model * href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon * Resource Names (ARNs) in the AWS General Reference.

*/ - inline bool PolicyArnHasBeenSet() const { return m_policyArnHasBeenSet; } + inline bool PolicyNameHasBeenSet() const { return m_policyNameHasBeenSet; } /** *

The Amazon Resource Name (ARN) of the IAM policy you want to delete.

@@ -58,7 +58,7 @@ namespace Model * href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon * Resource Names (ARNs) in the AWS General Reference.

*/ - inline void SetPolicyArn(const Aws::String& value) { m_policyArnHasBeenSet = true; m_policyArn = value; } + inline void SetPolicyName(const Aws::String& value) { m_policyNameHasBeenSet = true; m_policyName = value; } /** *

The Amazon Resource Name (ARN) of the IAM policy you want to delete.

@@ -66,7 +66,7 @@ namespace Model * href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon * Resource Names (ARNs) in the AWS General Reference.

*/ - inline void SetPolicyArn(Aws::String&& value) { m_policyArnHasBeenSet = true; m_policyArn = std::move(value); } + inline void SetPolicyName(Aws::String&& value) { m_policyNameHasBeenSet = true; m_policyName = std::move(value); } /** *

The Amazon Resource Name (ARN) of the IAM policy you want to delete.

@@ -74,7 +74,7 @@ namespace Model * href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon * Resource Names (ARNs) in the AWS General Reference.

*/ - inline void SetPolicyArn(const char* value) { m_policyArnHasBeenSet = true; m_policyArn.assign(value); } + inline void SetPolicyName(const char* value) { m_policyNameHasBeenSet = true; m_policyName.assign(value); } /** *

The Amazon Resource Name (ARN) of the IAM policy you want to delete.

@@ -82,7 +82,7 @@ namespace Model * href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon * Resource Names (ARNs) in the AWS General Reference.

*/ - inline DeletePolicyRequest& WithPolicyArn(const Aws::String& value) { SetPolicyArn(value); return *this;} + inline DeletePolicyRequest& WithPolicyName(const Aws::String& value) { SetPolicyName(value); return *this;} /** *

The Amazon Resource Name (ARN) of the IAM policy you want to delete.

@@ -90,7 +90,7 @@ namespace Model * href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon * Resource Names (ARNs) in the AWS General Reference.

*/ - inline DeletePolicyRequest& WithPolicyArn(Aws::String&& value) { SetPolicyArn(std::move(value)); return *this;} + inline DeletePolicyRequest& WithPolicyName(Aws::String&& value) { SetPolicyName(std::move(value)); return *this;} /** *

The Amazon Resource Name (ARN) of the IAM policy you want to delete.

@@ -98,12 +98,12 @@ namespace Model * href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon * Resource Names (ARNs) in the AWS General Reference.

*/ - inline DeletePolicyRequest& WithPolicyArn(const char* value) { SetPolicyArn(value); return *this;} + inline DeletePolicyRequest& WithPolicyName(const char* value) { SetPolicyName(value); return *this;} private: - Aws::String m_policyArn; - bool m_policyArnHasBeenSet; + Aws::String m_policyName; + bool m_policyNameHasBeenSet; }; } // namespace Model diff --git a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-iam/include/aws/iam/model/GetPolicyRequest.h b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-iam/include/aws/iam/model/GetPolicyRequest.h index 571677ff07b1705fe2e6b4cc99230170ac532bcf..728d0067c5e22c0f4dac96e2cb2d1a24e53f26ed 100644 --- a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-iam/include/aws/iam/model/GetPolicyRequest.h +++ b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-iam/include/aws/iam/model/GetPolicyRequest.h @@ -42,7 +42,7 @@ namespace Model * href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon * Resource Names (ARNs) in the AWS General Reference.

*/ - inline const Aws::String& GetPolicyArn() const{ return m_policyArn; } + inline const Aws::String& GetPolicyName() const{ return m_policyName; } /** *

The Amazon Resource Name (ARN) of the managed policy that you want @@ -50,7 +50,7 @@ namespace Model * href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon * Resource Names (ARNs) in the AWS General Reference.

*/ - inline bool PolicyArnHasBeenSet() const { return m_policyArnHasBeenSet; } + inline bool PolicyNameHasBeenSet() const { return m_policyNameHasBeenSet; } /** *

The Amazon Resource Name (ARN) of the managed policy that you want @@ -58,7 +58,7 @@ namespace Model * href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon * Resource Names (ARNs) in the AWS General Reference.

*/ - inline void SetPolicyArn(const Aws::String& value) { m_policyArnHasBeenSet = true; m_policyArn = value; } + inline void SetPolicyName(const Aws::String& value) { m_policyNameHasBeenSet = true; m_policyName = value; } /** *

The Amazon Resource Name (ARN) of the managed policy that you want @@ -66,7 +66,7 @@ namespace Model * href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon * Resource Names (ARNs) in the AWS General Reference.

*/ - inline void SetPolicyArn(Aws::String&& value) { m_policyArnHasBeenSet = true; m_policyArn = std::move(value); } + inline void SetPolicyName(Aws::String&& value) { m_policyNameHasBeenSet = true; m_policyName = std::move(value); } /** *

The Amazon Resource Name (ARN) of the managed policy that you want @@ -74,7 +74,7 @@ namespace Model * href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon * Resource Names (ARNs) in the AWS General Reference.

*/ - inline void SetPolicyArn(const char* value) { m_policyArnHasBeenSet = true; m_policyArn.assign(value); } + inline void SetPolicyName(const char* value) { m_policyNameHasBeenSet = true; m_policyName.assign(value); } /** *

The Amazon Resource Name (ARN) of the managed policy that you want @@ -82,7 +82,7 @@ namespace Model * href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon * Resource Names (ARNs) in the AWS General Reference.

*/ - inline GetPolicyRequest& WithPolicyArn(const Aws::String& value) { SetPolicyArn(value); return *this;} + inline GetPolicyRequest& WithPolicyName(const Aws::String& value) { SetPolicyName(value); return *this;} /** *

The Amazon Resource Name (ARN) of the managed policy that you want @@ -90,7 +90,7 @@ namespace Model * href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon * Resource Names (ARNs) in the AWS General Reference.

*/ - inline GetPolicyRequest& WithPolicyArn(Aws::String&& value) { SetPolicyArn(std::move(value)); return *this;} + inline GetPolicyRequest& WithPolicyName(Aws::String&& value) { SetPolicyName(std::move(value)); return *this;} /** *

The Amazon Resource Name (ARN) of the managed policy that you want @@ -98,12 +98,12 @@ namespace Model * href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon * Resource Names (ARNs) in the AWS General Reference.

*/ - inline GetPolicyRequest& WithPolicyArn(const char* value) { SetPolicyArn(value); return *this;} + inline GetPolicyRequest& WithPolicyName(const char* value) { SetPolicyName(value); return *this;} private: - Aws::String m_policyArn; - bool m_policyArnHasBeenSet; + Aws::String m_policyName; + bool m_policyNameHasBeenSet; }; } // namespace Model diff --git a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-iam/include/aws/iam/model/Policy.h b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-iam/include/aws/iam/model/Policy.h index 3a21539f059e58f36c15d2e7909055fc0770e3c0..d32e659e01e64b2cf57ecc273b7fa75ad5ff2131 100644 --- a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-iam/include/aws/iam/model/Policy.h +++ b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-iam/include/aws/iam/model/Policy.h @@ -88,6 +88,45 @@ namespace Model */ inline Policy& WithPolicyName(const char* value) { SetPolicyName(value); return *this;} + /** + *

The friendly name (not ARN) identifying the policy.

+ */ + inline const Aws::String& GetDocument() const{ return m_document; } + + /** + *

The friendly name (not ARN) identifying the policy.

+ */ + inline bool DocumentHasBeenSet() const { return m_documentHasBeenSet; } + + /** + *

The friendly name (not ARN) identifying the policy.

+ */ + inline void SetDocument(const Aws::String& value) { m_documentHasBeenSet = true; m_document = value; } + + /** + *

The friendly name (not ARN) identifying the policy.

+ */ + inline void SetDocument(Aws::String&& value) { m_documentHasBeenSet = true; m_document = std::move(value); } + + /** + *

The friendly name (not ARN) identifying the policy.

+ */ + inline void SetDocument(const char* value) { m_documentHasBeenSet = true; m_document.assign(value); } + + /** + *

The friendly name (not ARN) identifying the policy.

+ */ + inline Policy& WithDocument(const Aws::String& value) { SetDocument(value); return *this;} + + /** + *

The friendly name (not ARN) identifying the policy.

+ */ + inline Policy& WithDocument(Aws::String&& value) { SetDocument(std::move(value)); return *this;} + + /** + *

The friendly name (not ARN) identifying the policy.

+ */ + inline Policy& WithDocument(const char* value) { SetDocument(value); return *this;} /** *

The stable and unique string identifying the policy.

For more @@ -589,6 +628,9 @@ namespace Model Aws::String m_policyName; bool m_policyNameHasBeenSet; + + Aws::String m_document; + bool m_documentHasBeenSet; Aws::String m_policyId; bool m_policyIdHasBeenSet; diff --git a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-iam/source/model/DeletePolicyRequest.cpp b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-iam/source/model/DeletePolicyRequest.cpp index 6bccc6127cec0a4a89bd2d431d05afddcc1a69e0..5e3847ccafbeaf069c4e3ecef60f35ca557e7989 100644 --- a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-iam/source/model/DeletePolicyRequest.cpp +++ b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-iam/source/model/DeletePolicyRequest.cpp @@ -11,7 +11,7 @@ using namespace Aws::IAM::Model; using namespace Aws::Utils; DeletePolicyRequest::DeletePolicyRequest() : - m_policyArnHasBeenSet(false) + m_policyNameHasBeenSet(false) { } @@ -19,9 +19,9 @@ Aws::String DeletePolicyRequest::SerializePayload() const { Aws::StringStream ss; ss << "Action=DeletePolicy&"; - if(m_policyArnHasBeenSet) + if(m_policyNameHasBeenSet) { - ss << "PolicyArn=" << StringUtils::URLEncode(m_policyArn.c_str()) << "&"; + ss << "PolicyName=" << StringUtils::URLEncode(m_policyName.c_str()) << "&"; } ss << "Version=2010-05-08"; diff --git a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-iam/source/model/GetPolicyRequest.cpp b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-iam/source/model/GetPolicyRequest.cpp index 55d8173c3605b594cdc17dda4410ef189fc0e83d..1fa78dccc179b4a60aadb0f43e8dc9ade6e589c2 100644 --- a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-iam/source/model/GetPolicyRequest.cpp +++ b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-iam/source/model/GetPolicyRequest.cpp @@ -11,7 +11,7 @@ using namespace Aws::IAM::Model; using namespace Aws::Utils; GetPolicyRequest::GetPolicyRequest() : - m_policyArnHasBeenSet(false) + m_policyNameHasBeenSet(false) { } @@ -19,9 +19,9 @@ Aws::String GetPolicyRequest::SerializePayload() const { Aws::StringStream ss; ss << "Action=GetPolicy&"; - if(m_policyArnHasBeenSet) + if(m_policyNameHasBeenSet) { - ss << "PolicyArn=" << StringUtils::URLEncode(m_policyArn.c_str()) << "&"; + ss << "PolicyName=" << StringUtils::URLEncode(m_policyName.c_str()) << "&"; } ss << "Version=2010-05-08"; diff --git a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-iam/source/model/Policy.cpp b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-iam/source/model/Policy.cpp index c9135a56efc367b920276266634cce850ba003f9..a9417bb071c94fd6a66b2642b4bf02b1852a4cab 100644 --- a/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-iam/source/model/Policy.cpp +++ b/aws-sdk-cpp-1.8.183/aws-sdk-cpp-1.8.183/aws-cpp-sdk-iam/source/model/Policy.cpp @@ -22,6 +22,7 @@ namespace Model Policy::Policy() : m_policyNameHasBeenSet(false), + m_documentHasBeenSet(false), m_policyIdHasBeenSet(false), m_arnHasBeenSet(false), m_pathHasBeenSet(false), @@ -41,6 +42,7 @@ Policy::Policy() : Policy::Policy(const XmlNode& xmlNode) : m_policyNameHasBeenSet(false), + m_documentHasBeenSet(false), m_policyIdHasBeenSet(false), m_arnHasBeenSet(false), m_pathHasBeenSet(false), @@ -71,6 +73,12 @@ Policy& Policy::operator =(const XmlNode& xmlNode) m_policyName = Aws::Utils::Xml::DecodeEscapedXmlText(policyNameNode.GetText()); m_policyNameHasBeenSet = true; } + XmlNode documentNode = resultNode.FirstChild("Document"); + if(!documentNode.IsNull()) + { + m_document = Aws::Utils::Xml::DecodeEscapedXmlText(documentNode.GetText()); + m_documentHasBeenSet = true; + } XmlNode policyIdNode = resultNode.FirstChild("PolicyId"); if(!policyIdNode.IsNull()) { @@ -155,6 +163,11 @@ void Policy::OutputToStream(Aws::OStream& oStream, const char* location, unsigne oStream << location << index << locationValue << ".PolicyName=" << StringUtils::URLEncode(m_policyName.c_str()) << "&"; } + if(m_documentHasBeenSet) + { + oStream << location << index << locationValue << ".Document=" << StringUtils::URLEncode(m_document.c_str()) << "&"; + } + if(m_policyIdHasBeenSet) { oStream << location << index << locationValue << ".PolicyId=" << StringUtils::URLEncode(m_policyId.c_str()) << "&"; @@ -224,6 +237,10 @@ void Policy::OutputToStream(Aws::OStream& oStream, const char* location) const { oStream << location << ".PolicyName=" << StringUtils::URLEncode(m_policyName.c_str()) << "&"; } + if(m_documentHasBeenSet) + { + oStream << location << ".Document=" << StringUtils::URLEncode(m_document.c_str()) << "&"; + } if(m_policyIdHasBeenSet) { oStream << location << ".PolicyId=" << StringUtils::URLEncode(m_policyId.c_str()) << "&"; 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 2e7bb9ad17afce5592ef14f59ea3e1492331c0d7..f8c67bdedab71335268a7f27a6a39620457a9187 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 @@ -249,18 +249,36 @@ 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 tagAndNode = orNode.FirstChild("And"); + if(!tagAndNode.IsNull()) + { + XmlNode tagsNode = tagAndNode.FirstChild("Tag"); + if(!tagsNode.IsNull()) + { + XmlNode tagMember = tagsNode; + while(!tagMember.IsNull()) + { + m_policyFiltertags.push_back(tagMember); + tagMember = tagMember.NextNode("Tag"); + } + m_policyFiltertagsHasBeenSet = true; + } + } + else + { + 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()) @@ -363,17 +381,17 @@ 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 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()) @@ -567,14 +585,26 @@ 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_policyFiltertagsHasBeenSet) + { + if(m_policyOrHasBeenSet && m_policyFiltertags.size() > 1) + { + XmlNode tagAndNode = parentNode.CreateChildElement("And"); + for(const auto& item : m_policyFiltertags) + { + XmlNode tagsNode = tagAndNode.CreateChildElement("Tag"); + item.AddToNode(tagsNode); + } + } + else + { + for(const auto& item : m_policyFiltertags) + { + XmlNode tagsNode = parentNode.CreateChildElement("Tag"); + item.AddToNode(tagsNode); + } + } + } if(m_policyFilterUserMetadataKeyHasBeenSet || m_policyFilterUserMetadataValueHasBeenSet) { 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 bbddb342313796e0c3d3abc51a3e9b9c869700b5..3c0e6b1080c367fa50bea955593202da2e705a6c 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 @@ -159,19 +159,36 @@ LifecycleRuleFilter& LifecycleRuleFilter::operator =(const XmlNode& xmlNode) m_objectSizeBetweenEndHasBeenSet = 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; - } - + + XmlNode tagAndNode = resultNode.FirstChild("And"); + if(!tagAndNode.IsNull()) + { + XmlNode tagsNode = tagAndNode.FirstChild("Tag"); + if(!tagsNode.IsNull()) + { + XmlNode tagMember = tagsNode; + while(!tagMember.IsNull()) + { + m_tags.push_back(tagMember); + tagMember = tagMember.NextNode("Tag"); + } + m_tagsHasBeenSet = true; + } + } + else + { + 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; + } + } } @@ -260,11 +277,23 @@ void LifecycleRuleFilter::AddToNode(XmlNode& parentNode) const if(m_tagsHasBeenSet) { - for(const auto& item : m_tags) - { - XmlNode tagsNode = parentNode.CreateChildElement("Tag"); - item.AddToNode(tagsNode); - } + if(m_isOrHasBeenSet && m_tags.size() > 1) + { + XmlNode tagAndNode = parentNode.CreateChildElement("And"); + for(const auto& item : m_tags) + { + XmlNode tagsNode = tagAndNode.CreateChildElement("Tag"); + item.AddToNode(tagsNode); + } + } + else + { + for(const auto& item : m_tags) + { + XmlNode tagsNode = parentNode.CreateChildElement("Tag"); + item.AddToNode(tagsNode); + } + } } } diff --git a/create_policy.cpp b/create_policy.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6959bce9edc01f63cecebcf30d8b768af9689ef5 --- /dev/null +++ b/create_policy.cpp @@ -0,0 +1,49 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace Aws::IAM; +using namespace Aws::IAM::Model; +using namespace Aws::Utils; + + +int main(int argc, char** argv) +{ + Aws::SDKOptions options; + options.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Trace; + InitAPI(options); + + Aws::IAM::IAMClient iamClient = sugonGetIAMClient("Zv33LRIEIjMOOBXX9JmwJlfc048sfUtY", "wikiydsg0u0vmsl0tvaplkkuhh0rhgnf", "http://10.20.0.81:20482"); + + Aws::IAM::Model::CreatePolicyRequest request; + + request.SetPolicyName("C_policy1"); + request.SetPolicyDocument("{\"Version\": \"2012-10-17\", \"Statement\":[{\"Sid\":\"IAMExamplePolicy\", \"Effect\": \"Allow\", \"Action\":\"*\", \"Resource\":\"*\"}]}"); + + CreatePolicyOutcome outcome = iamClient.CreatePolicy(request); + + if (!outcome.IsSuccess()) + { + const Aws::IAM::IAMError &err = outcome.GetError(); + std::cerr << "Error: CreatePolicy: " << + err.GetExceptionName() << ": " << err.GetMessage() << std::endl; + } + else + { + Policy policy = outcome.GetResult().GetPolicy(); + std::cout< +#include +#include +#include +#include +#include +#include +#include + +using namespace Aws::IAM; +using namespace Aws::IAM::Model; +using namespace Aws::Utils; + + +int main(int argc, char** argv) +{ + Aws::SDKOptions options; + options.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Trace; + InitAPI(options); + + Aws::IAM::IAMClient iamClient = sugonGetIAMClient("Zv33LRIEIjMOOBXX9JmwJlfc048sfUtY", "wikiydsg0u0vmsl0tvaplkkuhh0rhgnf", "http://10.20.0.81:20482"); + + Aws::IAM::Model::DeletePolicyRequest request; + + request.SetPolicyName("C_policy1"); + + DeletePolicyOutcome outcome = iamClient.DeletePolicy(request); + + if (!outcome.IsSuccess()) + { + const Aws::IAM::IAMError &err = outcome.GetError(); + std::cerr << "Error: DeletePolicy: " << + err.GetExceptionName() << ": " << err.GetMessage() << std::endl; + } + else + { + ; + } + + std::cout << "success" << std::endl; + + Aws::ShutdownAPI(options); + + return 0; +} diff --git a/get_policy.cpp b/get_policy.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d741f892942a65ddcf6117fcfb79744bf25f445e --- /dev/null +++ b/get_policy.cpp @@ -0,0 +1,48 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace Aws::IAM; +using namespace Aws::IAM::Model; +using namespace Aws::Utils; + + +int main(int argc, char** argv) +{ + Aws::SDKOptions options; + options.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Trace; + InitAPI(options); + + Aws::IAM::IAMClient iamClient = sugonGetIAMClient("Zv33LRIEIjMOOBXX9JmwJlfc048sfUtY", "wikiydsg0u0vmsl0tvaplkkuhh0rhgnf", "http://10.20.0.81:20482"); + + Aws::IAM::Model::GetPolicyRequest request; + + request.SetPolicyName("C_policy1"); + + GetPolicyOutcome outcome = iamClient.GetPolicy(request); + + if (!outcome.IsSuccess()) + { + const Aws::IAM::IAMError &err = outcome.GetError(); + std::cerr << "Error: GetPolicy: " << + err.GetExceptionName() << ": " << err.GetMessage() << std::endl; + } + else + { + Policy policy = outcome.GetResult().GetPolicy(); + std::cout< +#include +#include +#include +#include +#include +#include +#include + +using namespace Aws::IAM; +using namespace Aws::IAM::Model; +using namespace Aws::Utils; + + +int main(int argc, char** argv) +{ + Aws::SDKOptions options; + options.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Trace; + InitAPI(options); + + Aws::IAM::IAMClient iamClient = sugonGetIAMClient("Zv33LRIEIjMOOBXX9JmwJlfc048sfUtY", "wikiydsg0u0vmsl0tvaplkkuhh0rhgnf", "http://10.20.0.81:20482"); + + Aws::IAM::Model::ListPoliciesRequest request; + + request.SetOnlyAttached(false); + request.SetMaxItems(100); + + ListPoliciesOutcome outcome = iamClient.ListPolicies(request); + + if (!outcome.IsSuccess()) + { + const Aws::IAM::IAMError &err = outcome.GetError(); + std::cerr << "Error: ListPolicies: " << + err.GetExceptionName() << ": " << err.GetMessage() << std::endl; + } + else + { + Aws::Vector policies= outcome.GetResult().GetPolicies(); + for (int i = 0; i < policies.size(); i++) { + std::cout<