1 /**
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 * SPDX-License-Identifier: Apache-2.0.
4 */
5
6 #include <aws/core/utils/Outcome.h>
7 #include <aws/core/auth/AWSAuthSigner.h>
8 #include <aws/core/client/CoreErrors.h>
9 #include <aws/core/client/RetryStrategy.h>
10 #include <aws/core/http/HttpClient.h>
11 #include <aws/core/http/HttpResponse.h>
12 #include <aws/core/http/HttpClientFactory.h>
13 #include <aws/core/auth/AWSCredentialsProviderChain.h>
14 #include <aws/core/utils/json/JsonSerializer.h>
15 #include <aws/core/utils/memory/stl/AWSStringStream.h>
16 #include <aws/core/utils/threading/Executor.h>
17 #include <aws/core/utils/DNS.h>
18 #include <aws/core/utils/logging/LogMacros.h>
19
20 #include <aws/honeycode/HoneycodeClient.h>
21 #include <aws/honeycode/HoneycodeEndpoint.h>
22 #include <aws/honeycode/HoneycodeErrorMarshaller.h>
23 #include <aws/honeycode/model/BatchCreateTableRowsRequest.h>
24 #include <aws/honeycode/model/BatchDeleteTableRowsRequest.h>
25 #include <aws/honeycode/model/BatchUpdateTableRowsRequest.h>
26 #include <aws/honeycode/model/BatchUpsertTableRowsRequest.h>
27 #include <aws/honeycode/model/DescribeTableDataImportJobRequest.h>
28 #include <aws/honeycode/model/GetScreenDataRequest.h>
29 #include <aws/honeycode/model/InvokeScreenAutomationRequest.h>
30 #include <aws/honeycode/model/ListTableColumnsRequest.h>
31 #include <aws/honeycode/model/ListTableRowsRequest.h>
32 #include <aws/honeycode/model/ListTablesRequest.h>
33 #include <aws/honeycode/model/QueryTableRowsRequest.h>
34 #include <aws/honeycode/model/StartTableDataImportJobRequest.h>
35
36 using namespace Aws;
37 using namespace Aws::Auth;
38 using namespace Aws::Client;
39 using namespace Aws::Honeycode;
40 using namespace Aws::Honeycode::Model;
41 using namespace Aws::Http;
42 using namespace Aws::Utils::Json;
43
44 static const char* SERVICE_NAME = "honeycode";
45 static const char* ALLOCATION_TAG = "HoneycodeClient";
46
47
HoneycodeClient(const Client::ClientConfiguration & clientConfiguration)48 HoneycodeClient::HoneycodeClient(const Client::ClientConfiguration& clientConfiguration) :
49 BASECLASS(clientConfiguration,
50 Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, Aws::MakeShared<DefaultAWSCredentialsProviderChain>(ALLOCATION_TAG),
51 SERVICE_NAME, Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
52 Aws::MakeShared<HoneycodeErrorMarshaller>(ALLOCATION_TAG)),
53 m_executor(clientConfiguration.executor)
54 {
55 init(clientConfiguration);
56 }
57
HoneycodeClient(const AWSCredentials & credentials,const Client::ClientConfiguration & clientConfiguration)58 HoneycodeClient::HoneycodeClient(const AWSCredentials& credentials, const Client::ClientConfiguration& clientConfiguration) :
59 BASECLASS(clientConfiguration,
60 Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, Aws::MakeShared<SimpleAWSCredentialsProvider>(ALLOCATION_TAG, credentials),
61 SERVICE_NAME, Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
62 Aws::MakeShared<HoneycodeErrorMarshaller>(ALLOCATION_TAG)),
63 m_executor(clientConfiguration.executor)
64 {
65 init(clientConfiguration);
66 }
67
HoneycodeClient(const std::shared_ptr<AWSCredentialsProvider> & credentialsProvider,const Client::ClientConfiguration & clientConfiguration)68 HoneycodeClient::HoneycodeClient(const std::shared_ptr<AWSCredentialsProvider>& credentialsProvider,
69 const Client::ClientConfiguration& clientConfiguration) :
70 BASECLASS(clientConfiguration,
71 Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, credentialsProvider,
72 SERVICE_NAME, Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
73 Aws::MakeShared<HoneycodeErrorMarshaller>(ALLOCATION_TAG)),
74 m_executor(clientConfiguration.executor)
75 {
76 init(clientConfiguration);
77 }
78
~HoneycodeClient()79 HoneycodeClient::~HoneycodeClient()
80 {
81 }
82
init(const Client::ClientConfiguration & config)83 void HoneycodeClient::init(const Client::ClientConfiguration& config)
84 {
85 SetServiceClientName("Honeycode");
86 m_configScheme = SchemeMapper::ToString(config.scheme);
87 if (config.endpointOverride.empty())
88 {
89 m_uri = m_configScheme + "://" + HoneycodeEndpoint::ForRegion(config.region, config.useDualStack);
90 }
91 else
92 {
93 OverrideEndpoint(config.endpointOverride);
94 }
95 }
96
OverrideEndpoint(const Aws::String & endpoint)97 void HoneycodeClient::OverrideEndpoint(const Aws::String& endpoint)
98 {
99 if (endpoint.compare(0, 7, "http://") == 0 || endpoint.compare(0, 8, "https://") == 0)
100 {
101 m_uri = endpoint;
102 }
103 else
104 {
105 m_uri = m_configScheme + "://" + endpoint;
106 }
107 }
108
BatchCreateTableRows(const BatchCreateTableRowsRequest & request) const109 BatchCreateTableRowsOutcome HoneycodeClient::BatchCreateTableRows(const BatchCreateTableRowsRequest& request) const
110 {
111 if (!request.WorkbookIdHasBeenSet())
112 {
113 AWS_LOGSTREAM_ERROR("BatchCreateTableRows", "Required field: WorkbookId, is not set");
114 return BatchCreateTableRowsOutcome(Aws::Client::AWSError<HoneycodeErrors>(HoneycodeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [WorkbookId]", false));
115 }
116 if (!request.TableIdHasBeenSet())
117 {
118 AWS_LOGSTREAM_ERROR("BatchCreateTableRows", "Required field: TableId, is not set");
119 return BatchCreateTableRowsOutcome(Aws::Client::AWSError<HoneycodeErrors>(HoneycodeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [TableId]", false));
120 }
121 Aws::Http::URI uri = m_uri;
122 uri.AddPathSegments("/workbooks/");
123 uri.AddPathSegment(request.GetWorkbookId());
124 uri.AddPathSegments("/tables/");
125 uri.AddPathSegment(request.GetTableId());
126 uri.AddPathSegments("/rows/batchcreate");
127 return BatchCreateTableRowsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
128 }
129
BatchCreateTableRowsCallable(const BatchCreateTableRowsRequest & request) const130 BatchCreateTableRowsOutcomeCallable HoneycodeClient::BatchCreateTableRowsCallable(const BatchCreateTableRowsRequest& request) const
131 {
132 auto task = Aws::MakeShared< std::packaged_task< BatchCreateTableRowsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->BatchCreateTableRows(request); } );
133 auto packagedFunction = [task]() { (*task)(); };
134 m_executor->Submit(packagedFunction);
135 return task->get_future();
136 }
137
BatchCreateTableRowsAsync(const BatchCreateTableRowsRequest & request,const BatchCreateTableRowsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const138 void HoneycodeClient::BatchCreateTableRowsAsync(const BatchCreateTableRowsRequest& request, const BatchCreateTableRowsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
139 {
140 m_executor->Submit( [this, request, handler, context](){ this->BatchCreateTableRowsAsyncHelper( request, handler, context ); } );
141 }
142
BatchCreateTableRowsAsyncHelper(const BatchCreateTableRowsRequest & request,const BatchCreateTableRowsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const143 void HoneycodeClient::BatchCreateTableRowsAsyncHelper(const BatchCreateTableRowsRequest& request, const BatchCreateTableRowsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
144 {
145 handler(this, request, BatchCreateTableRows(request), context);
146 }
147
BatchDeleteTableRows(const BatchDeleteTableRowsRequest & request) const148 BatchDeleteTableRowsOutcome HoneycodeClient::BatchDeleteTableRows(const BatchDeleteTableRowsRequest& request) const
149 {
150 if (!request.WorkbookIdHasBeenSet())
151 {
152 AWS_LOGSTREAM_ERROR("BatchDeleteTableRows", "Required field: WorkbookId, is not set");
153 return BatchDeleteTableRowsOutcome(Aws::Client::AWSError<HoneycodeErrors>(HoneycodeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [WorkbookId]", false));
154 }
155 if (!request.TableIdHasBeenSet())
156 {
157 AWS_LOGSTREAM_ERROR("BatchDeleteTableRows", "Required field: TableId, is not set");
158 return BatchDeleteTableRowsOutcome(Aws::Client::AWSError<HoneycodeErrors>(HoneycodeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [TableId]", false));
159 }
160 Aws::Http::URI uri = m_uri;
161 uri.AddPathSegments("/workbooks/");
162 uri.AddPathSegment(request.GetWorkbookId());
163 uri.AddPathSegments("/tables/");
164 uri.AddPathSegment(request.GetTableId());
165 uri.AddPathSegments("/rows/batchdelete");
166 return BatchDeleteTableRowsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
167 }
168
BatchDeleteTableRowsCallable(const BatchDeleteTableRowsRequest & request) const169 BatchDeleteTableRowsOutcomeCallable HoneycodeClient::BatchDeleteTableRowsCallable(const BatchDeleteTableRowsRequest& request) const
170 {
171 auto task = Aws::MakeShared< std::packaged_task< BatchDeleteTableRowsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->BatchDeleteTableRows(request); } );
172 auto packagedFunction = [task]() { (*task)(); };
173 m_executor->Submit(packagedFunction);
174 return task->get_future();
175 }
176
BatchDeleteTableRowsAsync(const BatchDeleteTableRowsRequest & request,const BatchDeleteTableRowsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const177 void HoneycodeClient::BatchDeleteTableRowsAsync(const BatchDeleteTableRowsRequest& request, const BatchDeleteTableRowsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
178 {
179 m_executor->Submit( [this, request, handler, context](){ this->BatchDeleteTableRowsAsyncHelper( request, handler, context ); } );
180 }
181
BatchDeleteTableRowsAsyncHelper(const BatchDeleteTableRowsRequest & request,const BatchDeleteTableRowsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const182 void HoneycodeClient::BatchDeleteTableRowsAsyncHelper(const BatchDeleteTableRowsRequest& request, const BatchDeleteTableRowsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
183 {
184 handler(this, request, BatchDeleteTableRows(request), context);
185 }
186
BatchUpdateTableRows(const BatchUpdateTableRowsRequest & request) const187 BatchUpdateTableRowsOutcome HoneycodeClient::BatchUpdateTableRows(const BatchUpdateTableRowsRequest& request) const
188 {
189 if (!request.WorkbookIdHasBeenSet())
190 {
191 AWS_LOGSTREAM_ERROR("BatchUpdateTableRows", "Required field: WorkbookId, is not set");
192 return BatchUpdateTableRowsOutcome(Aws::Client::AWSError<HoneycodeErrors>(HoneycodeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [WorkbookId]", false));
193 }
194 if (!request.TableIdHasBeenSet())
195 {
196 AWS_LOGSTREAM_ERROR("BatchUpdateTableRows", "Required field: TableId, is not set");
197 return BatchUpdateTableRowsOutcome(Aws::Client::AWSError<HoneycodeErrors>(HoneycodeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [TableId]", false));
198 }
199 Aws::Http::URI uri = m_uri;
200 uri.AddPathSegments("/workbooks/");
201 uri.AddPathSegment(request.GetWorkbookId());
202 uri.AddPathSegments("/tables/");
203 uri.AddPathSegment(request.GetTableId());
204 uri.AddPathSegments("/rows/batchupdate");
205 return BatchUpdateTableRowsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
206 }
207
BatchUpdateTableRowsCallable(const BatchUpdateTableRowsRequest & request) const208 BatchUpdateTableRowsOutcomeCallable HoneycodeClient::BatchUpdateTableRowsCallable(const BatchUpdateTableRowsRequest& request) const
209 {
210 auto task = Aws::MakeShared< std::packaged_task< BatchUpdateTableRowsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->BatchUpdateTableRows(request); } );
211 auto packagedFunction = [task]() { (*task)(); };
212 m_executor->Submit(packagedFunction);
213 return task->get_future();
214 }
215
BatchUpdateTableRowsAsync(const BatchUpdateTableRowsRequest & request,const BatchUpdateTableRowsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const216 void HoneycodeClient::BatchUpdateTableRowsAsync(const BatchUpdateTableRowsRequest& request, const BatchUpdateTableRowsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
217 {
218 m_executor->Submit( [this, request, handler, context](){ this->BatchUpdateTableRowsAsyncHelper( request, handler, context ); } );
219 }
220
BatchUpdateTableRowsAsyncHelper(const BatchUpdateTableRowsRequest & request,const BatchUpdateTableRowsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const221 void HoneycodeClient::BatchUpdateTableRowsAsyncHelper(const BatchUpdateTableRowsRequest& request, const BatchUpdateTableRowsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
222 {
223 handler(this, request, BatchUpdateTableRows(request), context);
224 }
225
BatchUpsertTableRows(const BatchUpsertTableRowsRequest & request) const226 BatchUpsertTableRowsOutcome HoneycodeClient::BatchUpsertTableRows(const BatchUpsertTableRowsRequest& request) const
227 {
228 if (!request.WorkbookIdHasBeenSet())
229 {
230 AWS_LOGSTREAM_ERROR("BatchUpsertTableRows", "Required field: WorkbookId, is not set");
231 return BatchUpsertTableRowsOutcome(Aws::Client::AWSError<HoneycodeErrors>(HoneycodeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [WorkbookId]", false));
232 }
233 if (!request.TableIdHasBeenSet())
234 {
235 AWS_LOGSTREAM_ERROR("BatchUpsertTableRows", "Required field: TableId, is not set");
236 return BatchUpsertTableRowsOutcome(Aws::Client::AWSError<HoneycodeErrors>(HoneycodeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [TableId]", false));
237 }
238 Aws::Http::URI uri = m_uri;
239 uri.AddPathSegments("/workbooks/");
240 uri.AddPathSegment(request.GetWorkbookId());
241 uri.AddPathSegments("/tables/");
242 uri.AddPathSegment(request.GetTableId());
243 uri.AddPathSegments("/rows/batchupsert");
244 return BatchUpsertTableRowsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
245 }
246
BatchUpsertTableRowsCallable(const BatchUpsertTableRowsRequest & request) const247 BatchUpsertTableRowsOutcomeCallable HoneycodeClient::BatchUpsertTableRowsCallable(const BatchUpsertTableRowsRequest& request) const
248 {
249 auto task = Aws::MakeShared< std::packaged_task< BatchUpsertTableRowsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->BatchUpsertTableRows(request); } );
250 auto packagedFunction = [task]() { (*task)(); };
251 m_executor->Submit(packagedFunction);
252 return task->get_future();
253 }
254
BatchUpsertTableRowsAsync(const BatchUpsertTableRowsRequest & request,const BatchUpsertTableRowsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const255 void HoneycodeClient::BatchUpsertTableRowsAsync(const BatchUpsertTableRowsRequest& request, const BatchUpsertTableRowsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
256 {
257 m_executor->Submit( [this, request, handler, context](){ this->BatchUpsertTableRowsAsyncHelper( request, handler, context ); } );
258 }
259
BatchUpsertTableRowsAsyncHelper(const BatchUpsertTableRowsRequest & request,const BatchUpsertTableRowsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const260 void HoneycodeClient::BatchUpsertTableRowsAsyncHelper(const BatchUpsertTableRowsRequest& request, const BatchUpsertTableRowsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
261 {
262 handler(this, request, BatchUpsertTableRows(request), context);
263 }
264
DescribeTableDataImportJob(const DescribeTableDataImportJobRequest & request) const265 DescribeTableDataImportJobOutcome HoneycodeClient::DescribeTableDataImportJob(const DescribeTableDataImportJobRequest& request) const
266 {
267 if (!request.WorkbookIdHasBeenSet())
268 {
269 AWS_LOGSTREAM_ERROR("DescribeTableDataImportJob", "Required field: WorkbookId, is not set");
270 return DescribeTableDataImportJobOutcome(Aws::Client::AWSError<HoneycodeErrors>(HoneycodeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [WorkbookId]", false));
271 }
272 if (!request.TableIdHasBeenSet())
273 {
274 AWS_LOGSTREAM_ERROR("DescribeTableDataImportJob", "Required field: TableId, is not set");
275 return DescribeTableDataImportJobOutcome(Aws::Client::AWSError<HoneycodeErrors>(HoneycodeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [TableId]", false));
276 }
277 if (!request.JobIdHasBeenSet())
278 {
279 AWS_LOGSTREAM_ERROR("DescribeTableDataImportJob", "Required field: JobId, is not set");
280 return DescribeTableDataImportJobOutcome(Aws::Client::AWSError<HoneycodeErrors>(HoneycodeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [JobId]", false));
281 }
282 Aws::Http::URI uri = m_uri;
283 uri.AddPathSegments("/workbooks/");
284 uri.AddPathSegment(request.GetWorkbookId());
285 uri.AddPathSegments("/tables/");
286 uri.AddPathSegment(request.GetTableId());
287 uri.AddPathSegments("/import/");
288 uri.AddPathSegment(request.GetJobId());
289 return DescribeTableDataImportJobOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
290 }
291
DescribeTableDataImportJobCallable(const DescribeTableDataImportJobRequest & request) const292 DescribeTableDataImportJobOutcomeCallable HoneycodeClient::DescribeTableDataImportJobCallable(const DescribeTableDataImportJobRequest& request) const
293 {
294 auto task = Aws::MakeShared< std::packaged_task< DescribeTableDataImportJobOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DescribeTableDataImportJob(request); } );
295 auto packagedFunction = [task]() { (*task)(); };
296 m_executor->Submit(packagedFunction);
297 return task->get_future();
298 }
299
DescribeTableDataImportJobAsync(const DescribeTableDataImportJobRequest & request,const DescribeTableDataImportJobResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const300 void HoneycodeClient::DescribeTableDataImportJobAsync(const DescribeTableDataImportJobRequest& request, const DescribeTableDataImportJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
301 {
302 m_executor->Submit( [this, request, handler, context](){ this->DescribeTableDataImportJobAsyncHelper( request, handler, context ); } );
303 }
304
DescribeTableDataImportJobAsyncHelper(const DescribeTableDataImportJobRequest & request,const DescribeTableDataImportJobResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const305 void HoneycodeClient::DescribeTableDataImportJobAsyncHelper(const DescribeTableDataImportJobRequest& request, const DescribeTableDataImportJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
306 {
307 handler(this, request, DescribeTableDataImportJob(request), context);
308 }
309
GetScreenData(const GetScreenDataRequest & request) const310 GetScreenDataOutcome HoneycodeClient::GetScreenData(const GetScreenDataRequest& request) const
311 {
312 Aws::Http::URI uri = m_uri;
313 uri.AddPathSegments("/screendata");
314 return GetScreenDataOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
315 }
316
GetScreenDataCallable(const GetScreenDataRequest & request) const317 GetScreenDataOutcomeCallable HoneycodeClient::GetScreenDataCallable(const GetScreenDataRequest& request) const
318 {
319 auto task = Aws::MakeShared< std::packaged_task< GetScreenDataOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetScreenData(request); } );
320 auto packagedFunction = [task]() { (*task)(); };
321 m_executor->Submit(packagedFunction);
322 return task->get_future();
323 }
324
GetScreenDataAsync(const GetScreenDataRequest & request,const GetScreenDataResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const325 void HoneycodeClient::GetScreenDataAsync(const GetScreenDataRequest& request, const GetScreenDataResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
326 {
327 m_executor->Submit( [this, request, handler, context](){ this->GetScreenDataAsyncHelper( request, handler, context ); } );
328 }
329
GetScreenDataAsyncHelper(const GetScreenDataRequest & request,const GetScreenDataResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const330 void HoneycodeClient::GetScreenDataAsyncHelper(const GetScreenDataRequest& request, const GetScreenDataResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
331 {
332 handler(this, request, GetScreenData(request), context);
333 }
334
InvokeScreenAutomation(const InvokeScreenAutomationRequest & request) const335 InvokeScreenAutomationOutcome HoneycodeClient::InvokeScreenAutomation(const InvokeScreenAutomationRequest& request) const
336 {
337 if (!request.WorkbookIdHasBeenSet())
338 {
339 AWS_LOGSTREAM_ERROR("InvokeScreenAutomation", "Required field: WorkbookId, is not set");
340 return InvokeScreenAutomationOutcome(Aws::Client::AWSError<HoneycodeErrors>(HoneycodeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [WorkbookId]", false));
341 }
342 if (!request.AppIdHasBeenSet())
343 {
344 AWS_LOGSTREAM_ERROR("InvokeScreenAutomation", "Required field: AppId, is not set");
345 return InvokeScreenAutomationOutcome(Aws::Client::AWSError<HoneycodeErrors>(HoneycodeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [AppId]", false));
346 }
347 if (!request.ScreenIdHasBeenSet())
348 {
349 AWS_LOGSTREAM_ERROR("InvokeScreenAutomation", "Required field: ScreenId, is not set");
350 return InvokeScreenAutomationOutcome(Aws::Client::AWSError<HoneycodeErrors>(HoneycodeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ScreenId]", false));
351 }
352 if (!request.ScreenAutomationIdHasBeenSet())
353 {
354 AWS_LOGSTREAM_ERROR("InvokeScreenAutomation", "Required field: ScreenAutomationId, is not set");
355 return InvokeScreenAutomationOutcome(Aws::Client::AWSError<HoneycodeErrors>(HoneycodeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ScreenAutomationId]", false));
356 }
357 Aws::Http::URI uri = m_uri;
358 uri.AddPathSegments("/workbooks/");
359 uri.AddPathSegment(request.GetWorkbookId());
360 uri.AddPathSegments("/apps/");
361 uri.AddPathSegment(request.GetAppId());
362 uri.AddPathSegments("/screens/");
363 uri.AddPathSegment(request.GetScreenId());
364 uri.AddPathSegments("/automations/");
365 uri.AddPathSegment(request.GetScreenAutomationId());
366 return InvokeScreenAutomationOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
367 }
368
InvokeScreenAutomationCallable(const InvokeScreenAutomationRequest & request) const369 InvokeScreenAutomationOutcomeCallable HoneycodeClient::InvokeScreenAutomationCallable(const InvokeScreenAutomationRequest& request) const
370 {
371 auto task = Aws::MakeShared< std::packaged_task< InvokeScreenAutomationOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->InvokeScreenAutomation(request); } );
372 auto packagedFunction = [task]() { (*task)(); };
373 m_executor->Submit(packagedFunction);
374 return task->get_future();
375 }
376
InvokeScreenAutomationAsync(const InvokeScreenAutomationRequest & request,const InvokeScreenAutomationResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const377 void HoneycodeClient::InvokeScreenAutomationAsync(const InvokeScreenAutomationRequest& request, const InvokeScreenAutomationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
378 {
379 m_executor->Submit( [this, request, handler, context](){ this->InvokeScreenAutomationAsyncHelper( request, handler, context ); } );
380 }
381
InvokeScreenAutomationAsyncHelper(const InvokeScreenAutomationRequest & request,const InvokeScreenAutomationResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const382 void HoneycodeClient::InvokeScreenAutomationAsyncHelper(const InvokeScreenAutomationRequest& request, const InvokeScreenAutomationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
383 {
384 handler(this, request, InvokeScreenAutomation(request), context);
385 }
386
ListTableColumns(const ListTableColumnsRequest & request) const387 ListTableColumnsOutcome HoneycodeClient::ListTableColumns(const ListTableColumnsRequest& request) const
388 {
389 if (!request.WorkbookIdHasBeenSet())
390 {
391 AWS_LOGSTREAM_ERROR("ListTableColumns", "Required field: WorkbookId, is not set");
392 return ListTableColumnsOutcome(Aws::Client::AWSError<HoneycodeErrors>(HoneycodeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [WorkbookId]", false));
393 }
394 if (!request.TableIdHasBeenSet())
395 {
396 AWS_LOGSTREAM_ERROR("ListTableColumns", "Required field: TableId, is not set");
397 return ListTableColumnsOutcome(Aws::Client::AWSError<HoneycodeErrors>(HoneycodeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [TableId]", false));
398 }
399 Aws::Http::URI uri = m_uri;
400 uri.AddPathSegments("/workbooks/");
401 uri.AddPathSegment(request.GetWorkbookId());
402 uri.AddPathSegments("/tables/");
403 uri.AddPathSegment(request.GetTableId());
404 uri.AddPathSegments("/columns");
405 return ListTableColumnsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
406 }
407
ListTableColumnsCallable(const ListTableColumnsRequest & request) const408 ListTableColumnsOutcomeCallable HoneycodeClient::ListTableColumnsCallable(const ListTableColumnsRequest& request) const
409 {
410 auto task = Aws::MakeShared< std::packaged_task< ListTableColumnsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListTableColumns(request); } );
411 auto packagedFunction = [task]() { (*task)(); };
412 m_executor->Submit(packagedFunction);
413 return task->get_future();
414 }
415
ListTableColumnsAsync(const ListTableColumnsRequest & request,const ListTableColumnsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const416 void HoneycodeClient::ListTableColumnsAsync(const ListTableColumnsRequest& request, const ListTableColumnsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
417 {
418 m_executor->Submit( [this, request, handler, context](){ this->ListTableColumnsAsyncHelper( request, handler, context ); } );
419 }
420
ListTableColumnsAsyncHelper(const ListTableColumnsRequest & request,const ListTableColumnsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const421 void HoneycodeClient::ListTableColumnsAsyncHelper(const ListTableColumnsRequest& request, const ListTableColumnsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
422 {
423 handler(this, request, ListTableColumns(request), context);
424 }
425
ListTableRows(const ListTableRowsRequest & request) const426 ListTableRowsOutcome HoneycodeClient::ListTableRows(const ListTableRowsRequest& request) const
427 {
428 if (!request.WorkbookIdHasBeenSet())
429 {
430 AWS_LOGSTREAM_ERROR("ListTableRows", "Required field: WorkbookId, is not set");
431 return ListTableRowsOutcome(Aws::Client::AWSError<HoneycodeErrors>(HoneycodeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [WorkbookId]", false));
432 }
433 if (!request.TableIdHasBeenSet())
434 {
435 AWS_LOGSTREAM_ERROR("ListTableRows", "Required field: TableId, is not set");
436 return ListTableRowsOutcome(Aws::Client::AWSError<HoneycodeErrors>(HoneycodeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [TableId]", false));
437 }
438 Aws::Http::URI uri = m_uri;
439 uri.AddPathSegments("/workbooks/");
440 uri.AddPathSegment(request.GetWorkbookId());
441 uri.AddPathSegments("/tables/");
442 uri.AddPathSegment(request.GetTableId());
443 uri.AddPathSegments("/rows/list");
444 return ListTableRowsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
445 }
446
ListTableRowsCallable(const ListTableRowsRequest & request) const447 ListTableRowsOutcomeCallable HoneycodeClient::ListTableRowsCallable(const ListTableRowsRequest& request) const
448 {
449 auto task = Aws::MakeShared< std::packaged_task< ListTableRowsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListTableRows(request); } );
450 auto packagedFunction = [task]() { (*task)(); };
451 m_executor->Submit(packagedFunction);
452 return task->get_future();
453 }
454
ListTableRowsAsync(const ListTableRowsRequest & request,const ListTableRowsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const455 void HoneycodeClient::ListTableRowsAsync(const ListTableRowsRequest& request, const ListTableRowsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
456 {
457 m_executor->Submit( [this, request, handler, context](){ this->ListTableRowsAsyncHelper( request, handler, context ); } );
458 }
459
ListTableRowsAsyncHelper(const ListTableRowsRequest & request,const ListTableRowsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const460 void HoneycodeClient::ListTableRowsAsyncHelper(const ListTableRowsRequest& request, const ListTableRowsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
461 {
462 handler(this, request, ListTableRows(request), context);
463 }
464
ListTables(const ListTablesRequest & request) const465 ListTablesOutcome HoneycodeClient::ListTables(const ListTablesRequest& request) const
466 {
467 if (!request.WorkbookIdHasBeenSet())
468 {
469 AWS_LOGSTREAM_ERROR("ListTables", "Required field: WorkbookId, is not set");
470 return ListTablesOutcome(Aws::Client::AWSError<HoneycodeErrors>(HoneycodeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [WorkbookId]", false));
471 }
472 Aws::Http::URI uri = m_uri;
473 uri.AddPathSegments("/workbooks/");
474 uri.AddPathSegment(request.GetWorkbookId());
475 uri.AddPathSegments("/tables");
476 return ListTablesOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
477 }
478
ListTablesCallable(const ListTablesRequest & request) const479 ListTablesOutcomeCallable HoneycodeClient::ListTablesCallable(const ListTablesRequest& request) const
480 {
481 auto task = Aws::MakeShared< std::packaged_task< ListTablesOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListTables(request); } );
482 auto packagedFunction = [task]() { (*task)(); };
483 m_executor->Submit(packagedFunction);
484 return task->get_future();
485 }
486
ListTablesAsync(const ListTablesRequest & request,const ListTablesResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const487 void HoneycodeClient::ListTablesAsync(const ListTablesRequest& request, const ListTablesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
488 {
489 m_executor->Submit( [this, request, handler, context](){ this->ListTablesAsyncHelper( request, handler, context ); } );
490 }
491
ListTablesAsyncHelper(const ListTablesRequest & request,const ListTablesResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const492 void HoneycodeClient::ListTablesAsyncHelper(const ListTablesRequest& request, const ListTablesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
493 {
494 handler(this, request, ListTables(request), context);
495 }
496
QueryTableRows(const QueryTableRowsRequest & request) const497 QueryTableRowsOutcome HoneycodeClient::QueryTableRows(const QueryTableRowsRequest& request) const
498 {
499 if (!request.WorkbookIdHasBeenSet())
500 {
501 AWS_LOGSTREAM_ERROR("QueryTableRows", "Required field: WorkbookId, is not set");
502 return QueryTableRowsOutcome(Aws::Client::AWSError<HoneycodeErrors>(HoneycodeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [WorkbookId]", false));
503 }
504 if (!request.TableIdHasBeenSet())
505 {
506 AWS_LOGSTREAM_ERROR("QueryTableRows", "Required field: TableId, is not set");
507 return QueryTableRowsOutcome(Aws::Client::AWSError<HoneycodeErrors>(HoneycodeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [TableId]", false));
508 }
509 Aws::Http::URI uri = m_uri;
510 uri.AddPathSegments("/workbooks/");
511 uri.AddPathSegment(request.GetWorkbookId());
512 uri.AddPathSegments("/tables/");
513 uri.AddPathSegment(request.GetTableId());
514 uri.AddPathSegments("/rows/query");
515 return QueryTableRowsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
516 }
517
QueryTableRowsCallable(const QueryTableRowsRequest & request) const518 QueryTableRowsOutcomeCallable HoneycodeClient::QueryTableRowsCallable(const QueryTableRowsRequest& request) const
519 {
520 auto task = Aws::MakeShared< std::packaged_task< QueryTableRowsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->QueryTableRows(request); } );
521 auto packagedFunction = [task]() { (*task)(); };
522 m_executor->Submit(packagedFunction);
523 return task->get_future();
524 }
525
QueryTableRowsAsync(const QueryTableRowsRequest & request,const QueryTableRowsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const526 void HoneycodeClient::QueryTableRowsAsync(const QueryTableRowsRequest& request, const QueryTableRowsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
527 {
528 m_executor->Submit( [this, request, handler, context](){ this->QueryTableRowsAsyncHelper( request, handler, context ); } );
529 }
530
QueryTableRowsAsyncHelper(const QueryTableRowsRequest & request,const QueryTableRowsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const531 void HoneycodeClient::QueryTableRowsAsyncHelper(const QueryTableRowsRequest& request, const QueryTableRowsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
532 {
533 handler(this, request, QueryTableRows(request), context);
534 }
535
StartTableDataImportJob(const StartTableDataImportJobRequest & request) const536 StartTableDataImportJobOutcome HoneycodeClient::StartTableDataImportJob(const StartTableDataImportJobRequest& request) const
537 {
538 if (!request.WorkbookIdHasBeenSet())
539 {
540 AWS_LOGSTREAM_ERROR("StartTableDataImportJob", "Required field: WorkbookId, is not set");
541 return StartTableDataImportJobOutcome(Aws::Client::AWSError<HoneycodeErrors>(HoneycodeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [WorkbookId]", false));
542 }
543 if (!request.DestinationTableIdHasBeenSet())
544 {
545 AWS_LOGSTREAM_ERROR("StartTableDataImportJob", "Required field: DestinationTableId, is not set");
546 return StartTableDataImportJobOutcome(Aws::Client::AWSError<HoneycodeErrors>(HoneycodeErrors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [DestinationTableId]", false));
547 }
548 Aws::Http::URI uri = m_uri;
549 uri.AddPathSegments("/workbooks/");
550 uri.AddPathSegment(request.GetWorkbookId());
551 uri.AddPathSegments("/tables/");
552 uri.AddPathSegment(request.GetDestinationTableId());
553 uri.AddPathSegments("/import");
554 return StartTableDataImportJobOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
555 }
556
StartTableDataImportJobCallable(const StartTableDataImportJobRequest & request) const557 StartTableDataImportJobOutcomeCallable HoneycodeClient::StartTableDataImportJobCallable(const StartTableDataImportJobRequest& request) const
558 {
559 auto task = Aws::MakeShared< std::packaged_task< StartTableDataImportJobOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->StartTableDataImportJob(request); } );
560 auto packagedFunction = [task]() { (*task)(); };
561 m_executor->Submit(packagedFunction);
562 return task->get_future();
563 }
564
StartTableDataImportJobAsync(const StartTableDataImportJobRequest & request,const StartTableDataImportJobResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const565 void HoneycodeClient::StartTableDataImportJobAsync(const StartTableDataImportJobRequest& request, const StartTableDataImportJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
566 {
567 m_executor->Submit( [this, request, handler, context](){ this->StartTableDataImportJobAsyncHelper( request, handler, context ); } );
568 }
569
StartTableDataImportJobAsyncHelper(const StartTableDataImportJobRequest & request,const StartTableDataImportJobResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const570 void HoneycodeClient::StartTableDataImportJobAsyncHelper(const StartTableDataImportJobRequest& request, const StartTableDataImportJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
571 {
572 handler(this, request, StartTableDataImportJob(request), context);
573 }
574
575