/** * 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 TimestreamWrite { namespace Model { Table::Table() : m_arnHasBeenSet(false), m_tableNameHasBeenSet(false), m_databaseNameHasBeenSet(false), m_tableStatus(TableStatus::NOT_SET), m_tableStatusHasBeenSet(false), m_retentionPropertiesHasBeenSet(false), m_creationTimeHasBeenSet(false), m_lastUpdatedTimeHasBeenSet(false), m_magneticStoreWritePropertiesHasBeenSet(false), m_schemaHasBeenSet(false) { } Table::Table(JsonView jsonValue) : m_arnHasBeenSet(false), m_tableNameHasBeenSet(false), m_databaseNameHasBeenSet(false), m_tableStatus(TableStatus::NOT_SET), m_tableStatusHasBeenSet(false), m_retentionPropertiesHasBeenSet(false), m_creationTimeHasBeenSet(false), m_lastUpdatedTimeHasBeenSet(false), m_magneticStoreWritePropertiesHasBeenSet(false), m_schemaHasBeenSet(false) { *this = jsonValue; } Table& Table::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("Arn")) { m_arn = jsonValue.GetString("Arn"); m_arnHasBeenSet = true; } if(jsonValue.ValueExists("TableName")) { m_tableName = jsonValue.GetString("TableName"); m_tableNameHasBeenSet = true; } if(jsonValue.ValueExists("DatabaseName")) { m_databaseName = jsonValue.GetString("DatabaseName"); m_databaseNameHasBeenSet = true; } if(jsonValue.ValueExists("TableStatus")) { m_tableStatus = TableStatusMapper::GetTableStatusForName(jsonValue.GetString("TableStatus")); m_tableStatusHasBeenSet = true; } if(jsonValue.ValueExists("RetentionProperties")) { m_retentionProperties = jsonValue.GetObject("RetentionProperties"); m_retentionPropertiesHasBeenSet = true; } if(jsonValue.ValueExists("CreationTime")) { m_creationTime = jsonValue.GetDouble("CreationTime"); m_creationTimeHasBeenSet = true; } if(jsonValue.ValueExists("LastUpdatedTime")) { m_lastUpdatedTime = jsonValue.GetDouble("LastUpdatedTime"); m_lastUpdatedTimeHasBeenSet = true; } if(jsonValue.ValueExists("MagneticStoreWriteProperties")) { m_magneticStoreWriteProperties = jsonValue.GetObject("MagneticStoreWriteProperties"); m_magneticStoreWritePropertiesHasBeenSet = true; } if(jsonValue.ValueExists("Schema")) { m_schema = jsonValue.GetObject("Schema"); m_schemaHasBeenSet = true; } return *this; } JsonValue Table::Jsonize() const { JsonValue payload; if(m_arnHasBeenSet) { payload.WithString("Arn", m_arn); } if(m_tableNameHasBeenSet) { payload.WithString("TableName", m_tableName); } if(m_databaseNameHasBeenSet) { payload.WithString("DatabaseName", m_databaseName); } if(m_tableStatusHasBeenSet) { payload.WithString("TableStatus", TableStatusMapper::GetNameForTableStatus(m_tableStatus)); } if(m_retentionPropertiesHasBeenSet) { payload.WithObject("RetentionProperties", m_retentionProperties.Jsonize()); } if(m_creationTimeHasBeenSet) { payload.WithDouble("CreationTime", m_creationTime.SecondsWithMSPrecision()); } if(m_lastUpdatedTimeHasBeenSet) { payload.WithDouble("LastUpdatedTime", m_lastUpdatedTime.SecondsWithMSPrecision()); } if(m_magneticStoreWritePropertiesHasBeenSet) { payload.WithObject("MagneticStoreWriteProperties", m_magneticStoreWriteProperties.Jsonize()); } if(m_schemaHasBeenSet) { payload.WithObject("Schema", m_schema.Jsonize()); } return payload; } } // namespace Model } // namespace TimestreamWrite } // namespace Aws