/** * 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 OpenSearchServerless { namespace Model { VpcEndpointDetail::VpcEndpointDetail() : m_createdDate(0), m_createdDateHasBeenSet(false), m_idHasBeenSet(false), m_nameHasBeenSet(false), m_securityGroupIdsHasBeenSet(false), m_status(VpcEndpointStatus::NOT_SET), m_statusHasBeenSet(false), m_subnetIdsHasBeenSet(false), m_vpcIdHasBeenSet(false) { } VpcEndpointDetail::VpcEndpointDetail(JsonView jsonValue) : m_createdDate(0), m_createdDateHasBeenSet(false), m_idHasBeenSet(false), m_nameHasBeenSet(false), m_securityGroupIdsHasBeenSet(false), m_status(VpcEndpointStatus::NOT_SET), m_statusHasBeenSet(false), m_subnetIdsHasBeenSet(false), m_vpcIdHasBeenSet(false) { *this = jsonValue; } VpcEndpointDetail& VpcEndpointDetail::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("createdDate")) { m_createdDate = jsonValue.GetInt64("createdDate"); m_createdDateHasBeenSet = true; } if(jsonValue.ValueExists("id")) { m_id = jsonValue.GetString("id"); m_idHasBeenSet = true; } if(jsonValue.ValueExists("name")) { m_name = jsonValue.GetString("name"); m_nameHasBeenSet = 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("status")) { m_status = VpcEndpointStatusMapper::GetVpcEndpointStatusForName(jsonValue.GetString("status")); m_statusHasBeenSet = 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 VpcEndpointDetail::Jsonize() const { JsonValue payload; if(m_createdDateHasBeenSet) { payload.WithInt64("createdDate", m_createdDate); } if(m_idHasBeenSet) { payload.WithString("id", m_id); } if(m_nameHasBeenSet) { payload.WithString("name", m_name); } 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_statusHasBeenSet) { payload.WithString("status", VpcEndpointStatusMapper::GetNameForVpcEndpointStatus(m_status)); } 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 OpenSearchServerless } // namespace Aws