149 lines
3.7 KiB
C++
149 lines
3.7 KiB
C++
|
|
/**
|
|||
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|||
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#include <aws/dms/model/CreateReplicationInstanceRequest.h>
|
|||
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|||
|
|
|
|||
|
|
#include <utility>
|
|||
|
|
|
|||
|
|
using namespace Aws::DatabaseMigrationService::Model;
|
|||
|
|
using namespace Aws::Utils::Json;
|
|||
|
|
using namespace Aws::Utils;
|
|||
|
|
|
|||
|
|
CreateReplicationInstanceRequest::CreateReplicationInstanceRequest() :
|
|||
|
|
m_replicationInstanceIdentifierHasBeenSet(false),
|
|||
|
|
m_allocatedStorage(0),
|
|||
|
|
m_allocatedStorageHasBeenSet(false),
|
|||
|
|
m_replicationInstanceClassHasBeenSet(false),
|
|||
|
|
m_vpcSecurityGroupIdsHasBeenSet(false),
|
|||
|
|
m_availabilityZoneHasBeenSet(false),
|
|||
|
|
m_replicationSubnetGroupIdentifierHasBeenSet(false),
|
|||
|
|
m_preferredMaintenanceWindowHasBeenSet(false),
|
|||
|
|
m_multiAZ(false),
|
|||
|
|
m_multiAZHasBeenSet(false),
|
|||
|
|
m_engineVersionHasBeenSet(false),
|
|||
|
|
m_autoMinorVersionUpgrade(false),
|
|||
|
|
m_autoMinorVersionUpgradeHasBeenSet(false),
|
|||
|
|
m_tagsHasBeenSet(false),
|
|||
|
|
m_kmsKeyIdHasBeenSet(false),
|
|||
|
|
m_publiclyAccessible(false),
|
|||
|
|
m_publiclyAccessibleHasBeenSet(false),
|
|||
|
|
m_dnsNameServersHasBeenSet(false)
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Aws::String CreateReplicationInstanceRequest::SerializePayload() const
|
|||
|
|
{
|
|||
|
|
JsonValue payload;
|
|||
|
|
|
|||
|
|
if(m_replicationInstanceIdentifierHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("ReplicationInstanceIdentifier", m_replicationInstanceIdentifier);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_allocatedStorageHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithInteger("AllocatedStorage", m_allocatedStorage);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_replicationInstanceClassHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("ReplicationInstanceClass", m_replicationInstanceClass);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_vpcSecurityGroupIdsHasBeenSet)
|
|||
|
|
{
|
|||
|
|
Array<JsonValue> vpcSecurityGroupIdsJsonList(m_vpcSecurityGroupIds.size());
|
|||
|
|
for(unsigned vpcSecurityGroupIdsIndex = 0; vpcSecurityGroupIdsIndex < vpcSecurityGroupIdsJsonList.GetLength(); ++vpcSecurityGroupIdsIndex)
|
|||
|
|
{
|
|||
|
|
vpcSecurityGroupIdsJsonList[vpcSecurityGroupIdsIndex].AsString(m_vpcSecurityGroupIds[vpcSecurityGroupIdsIndex]);
|
|||
|
|
}
|
|||
|
|
payload.WithArray("VpcSecurityGroupIds", std::move(vpcSecurityGroupIdsJsonList));
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_availabilityZoneHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("AvailabilityZone", m_availabilityZone);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_replicationSubnetGroupIdentifierHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("ReplicationSubnetGroupIdentifier", m_replicationSubnetGroupIdentifier);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_preferredMaintenanceWindowHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("PreferredMaintenanceWindow", m_preferredMaintenanceWindow);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_multiAZHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithBool("MultiAZ", m_multiAZ);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_engineVersionHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("EngineVersion", m_engineVersion);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_autoMinorVersionUpgradeHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithBool("AutoMinorVersionUpgrade", m_autoMinorVersionUpgrade);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
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_kmsKeyIdHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("KmsKeyId", m_kmsKeyId);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_publiclyAccessibleHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithBool("PubliclyAccessible", m_publiclyAccessible);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_dnsNameServersHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("DnsNameServers", m_dnsNameServers);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return payload.View().WriteReadable();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Aws::Http::HeaderValueCollection CreateReplicationInstanceRequest::GetRequestSpecificHeaders() const
|
|||
|
|
{
|
|||
|
|
Aws::Http::HeaderValueCollection headers;
|
|||
|
|
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AmazonDMSv20160101.CreateReplicationInstance"));
|
|||
|
|
return headers;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|