/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::VPCLattice::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; CreateServiceNetworkVpcAssociationRequest::CreateServiceNetworkVpcAssociationRequest() : m_clientToken(Aws::Utils::UUID::PseudoRandomUUID()), m_clientTokenHasBeenSet(true), m_securityGroupIdsHasBeenSet(false), m_serviceNetworkIdentifierHasBeenSet(false), m_tagsHasBeenSet(false), m_vpcIdentifierHasBeenSet(false) { } Aws::String CreateServiceNetworkVpcAssociationRequest::SerializePayload() const { JsonValue payload; if(m_clientTokenHasBeenSet) { payload.WithString("clientToken", m_clientToken); } 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_serviceNetworkIdentifierHasBeenSet) { payload.WithString("serviceNetworkIdentifier", m_serviceNetworkIdentifier); } if(m_tagsHasBeenSet) { JsonValue tagsJsonMap; for(auto& tagsItem : m_tags) { tagsJsonMap.WithString(tagsItem.first, tagsItem.second); } payload.WithObject("tags", std::move(tagsJsonMap)); } if(m_vpcIdentifierHasBeenSet) { payload.WithString("vpcIdentifier", m_vpcIdentifier); } return payload.View().WriteReadable(); }