Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion aws-cpp-sdk-s3/include/aws/s3/S3ServiceClientModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
#include <aws/s3/model/GetObjectTorrentResult.h>
#include <aws/s3/model/GetPublicAccessBlockResult.h>
#include <aws/s3/model/HeadObjectResult.h>
#include <aws/s3/model/HeadBucketResult.h>
#include <aws/s3/model/ListBucketAnalyticsConfigurationsResult.h>
#include <aws/s3/model/ListBucketIntelligentTieringConfigurationsResult.h>
#include <aws/s3/model/ListBucketInventoryConfigurationsResult.h>
Expand Down Expand Up @@ -261,7 +262,7 @@ namespace Aws
typedef Aws::Utils::Outcome<GetObjectTaggingResult, S3Error> GetObjectTaggingOutcome;
typedef Aws::Utils::Outcome<GetObjectTorrentResult, S3Error> GetObjectTorrentOutcome;
typedef Aws::Utils::Outcome<GetPublicAccessBlockResult, S3Error> GetPublicAccessBlockOutcome;
typedef Aws::Utils::Outcome<Aws::NoResult, S3Error> HeadBucketOutcome;
typedef Aws::Utils::Outcome<HeadBucketResult, S3Error> HeadBucketOutcome;
typedef Aws::Utils::Outcome<HeadObjectResult, S3Error> HeadObjectOutcome;
typedef Aws::Utils::Outcome<ListBucketAnalyticsConfigurationsResult, S3Error> ListBucketAnalyticsConfigurationsOutcome;
typedef Aws::Utils::Outcome<ListBucketIntelligentTieringConfigurationsResult, S3Error> ListBucketIntelligentTieringConfigurationsOutcome;
Expand Down
53 changes: 53 additions & 0 deletions aws-cpp-sdk-s3/include/aws/s3/model/HeadBucketResult.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/

#pragma once
#include <aws/s3/S3_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>

namespace Aws
{
template<typename RESULT_TYPE>
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<Aws::Utils::Xml::XmlDocument>& result);
AWS_S3_API HeadBucketResult(Aws::AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>&& result);
AWS_S3_API HeadBucketResult& operator=(Aws::AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument> result);


/**
* <p>Region of the bucket. If it's any empty string, this response header does not appear in the response.</p>
*/
inline const Aws::String & GetRegion() const{ return m_region; }

/**
* <p>Set region for the bucket.</p>
*/
inline void SetRegion(Aws::String value) { m_region = std::move(value); }

private:

Aws::String m_region;

};

} // namespace Model
} // namespace S3
} // namespace Aws
35 changes: 35 additions & 0 deletions aws-cpp-sdk-s3/source/model/HeadBucketResult.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/

#include <aws/s3/model/HeadBucketResult.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/xml/XmlSerializer.h>

#include <utility>

using namespace Aws::S3::Model;
using namespace Aws;

HeadBucketResult::HeadBucketResult(const Aws::AmazonWebServiceResult<Utils::Xml::XmlDocument>& result)
{
*this = result;
}

HeadBucketResult::HeadBucketResult(Aws::AmazonWebServiceResult<Utils::Xml::XmlDocument>&& result)
{
*this = std::move(result);
}

HeadBucketResult& HeadBucketResult::operator =(Aws::AmazonWebServiceResult<Utils::Xml::XmlDocument> 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;
}