1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/glue/model/BatchCreatePartitionRequest.h>
7 #include <aws/core/utils/json/JsonSerializer.h>
8 
9 #include <utility>
10 
11 using namespace Aws::Glue::Model;
12 using namespace Aws::Utils::Json;
13 using namespace Aws::Utils;
14 
BatchCreatePartitionRequest()15 BatchCreatePartitionRequest::BatchCreatePartitionRequest() :
16     m_catalogIdHasBeenSet(false),
17     m_databaseNameHasBeenSet(false),
18     m_tableNameHasBeenSet(false),
19     m_partitionInputListHasBeenSet(false)
20 {
21 }
22 
SerializePayload() const23 Aws::String BatchCreatePartitionRequest::SerializePayload() const
24 {
25   JsonValue payload;
26 
27   if(m_catalogIdHasBeenSet)
28   {
29    payload.WithString("CatalogId", m_catalogId);
30 
31   }
32 
33   if(m_databaseNameHasBeenSet)
34   {
35    payload.WithString("DatabaseName", m_databaseName);
36 
37   }
38 
39   if(m_tableNameHasBeenSet)
40   {
41    payload.WithString("TableName", m_tableName);
42 
43   }
44 
45   if(m_partitionInputListHasBeenSet)
46   {
47    Array<JsonValue> partitionInputListJsonList(m_partitionInputList.size());
48    for(unsigned partitionInputListIndex = 0; partitionInputListIndex < partitionInputListJsonList.GetLength(); ++partitionInputListIndex)
49    {
50      partitionInputListJsonList[partitionInputListIndex].AsObject(m_partitionInputList[partitionInputListIndex].Jsonize());
51    }
52    payload.WithArray("PartitionInputList", std::move(partitionInputListJsonList));
53 
54   }
55 
56   return payload.View().WriteReadable();
57 }
58 
GetRequestSpecificHeaders() const59 Aws::Http::HeaderValueCollection BatchCreatePartitionRequest::GetRequestSpecificHeaders() const
60 {
61   Aws::Http::HeaderValueCollection headers;
62   headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSGlue.BatchCreatePartition"));
63   return headers;
64 
65 }
66 
67 
68 
69 
70