DeleteBucketReplicationRequest.cpp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /**
  2. * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
  3. * SPDX-License-Identifier: Apache-2.0.
  4. */
  5. #include <aws/s3/model/DeleteBucketReplicationRequest.h>
  6. #include <aws/core/utils/xml/XmlSerializer.h>
  7. #include <aws/core/utils/memory/stl/AWSStringStream.h>
  8. #include <aws/core/http/URI.h>
  9. #include <aws/core/utils/memory/stl/AWSStringStream.h>
  10. #include <utility>
  11. using namespace Aws::S3::Model;
  12. using namespace Aws::Utils::Xml;
  13. using namespace Aws::Utils;
  14. using namespace Aws::Http;
  15. DeleteBucketReplicationRequest::DeleteBucketReplicationRequest() :
  16. m_bucketHasBeenSet(false),
  17. m_expectedBucketOwnerHasBeenSet(false),
  18. m_customizedAccessLogTagHasBeenSet(false)
  19. {
  20. }
  21. Aws::String DeleteBucketReplicationRequest::SerializePayload() const
  22. {
  23. return {};
  24. }
  25. void DeleteBucketReplicationRequest::AddQueryStringParameters(URI& uri) const
  26. {
  27. Aws::StringStream ss;
  28. if(!m_customizedAccessLogTag.empty())
  29. {
  30. // only accept customized LogTag which starts with "x-"
  31. Aws::Map<Aws::String, Aws::String> collectedLogTags;
  32. for(const auto& entry: m_customizedAccessLogTag)
  33. {
  34. if (!entry.first.empty() && !entry.second.empty() && entry.first.substr(0, 2) == "x-")
  35. {
  36. collectedLogTags.emplace(entry.first, entry.second);
  37. }
  38. }
  39. if (!collectedLogTags.empty())
  40. {
  41. uri.AddQueryStringParameter(collectedLogTags);
  42. }
  43. }
  44. }
  45. Aws::Http::HeaderValueCollection DeleteBucketReplicationRequest::GetRequestSpecificHeaders() const
  46. {
  47. Aws::Http::HeaderValueCollection headers;
  48. Aws::StringStream ss;
  49. if(m_expectedBucketOwnerHasBeenSet)
  50. {
  51. ss << m_expectedBucketOwner;
  52. headers.emplace("x-amz-expected-bucket-owner", ss.str());
  53. ss.str("");
  54. }
  55. return headers;
  56. }