diff --git a/aws-cpp-sdk-s3/include/aws/s3/S3ServiceClientModel.h b/aws-cpp-sdk-s3/include/aws/s3/S3ServiceClientModel.h index e0938c41eae2..a9e9c5079fb3 100644 --- a/aws-cpp-sdk-s3/include/aws/s3/S3ServiceClientModel.h +++ b/aws-cpp-sdk-s3/include/aws/s3/S3ServiceClientModel.h @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #include @@ -261,7 +262,7 @@ namespace Aws typedef Aws::Utils::Outcome GetObjectTaggingOutcome; typedef Aws::Utils::Outcome GetObjectTorrentOutcome; typedef Aws::Utils::Outcome GetPublicAccessBlockOutcome; - typedef Aws::Utils::Outcome HeadBucketOutcome; + typedef Aws::Utils::Outcome HeadBucketOutcome; typedef Aws::Utils::Outcome HeadObjectOutcome; typedef Aws::Utils::Outcome ListBucketAnalyticsConfigurationsOutcome; typedef Aws::Utils::Outcome ListBucketIntelligentTieringConfigurationsOutcome; diff --git a/aws-cpp-sdk-s3/include/aws/s3/model/HeadBucketResult.h b/aws-cpp-sdk-s3/include/aws/s3/model/HeadBucketResult.h new file mode 100644 index 000000000000..85a0ffe4837a --- /dev/null +++ b/aws-cpp-sdk-s3/include/aws/s3/model/HeadBucketResult.h @@ -0,0 +1,53 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +#pragma once +#include +#include + +namespace Aws +{ +template +class AmazonWebServiceResult; + +namespace Utils +{ +namespace Xml +{ + class XmlDocument; +} // namespace Xml +} // namespace Utils +namespace S3 +{ +namespace Model +{ + class HeadBucketResult + { + public: + AWS_S3_API HeadBucketResult() = default; + AWS_S3_API HeadBucketResult(const Aws::AmazonWebServiceResult& result); + AWS_S3_API HeadBucketResult(Aws::AmazonWebServiceResult&& result); + AWS_S3_API HeadBucketResult& operator=(Aws::AmazonWebServiceResult result); + + + /** + *

Region of the bucket. If it's any empty string, this response header does not appear in the response.

+ */ + inline const Aws::String & GetRegion() const{ return m_region; } + + /** + *

Set region for the bucket.

+ */ + inline void SetRegion(Aws::String value) { m_region = std::move(value); } + + private: + + Aws::String m_region; + + }; + +} // namespace Model +} // namespace S3 +} // namespace Aws diff --git a/aws-cpp-sdk-s3/source/model/HeadBucketResult.cpp b/aws-cpp-sdk-s3/source/model/HeadBucketResult.cpp new file mode 100644 index 000000000000..93cd8f43f79b --- /dev/null +++ b/aws-cpp-sdk-s3/source/model/HeadBucketResult.cpp @@ -0,0 +1,35 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +#include +#include +#include + +#include + +using namespace Aws::S3::Model; +using namespace Aws; + +HeadBucketResult::HeadBucketResult(const Aws::AmazonWebServiceResult& result) +{ + *this = result; +} + +HeadBucketResult::HeadBucketResult(Aws::AmazonWebServiceResult&& result) +{ + *this = std::move(result); +} + +HeadBucketResult& HeadBucketResult::operator =(Aws::AmazonWebServiceResult result) +{ + const auto& headers = result.GetHeaderValueCollection(); + const auto& requestIdIter = headers.find("x-amz-bucket-region"); + if(requestIdIter != headers.end()) + { + m_region = requestIdIter->second; + } + + return *this; +}