AWS SDK for C++  0.14.3
AWS SDK for C++
SnowballClient.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
36 #include <future>
37 #include <functional>
38 
39 namespace Aws
40 {
41 
42 namespace Http
43 {
44  class HttpClient;
45  class HttpClientFactory;
46 } // namespace Http
47 
48 namespace Utils
49 {
50  template< typename R, typename E> class Outcome;
51 
52 namespace Threading
53 {
54  class Executor;
55 } // namespace Threading
56 
57 namespace Json
58 {
59  class JsonValue;
60 } // namespace Json
61 } // namespace Utils
62 
63 namespace Auth
64 {
65  class AWSCredentials;
66  class AWSCredentialsProvider;
67 } // namespace Auth
68 
69 namespace Client
70 {
71  class RetryStrategy;
72 } // namespace Client
73 
74 namespace Snowball
75 {
76 
77 namespace Model
78 {
79  class CancelJobRequest;
80  class CreateAddressRequest;
81  class CreateJobRequest;
82  class DescribeAddressRequest;
83  class DescribeAddressesRequest;
84  class DescribeJobRequest;
85  class GetJobManifestRequest;
86  class GetJobUnlockCodeRequest;
87  class GetSnowballUsageRequest;
88  class ListJobsRequest;
90 
102 
103  typedef std::future<CancelJobOutcome> CancelJobOutcomeCallable;
104  typedef std::future<CreateAddressOutcome> CreateAddressOutcomeCallable;
105  typedef std::future<CreateJobOutcome> CreateJobOutcomeCallable;
106  typedef std::future<DescribeAddressOutcome> DescribeAddressOutcomeCallable;
107  typedef std::future<DescribeAddressesOutcome> DescribeAddressesOutcomeCallable;
108  typedef std::future<DescribeJobOutcome> DescribeJobOutcomeCallable;
109  typedef std::future<GetJobManifestOutcome> GetJobManifestOutcomeCallable;
110  typedef std::future<GetJobUnlockCodeOutcome> GetJobUnlockCodeOutcomeCallable;
111  typedef std::future<GetSnowballUsageOutcome> GetSnowballUsageOutcomeCallable;
112  typedef std::future<ListJobsOutcome> ListJobsOutcomeCallable;
113  typedef std::future<UpdateJobOutcome> UpdateJobOutcomeCallable;
114 } // namespace Model
115 
117 
118  typedef std::function<void(const SnowballClient*, const Model::CancelJobRequest&, const Model::CancelJobOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CancelJobResponseReceivedHandler;
119  typedef std::function<void(const SnowballClient*, const Model::CreateAddressRequest&, const Model::CreateAddressOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateAddressResponseReceivedHandler;
120  typedef std::function<void(const SnowballClient*, const Model::CreateJobRequest&, const Model::CreateJobOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateJobResponseReceivedHandler;
121  typedef std::function<void(const SnowballClient*, const Model::DescribeAddressRequest&, const Model::DescribeAddressOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DescribeAddressResponseReceivedHandler;
122  typedef std::function<void(const SnowballClient*, const Model::DescribeAddressesRequest&, const Model::DescribeAddressesOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DescribeAddressesResponseReceivedHandler;
123  typedef std::function<void(const SnowballClient*, const Model::DescribeJobRequest&, const Model::DescribeJobOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DescribeJobResponseReceivedHandler;
124  typedef std::function<void(const SnowballClient*, const Model::GetJobManifestRequest&, const Model::GetJobManifestOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetJobManifestResponseReceivedHandler;
125  typedef std::function<void(const SnowballClient*, const Model::GetJobUnlockCodeRequest&, const Model::GetJobUnlockCodeOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetJobUnlockCodeResponseReceivedHandler;
126  typedef std::function<void(const SnowballClient*, const Model::GetSnowballUsageRequest&, const Model::GetSnowballUsageOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetSnowballUsageResponseReceivedHandler;
127  typedef std::function<void(const SnowballClient*, const Model::ListJobsRequest&, const Model::ListJobsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListJobsResponseReceivedHandler;
128  typedef std::function<void(const SnowballClient*, const Model::UpdateJobRequest&, const Model::UpdateJobOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > UpdateJobResponseReceivedHandler;
129 
134  {
135  public:
137 
143 
148  SnowballClient(const Auth::AWSCredentials& credentials, const Client::ClientConfiguration& clientConfiguration = Client::ClientConfiguration());
149 
154  SnowballClient(const std::shared_ptr<Auth::AWSCredentialsProvider>& credentialsProvider,
155  const Client::ClientConfiguration& clientConfiguration = Client::ClientConfiguration());
156 
157  virtual ~SnowballClient();
158 
166  virtual Model::CancelJobOutcome CancelJob(const Model::CancelJobRequest& request) const;
167 
177  virtual Model::CancelJobOutcomeCallable CancelJobCallable(const Model::CancelJobRequest& request) const;
178 
188  virtual void CancelJobAsync(const Model::CancelJobRequest& request, const CancelJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
189 
196  virtual Model::CreateAddressOutcome CreateAddress(const Model::CreateAddressRequest& request) const;
197 
206  virtual Model::CreateAddressOutcomeCallable CreateAddressCallable(const Model::CreateAddressRequest& request) const;
207 
216  virtual void CreateAddressAsync(const Model::CreateAddressRequest& request, const CreateAddressResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
217 
224  virtual Model::CreateJobOutcome CreateJob(const Model::CreateJobRequest& request) const;
225 
234  virtual Model::CreateJobOutcomeCallable CreateJobCallable(const Model::CreateJobRequest& request) const;
235 
244  virtual void CreateJobAsync(const Model::CreateJobRequest& request, const CreateJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
245 
250  virtual Model::DescribeAddressOutcome DescribeAddress(const Model::DescribeAddressRequest& request) const;
251 
258  virtual Model::DescribeAddressOutcomeCallable DescribeAddressCallable(const Model::DescribeAddressRequest& request) const;
259 
266  virtual void DescribeAddressAsync(const Model::DescribeAddressRequest& request, const DescribeAddressResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
267 
273  virtual Model::DescribeAddressesOutcome DescribeAddresses(const Model::DescribeAddressesRequest& request) const;
274 
282  virtual Model::DescribeAddressesOutcomeCallable DescribeAddressesCallable(const Model::DescribeAddressesRequest& request) const;
283 
291  virtual void DescribeAddressesAsync(const Model::DescribeAddressesRequest& request, const DescribeAddressesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
292 
297  virtual Model::DescribeJobOutcome DescribeJob(const Model::DescribeJobRequest& request) const;
298 
305  virtual Model::DescribeJobOutcomeCallable DescribeJobCallable(const Model::DescribeJobRequest& request) const;
306 
313  virtual void DescribeJobAsync(const Model::DescribeJobRequest& request, const DescribeJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
314 
331  virtual Model::GetJobManifestOutcome GetJobManifest(const Model::GetJobManifestRequest& request) const;
332 
351  virtual Model::GetJobManifestOutcomeCallable GetJobManifestCallable(const Model::GetJobManifestRequest& request) const;
352 
371  virtual void GetJobManifestAsync(const Model::GetJobManifestRequest& request, const GetJobManifestResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
372 
385  virtual Model::GetJobUnlockCodeOutcome GetJobUnlockCode(const Model::GetJobUnlockCodeRequest& request) const;
386 
401  virtual Model::GetJobUnlockCodeOutcomeCallable GetJobUnlockCodeCallable(const Model::GetJobUnlockCodeRequest& request) const;
402 
417  virtual void GetJobUnlockCodeAsync(const Model::GetJobUnlockCodeRequest& request, const GetJobUnlockCodeResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
418 
425  virtual Model::GetSnowballUsageOutcome GetSnowballUsage(const Model::GetSnowballUsageRequest& request) const;
426 
435  virtual Model::GetSnowballUsageOutcomeCallable GetSnowballUsageCallable(const Model::GetSnowballUsageRequest& request) const;
436 
445  virtual void GetSnowballUsageAsync(const Model::GetSnowballUsageRequest& request, const GetSnowballUsageResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
446 
454  virtual Model::ListJobsOutcome ListJobs(const Model::ListJobsRequest& request) const;
455 
465  virtual Model::ListJobsOutcomeCallable ListJobsCallable(const Model::ListJobsRequest& request) const;
466 
476  virtual void ListJobsAsync(const Model::ListJobsRequest& request, const ListJobsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
477 
484  virtual Model::UpdateJobOutcome UpdateJob(const Model::UpdateJobRequest& request) const;
485 
494  virtual Model::UpdateJobOutcomeCallable UpdateJobCallable(const Model::UpdateJobRequest& request) const;
495 
504  virtual void UpdateJobAsync(const Model::UpdateJobRequest& request, const UpdateJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const;
505 
506 
507  private:
508  void init(const Client::ClientConfiguration& clientConfiguration);
509 
511  void CancelJobAsyncHelper(const Model::CancelJobRequest& request, const CancelJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
512  void CreateAddressAsyncHelper(const Model::CreateAddressRequest& request, const CreateAddressResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
513  void CreateJobAsyncHelper(const Model::CreateJobRequest& request, const CreateJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
514  void DescribeAddressAsyncHelper(const Model::DescribeAddressRequest& request, const DescribeAddressResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
515  void DescribeAddressesAsyncHelper(const Model::DescribeAddressesRequest& request, const DescribeAddressesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
516  void DescribeJobAsyncHelper(const Model::DescribeJobRequest& request, const DescribeJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
517  void GetJobManifestAsyncHelper(const Model::GetJobManifestRequest& request, const GetJobManifestResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
518  void GetJobUnlockCodeAsyncHelper(const Model::GetJobUnlockCodeRequest& request, const GetJobUnlockCodeResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
519  void GetSnowballUsageAsyncHelper(const Model::GetSnowballUsageRequest& request, const GetSnowballUsageResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
520  void ListJobsAsyncHelper(const Model::ListJobsRequest& request, const ListJobsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
521  void UpdateJobAsyncHelper(const Model::UpdateJobRequest& request, const UpdateJobResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const;
522 
523  Aws::String m_uri;
524  std::shared_ptr<Utils::Threading::Executor> m_executor;
525  };
526 
527 } // namespace Snowball
528 } // namespace Aws
std::future< DescribeAddressesOutcome > DescribeAddressesOutcomeCallable
std::future< GetSnowballUsageOutcome > GetSnowballUsageOutcomeCallable
std::future< CreateJobOutcome > CreateJobOutcomeCallable
Aws::Utils::Outcome< GetSnowballUsageResult, Aws::Client::AWSError< SnowballErrors > > GetSnowballUsageOutcome
std::function< void(const SnowballClient *, const Model::UpdateJobRequest &, const Model::UpdateJobOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > UpdateJobResponseReceivedHandler
std::future< CancelJobOutcome > CancelJobOutcomeCallable
Aws::Utils::Outcome< DescribeAddressesResult, Aws::Client::AWSError< SnowballErrors > > DescribeAddressesOutcome
std::function< void(const SnowballClient *, const Model::CreateJobRequest &, const Model::CreateJobOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > CreateJobResponseReceivedHandler
Aws::Client::AWSJsonClient BASECLASS
std::future< UpdateJobOutcome > UpdateJobOutcomeCallable
std::function< void(const SnowballClient *, const Model::DescribeJobRequest &, const Model::DescribeJobOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > DescribeJobResponseReceivedHandler
Aws::Utils::Outcome< GetJobManifestResult, Aws::Client::AWSError< SnowballErrors > > GetJobManifestOutcome
std::function< void(const SnowballClient *, const Model::GetJobUnlockCodeRequest &, const Model::GetJobUnlockCodeOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > GetJobUnlockCodeResponseReceivedHandler
Aws::Utils::Outcome< DescribeAddressResult, Aws::Client::AWSError< SnowballErrors > > DescribeAddressOutcome
std::function< void(const SnowballClient *, const Model::CreateAddressRequest &, const Model::CreateAddressOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > CreateAddressResponseReceivedHandler
Aws::Utils::Outcome< UpdateJobResult, Aws::Client::AWSError< SnowballErrors > > UpdateJobOutcome
std::function< void(const SnowballClient *, const Model::GetSnowballUsageRequest &, const Model::GetSnowballUsageOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > GetSnowballUsageResponseReceivedHandler
Aws::Utils::Outcome< DescribeJobResult, Aws::Client::AWSError< SnowballErrors > > DescribeJobOutcome
std::function< void(const SnowballClient *, const Model::CancelJobRequest &, const Model::CancelJobOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > CancelJobResponseReceivedHandler
std::future< ListJobsOutcome > ListJobsOutcomeCallable
std::function< void(const SnowballClient *, const Model::ListJobsRequest &, const Model::ListJobsOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > ListJobsResponseReceivedHandler
#define AWS_SNOWBALL_API
Aws::Utils::Outcome< CancelJobResult, Aws::Client::AWSError< SnowballErrors > > CancelJobOutcome
std::future< GetJobManifestOutcome > GetJobManifestOutcomeCallable
Aws::Utils::Outcome< CreateAddressResult, Aws::Client::AWSError< SnowballErrors > > CreateAddressOutcome
Aws::Utils::Outcome< GetJobUnlockCodeResult, Aws::Client::AWSError< SnowballErrors > > GetJobUnlockCodeOutcome
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Definition: AWSString.h:97
std::future< GetJobUnlockCodeOutcome > GetJobUnlockCodeOutcomeCallable
std::future< DescribeAddressOutcome > DescribeAddressOutcomeCallable
Aws::Utils::Outcome< CreateJobResult, Aws::Client::AWSError< SnowballErrors > > CreateJobOutcome
std::future< CreateAddressOutcome > CreateAddressOutcomeCallable
std::function< void(const SnowballClient *, const Model::DescribeAddressRequest &, const Model::DescribeAddressOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > DescribeAddressResponseReceivedHandler
std::future< DescribeJobOutcome > DescribeJobOutcomeCallable
std::function< void(const SnowballClient *, const Model::GetJobManifestRequest &, const Model::GetJobManifestOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > GetJobManifestResponseReceivedHandler
Aws::Utils::Outcome< ListJobsResult, Aws::Client::AWSError< SnowballErrors > > ListJobsOutcome
JSON (JavaScript Object Notation).
std::function< void(const SnowballClient *, const Model::DescribeAddressesRequest &, const Model::DescribeAddressesOutcome &, const std::shared_ptr< const Aws::Client::AsyncCallerContext > &) > DescribeAddressesResponseReceivedHandler