/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::MQ::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; CreateBrokerRequest::CreateBrokerRequest() : m_authenticationStrategy(AuthenticationStrategy::NOT_SET), m_authenticationStrategyHasBeenSet(false), m_autoMinorVersionUpgrade(false), m_autoMinorVersionUpgradeHasBeenSet(false), m_brokerNameHasBeenSet(false), m_configurationHasBeenSet(false), m_creatorRequestId(Aws::Utils::UUID::PseudoRandomUUID()), m_creatorRequestIdHasBeenSet(true), m_deploymentMode(DeploymentMode::NOT_SET), m_deploymentModeHasBeenSet(false), m_encryptionOptionsHasBeenSet(false), m_engineType(EngineType::NOT_SET), m_engineTypeHasBeenSet(false), m_engineVersionHasBeenSet(false), m_hostInstanceTypeHasBeenSet(false), m_ldapServerMetadataHasBeenSet(false), m_logsHasBeenSet(false), m_maintenanceWindowStartTimeHasBeenSet(false), m_publiclyAccessible(false), m_publiclyAccessibleHasBeenSet(false), m_securityGroupsHasBeenSet(false), m_storageType(BrokerStorageType::NOT_SET), m_storageTypeHasBeenSet(false), m_subnetIdsHasBeenSet(false), m_tagsHasBeenSet(false), m_usersHasBeenSet(false), m_dataReplicationMode(DataReplicationMode::NOT_SET), m_dataReplicationModeHasBeenSet(false), m_dataReplicationPrimaryBrokerArnHasBeenSet(false) { } Aws::String CreateBrokerRequest::SerializePayload() const { JsonValue payload; if(m_authenticationStrategyHasBeenSet) { payload.WithString("authenticationStrategy", AuthenticationStrategyMapper::GetNameForAuthenticationStrategy(m_authenticationStrategy)); } if(m_autoMinorVersionUpgradeHasBeenSet) { payload.WithBool("autoMinorVersionUpgrade", m_autoMinorVersionUpgrade); } if(m_brokerNameHasBeenSet) { payload.WithString("brokerName", m_brokerName); } if(m_configurationHasBeenSet) { payload.WithObject("configuration", m_configuration.Jsonize()); } if(m_creatorRequestIdHasBeenSet) { payload.WithString("creatorRequestId", m_creatorRequestId); } if(m_deploymentModeHasBeenSet) { payload.WithString("deploymentMode", DeploymentModeMapper::GetNameForDeploymentMode(m_deploymentMode)); } if(m_encryptionOptionsHasBeenSet) { payload.WithObject("encryptionOptions", m_encryptionOptions.Jsonize()); } if(m_engineTypeHasBeenSet) { payload.WithString("engineType", EngineTypeMapper::GetNameForEngineType(m_engineType)); } if(m_engineVersionHasBeenSet) { payload.WithString("engineVersion", m_engineVersion); } if(m_hostInstanceTypeHasBeenSet) { payload.WithString("hostInstanceType", m_hostInstanceType); } if(m_ldapServerMetadataHasBeenSet) { payload.WithObject("ldapServerMetadata", m_ldapServerMetadata.Jsonize()); } if(m_logsHasBeenSet) { payload.WithObject("logs", m_logs.Jsonize()); } if(m_maintenanceWindowStartTimeHasBeenSet) { payload.WithObject("maintenanceWindowStartTime", m_maintenanceWindowStartTime.Jsonize()); } if(m_publiclyAccessibleHasBeenSet) { payload.WithBool("publiclyAccessible", m_publiclyAccessible); } if(m_securityGroupsHasBeenSet) { Aws::Utils::Array securityGroupsJsonList(m_securityGroups.size()); for(unsigned securityGroupsIndex = 0; securityGroupsIndex < securityGroupsJsonList.GetLength(); ++securityGroupsIndex) { securityGroupsJsonList[securityGroupsIndex].AsString(m_securityGroups[securityGroupsIndex]); } payload.WithArray("securityGroups", std::move(securityGroupsJsonList)); } if(m_storageTypeHasBeenSet) { payload.WithString("storageType", BrokerStorageTypeMapper::GetNameForBrokerStorageType(m_storageType)); } 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_tagsHasBeenSet) { JsonValue tagsJsonMap; for(auto& tagsItem : m_tags) { tagsJsonMap.WithString(tagsItem.first, tagsItem.second); } payload.WithObject("tags", std::move(tagsJsonMap)); } if(m_usersHasBeenSet) { Aws::Utils::Array usersJsonList(m_users.size()); for(unsigned usersIndex = 0; usersIndex < usersJsonList.GetLength(); ++usersIndex) { usersJsonList[usersIndex].AsObject(m_users[usersIndex].Jsonize()); } payload.WithArray("users", std::move(usersJsonList)); } if(m_dataReplicationModeHasBeenSet) { payload.WithString("dataReplicationMode", DataReplicationModeMapper::GetNameForDataReplicationMode(m_dataReplicationMode)); } if(m_dataReplicationPrimaryBrokerArnHasBeenSet) { payload.WithString("dataReplicationPrimaryBrokerArn", m_dataReplicationPrimaryBrokerArn); } return payload.View().WriteReadable(); }