/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::TimestreamWrite::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; WriteRecordsRequest::WriteRecordsRequest() : m_databaseNameHasBeenSet(false), m_tableNameHasBeenSet(false), m_commonAttributesHasBeenSet(false), m_recordsHasBeenSet(false) { } Aws::String WriteRecordsRequest::SerializePayload() const { JsonValue payload; if(m_databaseNameHasBeenSet) { payload.WithString("DatabaseName", m_databaseName); } if(m_tableNameHasBeenSet) { payload.WithString("TableName", m_tableName); } if(m_commonAttributesHasBeenSet) { payload.WithObject("CommonAttributes", m_commonAttributes.Jsonize()); } if(m_recordsHasBeenSet) { Aws::Utils::Array recordsJsonList(m_records.size()); for(unsigned recordsIndex = 0; recordsIndex < recordsJsonList.GetLength(); ++recordsIndex) { recordsJsonList[recordsIndex].AsObject(m_records[recordsIndex].Jsonize()); } payload.WithArray("Records", std::move(recordsJsonList)); } return payload.View().WriteReadable(); } Aws::Http::HeaderValueCollection WriteRecordsRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "Timestream_20181101.WriteRecords")); return headers; }