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-sagemaker/source/model/VpcConfig.cpp

91 lines
2.3 KiB
C++

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/sagemaker/model/VpcConfig.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace SageMaker
{
namespace Model
{
VpcConfig::VpcConfig() :
m_securityGroupIdsHasBeenSet(false),
m_subnetsHasBeenSet(false)
{
}
VpcConfig::VpcConfig(JsonView jsonValue) :
m_securityGroupIdsHasBeenSet(false),
m_subnetsHasBeenSet(false)
{
*this = jsonValue;
}
VpcConfig& VpcConfig::operator =(JsonView jsonValue)
{
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;
}
if(jsonValue.ValueExists("Subnets"))
{
Array<JsonView> subnetsJsonList = jsonValue.GetArray("Subnets");
for(unsigned subnetsIndex = 0; subnetsIndex < subnetsJsonList.GetLength(); ++subnetsIndex)
{
m_subnets.push_back(subnetsJsonList[subnetsIndex].AsString());
}
m_subnetsHasBeenSet = true;
}
return *this;
}
JsonValue VpcConfig::Jsonize() const
{
JsonValue payload;
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));
}
if(m_subnetsHasBeenSet)
{
Array<JsonValue> subnetsJsonList(m_subnets.size());
for(unsigned subnetsIndex = 0; subnetsIndex < subnetsJsonList.GetLength(); ++subnetsIndex)
{
subnetsJsonList[subnetsIndex].AsString(m_subnets[subnetsIndex]);
}
payload.WithArray("Subnets", std::move(subnetsJsonList));
}
return payload;
}
} // namespace Model
} // namespace SageMaker
} // namespace Aws