This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
pxz-hos-client-cpp-module/support/aws-sdk-cpp-master/aws-cpp-sdk-ec2/source/model/CopySnapshotRequest.cpp

91 lines
2.2 KiB
C++

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/ec2/model/CopySnapshotRequest.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
using namespace Aws::EC2::Model;
using namespace Aws::Utils;
CopySnapshotRequest::CopySnapshotRequest() :
m_descriptionHasBeenSet(false),
m_destinationRegionHasBeenSet(false),
m_encrypted(false),
m_encryptedHasBeenSet(false),
m_kmsKeyIdHasBeenSet(false),
m_presignedUrlHasBeenSet(false),
m_sourceRegionHasBeenSet(false),
m_sourceSnapshotIdHasBeenSet(false),
m_tagSpecificationsHasBeenSet(false),
m_dryRun(false),
m_dryRunHasBeenSet(false)
{
}
Aws::String CopySnapshotRequest::SerializePayload() const
{
Aws::StringStream ss;
ss << "Action=CopySnapshot&";
if(m_descriptionHasBeenSet)
{
ss << "Description=" << StringUtils::URLEncode(m_description.c_str()) << "&";
}
if(m_destinationRegionHasBeenSet)
{
ss << "DestinationRegion=" << StringUtils::URLEncode(m_destinationRegion.c_str()) << "&";
}
if(m_encryptedHasBeenSet)
{
ss << "Encrypted=" << std::boolalpha << m_encrypted << "&";
}
if(m_kmsKeyIdHasBeenSet)
{
ss << "KmsKeyId=" << StringUtils::URLEncode(m_kmsKeyId.c_str()) << "&";
}
if(m_presignedUrlHasBeenSet)
{
ss << "PresignedUrl=" << StringUtils::URLEncode(m_presignedUrl.c_str()) << "&";
}
if(m_sourceRegionHasBeenSet)
{
ss << "SourceRegion=" << StringUtils::URLEncode(m_sourceRegion.c_str()) << "&";
}
if(m_sourceSnapshotIdHasBeenSet)
{
ss << "SourceSnapshotId=" << StringUtils::URLEncode(m_sourceSnapshotId.c_str()) << "&";
}
if(m_tagSpecificationsHasBeenSet)
{
unsigned tagSpecificationsCount = 1;
for(auto& item : m_tagSpecifications)
{
item.OutputToStream(ss, "TagSpecification.", tagSpecificationsCount, "");
tagSpecificationsCount++;
}
}
if(m_dryRunHasBeenSet)
{
ss << "DryRun=" << std::boolalpha << m_dryRun << "&";
}
ss << "Version=2016-11-15";
return ss.str();
}
void CopySnapshotRequest::DumpBodyToUrl(Aws::Http::URI& uri ) const
{
uri.SetQueryString(SerializePayload());
}