/** * 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 DirectoryService { namespace Model { DirectoryVpcSettings::DirectoryVpcSettings() : m_vpcIdHasBeenSet(false), m_subnetIdsHasBeenSet(false) { } DirectoryVpcSettings::DirectoryVpcSettings(JsonView jsonValue) : m_vpcIdHasBeenSet(false), m_subnetIdsHasBeenSet(false) { *this = jsonValue; } DirectoryVpcSettings& DirectoryVpcSettings::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("VpcId")) { m_vpcId = jsonValue.GetString("VpcId"); m_vpcIdHasBeenSet = 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; } return *this; } JsonValue DirectoryVpcSettings::Jsonize() const { JsonValue payload; if(m_vpcIdHasBeenSet) { payload.WithString("VpcId", m_vpcId); } 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)); } return payload; } } // namespace Model } // namespace DirectoryService } // namespace Aws