/** * 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 WorkSpacesWeb { namespace Model { NetworkSettings::NetworkSettings() : m_associatedPortalArnsHasBeenSet(false), m_networkSettingsArnHasBeenSet(false), m_securityGroupIdsHasBeenSet(false), m_subnetIdsHasBeenSet(false), m_vpcIdHasBeenSet(false) { } NetworkSettings::NetworkSettings(JsonView jsonValue) : m_associatedPortalArnsHasBeenSet(false), m_networkSettingsArnHasBeenSet(false), m_securityGroupIdsHasBeenSet(false), m_subnetIdsHasBeenSet(false), m_vpcIdHasBeenSet(false) { *this = jsonValue; } NetworkSettings& NetworkSettings::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("associatedPortalArns")) { Aws::Utils::Array associatedPortalArnsJsonList = jsonValue.GetArray("associatedPortalArns"); for(unsigned associatedPortalArnsIndex = 0; associatedPortalArnsIndex < associatedPortalArnsJsonList.GetLength(); ++associatedPortalArnsIndex) { m_associatedPortalArns.push_back(associatedPortalArnsJsonList[associatedPortalArnsIndex].AsString()); } m_associatedPortalArnsHasBeenSet = true; } if(jsonValue.ValueExists("networkSettingsArn")) { m_networkSettingsArn = jsonValue.GetString("networkSettingsArn"); m_networkSettingsArnHasBeenSet = true; } 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 NetworkSettings::Jsonize() const { JsonValue payload; if(m_associatedPortalArnsHasBeenSet) { Aws::Utils::Array associatedPortalArnsJsonList(m_associatedPortalArns.size()); for(unsigned associatedPortalArnsIndex = 0; associatedPortalArnsIndex < associatedPortalArnsJsonList.GetLength(); ++associatedPortalArnsIndex) { associatedPortalArnsJsonList[associatedPortalArnsIndex].AsString(m_associatedPortalArns[associatedPortalArnsIndex]); } payload.WithArray("associatedPortalArns", std::move(associatedPortalArnsJsonList)); } if(m_networkSettingsArnHasBeenSet) { payload.WithString("networkSettingsArn", m_networkSettingsArn); } 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 WorkSpacesWeb } // namespace Aws