64 lines
1.7 KiB
C++
64 lines
1.7 KiB
C++
|
|
/**
|
|||
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|||
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#include <aws/ec2/model/ModifyInstanceMetadataOptionsRequest.h>
|
|||
|
|
#include <aws/core/utils/StringUtils.h>
|
|||
|
|
#include <aws/core/utils/memory/stl/AWSStringStream.h>
|
|||
|
|
|
|||
|
|
using namespace Aws::EC2::Model;
|
|||
|
|
using namespace Aws::Utils;
|
|||
|
|
|
|||
|
|
ModifyInstanceMetadataOptionsRequest::ModifyInstanceMetadataOptionsRequest() :
|
|||
|
|
m_instanceIdHasBeenSet(false),
|
|||
|
|
m_httpTokens(HttpTokensState::NOT_SET),
|
|||
|
|
m_httpTokensHasBeenSet(false),
|
|||
|
|
m_httpPutResponseHopLimit(0),
|
|||
|
|
m_httpPutResponseHopLimitHasBeenSet(false),
|
|||
|
|
m_httpEndpoint(InstanceMetadataEndpointState::NOT_SET),
|
|||
|
|
m_httpEndpointHasBeenSet(false),
|
|||
|
|
m_dryRun(false),
|
|||
|
|
m_dryRunHasBeenSet(false)
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Aws::String ModifyInstanceMetadataOptionsRequest::SerializePayload() const
|
|||
|
|
{
|
|||
|
|
Aws::StringStream ss;
|
|||
|
|
ss << "Action=ModifyInstanceMetadataOptions&";
|
|||
|
|
if(m_instanceIdHasBeenSet)
|
|||
|
|
{
|
|||
|
|
ss << "InstanceId=" << StringUtils::URLEncode(m_instanceId.c_str()) << "&";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_httpTokensHasBeenSet)
|
|||
|
|
{
|
|||
|
|
ss << "HttpTokens=" << HttpTokensStateMapper::GetNameForHttpTokensState(m_httpTokens) << "&";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_httpPutResponseHopLimitHasBeenSet)
|
|||
|
|
{
|
|||
|
|
ss << "HttpPutResponseHopLimit=" << m_httpPutResponseHopLimit << "&";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_httpEndpointHasBeenSet)
|
|||
|
|
{
|
|||
|
|
ss << "HttpEndpoint=" << InstanceMetadataEndpointStateMapper::GetNameForInstanceMetadataEndpointState(m_httpEndpoint) << "&";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_dryRunHasBeenSet)
|
|||
|
|
{
|
|||
|
|
ss << "DryRun=" << std::boolalpha << m_dryRun << "&";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
ss << "Version=2016-11-15";
|
|||
|
|
return ss.str();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
void ModifyInstanceMetadataOptionsRequest::DumpBodyToUrl(Aws::Http::URI& uri ) const
|
|||
|
|
{
|
|||
|
|
uri.SetQueryString(SerializePayload());
|
|||
|
|
}
|