/** * 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 LicenseManagerUserSubscriptions { namespace Model { Settings::Settings() : m_securityGroupIdHasBeenSet(false), m_subnetsHasBeenSet(false) { } Settings::Settings(JsonView jsonValue) : m_securityGroupIdHasBeenSet(false), m_subnetsHasBeenSet(false) { *this = jsonValue; } Settings& Settings::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("SecurityGroupId")) { m_securityGroupId = jsonValue.GetString("SecurityGroupId"); m_securityGroupIdHasBeenSet = true; } if(jsonValue.ValueExists("Subnets")) { Aws::Utils::Array subnetsJsonList = jsonValue.GetArray("Subnets"); for(unsigned subnetsIndex = 0; subnetsIndex < subnetsJsonList.GetLength(); ++subnetsIndex) { m_subnets.push_back(subnetsJsonList[subnetsIndex].AsString()); } m_subnetsHasBeenSet = true; } return *this; } JsonValue Settings::Jsonize() const { JsonValue payload; if(m_securityGroupIdHasBeenSet) { payload.WithString("SecurityGroupId", m_securityGroupId); } if(m_subnetsHasBeenSet) { Aws::Utils::Array subnetsJsonList(m_subnets.size()); for(unsigned subnetsIndex = 0; subnetsIndex < subnetsJsonList.GetLength(); ++subnetsIndex) { subnetsJsonList[subnetsIndex].AsString(m_subnets[subnetsIndex]); } payload.WithArray("Subnets", std::move(subnetsJsonList)); } return payload; } } // namespace Model } // namespace LicenseManagerUserSubscriptions } // namespace Aws