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/CreateDevEndpointRequest.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
CreateDevEndpointRequest()15 CreateDevEndpointRequest::CreateDevEndpointRequest() :
16 m_endpointNameHasBeenSet(false),
17 m_roleArnHasBeenSet(false),
18 m_securityGroupIdsHasBeenSet(false),
19 m_subnetIdHasBeenSet(false),
20 m_publicKeyHasBeenSet(false),
21 m_publicKeysHasBeenSet(false),
22 m_numberOfNodes(0),
23 m_numberOfNodesHasBeenSet(false),
24 m_workerType(WorkerType::NOT_SET),
25 m_workerTypeHasBeenSet(false),
26 m_glueVersionHasBeenSet(false),
27 m_numberOfWorkers(0),
28 m_numberOfWorkersHasBeenSet(false),
29 m_extraPythonLibsS3PathHasBeenSet(false),
30 m_extraJarsS3PathHasBeenSet(false),
31 m_securityConfigurationHasBeenSet(false),
32 m_tagsHasBeenSet(false),
33 m_argumentsHasBeenSet(false)
34 {
35 }
36
SerializePayload() const37 Aws::String CreateDevEndpointRequest::SerializePayload() const
38 {
39 JsonValue payload;
40
41 if(m_endpointNameHasBeenSet)
42 {
43 payload.WithString("EndpointName", m_endpointName);
44
45 }
46
47 if(m_roleArnHasBeenSet)
48 {
49 payload.WithString("RoleArn", m_roleArn);
50
51 }
52
53 if(m_securityGroupIdsHasBeenSet)
54 {
55 Array<JsonValue> securityGroupIdsJsonList(m_securityGroupIds.size());
56 for(unsigned securityGroupIdsIndex = 0; securityGroupIdsIndex < securityGroupIdsJsonList.GetLength(); ++securityGroupIdsIndex)
57 {
58 securityGroupIdsJsonList[securityGroupIdsIndex].AsString(m_securityGroupIds[securityGroupIdsIndex]);
59 }
60 payload.WithArray("SecurityGroupIds", std::move(securityGroupIdsJsonList));
61
62 }
63
64 if(m_subnetIdHasBeenSet)
65 {
66 payload.WithString("SubnetId", m_subnetId);
67
68 }
69
70 if(m_publicKeyHasBeenSet)
71 {
72 payload.WithString("PublicKey", m_publicKey);
73
74 }
75
76 if(m_publicKeysHasBeenSet)
77 {
78 Array<JsonValue> publicKeysJsonList(m_publicKeys.size());
79 for(unsigned publicKeysIndex = 0; publicKeysIndex < publicKeysJsonList.GetLength(); ++publicKeysIndex)
80 {
81 publicKeysJsonList[publicKeysIndex].AsString(m_publicKeys[publicKeysIndex]);
82 }
83 payload.WithArray("PublicKeys", std::move(publicKeysJsonList));
84
85 }
86
87 if(m_numberOfNodesHasBeenSet)
88 {
89 payload.WithInteger("NumberOfNodes", m_numberOfNodes);
90
91 }
92
93 if(m_workerTypeHasBeenSet)
94 {
95 payload.WithString("WorkerType", WorkerTypeMapper::GetNameForWorkerType(m_workerType));
96 }
97
98 if(m_glueVersionHasBeenSet)
99 {
100 payload.WithString("GlueVersion", m_glueVersion);
101
102 }
103
104 if(m_numberOfWorkersHasBeenSet)
105 {
106 payload.WithInteger("NumberOfWorkers", m_numberOfWorkers);
107
108 }
109
110 if(m_extraPythonLibsS3PathHasBeenSet)
111 {
112 payload.WithString("ExtraPythonLibsS3Path", m_extraPythonLibsS3Path);
113
114 }
115
116 if(m_extraJarsS3PathHasBeenSet)
117 {
118 payload.WithString("ExtraJarsS3Path", m_extraJarsS3Path);
119
120 }
121
122 if(m_securityConfigurationHasBeenSet)
123 {
124 payload.WithString("SecurityConfiguration", m_securityConfiguration);
125
126 }
127
128 if(m_tagsHasBeenSet)
129 {
130 JsonValue tagsJsonMap;
131 for(auto& tagsItem : m_tags)
132 {
133 tagsJsonMap.WithString(tagsItem.first, tagsItem.second);
134 }
135 payload.WithObject("Tags", std::move(tagsJsonMap));
136
137 }
138
139 if(m_argumentsHasBeenSet)
140 {
141 JsonValue argumentsJsonMap;
142 for(auto& argumentsItem : m_arguments)
143 {
144 argumentsJsonMap.WithString(argumentsItem.first, argumentsItem.second);
145 }
146 payload.WithObject("Arguments", std::move(argumentsJsonMap));
147
148 }
149
150 return payload.View().WriteReadable();
151 }
152
GetRequestSpecificHeaders() const153 Aws::Http::HeaderValueCollection CreateDevEndpointRequest::GetRequestSpecificHeaders() const
154 {
155 Aws::Http::HeaderValueCollection headers;
156 headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSGlue.CreateDevEndpoint"));
157 return headers;
158
159 }
160
161
162
163
164