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-lightsail/source/model/CreateInstancesRequest.cpp

108 lines
2.5 KiB
C++

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/lightsail/model/CreateInstancesRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Lightsail::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
CreateInstancesRequest::CreateInstancesRequest() :
m_instanceNamesHasBeenSet(false),
m_availabilityZoneHasBeenSet(false),
m_blueprintIdHasBeenSet(false),
m_bundleIdHasBeenSet(false),
m_userDataHasBeenSet(false),
m_keyPairNameHasBeenSet(false),
m_tagsHasBeenSet(false),
m_addOnsHasBeenSet(false)
{
}
Aws::String CreateInstancesRequest::SerializePayload() const
{
JsonValue payload;
if(m_instanceNamesHasBeenSet)
{
Array<JsonValue> instanceNamesJsonList(m_instanceNames.size());
for(unsigned instanceNamesIndex = 0; instanceNamesIndex < instanceNamesJsonList.GetLength(); ++instanceNamesIndex)
{
instanceNamesJsonList[instanceNamesIndex].AsString(m_instanceNames[instanceNamesIndex]);
}
payload.WithArray("instanceNames", std::move(instanceNamesJsonList));
}
if(m_availabilityZoneHasBeenSet)
{
payload.WithString("availabilityZone", m_availabilityZone);
}
if(m_blueprintIdHasBeenSet)
{
payload.WithString("blueprintId", m_blueprintId);
}
if(m_bundleIdHasBeenSet)
{
payload.WithString("bundleId", m_bundleId);
}
if(m_userDataHasBeenSet)
{
payload.WithString("userData", m_userData);
}
if(m_keyPairNameHasBeenSet)
{
payload.WithString("keyPairName", m_keyPairName);
}
if(m_tagsHasBeenSet)
{
Array<JsonValue> tagsJsonList(m_tags.size());
for(unsigned tagsIndex = 0; tagsIndex < tagsJsonList.GetLength(); ++tagsIndex)
{
tagsJsonList[tagsIndex].AsObject(m_tags[tagsIndex].Jsonize());
}
payload.WithArray("tags", std::move(tagsJsonList));
}
if(m_addOnsHasBeenSet)
{
Array<JsonValue> addOnsJsonList(m_addOns.size());
for(unsigned addOnsIndex = 0; addOnsIndex < addOnsJsonList.GetLength(); ++addOnsIndex)
{
addOnsJsonList[addOnsIndex].AsObject(m_addOns[addOnsIndex].Jsonize());
}
payload.WithArray("addOns", std::move(addOnsJsonList));
}
return payload.View().WriteReadable();
}
Aws::Http::HeaderValueCollection CreateInstancesRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "Lightsail_20161128.CreateInstances"));
return headers;
}