121 lines
3.1 KiB
C++
121 lines
3.1 KiB
C++
|
|
/**
|
|||
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|||
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#include <aws/kinesisanalyticsv2/model/VpcConfigurationDescription.h>
|
|||
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|||
|
|
|
|||
|
|
#include <utility>
|
|||
|
|
|
|||
|
|
using namespace Aws::Utils::Json;
|
|||
|
|
using namespace Aws::Utils;
|
|||
|
|
|
|||
|
|
namespace Aws
|
|||
|
|
{
|
|||
|
|
namespace KinesisAnalyticsV2
|
|||
|
|
{
|
|||
|
|
namespace Model
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
VpcConfigurationDescription::VpcConfigurationDescription() :
|
|||
|
|
m_vpcConfigurationIdHasBeenSet(false),
|
|||
|
|
m_vpcIdHasBeenSet(false),
|
|||
|
|
m_subnetIdsHasBeenSet(false),
|
|||
|
|
m_securityGroupIdsHasBeenSet(false)
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
VpcConfigurationDescription::VpcConfigurationDescription(JsonView jsonValue) :
|
|||
|
|
m_vpcConfigurationIdHasBeenSet(false),
|
|||
|
|
m_vpcIdHasBeenSet(false),
|
|||
|
|
m_subnetIdsHasBeenSet(false),
|
|||
|
|
m_securityGroupIdsHasBeenSet(false)
|
|||
|
|
{
|
|||
|
|
*this = jsonValue;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
VpcConfigurationDescription& VpcConfigurationDescription::operator =(JsonView jsonValue)
|
|||
|
|
{
|
|||
|
|
if(jsonValue.ValueExists("VpcConfigurationId"))
|
|||
|
|
{
|
|||
|
|
m_vpcConfigurationId = jsonValue.GetString("VpcConfigurationId");
|
|||
|
|
|
|||
|
|
m_vpcConfigurationIdHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(jsonValue.ValueExists("VpcId"))
|
|||
|
|
{
|
|||
|
|
m_vpcId = jsonValue.GetString("VpcId");
|
|||
|
|
|
|||
|
|
m_vpcIdHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(jsonValue.ValueExists("SubnetIds"))
|
|||
|
|
{
|
|||
|
|
Array<JsonView> subnetIdsJsonList = jsonValue.GetArray("SubnetIds");
|
|||
|
|
for(unsigned subnetIdsIndex = 0; subnetIdsIndex < subnetIdsJsonList.GetLength(); ++subnetIdsIndex)
|
|||
|
|
{
|
|||
|
|
m_subnetIds.push_back(subnetIdsJsonList[subnetIdsIndex].AsString());
|
|||
|
|
}
|
|||
|
|
m_subnetIdsHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(jsonValue.ValueExists("SecurityGroupIds"))
|
|||
|
|
{
|
|||
|
|
Array<JsonView> securityGroupIdsJsonList = jsonValue.GetArray("SecurityGroupIds");
|
|||
|
|
for(unsigned securityGroupIdsIndex = 0; securityGroupIdsIndex < securityGroupIdsJsonList.GetLength(); ++securityGroupIdsIndex)
|
|||
|
|
{
|
|||
|
|
m_securityGroupIds.push_back(securityGroupIdsJsonList[securityGroupIdsIndex].AsString());
|
|||
|
|
}
|
|||
|
|
m_securityGroupIdsHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return *this;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
JsonValue VpcConfigurationDescription::Jsonize() const
|
|||
|
|
{
|
|||
|
|
JsonValue payload;
|
|||
|
|
|
|||
|
|
if(m_vpcConfigurationIdHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("VpcConfigurationId", m_vpcConfigurationId);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_vpcIdHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("VpcId", m_vpcId);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_subnetIdsHasBeenSet)
|
|||
|
|
{
|
|||
|
|
Array<JsonValue> subnetIdsJsonList(m_subnetIds.size());
|
|||
|
|
for(unsigned subnetIdsIndex = 0; subnetIdsIndex < subnetIdsJsonList.GetLength(); ++subnetIdsIndex)
|
|||
|
|
{
|
|||
|
|
subnetIdsJsonList[subnetIdsIndex].AsString(m_subnetIds[subnetIdsIndex]);
|
|||
|
|
}
|
|||
|
|
payload.WithArray("SubnetIds", std::move(subnetIdsJsonList));
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_securityGroupIdsHasBeenSet)
|
|||
|
|
{
|
|||
|
|
Array<JsonValue> securityGroupIdsJsonList(m_securityGroupIds.size());
|
|||
|
|
for(unsigned securityGroupIdsIndex = 0; securityGroupIdsIndex < securityGroupIdsJsonList.GetLength(); ++securityGroupIdsIndex)
|
|||
|
|
{
|
|||
|
|
securityGroupIdsJsonList[securityGroupIdsIndex].AsString(m_securityGroupIds[securityGroupIdsIndex]);
|
|||
|
|
}
|
|||
|
|
payload.WithArray("SecurityGroupIds", std::move(securityGroupIdsJsonList));
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return payload;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
} // namespace Model
|
|||
|
|
} // namespace KinesisAnalyticsV2
|
|||
|
|
} // namespace Aws
|