/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::EC2::Model; using namespace Aws::Utils; ExportImageRequest::ExportImageRequest() : m_clientToken(Aws::Utils::UUID::PseudoRandomUUID()), m_clientTokenHasBeenSet(true), m_descriptionHasBeenSet(false), m_diskImageFormat(DiskImageFormat::NOT_SET), m_diskImageFormatHasBeenSet(false), m_dryRun(false), m_dryRunHasBeenSet(false), m_imageIdHasBeenSet(false), m_s3ExportLocationHasBeenSet(false), m_roleNameHasBeenSet(false), m_tagSpecificationsHasBeenSet(false) { } Aws::String ExportImageRequest::SerializePayload() const { Aws::StringStream ss; ss << "Action=ExportImage&"; if(m_clientTokenHasBeenSet) { ss << "ClientToken=" << StringUtils::URLEncode(m_clientToken.c_str()) << "&"; } if(m_descriptionHasBeenSet) { ss << "Description=" << StringUtils::URLEncode(m_description.c_str()) << "&"; } if(m_diskImageFormatHasBeenSet) { ss << "DiskImageFormat=" << DiskImageFormatMapper::GetNameForDiskImageFormat(m_diskImageFormat) << "&"; } if(m_dryRunHasBeenSet) { ss << "DryRun=" << std::boolalpha << m_dryRun << "&"; } if(m_imageIdHasBeenSet) { ss << "ImageId=" << StringUtils::URLEncode(m_imageId.c_str()) << "&"; } if(m_s3ExportLocationHasBeenSet) { m_s3ExportLocation.OutputToStream(ss, "S3ExportLocation"); } if(m_roleNameHasBeenSet) { ss << "RoleName=" << StringUtils::URLEncode(m_roleName.c_str()) << "&"; } if(m_tagSpecificationsHasBeenSet) { unsigned tagSpecificationsCount = 1; for(auto& item : m_tagSpecifications) { item.OutputToStream(ss, "TagSpecification.", tagSpecificationsCount, ""); tagSpecificationsCount++; } } ss << "Version=2016-11-15"; return ss.str(); } void ExportImageRequest::DumpBodyToUrl(Aws::Http::URI& uri ) const { uri.SetQueryString(SerializePayload()); }