/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::QuickSight::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; CreateDataSetRequest::CreateDataSetRequest() : m_awsAccountIdHasBeenSet(false), m_dataSetIdHasBeenSet(false), m_nameHasBeenSet(false), m_physicalTableMapHasBeenSet(false), m_logicalTableMapHasBeenSet(false), m_importMode(DataSetImportMode::NOT_SET), m_importModeHasBeenSet(false), m_columnGroupsHasBeenSet(false), m_permissionsHasBeenSet(false), m_rowLevelPermissionDataSetHasBeenSet(false), m_tagsHasBeenSet(false) { } Aws::String CreateDataSetRequest::SerializePayload() const { JsonValue payload; if(m_dataSetIdHasBeenSet) { payload.WithString("DataSetId", m_dataSetId); } if(m_nameHasBeenSet) { payload.WithString("Name", m_name); } if(m_physicalTableMapHasBeenSet) { JsonValue physicalTableMapJsonMap; for(auto& physicalTableMapItem : m_physicalTableMap) { physicalTableMapJsonMap.WithObject(physicalTableMapItem.first, physicalTableMapItem.second.Jsonize()); } payload.WithObject("PhysicalTableMap", std::move(physicalTableMapJsonMap)); } if(m_logicalTableMapHasBeenSet) { JsonValue logicalTableMapJsonMap; for(auto& logicalTableMapItem : m_logicalTableMap) { logicalTableMapJsonMap.WithObject(logicalTableMapItem.first, logicalTableMapItem.second.Jsonize()); } payload.WithObject("LogicalTableMap", std::move(logicalTableMapJsonMap)); } if(m_importModeHasBeenSet) { payload.WithString("ImportMode", DataSetImportModeMapper::GetNameForDataSetImportMode(m_importMode)); } if(m_columnGroupsHasBeenSet) { Array columnGroupsJsonList(m_columnGroups.size()); for(unsigned columnGroupsIndex = 0; columnGroupsIndex < columnGroupsJsonList.GetLength(); ++columnGroupsIndex) { columnGroupsJsonList[columnGroupsIndex].AsObject(m_columnGroups[columnGroupsIndex].Jsonize()); } payload.WithArray("ColumnGroups", std::move(columnGroupsJsonList)); } if(m_permissionsHasBeenSet) { Array permissionsJsonList(m_permissions.size()); for(unsigned permissionsIndex = 0; permissionsIndex < permissionsJsonList.GetLength(); ++permissionsIndex) { permissionsJsonList[permissionsIndex].AsObject(m_permissions[permissionsIndex].Jsonize()); } payload.WithArray("Permissions", std::move(permissionsJsonList)); } if(m_rowLevelPermissionDataSetHasBeenSet) { payload.WithObject("RowLevelPermissionDataSet", m_rowLevelPermissionDataSet.Jsonize()); } if(m_tagsHasBeenSet) { Array tagsJsonList(m_tags.size()); for(unsigned tagsIndex = 0; tagsIndex < tagsJsonList.GetLength(); ++tagsIndex) { tagsJsonList[tagsIndex].AsObject(m_tags[tagsIndex].Jsonize()); } payload.WithArray("Tags", std::move(tagsJsonList)); } return payload.View().WriteReadable(); }