113 lines
2.5 KiB
C++
113 lines
2.5 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/mediaconnect/model/VpcInterfaceRequest.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
|
|
namespace Aws
|
|
{
|
|
namespace MediaConnect
|
|
{
|
|
namespace Model
|
|
{
|
|
|
|
VpcInterfaceRequest::VpcInterfaceRequest() :
|
|
m_nameHasBeenSet(false),
|
|
m_roleArnHasBeenSet(false),
|
|
m_securityGroupIdsHasBeenSet(false),
|
|
m_subnetIdHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
VpcInterfaceRequest::VpcInterfaceRequest(JsonView jsonValue) :
|
|
m_nameHasBeenSet(false),
|
|
m_roleArnHasBeenSet(false),
|
|
m_securityGroupIdsHasBeenSet(false),
|
|
m_subnetIdHasBeenSet(false)
|
|
{
|
|
*this = jsonValue;
|
|
}
|
|
|
|
VpcInterfaceRequest& VpcInterfaceRequest::operator =(JsonView jsonValue)
|
|
{
|
|
if(jsonValue.ValueExists("name"))
|
|
{
|
|
m_name = jsonValue.GetString("name");
|
|
|
|
m_nameHasBeenSet = true;
|
|
}
|
|
|
|
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("subnetId"))
|
|
{
|
|
m_subnetId = jsonValue.GetString("subnetId");
|
|
|
|
m_subnetIdHasBeenSet = true;
|
|
}
|
|
|
|
return *this;
|
|
}
|
|
|
|
JsonValue VpcInterfaceRequest::Jsonize() const
|
|
{
|
|
JsonValue payload;
|
|
|
|
if(m_nameHasBeenSet)
|
|
{
|
|
payload.WithString("name", m_name);
|
|
|
|
}
|
|
|
|
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_subnetIdHasBeenSet)
|
|
{
|
|
payload.WithString("subnetId", m_subnetId);
|
|
|
|
}
|
|
|
|
return payload;
|
|
}
|
|
|
|
} // namespace Model
|
|
} // namespace MediaConnect
|
|
} // namespace Aws
|