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-groundstation/source/model/SecurityDetails.cpp

106 lines
2.7 KiB
C++

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/groundstation/model/SecurityDetails.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace GroundStation
{
namespace Model
{
SecurityDetails::SecurityDetails() :
m_roleArnHasBeenSet(false),
m_securityGroupIdsHasBeenSet(false),
m_subnetIdsHasBeenSet(false)
{
}
SecurityDetails::SecurityDetails(JsonView jsonValue) :
m_roleArnHasBeenSet(false),
m_securityGroupIdsHasBeenSet(false),
m_subnetIdsHasBeenSet(false)
{
*this = jsonValue;
}
SecurityDetails& SecurityDetails::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("roleArn"))
{
m_roleArn = jsonValue.GetString("roleArn");
m_roleArnHasBeenSet = 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;
}
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;
}
return *this;
}
JsonValue SecurityDetails::Jsonize() const
{
JsonValue payload;
if(m_roleArnHasBeenSet)
{
payload.WithString("roleArn", m_roleArn);
}
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_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));
}
return payload;
}
} // namespace Model
} // namespace GroundStation
} // namespace Aws