AWS SDK for C++  0.14.3
AWS SDK for C++
ImportExportClient.h
Go to the documentation of this file.
1 /*
2 * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License").
5 * You may not use this file except in compliance with the License.
6 * A copy of the License is located at
7 *
8 * http://aws.amazon.com/apache2.0
9 *
10 * or in the "license" file accompanying this file. This file is distributed
11 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 * express or implied. See the License for the specific language governing
13 * permissions and limitations under the License.
14 */
15 #pragma once
31 #include <future>
32 #include <functional>
33 
34 namespace Aws
35 {
36 
37 namespace Http
38 {
39  class HttpClient;
40  class HttpClientFactory;
41 } // namespace Http
42 
43 namespace Utils
44 {
45  template< typename R, typename E> class Outcome;
46 
47 namespace Threading
48 {
49  class Executor;
50 } // namespace Threading
51 
52 namespace Xml
53 {
54  class XmlDocument;
55 } // namespace Xml
56 } // namespace Utils
57 
58 namespace Auth
59 {
60  class AWSCredentials;
61  class AWSCredentialsProvider;
62 } // namespace Auth
63 
64 namespace Client
65 {
66  class RetryStrategy;
67 } // namespace Client
68 
69 namespace ImportExport
70 {
71 
72 namespace Model
73 {
74  class CancelJobRequest;
75  class CreateJobRequest;
77  class GetStatusRequest;
78  class ListJobsRequest;
80 
87 
88  typedef std::future<CancelJobOutcome> CancelJobOutcomeCallable;
89  typedef std::future<CreateJobOutcome> CreateJobOutcomeCallable;
90  typedef std::future<GetShippingLabelOutcome> GetShippingLabelOutcomeCallable;
91  typedef std::future<GetStatusOutcome> GetStatusOutcomeCallable;
92  typedef std::future<ListJobsOutcome> ListJobsOutcomeCallable;
93  typedef std::future<UpdateJobOutcome> UpdateJobOutcomeCallable;
94 } // namespace Model
95 
97 
98  typedef std::function<void(const ImportExportClient*, const Model::CancelJobRequest&, const Model::CancelJobOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CancelJobResponseReceivedHandler;
99  typedef std::function<void(const ImportExportClient*, const Model::CreateJobRequest&, const Model::CreateJobOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateJobResponseReceivedHandler;
100  typedef std::function<void(const ImportExportClient*, const Model::GetShippingLabelRequest&, const Model::GetShippingLabelOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetShippingLabelResponseReceivedHandler;
101  typedef std::function<void(const ImportExportClient*, const Model::GetStatusRequest&, const Model::GetStatusOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetStatusResponseReceivedHandler;
102  typedef std::function<void(const ImportExportClient*, const Model::ListJobsRequest&, const Model::ListJobsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListJobsResponseReceivedHandler;
103  typedef std::function<void(const ImportExportClient*, const Model::UpdateJobRequest&, const Model::UpdateJobOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > UpdateJobResponseReceivedHandler;
104 
114  {
115  public:
117 
123 
128  ImportExportClient(const Auth::AWSCredentials& credentials, const Client::ClientConfiguration& clientConfiguration = Client::ClientConfiguration());
129 
134  ImportExportClient(const std::shared_ptr<Auth::AWSCredentialsProvider>& credentialsProvider,
135  const Client::ClientConfiguration& clientConfiguration = Client::ClientConfiguration());
136 
137  virtual ~ImportExportClient();
138 
143  virtual Model::CancelJobOutcome CancelJob(const Model::CancelJobRequest& request) const;
144 
151  virtual Model::CancelJobOutcomeCallable CancelJobCallable(const Model::CancelJobRequest& request) const;
152 
159  virtual void CancelJobAsync(const Model::CancelJobRequest& request, const CancelJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
160 
168  virtual Model::CreateJobOutcome CreateJob(const Model::CreateJobRequest& request) const;
169 
179  virtual Model::CreateJobOutcomeCallable CreateJobCallable(const Model::CreateJobRequest& request) const;
180 
190  virtual void CreateJobAsync(const Model::CreateJobRequest& request, const CreateJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
191 
196  virtual Model::GetShippingLabelOutcome GetShippingLabel(const Model::GetShippingLabelRequest& request) const;
197 
204  virtual Model::GetShippingLabelOutcomeCallable GetShippingLabelCallable(const Model::GetShippingLabelRequest& request) const;
205 
212  virtual void GetShippingLabelAsync(const Model::GetShippingLabelRequest& request, const GetShippingLabelResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
213 
219  virtual Model::GetStatusOutcome GetStatus(const Model::GetStatusRequest& request) const;
220 
228  virtual Model::GetStatusOutcomeCallable GetStatusCallable(const Model::GetStatusRequest& request) const;
229 
237  virtual void GetStatusAsync(const Model::GetStatusRequest& request, const GetStatusResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
238 
245  virtual Model::ListJobsOutcome ListJobs(const Model::ListJobsRequest& request) const;
246 
255  virtual Model::ListJobsOutcomeCallable ListJobsCallable(const Model::ListJobsRequest& request) const;
256 
265  virtual void ListJobsAsync(const Model::ListJobsRequest& request, const ListJobsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
266 
274  virtual Model::UpdateJobOutcome UpdateJob(const Model::UpdateJobRequest& request) const;
275 
285  virtual Model::UpdateJobOutcomeCallable UpdateJobCallable(const Model::UpdateJobRequest& request) const;
286 
296  virtual void UpdateJobAsync(const Model::UpdateJobRequest& request, const UpdateJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
297 
298 
299  private:
300  void init(const Client::ClientConfiguration& clientConfiguration);
301 
303  void CancelJobAsyncHelper(const Model::CancelJobRequest& request, const CancelJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
304  void CreateJobAsyncHelper(const Model::CreateJobRequest& request, const CreateJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
305  void GetShippingLabelAsyncHelper(const Model::GetShippingLabelRequest& request, const GetShippingLabelResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
306  void GetStatusAsyncHelper(const Model::GetStatusRequest& request, const GetStatusResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
307  void ListJobsAsyncHelper(const Model::ListJobsRequest& request, const ListJobsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
308  void UpdateJobAsyncHelper(const Model::UpdateJobRequest& request, const UpdateJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
309 
310  Aws::String m_uri;
311  std::shared_ptr<Utils::Threading::Executor> m_executor;
312  };
313 
314 } // namespace ImportExport
315 } // namespace Aws
Aws::Utils::Outcome< CreateJobResult, Aws::Client::AWSError< ImportExportErrors > > CreateJobOutcome
Aws::Utils::Outcome< UpdateJobResult, Aws::Client::AWSError< ImportExportErrors > > UpdateJobOutcome
std::future< ListJobsOutcome > ListJobsOutcomeCallable
std::future< GetShippingLabelOutcome > GetShippingLabelOutcomeCallable
std::function< void(const ImportExportClient *, const Model::ListJobsRequest &, const Model::ListJobsOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > ListJobsResponseReceivedHandler
Aws::Utils::Outcome< ListJobsResult, Aws::Client::AWSError< ImportExportErrors > > ListJobsOutcome
std::function< void(const ImportExportClient *, const Model::GetShippingLabelRequest &, const Model::GetShippingLabelOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > GetShippingLabelResponseReceivedHandler
std::future< CreateJobOutcome > CreateJobOutcomeCallable
std::function< void(const ImportExportClient *, const Model::GetStatusRequest &, const Model::GetStatusOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > GetStatusResponseReceivedHandler
Aws::Utils::Outcome< GetShippingLabelResult, Aws::Client::AWSError< ImportExportErrors > > GetShippingLabelOutcome
std::future< UpdateJobOutcome > UpdateJobOutcomeCallable
std::function< void(const ImportExportClient *, const Model::CreateJobRequest &, const Model::CreateJobOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > CreateJobResponseReceivedHandler
std::function< void(const ImportExportClient *, const Model::CancelJobRequest &, const Model::CancelJobOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > CancelJobResponseReceivedHandler
std::future< GetStatusOutcome > GetStatusOutcomeCallable
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Definition: AWSString.h:97
Aws::Utils::Outcome< CancelJobResult, Aws::Client::AWSError< ImportExportErrors > > CancelJobOutcome
std::function< void(const ImportExportClient *, const Model::UpdateJobRequest &, const Model::UpdateJobOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > UpdateJobResponseReceivedHandler
Aws::Utils::Outcome< GetStatusResult, Aws::Client::AWSError< ImportExportErrors > > GetStatusOutcome
std::future< CancelJobOutcome > CancelJobOutcomeCallable
#define AWS_IMPORTEXPORT_API
JSON (JavaScript Object Notation).