/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws { namespace SecurityHub { namespace Model { AwsLambdaFunctionVpcConfig::AwsLambdaFunctionVpcConfig() : m_securityGroupIdsHasBeenSet(false), m_subnetIdsHasBeenSet(false), m_vpcIdHasBeenSet(false) { } AwsLambdaFunctionVpcConfig::AwsLambdaFunctionVpcConfig(JsonView jsonValue) : m_securityGroupIdsHasBeenSet(false), m_subnetIdsHasBeenSet(false), m_vpcIdHasBeenSet(false) { *this = jsonValue; } AwsLambdaFunctionVpcConfig& AwsLambdaFunctionVpcConfig::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("SecurityGroupIds")) { Aws::Utils::Array 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")) { Aws::Utils::Array 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("VpcId")) { m_vpcId = jsonValue.GetString("VpcId"); m_vpcIdHasBeenSet = true; } return *this; } JsonValue AwsLambdaFunctionVpcConfig::Jsonize() const { JsonValue payload; if(m_securityGroupIdsHasBeenSet) { Aws::Utils::Array 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) { Aws::Utils::Array 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_vpcIdHasBeenSet) { payload.WithString("VpcId", m_vpcId); } return payload; } } // namespace Model } // namespace SecurityHub } // namespace Aws