/** * 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 { UpdateVpcEndpointDetail::UpdateVpcEndpointDetail() : m_idHasBeenSet(false), m_lastModifiedDate(0), m_lastModifiedDateHasBeenSet(false), m_nameHasBeenSet(false), m_securityGroupIdsHasBeenSet(false), m_status(VpcEndpointStatus::NOT_SET), m_statusHasBeenSet(false), m_subnetIdsHasBeenSet(false) { } UpdateVpcEndpointDetail::UpdateVpcEndpointDetail(JsonView jsonValue) : m_idHasBeenSet(false), m_lastModifiedDate(0), m_lastModifiedDateHasBeenSet(false), m_nameHasBeenSet(false), m_securityGroupIdsHasBeenSet(false), m_status(VpcEndpointStatus::NOT_SET), m_statusHasBeenSet(false), m_subnetIdsHasBeenSet(false) { *this = jsonValue; } UpdateVpcEndpointDetail& UpdateVpcEndpointDetail::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("id")) { m_id = jsonValue.GetString("id"); m_idHasBeenSet = true; } if(jsonValue.ValueExists("lastModifiedDate")) { m_lastModifiedDate = jsonValue.GetInt64("lastModifiedDate"); m_lastModifiedDateHasBeenSet = 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; } return *this; } JsonValue UpdateVpcEndpointDetail::Jsonize() const { JsonValue payload; if(m_idHasBeenSet) { payload.WithString("id", m_id); } if(m_lastModifiedDateHasBeenSet) { payload.WithInt64("lastModifiedDate", m_lastModifiedDate); } 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)); } return payload; } } // namespace Model } // namespace OpenSearchServerless } // namespace Aws