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/greengrassv2/GreengrassV2Client.h>
21 #include <aws/greengrassv2/GreengrassV2Endpoint.h>
22 #include <aws/greengrassv2/GreengrassV2ErrorMarshaller.h>
23 #include <aws/greengrassv2/model/BatchAssociateClientDeviceWithCoreDeviceRequest.h>
24 #include <aws/greengrassv2/model/BatchDisassociateClientDeviceFromCoreDeviceRequest.h>
25 #include <aws/greengrassv2/model/CancelDeploymentRequest.h>
26 #include <aws/greengrassv2/model/CreateComponentVersionRequest.h>
27 #include <aws/greengrassv2/model/CreateDeploymentRequest.h>
28 #include <aws/greengrassv2/model/DeleteComponentRequest.h>
29 #include <aws/greengrassv2/model/DeleteCoreDeviceRequest.h>
30 #include <aws/greengrassv2/model/DescribeComponentRequest.h>
31 #include <aws/greengrassv2/model/GetComponentRequest.h>
32 #include <aws/greengrassv2/model/GetComponentVersionArtifactRequest.h>
33 #include <aws/greengrassv2/model/GetCoreDeviceRequest.h>
34 #include <aws/greengrassv2/model/GetDeploymentRequest.h>
35 #include <aws/greengrassv2/model/ListClientDevicesAssociatedWithCoreDeviceRequest.h>
36 #include <aws/greengrassv2/model/ListComponentVersionsRequest.h>
37 #include <aws/greengrassv2/model/ListComponentsRequest.h>
38 #include <aws/greengrassv2/model/ListCoreDevicesRequest.h>
39 #include <aws/greengrassv2/model/ListDeploymentsRequest.h>
40 #include <aws/greengrassv2/model/ListEffectiveDeploymentsRequest.h>
41 #include <aws/greengrassv2/model/ListInstalledComponentsRequest.h>
42 #include <aws/greengrassv2/model/ListTagsForResourceRequest.h>
43 #include <aws/greengrassv2/model/ResolveComponentCandidatesRequest.h>
44 #include <aws/greengrassv2/model/TagResourceRequest.h>
45 #include <aws/greengrassv2/model/UntagResourceRequest.h>
46 
47 using namespace Aws;
48 using namespace Aws::Auth;
49 using namespace Aws::Client;
50 using namespace Aws::GreengrassV2;
51 using namespace Aws::GreengrassV2::Model;
52 using namespace Aws::Http;
53 using namespace Aws::Utils::Json;
54 
55 static const char* SERVICE_NAME = "greengrass";
56 static const char* ALLOCATION_TAG = "GreengrassV2Client";
57 
58 
GreengrassV2Client(const Client::ClientConfiguration & clientConfiguration)59 GreengrassV2Client::GreengrassV2Client(const Client::ClientConfiguration& clientConfiguration) :
60   BASECLASS(clientConfiguration,
61     Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, Aws::MakeShared<DefaultAWSCredentialsProviderChain>(ALLOCATION_TAG),
62         SERVICE_NAME, Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
63     Aws::MakeShared<GreengrassV2ErrorMarshaller>(ALLOCATION_TAG)),
64     m_executor(clientConfiguration.executor)
65 {
66   init(clientConfiguration);
67 }
68 
GreengrassV2Client(const AWSCredentials & credentials,const Client::ClientConfiguration & clientConfiguration)69 GreengrassV2Client::GreengrassV2Client(const AWSCredentials& credentials, const Client::ClientConfiguration& clientConfiguration) :
70   BASECLASS(clientConfiguration,
71     Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, Aws::MakeShared<SimpleAWSCredentialsProvider>(ALLOCATION_TAG, credentials),
72          SERVICE_NAME, Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
73     Aws::MakeShared<GreengrassV2ErrorMarshaller>(ALLOCATION_TAG)),
74     m_executor(clientConfiguration.executor)
75 {
76   init(clientConfiguration);
77 }
78 
GreengrassV2Client(const std::shared_ptr<AWSCredentialsProvider> & credentialsProvider,const Client::ClientConfiguration & clientConfiguration)79 GreengrassV2Client::GreengrassV2Client(const std::shared_ptr<AWSCredentialsProvider>& credentialsProvider,
80   const Client::ClientConfiguration& clientConfiguration) :
81   BASECLASS(clientConfiguration,
82     Aws::MakeShared<AWSAuthV4Signer>(ALLOCATION_TAG, credentialsProvider,
83          SERVICE_NAME, Aws::Region::ComputeSignerRegion(clientConfiguration.region)),
84     Aws::MakeShared<GreengrassV2ErrorMarshaller>(ALLOCATION_TAG)),
85     m_executor(clientConfiguration.executor)
86 {
87   init(clientConfiguration);
88 }
89 
~GreengrassV2Client()90 GreengrassV2Client::~GreengrassV2Client()
91 {
92 }
93 
init(const Client::ClientConfiguration & config)94 void GreengrassV2Client::init(const Client::ClientConfiguration& config)
95 {
96   SetServiceClientName("GreengrassV2");
97   m_configScheme = SchemeMapper::ToString(config.scheme);
98   if (config.endpointOverride.empty())
99   {
100       m_uri = m_configScheme + "://" + GreengrassV2Endpoint::ForRegion(config.region, config.useDualStack);
101   }
102   else
103   {
104       OverrideEndpoint(config.endpointOverride);
105   }
106 }
107 
OverrideEndpoint(const Aws::String & endpoint)108 void GreengrassV2Client::OverrideEndpoint(const Aws::String& endpoint)
109 {
110   if (endpoint.compare(0, 7, "http://") == 0 || endpoint.compare(0, 8, "https://") == 0)
111   {
112       m_uri = endpoint;
113   }
114   else
115   {
116       m_uri = m_configScheme + "://" + endpoint;
117   }
118 }
119 
BatchAssociateClientDeviceWithCoreDevice(const BatchAssociateClientDeviceWithCoreDeviceRequest & request) const120 BatchAssociateClientDeviceWithCoreDeviceOutcome GreengrassV2Client::BatchAssociateClientDeviceWithCoreDevice(const BatchAssociateClientDeviceWithCoreDeviceRequest& request) const
121 {
122   if (!request.CoreDeviceThingNameHasBeenSet())
123   {
124     AWS_LOGSTREAM_ERROR("BatchAssociateClientDeviceWithCoreDevice", "Required field: CoreDeviceThingName, is not set");
125     return BatchAssociateClientDeviceWithCoreDeviceOutcome(Aws::Client::AWSError<GreengrassV2Errors>(GreengrassV2Errors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [CoreDeviceThingName]", false));
126   }
127   Aws::Http::URI uri = m_uri;
128   uri.AddPathSegments("/greengrass/v2/coreDevices/");
129   uri.AddPathSegment(request.GetCoreDeviceThingName());
130   uri.AddPathSegments("/associateClientDevices");
131   return BatchAssociateClientDeviceWithCoreDeviceOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
132 }
133 
BatchAssociateClientDeviceWithCoreDeviceCallable(const BatchAssociateClientDeviceWithCoreDeviceRequest & request) const134 BatchAssociateClientDeviceWithCoreDeviceOutcomeCallable GreengrassV2Client::BatchAssociateClientDeviceWithCoreDeviceCallable(const BatchAssociateClientDeviceWithCoreDeviceRequest& request) const
135 {
136   auto task = Aws::MakeShared< std::packaged_task< BatchAssociateClientDeviceWithCoreDeviceOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->BatchAssociateClientDeviceWithCoreDevice(request); } );
137   auto packagedFunction = [task]() { (*task)(); };
138   m_executor->Submit(packagedFunction);
139   return task->get_future();
140 }
141 
BatchAssociateClientDeviceWithCoreDeviceAsync(const BatchAssociateClientDeviceWithCoreDeviceRequest & request,const BatchAssociateClientDeviceWithCoreDeviceResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const142 void GreengrassV2Client::BatchAssociateClientDeviceWithCoreDeviceAsync(const BatchAssociateClientDeviceWithCoreDeviceRequest& request, const BatchAssociateClientDeviceWithCoreDeviceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
143 {
144   m_executor->Submit( [this, request, handler, context](){ this->BatchAssociateClientDeviceWithCoreDeviceAsyncHelper( request, handler, context ); } );
145 }
146 
BatchAssociateClientDeviceWithCoreDeviceAsyncHelper(const BatchAssociateClientDeviceWithCoreDeviceRequest & request,const BatchAssociateClientDeviceWithCoreDeviceResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const147 void GreengrassV2Client::BatchAssociateClientDeviceWithCoreDeviceAsyncHelper(const BatchAssociateClientDeviceWithCoreDeviceRequest& request, const BatchAssociateClientDeviceWithCoreDeviceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
148 {
149   handler(this, request, BatchAssociateClientDeviceWithCoreDevice(request), context);
150 }
151 
BatchDisassociateClientDeviceFromCoreDevice(const BatchDisassociateClientDeviceFromCoreDeviceRequest & request) const152 BatchDisassociateClientDeviceFromCoreDeviceOutcome GreengrassV2Client::BatchDisassociateClientDeviceFromCoreDevice(const BatchDisassociateClientDeviceFromCoreDeviceRequest& request) const
153 {
154   if (!request.CoreDeviceThingNameHasBeenSet())
155   {
156     AWS_LOGSTREAM_ERROR("BatchDisassociateClientDeviceFromCoreDevice", "Required field: CoreDeviceThingName, is not set");
157     return BatchDisassociateClientDeviceFromCoreDeviceOutcome(Aws::Client::AWSError<GreengrassV2Errors>(GreengrassV2Errors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [CoreDeviceThingName]", false));
158   }
159   Aws::Http::URI uri = m_uri;
160   uri.AddPathSegments("/greengrass/v2/coreDevices/");
161   uri.AddPathSegment(request.GetCoreDeviceThingName());
162   uri.AddPathSegments("/disassociateClientDevices");
163   return BatchDisassociateClientDeviceFromCoreDeviceOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
164 }
165 
BatchDisassociateClientDeviceFromCoreDeviceCallable(const BatchDisassociateClientDeviceFromCoreDeviceRequest & request) const166 BatchDisassociateClientDeviceFromCoreDeviceOutcomeCallable GreengrassV2Client::BatchDisassociateClientDeviceFromCoreDeviceCallable(const BatchDisassociateClientDeviceFromCoreDeviceRequest& request) const
167 {
168   auto task = Aws::MakeShared< std::packaged_task< BatchDisassociateClientDeviceFromCoreDeviceOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->BatchDisassociateClientDeviceFromCoreDevice(request); } );
169   auto packagedFunction = [task]() { (*task)(); };
170   m_executor->Submit(packagedFunction);
171   return task->get_future();
172 }
173 
BatchDisassociateClientDeviceFromCoreDeviceAsync(const BatchDisassociateClientDeviceFromCoreDeviceRequest & request,const BatchDisassociateClientDeviceFromCoreDeviceResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const174 void GreengrassV2Client::BatchDisassociateClientDeviceFromCoreDeviceAsync(const BatchDisassociateClientDeviceFromCoreDeviceRequest& request, const BatchDisassociateClientDeviceFromCoreDeviceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
175 {
176   m_executor->Submit( [this, request, handler, context](){ this->BatchDisassociateClientDeviceFromCoreDeviceAsyncHelper( request, handler, context ); } );
177 }
178 
BatchDisassociateClientDeviceFromCoreDeviceAsyncHelper(const BatchDisassociateClientDeviceFromCoreDeviceRequest & request,const BatchDisassociateClientDeviceFromCoreDeviceResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const179 void GreengrassV2Client::BatchDisassociateClientDeviceFromCoreDeviceAsyncHelper(const BatchDisassociateClientDeviceFromCoreDeviceRequest& request, const BatchDisassociateClientDeviceFromCoreDeviceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
180 {
181   handler(this, request, BatchDisassociateClientDeviceFromCoreDevice(request), context);
182 }
183 
CancelDeployment(const CancelDeploymentRequest & request) const184 CancelDeploymentOutcome GreengrassV2Client::CancelDeployment(const CancelDeploymentRequest& request) const
185 {
186   if (!request.DeploymentIdHasBeenSet())
187   {
188     AWS_LOGSTREAM_ERROR("CancelDeployment", "Required field: DeploymentId, is not set");
189     return CancelDeploymentOutcome(Aws::Client::AWSError<GreengrassV2Errors>(GreengrassV2Errors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [DeploymentId]", false));
190   }
191   Aws::Http::URI uri = m_uri;
192   uri.AddPathSegments("/greengrass/v2/deployments/");
193   uri.AddPathSegment(request.GetDeploymentId());
194   uri.AddPathSegments("/cancel");
195   return CancelDeploymentOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
196 }
197 
CancelDeploymentCallable(const CancelDeploymentRequest & request) const198 CancelDeploymentOutcomeCallable GreengrassV2Client::CancelDeploymentCallable(const CancelDeploymentRequest& request) const
199 {
200   auto task = Aws::MakeShared< std::packaged_task< CancelDeploymentOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->CancelDeployment(request); } );
201   auto packagedFunction = [task]() { (*task)(); };
202   m_executor->Submit(packagedFunction);
203   return task->get_future();
204 }
205 
CancelDeploymentAsync(const CancelDeploymentRequest & request,const CancelDeploymentResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const206 void GreengrassV2Client::CancelDeploymentAsync(const CancelDeploymentRequest& request, const CancelDeploymentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
207 {
208   m_executor->Submit( [this, request, handler, context](){ this->CancelDeploymentAsyncHelper( request, handler, context ); } );
209 }
210 
CancelDeploymentAsyncHelper(const CancelDeploymentRequest & request,const CancelDeploymentResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const211 void GreengrassV2Client::CancelDeploymentAsyncHelper(const CancelDeploymentRequest& request, const CancelDeploymentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
212 {
213   handler(this, request, CancelDeployment(request), context);
214 }
215 
CreateComponentVersion(const CreateComponentVersionRequest & request) const216 CreateComponentVersionOutcome GreengrassV2Client::CreateComponentVersion(const CreateComponentVersionRequest& request) const
217 {
218   Aws::Http::URI uri = m_uri;
219   uri.AddPathSegments("/greengrass/v2/createComponentVersion");
220   return CreateComponentVersionOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
221 }
222 
CreateComponentVersionCallable(const CreateComponentVersionRequest & request) const223 CreateComponentVersionOutcomeCallable GreengrassV2Client::CreateComponentVersionCallable(const CreateComponentVersionRequest& request) const
224 {
225   auto task = Aws::MakeShared< std::packaged_task< CreateComponentVersionOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->CreateComponentVersion(request); } );
226   auto packagedFunction = [task]() { (*task)(); };
227   m_executor->Submit(packagedFunction);
228   return task->get_future();
229 }
230 
CreateComponentVersionAsync(const CreateComponentVersionRequest & request,const CreateComponentVersionResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const231 void GreengrassV2Client::CreateComponentVersionAsync(const CreateComponentVersionRequest& request, const CreateComponentVersionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
232 {
233   m_executor->Submit( [this, request, handler, context](){ this->CreateComponentVersionAsyncHelper( request, handler, context ); } );
234 }
235 
CreateComponentVersionAsyncHelper(const CreateComponentVersionRequest & request,const CreateComponentVersionResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const236 void GreengrassV2Client::CreateComponentVersionAsyncHelper(const CreateComponentVersionRequest& request, const CreateComponentVersionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
237 {
238   handler(this, request, CreateComponentVersion(request), context);
239 }
240 
CreateDeployment(const CreateDeploymentRequest & request) const241 CreateDeploymentOutcome GreengrassV2Client::CreateDeployment(const CreateDeploymentRequest& request) const
242 {
243   Aws::Http::URI uri = m_uri;
244   uri.AddPathSegments("/greengrass/v2/deployments");
245   return CreateDeploymentOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
246 }
247 
CreateDeploymentCallable(const CreateDeploymentRequest & request) const248 CreateDeploymentOutcomeCallable GreengrassV2Client::CreateDeploymentCallable(const CreateDeploymentRequest& request) const
249 {
250   auto task = Aws::MakeShared< std::packaged_task< CreateDeploymentOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->CreateDeployment(request); } );
251   auto packagedFunction = [task]() { (*task)(); };
252   m_executor->Submit(packagedFunction);
253   return task->get_future();
254 }
255 
CreateDeploymentAsync(const CreateDeploymentRequest & request,const CreateDeploymentResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const256 void GreengrassV2Client::CreateDeploymentAsync(const CreateDeploymentRequest& request, const CreateDeploymentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
257 {
258   m_executor->Submit( [this, request, handler, context](){ this->CreateDeploymentAsyncHelper( request, handler, context ); } );
259 }
260 
CreateDeploymentAsyncHelper(const CreateDeploymentRequest & request,const CreateDeploymentResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const261 void GreengrassV2Client::CreateDeploymentAsyncHelper(const CreateDeploymentRequest& request, const CreateDeploymentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
262 {
263   handler(this, request, CreateDeployment(request), context);
264 }
265 
DeleteComponent(const DeleteComponentRequest & request) const266 DeleteComponentOutcome GreengrassV2Client::DeleteComponent(const DeleteComponentRequest& request) const
267 {
268   if (!request.ArnHasBeenSet())
269   {
270     AWS_LOGSTREAM_ERROR("DeleteComponent", "Required field: Arn, is not set");
271     return DeleteComponentOutcome(Aws::Client::AWSError<GreengrassV2Errors>(GreengrassV2Errors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [Arn]", false));
272   }
273   Aws::Http::URI uri = m_uri;
274   uri.AddPathSegments("/greengrass/v2/components/");
275   uri.AddPathSegment(request.GetArn());
276   return DeleteComponentOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_DELETE, Aws::Auth::SIGV4_SIGNER));
277 }
278 
DeleteComponentCallable(const DeleteComponentRequest & request) const279 DeleteComponentOutcomeCallable GreengrassV2Client::DeleteComponentCallable(const DeleteComponentRequest& request) const
280 {
281   auto task = Aws::MakeShared< std::packaged_task< DeleteComponentOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DeleteComponent(request); } );
282   auto packagedFunction = [task]() { (*task)(); };
283   m_executor->Submit(packagedFunction);
284   return task->get_future();
285 }
286 
DeleteComponentAsync(const DeleteComponentRequest & request,const DeleteComponentResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const287 void GreengrassV2Client::DeleteComponentAsync(const DeleteComponentRequest& request, const DeleteComponentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
288 {
289   m_executor->Submit( [this, request, handler, context](){ this->DeleteComponentAsyncHelper( request, handler, context ); } );
290 }
291 
DeleteComponentAsyncHelper(const DeleteComponentRequest & request,const DeleteComponentResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const292 void GreengrassV2Client::DeleteComponentAsyncHelper(const DeleteComponentRequest& request, const DeleteComponentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
293 {
294   handler(this, request, DeleteComponent(request), context);
295 }
296 
DeleteCoreDevice(const DeleteCoreDeviceRequest & request) const297 DeleteCoreDeviceOutcome GreengrassV2Client::DeleteCoreDevice(const DeleteCoreDeviceRequest& request) const
298 {
299   if (!request.CoreDeviceThingNameHasBeenSet())
300   {
301     AWS_LOGSTREAM_ERROR("DeleteCoreDevice", "Required field: CoreDeviceThingName, is not set");
302     return DeleteCoreDeviceOutcome(Aws::Client::AWSError<GreengrassV2Errors>(GreengrassV2Errors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [CoreDeviceThingName]", false));
303   }
304   Aws::Http::URI uri = m_uri;
305   uri.AddPathSegments("/greengrass/v2/coreDevices/");
306   uri.AddPathSegment(request.GetCoreDeviceThingName());
307   return DeleteCoreDeviceOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_DELETE, Aws::Auth::SIGV4_SIGNER));
308 }
309 
DeleteCoreDeviceCallable(const DeleteCoreDeviceRequest & request) const310 DeleteCoreDeviceOutcomeCallable GreengrassV2Client::DeleteCoreDeviceCallable(const DeleteCoreDeviceRequest& request) const
311 {
312   auto task = Aws::MakeShared< std::packaged_task< DeleteCoreDeviceOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DeleteCoreDevice(request); } );
313   auto packagedFunction = [task]() { (*task)(); };
314   m_executor->Submit(packagedFunction);
315   return task->get_future();
316 }
317 
DeleteCoreDeviceAsync(const DeleteCoreDeviceRequest & request,const DeleteCoreDeviceResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const318 void GreengrassV2Client::DeleteCoreDeviceAsync(const DeleteCoreDeviceRequest& request, const DeleteCoreDeviceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
319 {
320   m_executor->Submit( [this, request, handler, context](){ this->DeleteCoreDeviceAsyncHelper( request, handler, context ); } );
321 }
322 
DeleteCoreDeviceAsyncHelper(const DeleteCoreDeviceRequest & request,const DeleteCoreDeviceResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const323 void GreengrassV2Client::DeleteCoreDeviceAsyncHelper(const DeleteCoreDeviceRequest& request, const DeleteCoreDeviceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
324 {
325   handler(this, request, DeleteCoreDevice(request), context);
326 }
327 
DescribeComponent(const DescribeComponentRequest & request) const328 DescribeComponentOutcome GreengrassV2Client::DescribeComponent(const DescribeComponentRequest& request) const
329 {
330   if (!request.ArnHasBeenSet())
331   {
332     AWS_LOGSTREAM_ERROR("DescribeComponent", "Required field: Arn, is not set");
333     return DescribeComponentOutcome(Aws::Client::AWSError<GreengrassV2Errors>(GreengrassV2Errors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [Arn]", false));
334   }
335   Aws::Http::URI uri = m_uri;
336   uri.AddPathSegments("/greengrass/v2/components/");
337   uri.AddPathSegment(request.GetArn());
338   uri.AddPathSegments("/metadata");
339   return DescribeComponentOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
340 }
341 
DescribeComponentCallable(const DescribeComponentRequest & request) const342 DescribeComponentOutcomeCallable GreengrassV2Client::DescribeComponentCallable(const DescribeComponentRequest& request) const
343 {
344   auto task = Aws::MakeShared< std::packaged_task< DescribeComponentOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->DescribeComponent(request); } );
345   auto packagedFunction = [task]() { (*task)(); };
346   m_executor->Submit(packagedFunction);
347   return task->get_future();
348 }
349 
DescribeComponentAsync(const DescribeComponentRequest & request,const DescribeComponentResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const350 void GreengrassV2Client::DescribeComponentAsync(const DescribeComponentRequest& request, const DescribeComponentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
351 {
352   m_executor->Submit( [this, request, handler, context](){ this->DescribeComponentAsyncHelper( request, handler, context ); } );
353 }
354 
DescribeComponentAsyncHelper(const DescribeComponentRequest & request,const DescribeComponentResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const355 void GreengrassV2Client::DescribeComponentAsyncHelper(const DescribeComponentRequest& request, const DescribeComponentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
356 {
357   handler(this, request, DescribeComponent(request), context);
358 }
359 
GetComponent(const GetComponentRequest & request) const360 GetComponentOutcome GreengrassV2Client::GetComponent(const GetComponentRequest& request) const
361 {
362   if (!request.ArnHasBeenSet())
363   {
364     AWS_LOGSTREAM_ERROR("GetComponent", "Required field: Arn, is not set");
365     return GetComponentOutcome(Aws::Client::AWSError<GreengrassV2Errors>(GreengrassV2Errors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [Arn]", false));
366   }
367   Aws::Http::URI uri = m_uri;
368   uri.AddPathSegments("/greengrass/v2/components/");
369   uri.AddPathSegment(request.GetArn());
370   return GetComponentOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
371 }
372 
GetComponentCallable(const GetComponentRequest & request) const373 GetComponentOutcomeCallable GreengrassV2Client::GetComponentCallable(const GetComponentRequest& request) const
374 {
375   auto task = Aws::MakeShared< std::packaged_task< GetComponentOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetComponent(request); } );
376   auto packagedFunction = [task]() { (*task)(); };
377   m_executor->Submit(packagedFunction);
378   return task->get_future();
379 }
380 
GetComponentAsync(const GetComponentRequest & request,const GetComponentResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const381 void GreengrassV2Client::GetComponentAsync(const GetComponentRequest& request, const GetComponentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
382 {
383   m_executor->Submit( [this, request, handler, context](){ this->GetComponentAsyncHelper( request, handler, context ); } );
384 }
385 
GetComponentAsyncHelper(const GetComponentRequest & request,const GetComponentResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const386 void GreengrassV2Client::GetComponentAsyncHelper(const GetComponentRequest& request, const GetComponentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
387 {
388   handler(this, request, GetComponent(request), context);
389 }
390 
GetComponentVersionArtifact(const GetComponentVersionArtifactRequest & request) const391 GetComponentVersionArtifactOutcome GreengrassV2Client::GetComponentVersionArtifact(const GetComponentVersionArtifactRequest& request) const
392 {
393   if (!request.ArnHasBeenSet())
394   {
395     AWS_LOGSTREAM_ERROR("GetComponentVersionArtifact", "Required field: Arn, is not set");
396     return GetComponentVersionArtifactOutcome(Aws::Client::AWSError<GreengrassV2Errors>(GreengrassV2Errors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [Arn]", false));
397   }
398   if (!request.ArtifactNameHasBeenSet())
399   {
400     AWS_LOGSTREAM_ERROR("GetComponentVersionArtifact", "Required field: ArtifactName, is not set");
401     return GetComponentVersionArtifactOutcome(Aws::Client::AWSError<GreengrassV2Errors>(GreengrassV2Errors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ArtifactName]", false));
402   }
403   Aws::Http::URI uri = m_uri;
404   uri.AddPathSegments("/greengrass/v2/components/");
405   uri.AddPathSegment(request.GetArn());
406   uri.AddPathSegments("/artifacts/");
407   uri.AddPathSegments(request.GetArtifactName());
408   return GetComponentVersionArtifactOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
409 }
410 
GetComponentVersionArtifactCallable(const GetComponentVersionArtifactRequest & request) const411 GetComponentVersionArtifactOutcomeCallable GreengrassV2Client::GetComponentVersionArtifactCallable(const GetComponentVersionArtifactRequest& request) const
412 {
413   auto task = Aws::MakeShared< std::packaged_task< GetComponentVersionArtifactOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetComponentVersionArtifact(request); } );
414   auto packagedFunction = [task]() { (*task)(); };
415   m_executor->Submit(packagedFunction);
416   return task->get_future();
417 }
418 
GetComponentVersionArtifactAsync(const GetComponentVersionArtifactRequest & request,const GetComponentVersionArtifactResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const419 void GreengrassV2Client::GetComponentVersionArtifactAsync(const GetComponentVersionArtifactRequest& request, const GetComponentVersionArtifactResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
420 {
421   m_executor->Submit( [this, request, handler, context](){ this->GetComponentVersionArtifactAsyncHelper( request, handler, context ); } );
422 }
423 
GetComponentVersionArtifactAsyncHelper(const GetComponentVersionArtifactRequest & request,const GetComponentVersionArtifactResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const424 void GreengrassV2Client::GetComponentVersionArtifactAsyncHelper(const GetComponentVersionArtifactRequest& request, const GetComponentVersionArtifactResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
425 {
426   handler(this, request, GetComponentVersionArtifact(request), context);
427 }
428 
GetCoreDevice(const GetCoreDeviceRequest & request) const429 GetCoreDeviceOutcome GreengrassV2Client::GetCoreDevice(const GetCoreDeviceRequest& request) const
430 {
431   if (!request.CoreDeviceThingNameHasBeenSet())
432   {
433     AWS_LOGSTREAM_ERROR("GetCoreDevice", "Required field: CoreDeviceThingName, is not set");
434     return GetCoreDeviceOutcome(Aws::Client::AWSError<GreengrassV2Errors>(GreengrassV2Errors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [CoreDeviceThingName]", false));
435   }
436   Aws::Http::URI uri = m_uri;
437   uri.AddPathSegments("/greengrass/v2/coreDevices/");
438   uri.AddPathSegment(request.GetCoreDeviceThingName());
439   return GetCoreDeviceOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
440 }
441 
GetCoreDeviceCallable(const GetCoreDeviceRequest & request) const442 GetCoreDeviceOutcomeCallable GreengrassV2Client::GetCoreDeviceCallable(const GetCoreDeviceRequest& request) const
443 {
444   auto task = Aws::MakeShared< std::packaged_task< GetCoreDeviceOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetCoreDevice(request); } );
445   auto packagedFunction = [task]() { (*task)(); };
446   m_executor->Submit(packagedFunction);
447   return task->get_future();
448 }
449 
GetCoreDeviceAsync(const GetCoreDeviceRequest & request,const GetCoreDeviceResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const450 void GreengrassV2Client::GetCoreDeviceAsync(const GetCoreDeviceRequest& request, const GetCoreDeviceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
451 {
452   m_executor->Submit( [this, request, handler, context](){ this->GetCoreDeviceAsyncHelper( request, handler, context ); } );
453 }
454 
GetCoreDeviceAsyncHelper(const GetCoreDeviceRequest & request,const GetCoreDeviceResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const455 void GreengrassV2Client::GetCoreDeviceAsyncHelper(const GetCoreDeviceRequest& request, const GetCoreDeviceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
456 {
457   handler(this, request, GetCoreDevice(request), context);
458 }
459 
GetDeployment(const GetDeploymentRequest & request) const460 GetDeploymentOutcome GreengrassV2Client::GetDeployment(const GetDeploymentRequest& request) const
461 {
462   if (!request.DeploymentIdHasBeenSet())
463   {
464     AWS_LOGSTREAM_ERROR("GetDeployment", "Required field: DeploymentId, is not set");
465     return GetDeploymentOutcome(Aws::Client::AWSError<GreengrassV2Errors>(GreengrassV2Errors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [DeploymentId]", false));
466   }
467   Aws::Http::URI uri = m_uri;
468   uri.AddPathSegments("/greengrass/v2/deployments/");
469   uri.AddPathSegment(request.GetDeploymentId());
470   return GetDeploymentOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
471 }
472 
GetDeploymentCallable(const GetDeploymentRequest & request) const473 GetDeploymentOutcomeCallable GreengrassV2Client::GetDeploymentCallable(const GetDeploymentRequest& request) const
474 {
475   auto task = Aws::MakeShared< std::packaged_task< GetDeploymentOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->GetDeployment(request); } );
476   auto packagedFunction = [task]() { (*task)(); };
477   m_executor->Submit(packagedFunction);
478   return task->get_future();
479 }
480 
GetDeploymentAsync(const GetDeploymentRequest & request,const GetDeploymentResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const481 void GreengrassV2Client::GetDeploymentAsync(const GetDeploymentRequest& request, const GetDeploymentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
482 {
483   m_executor->Submit( [this, request, handler, context](){ this->GetDeploymentAsyncHelper( request, handler, context ); } );
484 }
485 
GetDeploymentAsyncHelper(const GetDeploymentRequest & request,const GetDeploymentResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const486 void GreengrassV2Client::GetDeploymentAsyncHelper(const GetDeploymentRequest& request, const GetDeploymentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
487 {
488   handler(this, request, GetDeployment(request), context);
489 }
490 
ListClientDevicesAssociatedWithCoreDevice(const ListClientDevicesAssociatedWithCoreDeviceRequest & request) const491 ListClientDevicesAssociatedWithCoreDeviceOutcome GreengrassV2Client::ListClientDevicesAssociatedWithCoreDevice(const ListClientDevicesAssociatedWithCoreDeviceRequest& request) const
492 {
493   if (!request.CoreDeviceThingNameHasBeenSet())
494   {
495     AWS_LOGSTREAM_ERROR("ListClientDevicesAssociatedWithCoreDevice", "Required field: CoreDeviceThingName, is not set");
496     return ListClientDevicesAssociatedWithCoreDeviceOutcome(Aws::Client::AWSError<GreengrassV2Errors>(GreengrassV2Errors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [CoreDeviceThingName]", false));
497   }
498   Aws::Http::URI uri = m_uri;
499   uri.AddPathSegments("/greengrass/v2/coreDevices/");
500   uri.AddPathSegment(request.GetCoreDeviceThingName());
501   uri.AddPathSegments("/associatedClientDevices");
502   return ListClientDevicesAssociatedWithCoreDeviceOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
503 }
504 
ListClientDevicesAssociatedWithCoreDeviceCallable(const ListClientDevicesAssociatedWithCoreDeviceRequest & request) const505 ListClientDevicesAssociatedWithCoreDeviceOutcomeCallable GreengrassV2Client::ListClientDevicesAssociatedWithCoreDeviceCallable(const ListClientDevicesAssociatedWithCoreDeviceRequest& request) const
506 {
507   auto task = Aws::MakeShared< std::packaged_task< ListClientDevicesAssociatedWithCoreDeviceOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListClientDevicesAssociatedWithCoreDevice(request); } );
508   auto packagedFunction = [task]() { (*task)(); };
509   m_executor->Submit(packagedFunction);
510   return task->get_future();
511 }
512 
ListClientDevicesAssociatedWithCoreDeviceAsync(const ListClientDevicesAssociatedWithCoreDeviceRequest & request,const ListClientDevicesAssociatedWithCoreDeviceResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const513 void GreengrassV2Client::ListClientDevicesAssociatedWithCoreDeviceAsync(const ListClientDevicesAssociatedWithCoreDeviceRequest& request, const ListClientDevicesAssociatedWithCoreDeviceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
514 {
515   m_executor->Submit( [this, request, handler, context](){ this->ListClientDevicesAssociatedWithCoreDeviceAsyncHelper( request, handler, context ); } );
516 }
517 
ListClientDevicesAssociatedWithCoreDeviceAsyncHelper(const ListClientDevicesAssociatedWithCoreDeviceRequest & request,const ListClientDevicesAssociatedWithCoreDeviceResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const518 void GreengrassV2Client::ListClientDevicesAssociatedWithCoreDeviceAsyncHelper(const ListClientDevicesAssociatedWithCoreDeviceRequest& request, const ListClientDevicesAssociatedWithCoreDeviceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
519 {
520   handler(this, request, ListClientDevicesAssociatedWithCoreDevice(request), context);
521 }
522 
ListComponentVersions(const ListComponentVersionsRequest & request) const523 ListComponentVersionsOutcome GreengrassV2Client::ListComponentVersions(const ListComponentVersionsRequest& request) const
524 {
525   if (!request.ArnHasBeenSet())
526   {
527     AWS_LOGSTREAM_ERROR("ListComponentVersions", "Required field: Arn, is not set");
528     return ListComponentVersionsOutcome(Aws::Client::AWSError<GreengrassV2Errors>(GreengrassV2Errors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [Arn]", false));
529   }
530   Aws::Http::URI uri = m_uri;
531   uri.AddPathSegments("/greengrass/v2/components/");
532   uri.AddPathSegment(request.GetArn());
533   uri.AddPathSegments("/versions");
534   return ListComponentVersionsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
535 }
536 
ListComponentVersionsCallable(const ListComponentVersionsRequest & request) const537 ListComponentVersionsOutcomeCallable GreengrassV2Client::ListComponentVersionsCallable(const ListComponentVersionsRequest& request) const
538 {
539   auto task = Aws::MakeShared< std::packaged_task< ListComponentVersionsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListComponentVersions(request); } );
540   auto packagedFunction = [task]() { (*task)(); };
541   m_executor->Submit(packagedFunction);
542   return task->get_future();
543 }
544 
ListComponentVersionsAsync(const ListComponentVersionsRequest & request,const ListComponentVersionsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const545 void GreengrassV2Client::ListComponentVersionsAsync(const ListComponentVersionsRequest& request, const ListComponentVersionsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
546 {
547   m_executor->Submit( [this, request, handler, context](){ this->ListComponentVersionsAsyncHelper( request, handler, context ); } );
548 }
549 
ListComponentVersionsAsyncHelper(const ListComponentVersionsRequest & request,const ListComponentVersionsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const550 void GreengrassV2Client::ListComponentVersionsAsyncHelper(const ListComponentVersionsRequest& request, const ListComponentVersionsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
551 {
552   handler(this, request, ListComponentVersions(request), context);
553 }
554 
ListComponents(const ListComponentsRequest & request) const555 ListComponentsOutcome GreengrassV2Client::ListComponents(const ListComponentsRequest& request) const
556 {
557   Aws::Http::URI uri = m_uri;
558   uri.AddPathSegments("/greengrass/v2/components");
559   return ListComponentsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
560 }
561 
ListComponentsCallable(const ListComponentsRequest & request) const562 ListComponentsOutcomeCallable GreengrassV2Client::ListComponentsCallable(const ListComponentsRequest& request) const
563 {
564   auto task = Aws::MakeShared< std::packaged_task< ListComponentsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListComponents(request); } );
565   auto packagedFunction = [task]() { (*task)(); };
566   m_executor->Submit(packagedFunction);
567   return task->get_future();
568 }
569 
ListComponentsAsync(const ListComponentsRequest & request,const ListComponentsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const570 void GreengrassV2Client::ListComponentsAsync(const ListComponentsRequest& request, const ListComponentsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
571 {
572   m_executor->Submit( [this, request, handler, context](){ this->ListComponentsAsyncHelper( request, handler, context ); } );
573 }
574 
ListComponentsAsyncHelper(const ListComponentsRequest & request,const ListComponentsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const575 void GreengrassV2Client::ListComponentsAsyncHelper(const ListComponentsRequest& request, const ListComponentsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
576 {
577   handler(this, request, ListComponents(request), context);
578 }
579 
ListCoreDevices(const ListCoreDevicesRequest & request) const580 ListCoreDevicesOutcome GreengrassV2Client::ListCoreDevices(const ListCoreDevicesRequest& request) const
581 {
582   Aws::Http::URI uri = m_uri;
583   uri.AddPathSegments("/greengrass/v2/coreDevices");
584   return ListCoreDevicesOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
585 }
586 
ListCoreDevicesCallable(const ListCoreDevicesRequest & request) const587 ListCoreDevicesOutcomeCallable GreengrassV2Client::ListCoreDevicesCallable(const ListCoreDevicesRequest& request) const
588 {
589   auto task = Aws::MakeShared< std::packaged_task< ListCoreDevicesOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListCoreDevices(request); } );
590   auto packagedFunction = [task]() { (*task)(); };
591   m_executor->Submit(packagedFunction);
592   return task->get_future();
593 }
594 
ListCoreDevicesAsync(const ListCoreDevicesRequest & request,const ListCoreDevicesResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const595 void GreengrassV2Client::ListCoreDevicesAsync(const ListCoreDevicesRequest& request, const ListCoreDevicesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
596 {
597   m_executor->Submit( [this, request, handler, context](){ this->ListCoreDevicesAsyncHelper( request, handler, context ); } );
598 }
599 
ListCoreDevicesAsyncHelper(const ListCoreDevicesRequest & request,const ListCoreDevicesResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const600 void GreengrassV2Client::ListCoreDevicesAsyncHelper(const ListCoreDevicesRequest& request, const ListCoreDevicesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
601 {
602   handler(this, request, ListCoreDevices(request), context);
603 }
604 
ListDeployments(const ListDeploymentsRequest & request) const605 ListDeploymentsOutcome GreengrassV2Client::ListDeployments(const ListDeploymentsRequest& request) const
606 {
607   Aws::Http::URI uri = m_uri;
608   uri.AddPathSegments("/greengrass/v2/deployments");
609   return ListDeploymentsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
610 }
611 
ListDeploymentsCallable(const ListDeploymentsRequest & request) const612 ListDeploymentsOutcomeCallable GreengrassV2Client::ListDeploymentsCallable(const ListDeploymentsRequest& request) const
613 {
614   auto task = Aws::MakeShared< std::packaged_task< ListDeploymentsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListDeployments(request); } );
615   auto packagedFunction = [task]() { (*task)(); };
616   m_executor->Submit(packagedFunction);
617   return task->get_future();
618 }
619 
ListDeploymentsAsync(const ListDeploymentsRequest & request,const ListDeploymentsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const620 void GreengrassV2Client::ListDeploymentsAsync(const ListDeploymentsRequest& request, const ListDeploymentsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
621 {
622   m_executor->Submit( [this, request, handler, context](){ this->ListDeploymentsAsyncHelper( request, handler, context ); } );
623 }
624 
ListDeploymentsAsyncHelper(const ListDeploymentsRequest & request,const ListDeploymentsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const625 void GreengrassV2Client::ListDeploymentsAsyncHelper(const ListDeploymentsRequest& request, const ListDeploymentsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
626 {
627   handler(this, request, ListDeployments(request), context);
628 }
629 
ListEffectiveDeployments(const ListEffectiveDeploymentsRequest & request) const630 ListEffectiveDeploymentsOutcome GreengrassV2Client::ListEffectiveDeployments(const ListEffectiveDeploymentsRequest& request) const
631 {
632   if (!request.CoreDeviceThingNameHasBeenSet())
633   {
634     AWS_LOGSTREAM_ERROR("ListEffectiveDeployments", "Required field: CoreDeviceThingName, is not set");
635     return ListEffectiveDeploymentsOutcome(Aws::Client::AWSError<GreengrassV2Errors>(GreengrassV2Errors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [CoreDeviceThingName]", false));
636   }
637   Aws::Http::URI uri = m_uri;
638   uri.AddPathSegments("/greengrass/v2/coreDevices/");
639   uri.AddPathSegment(request.GetCoreDeviceThingName());
640   uri.AddPathSegments("/effectiveDeployments");
641   return ListEffectiveDeploymentsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
642 }
643 
ListEffectiveDeploymentsCallable(const ListEffectiveDeploymentsRequest & request) const644 ListEffectiveDeploymentsOutcomeCallable GreengrassV2Client::ListEffectiveDeploymentsCallable(const ListEffectiveDeploymentsRequest& request) const
645 {
646   auto task = Aws::MakeShared< std::packaged_task< ListEffectiveDeploymentsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListEffectiveDeployments(request); } );
647   auto packagedFunction = [task]() { (*task)(); };
648   m_executor->Submit(packagedFunction);
649   return task->get_future();
650 }
651 
ListEffectiveDeploymentsAsync(const ListEffectiveDeploymentsRequest & request,const ListEffectiveDeploymentsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const652 void GreengrassV2Client::ListEffectiveDeploymentsAsync(const ListEffectiveDeploymentsRequest& request, const ListEffectiveDeploymentsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
653 {
654   m_executor->Submit( [this, request, handler, context](){ this->ListEffectiveDeploymentsAsyncHelper( request, handler, context ); } );
655 }
656 
ListEffectiveDeploymentsAsyncHelper(const ListEffectiveDeploymentsRequest & request,const ListEffectiveDeploymentsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const657 void GreengrassV2Client::ListEffectiveDeploymentsAsyncHelper(const ListEffectiveDeploymentsRequest& request, const ListEffectiveDeploymentsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
658 {
659   handler(this, request, ListEffectiveDeployments(request), context);
660 }
661 
ListInstalledComponents(const ListInstalledComponentsRequest & request) const662 ListInstalledComponentsOutcome GreengrassV2Client::ListInstalledComponents(const ListInstalledComponentsRequest& request) const
663 {
664   if (!request.CoreDeviceThingNameHasBeenSet())
665   {
666     AWS_LOGSTREAM_ERROR("ListInstalledComponents", "Required field: CoreDeviceThingName, is not set");
667     return ListInstalledComponentsOutcome(Aws::Client::AWSError<GreengrassV2Errors>(GreengrassV2Errors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [CoreDeviceThingName]", false));
668   }
669   Aws::Http::URI uri = m_uri;
670   uri.AddPathSegments("/greengrass/v2/coreDevices/");
671   uri.AddPathSegment(request.GetCoreDeviceThingName());
672   uri.AddPathSegments("/installedComponents");
673   return ListInstalledComponentsOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
674 }
675 
ListInstalledComponentsCallable(const ListInstalledComponentsRequest & request) const676 ListInstalledComponentsOutcomeCallable GreengrassV2Client::ListInstalledComponentsCallable(const ListInstalledComponentsRequest& request) const
677 {
678   auto task = Aws::MakeShared< std::packaged_task< ListInstalledComponentsOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListInstalledComponents(request); } );
679   auto packagedFunction = [task]() { (*task)(); };
680   m_executor->Submit(packagedFunction);
681   return task->get_future();
682 }
683 
ListInstalledComponentsAsync(const ListInstalledComponentsRequest & request,const ListInstalledComponentsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const684 void GreengrassV2Client::ListInstalledComponentsAsync(const ListInstalledComponentsRequest& request, const ListInstalledComponentsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
685 {
686   m_executor->Submit( [this, request, handler, context](){ this->ListInstalledComponentsAsyncHelper( request, handler, context ); } );
687 }
688 
ListInstalledComponentsAsyncHelper(const ListInstalledComponentsRequest & request,const ListInstalledComponentsResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const689 void GreengrassV2Client::ListInstalledComponentsAsyncHelper(const ListInstalledComponentsRequest& request, const ListInstalledComponentsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
690 {
691   handler(this, request, ListInstalledComponents(request), context);
692 }
693 
ListTagsForResource(const ListTagsForResourceRequest & request) const694 ListTagsForResourceOutcome GreengrassV2Client::ListTagsForResource(const ListTagsForResourceRequest& request) const
695 {
696   if (!request.ResourceArnHasBeenSet())
697   {
698     AWS_LOGSTREAM_ERROR("ListTagsForResource", "Required field: ResourceArn, is not set");
699     return ListTagsForResourceOutcome(Aws::Client::AWSError<GreengrassV2Errors>(GreengrassV2Errors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ResourceArn]", false));
700   }
701   Aws::Http::URI uri = m_uri;
702   uri.AddPathSegments("/tags/");
703   uri.AddPathSegment(request.GetResourceArn());
704   return ListTagsForResourceOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_GET, Aws::Auth::SIGV4_SIGNER));
705 }
706 
ListTagsForResourceCallable(const ListTagsForResourceRequest & request) const707 ListTagsForResourceOutcomeCallable GreengrassV2Client::ListTagsForResourceCallable(const ListTagsForResourceRequest& request) const
708 {
709   auto task = Aws::MakeShared< std::packaged_task< ListTagsForResourceOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ListTagsForResource(request); } );
710   auto packagedFunction = [task]() { (*task)(); };
711   m_executor->Submit(packagedFunction);
712   return task->get_future();
713 }
714 
ListTagsForResourceAsync(const ListTagsForResourceRequest & request,const ListTagsForResourceResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const715 void GreengrassV2Client::ListTagsForResourceAsync(const ListTagsForResourceRequest& request, const ListTagsForResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
716 {
717   m_executor->Submit( [this, request, handler, context](){ this->ListTagsForResourceAsyncHelper( request, handler, context ); } );
718 }
719 
ListTagsForResourceAsyncHelper(const ListTagsForResourceRequest & request,const ListTagsForResourceResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const720 void GreengrassV2Client::ListTagsForResourceAsyncHelper(const ListTagsForResourceRequest& request, const ListTagsForResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
721 {
722   handler(this, request, ListTagsForResource(request), context);
723 }
724 
ResolveComponentCandidates(const ResolveComponentCandidatesRequest & request) const725 ResolveComponentCandidatesOutcome GreengrassV2Client::ResolveComponentCandidates(const ResolveComponentCandidatesRequest& request) const
726 {
727   Aws::Http::URI uri = m_uri;
728   uri.AddPathSegments("/greengrass/v2/resolveComponentCandidates");
729   return ResolveComponentCandidatesOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
730 }
731 
ResolveComponentCandidatesCallable(const ResolveComponentCandidatesRequest & request) const732 ResolveComponentCandidatesOutcomeCallable GreengrassV2Client::ResolveComponentCandidatesCallable(const ResolveComponentCandidatesRequest& request) const
733 {
734   auto task = Aws::MakeShared< std::packaged_task< ResolveComponentCandidatesOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->ResolveComponentCandidates(request); } );
735   auto packagedFunction = [task]() { (*task)(); };
736   m_executor->Submit(packagedFunction);
737   return task->get_future();
738 }
739 
ResolveComponentCandidatesAsync(const ResolveComponentCandidatesRequest & request,const ResolveComponentCandidatesResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const740 void GreengrassV2Client::ResolveComponentCandidatesAsync(const ResolveComponentCandidatesRequest& request, const ResolveComponentCandidatesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
741 {
742   m_executor->Submit( [this, request, handler, context](){ this->ResolveComponentCandidatesAsyncHelper( request, handler, context ); } );
743 }
744 
ResolveComponentCandidatesAsyncHelper(const ResolveComponentCandidatesRequest & request,const ResolveComponentCandidatesResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const745 void GreengrassV2Client::ResolveComponentCandidatesAsyncHelper(const ResolveComponentCandidatesRequest& request, const ResolveComponentCandidatesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
746 {
747   handler(this, request, ResolveComponentCandidates(request), context);
748 }
749 
TagResource(const TagResourceRequest & request) const750 TagResourceOutcome GreengrassV2Client::TagResource(const TagResourceRequest& request) const
751 {
752   if (!request.ResourceArnHasBeenSet())
753   {
754     AWS_LOGSTREAM_ERROR("TagResource", "Required field: ResourceArn, is not set");
755     return TagResourceOutcome(Aws::Client::AWSError<GreengrassV2Errors>(GreengrassV2Errors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ResourceArn]", false));
756   }
757   Aws::Http::URI uri = m_uri;
758   uri.AddPathSegments("/tags/");
759   uri.AddPathSegment(request.GetResourceArn());
760   return TagResourceOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_POST, Aws::Auth::SIGV4_SIGNER));
761 }
762 
TagResourceCallable(const TagResourceRequest & request) const763 TagResourceOutcomeCallable GreengrassV2Client::TagResourceCallable(const TagResourceRequest& request) const
764 {
765   auto task = Aws::MakeShared< std::packaged_task< TagResourceOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->TagResource(request); } );
766   auto packagedFunction = [task]() { (*task)(); };
767   m_executor->Submit(packagedFunction);
768   return task->get_future();
769 }
770 
TagResourceAsync(const TagResourceRequest & request,const TagResourceResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const771 void GreengrassV2Client::TagResourceAsync(const TagResourceRequest& request, const TagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
772 {
773   m_executor->Submit( [this, request, handler, context](){ this->TagResourceAsyncHelper( request, handler, context ); } );
774 }
775 
TagResourceAsyncHelper(const TagResourceRequest & request,const TagResourceResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const776 void GreengrassV2Client::TagResourceAsyncHelper(const TagResourceRequest& request, const TagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
777 {
778   handler(this, request, TagResource(request), context);
779 }
780 
UntagResource(const UntagResourceRequest & request) const781 UntagResourceOutcome GreengrassV2Client::UntagResource(const UntagResourceRequest& request) const
782 {
783   if (!request.ResourceArnHasBeenSet())
784   {
785     AWS_LOGSTREAM_ERROR("UntagResource", "Required field: ResourceArn, is not set");
786     return UntagResourceOutcome(Aws::Client::AWSError<GreengrassV2Errors>(GreengrassV2Errors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [ResourceArn]", false));
787   }
788   if (!request.TagKeysHasBeenSet())
789   {
790     AWS_LOGSTREAM_ERROR("UntagResource", "Required field: TagKeys, is not set");
791     return UntagResourceOutcome(Aws::Client::AWSError<GreengrassV2Errors>(GreengrassV2Errors::MISSING_PARAMETER, "MISSING_PARAMETER", "Missing required field [TagKeys]", false));
792   }
793   Aws::Http::URI uri = m_uri;
794   uri.AddPathSegments("/tags/");
795   uri.AddPathSegment(request.GetResourceArn());
796   return UntagResourceOutcome(MakeRequest(uri, request, Aws::Http::HttpMethod::HTTP_DELETE, Aws::Auth::SIGV4_SIGNER));
797 }
798 
UntagResourceCallable(const UntagResourceRequest & request) const799 UntagResourceOutcomeCallable GreengrassV2Client::UntagResourceCallable(const UntagResourceRequest& request) const
800 {
801   auto task = Aws::MakeShared< std::packaged_task< UntagResourceOutcome() > >(ALLOCATION_TAG, [this, request](){ return this->UntagResource(request); } );
802   auto packagedFunction = [task]() { (*task)(); };
803   m_executor->Submit(packagedFunction);
804   return task->get_future();
805 }
806 
UntagResourceAsync(const UntagResourceRequest & request,const UntagResourceResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const807 void GreengrassV2Client::UntagResourceAsync(const UntagResourceRequest& request, const UntagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
808 {
809   m_executor->Submit( [this, request, handler, context](){ this->UntagResourceAsyncHelper( request, handler, context ); } );
810 }
811 
UntagResourceAsyncHelper(const UntagResourceRequest & request,const UntagResourceResponseReceivedHandler & handler,const std::shared_ptr<const Aws::Client::AsyncCallerContext> & context) const812 void GreengrassV2Client::UntagResourceAsyncHelper(const UntagResourceRequest& request, const UntagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const
813 {
814   handler(this, request, UntagResource(request), context);
815 }
816 
817