1 /** 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * SPDX-License-Identifier: Apache-2.0. 4 */ 5 6 #pragma once 7 #include <aws/finspace/Finspace_EXPORTS.h> 8 #include <aws/finspace/FinspaceErrors.h> 9 #include <aws/core/client/AWSError.h> 10 #include <aws/core/client/ClientConfiguration.h> 11 #include <aws/core/client/AWSClient.h> 12 #include <aws/core/utils/memory/stl/AWSString.h> 13 #include <aws/core/utils/json/JsonSerializer.h> 14 #include <aws/finspace/model/CreateEnvironmentResult.h> 15 #include <aws/finspace/model/DeleteEnvironmentResult.h> 16 #include <aws/finspace/model/GetEnvironmentResult.h> 17 #include <aws/finspace/model/ListEnvironmentsResult.h> 18 #include <aws/finspace/model/ListTagsForResourceResult.h> 19 #include <aws/finspace/model/TagResourceResult.h> 20 #include <aws/finspace/model/UntagResourceResult.h> 21 #include <aws/finspace/model/UpdateEnvironmentResult.h> 22 #include <aws/core/client/AsyncCallerContext.h> 23 #include <aws/core/http/HttpTypes.h> 24 #include <future> 25 #include <functional> 26 27 namespace Aws 28 { 29 30 namespace Http 31 { 32 class HttpClient; 33 class HttpClientFactory; 34 } // namespace Http 35 36 namespace Utils 37 { 38 template< typename R, typename E> class Outcome; 39 namespace Threading 40 { 41 class Executor; 42 } // namespace Threading 43 } // namespace Utils 44 45 namespace Auth 46 { 47 class AWSCredentials; 48 class AWSCredentialsProvider; 49 } // namespace Auth 50 51 namespace Client 52 { 53 class RetryStrategy; 54 } // namespace Client 55 56 namespace finspace 57 { 58 59 namespace Model 60 { 61 class CreateEnvironmentRequest; 62 class DeleteEnvironmentRequest; 63 class GetEnvironmentRequest; 64 class ListEnvironmentsRequest; 65 class ListTagsForResourceRequest; 66 class TagResourceRequest; 67 class UntagResourceRequest; 68 class UpdateEnvironmentRequest; 69 70 typedef Aws::Utils::Outcome<CreateEnvironmentResult, FinspaceError> CreateEnvironmentOutcome; 71 typedef Aws::Utils::Outcome<DeleteEnvironmentResult, FinspaceError> DeleteEnvironmentOutcome; 72 typedef Aws::Utils::Outcome<GetEnvironmentResult, FinspaceError> GetEnvironmentOutcome; 73 typedef Aws::Utils::Outcome<ListEnvironmentsResult, FinspaceError> ListEnvironmentsOutcome; 74 typedef Aws::Utils::Outcome<ListTagsForResourceResult, FinspaceError> ListTagsForResourceOutcome; 75 typedef Aws::Utils::Outcome<TagResourceResult, FinspaceError> TagResourceOutcome; 76 typedef Aws::Utils::Outcome<UntagResourceResult, FinspaceError> UntagResourceOutcome; 77 typedef Aws::Utils::Outcome<UpdateEnvironmentResult, FinspaceError> UpdateEnvironmentOutcome; 78 79 typedef std::future<CreateEnvironmentOutcome> CreateEnvironmentOutcomeCallable; 80 typedef std::future<DeleteEnvironmentOutcome> DeleteEnvironmentOutcomeCallable; 81 typedef std::future<GetEnvironmentOutcome> GetEnvironmentOutcomeCallable; 82 typedef std::future<ListEnvironmentsOutcome> ListEnvironmentsOutcomeCallable; 83 typedef std::future<ListTagsForResourceOutcome> ListTagsForResourceOutcomeCallable; 84 typedef std::future<TagResourceOutcome> TagResourceOutcomeCallable; 85 typedef std::future<UntagResourceOutcome> UntagResourceOutcomeCallable; 86 typedef std::future<UpdateEnvironmentOutcome> UpdateEnvironmentOutcomeCallable; 87 } // namespace Model 88 89 class FinspaceClient; 90 91 typedef std::function<void(const FinspaceClient*, const Model::CreateEnvironmentRequest&, const Model::CreateEnvironmentOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateEnvironmentResponseReceivedHandler; 92 typedef std::function<void(const FinspaceClient*, const Model::DeleteEnvironmentRequest&, const Model::DeleteEnvironmentOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteEnvironmentResponseReceivedHandler; 93 typedef std::function<void(const FinspaceClient*, const Model::GetEnvironmentRequest&, const Model::GetEnvironmentOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetEnvironmentResponseReceivedHandler; 94 typedef std::function<void(const FinspaceClient*, const Model::ListEnvironmentsRequest&, const Model::ListEnvironmentsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListEnvironmentsResponseReceivedHandler; 95 typedef std::function<void(const FinspaceClient*, const Model::ListTagsForResourceRequest&, const Model::ListTagsForResourceOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListTagsForResourceResponseReceivedHandler; 96 typedef std::function<void(const FinspaceClient*, const Model::TagResourceRequest&, const Model::TagResourceOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > TagResourceResponseReceivedHandler; 97 typedef std::function<void(const FinspaceClient*, const Model::UntagResourceRequest&, const Model::UntagResourceOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > UntagResourceResponseReceivedHandler; 98 typedef std::function<void(const FinspaceClient*, const Model::UpdateEnvironmentRequest&, const Model::UpdateEnvironmentOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > UpdateEnvironmentResponseReceivedHandler; 99 100 /** 101 * <p>The FinSpace management service provides the APIs for managing the FinSpace 102 * environments. </p> 103 */ 104 class AWS_FINSPACE_API FinspaceClient : public Aws::Client::AWSJsonClient 105 { 106 public: 107 typedef Aws::Client::AWSJsonClient BASECLASS; 108 109 /** 110 * Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config 111 * is not specified, it will be initialized to default values. 112 */ 113 FinspaceClient(const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration()); 114 115 /** 116 * Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config 117 * is not specified, it will be initialized to default values. 118 */ 119 FinspaceClient(const Aws::Auth::AWSCredentials& credentials, const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration()); 120 121 /** 122 * Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied, 123 * the default http client factory will be used 124 */ 125 FinspaceClient(const std::shared_ptr<Aws::Auth::AWSCredentialsProvider>& credentialsProvider, 126 const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration()); 127 128 virtual ~FinspaceClient(); 129 130 131 /** 132 * <p>Create a new FinSpace environment.</p><p><h3>See Also:</h3> <a 133 * href="http://docs.aws.amazon.com/goto/WebAPI/finspace-2021-03-12/CreateEnvironment">AWS 134 * API Reference</a></p> 135 */ 136 virtual Model::CreateEnvironmentOutcome CreateEnvironment(const Model::CreateEnvironmentRequest& request) const; 137 138 /** 139 * <p>Create a new FinSpace environment.</p><p><h3>See Also:</h3> <a 140 * href="http://docs.aws.amazon.com/goto/WebAPI/finspace-2021-03-12/CreateEnvironment">AWS 141 * API Reference</a></p> 142 * 143 * returns a future to the operation so that it can be executed in parallel to other requests. 144 */ 145 virtual Model::CreateEnvironmentOutcomeCallable CreateEnvironmentCallable(const Model::CreateEnvironmentRequest& request) const; 146 147 /** 148 * <p>Create a new FinSpace environment.</p><p><h3>See Also:</h3> <a 149 * href="http://docs.aws.amazon.com/goto/WebAPI/finspace-2021-03-12/CreateEnvironment">AWS 150 * API Reference</a></p> 151 * 152 * Queues the request into a thread executor and triggers associated callback when operation has finished. 153 */ 154 virtual void CreateEnvironmentAsync(const Model::CreateEnvironmentRequest& request, const CreateEnvironmentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; 155 156 /** 157 * <p>Delete an FinSpace environment.</p><p><h3>See Also:</h3> <a 158 * href="http://docs.aws.amazon.com/goto/WebAPI/finspace-2021-03-12/DeleteEnvironment">AWS 159 * API Reference</a></p> 160 */ 161 virtual Model::DeleteEnvironmentOutcome DeleteEnvironment(const Model::DeleteEnvironmentRequest& request) const; 162 163 /** 164 * <p>Delete an FinSpace environment.</p><p><h3>See Also:</h3> <a 165 * href="http://docs.aws.amazon.com/goto/WebAPI/finspace-2021-03-12/DeleteEnvironment">AWS 166 * API Reference</a></p> 167 * 168 * returns a future to the operation so that it can be executed in parallel to other requests. 169 */ 170 virtual Model::DeleteEnvironmentOutcomeCallable DeleteEnvironmentCallable(const Model::DeleteEnvironmentRequest& request) const; 171 172 /** 173 * <p>Delete an FinSpace environment.</p><p><h3>See Also:</h3> <a 174 * href="http://docs.aws.amazon.com/goto/WebAPI/finspace-2021-03-12/DeleteEnvironment">AWS 175 * API Reference</a></p> 176 * 177 * Queues the request into a thread executor and triggers associated callback when operation has finished. 178 */ 179 virtual void DeleteEnvironmentAsync(const Model::DeleteEnvironmentRequest& request, const DeleteEnvironmentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; 180 181 /** 182 * <p>Returns the FinSpace environment object.</p><p><h3>See Also:</h3> <a 183 * href="http://docs.aws.amazon.com/goto/WebAPI/finspace-2021-03-12/GetEnvironment">AWS 184 * API Reference</a></p> 185 */ 186 virtual Model::GetEnvironmentOutcome GetEnvironment(const Model::GetEnvironmentRequest& request) const; 187 188 /** 189 * <p>Returns the FinSpace environment object.</p><p><h3>See Also:</h3> <a 190 * href="http://docs.aws.amazon.com/goto/WebAPI/finspace-2021-03-12/GetEnvironment">AWS 191 * API Reference</a></p> 192 * 193 * returns a future to the operation so that it can be executed in parallel to other requests. 194 */ 195 virtual Model::GetEnvironmentOutcomeCallable GetEnvironmentCallable(const Model::GetEnvironmentRequest& request) const; 196 197 /** 198 * <p>Returns the FinSpace environment object.</p><p><h3>See Also:</h3> <a 199 * href="http://docs.aws.amazon.com/goto/WebAPI/finspace-2021-03-12/GetEnvironment">AWS 200 * API Reference</a></p> 201 * 202 * Queues the request into a thread executor and triggers associated callback when operation has finished. 203 */ 204 virtual void GetEnvironmentAsync(const Model::GetEnvironmentRequest& request, const GetEnvironmentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; 205 206 /** 207 * <p>A list of all of your FinSpace environments.</p><p><h3>See Also:</h3> <a 208 * href="http://docs.aws.amazon.com/goto/WebAPI/finspace-2021-03-12/ListEnvironments">AWS 209 * API Reference</a></p> 210 */ 211 virtual Model::ListEnvironmentsOutcome ListEnvironments(const Model::ListEnvironmentsRequest& request) const; 212 213 /** 214 * <p>A list of all of your FinSpace environments.</p><p><h3>See Also:</h3> <a 215 * href="http://docs.aws.amazon.com/goto/WebAPI/finspace-2021-03-12/ListEnvironments">AWS 216 * API Reference</a></p> 217 * 218 * returns a future to the operation so that it can be executed in parallel to other requests. 219 */ 220 virtual Model::ListEnvironmentsOutcomeCallable ListEnvironmentsCallable(const Model::ListEnvironmentsRequest& request) const; 221 222 /** 223 * <p>A list of all of your FinSpace environments.</p><p><h3>See Also:</h3> <a 224 * href="http://docs.aws.amazon.com/goto/WebAPI/finspace-2021-03-12/ListEnvironments">AWS 225 * API Reference</a></p> 226 * 227 * Queues the request into a thread executor and triggers associated callback when operation has finished. 228 */ 229 virtual void ListEnvironmentsAsync(const Model::ListEnvironmentsRequest& request, const ListEnvironmentsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; 230 231 /** 232 * <p>A list of all tags for a resource.</p><p><h3>See Also:</h3> <a 233 * href="http://docs.aws.amazon.com/goto/WebAPI/finspace-2021-03-12/ListTagsForResource">AWS 234 * API Reference</a></p> 235 */ 236 virtual Model::ListTagsForResourceOutcome ListTagsForResource(const Model::ListTagsForResourceRequest& request) const; 237 238 /** 239 * <p>A list of all tags for a resource.</p><p><h3>See Also:</h3> <a 240 * href="http://docs.aws.amazon.com/goto/WebAPI/finspace-2021-03-12/ListTagsForResource">AWS 241 * API Reference</a></p> 242 * 243 * returns a future to the operation so that it can be executed in parallel to other requests. 244 */ 245 virtual Model::ListTagsForResourceOutcomeCallable ListTagsForResourceCallable(const Model::ListTagsForResourceRequest& request) const; 246 247 /** 248 * <p>A list of all tags for a resource.</p><p><h3>See Also:</h3> <a 249 * href="http://docs.aws.amazon.com/goto/WebAPI/finspace-2021-03-12/ListTagsForResource">AWS 250 * API Reference</a></p> 251 * 252 * Queues the request into a thread executor and triggers associated callback when operation has finished. 253 */ 254 virtual void ListTagsForResourceAsync(const Model::ListTagsForResourceRequest& request, const ListTagsForResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; 255 256 /** 257 * <p>Adds metadata tags to a FinSpace resource.</p><p><h3>See Also:</h3> <a 258 * href="http://docs.aws.amazon.com/goto/WebAPI/finspace-2021-03-12/TagResource">AWS 259 * API Reference</a></p> 260 */ 261 virtual Model::TagResourceOutcome TagResource(const Model::TagResourceRequest& request) const; 262 263 /** 264 * <p>Adds metadata tags to a FinSpace resource.</p><p><h3>See Also:</h3> <a 265 * href="http://docs.aws.amazon.com/goto/WebAPI/finspace-2021-03-12/TagResource">AWS 266 * API Reference</a></p> 267 * 268 * returns a future to the operation so that it can be executed in parallel to other requests. 269 */ 270 virtual Model::TagResourceOutcomeCallable TagResourceCallable(const Model::TagResourceRequest& request) const; 271 272 /** 273 * <p>Adds metadata tags to a FinSpace resource.</p><p><h3>See Also:</h3> <a 274 * href="http://docs.aws.amazon.com/goto/WebAPI/finspace-2021-03-12/TagResource">AWS 275 * API Reference</a></p> 276 * 277 * Queues the request into a thread executor and triggers associated callback when operation has finished. 278 */ 279 virtual void TagResourceAsync(const Model::TagResourceRequest& request, const TagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; 280 281 /** 282 * <p>Removes metadata tags from a FinSpace resource.</p><p><h3>See Also:</h3> <a 283 * href="http://docs.aws.amazon.com/goto/WebAPI/finspace-2021-03-12/UntagResource">AWS 284 * API Reference</a></p> 285 */ 286 virtual Model::UntagResourceOutcome UntagResource(const Model::UntagResourceRequest& request) const; 287 288 /** 289 * <p>Removes metadata tags from a FinSpace resource.</p><p><h3>See Also:</h3> <a 290 * href="http://docs.aws.amazon.com/goto/WebAPI/finspace-2021-03-12/UntagResource">AWS 291 * API Reference</a></p> 292 * 293 * returns a future to the operation so that it can be executed in parallel to other requests. 294 */ 295 virtual Model::UntagResourceOutcomeCallable UntagResourceCallable(const Model::UntagResourceRequest& request) const; 296 297 /** 298 * <p>Removes metadata tags from a FinSpace resource.</p><p><h3>See Also:</h3> <a 299 * href="http://docs.aws.amazon.com/goto/WebAPI/finspace-2021-03-12/UntagResource">AWS 300 * API Reference</a></p> 301 * 302 * Queues the request into a thread executor and triggers associated callback when operation has finished. 303 */ 304 virtual void UntagResourceAsync(const Model::UntagResourceRequest& request, const UntagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; 305 306 /** 307 * <p>Update your FinSpace environment.</p><p><h3>See Also:</h3> <a 308 * href="http://docs.aws.amazon.com/goto/WebAPI/finspace-2021-03-12/UpdateEnvironment">AWS 309 * API Reference</a></p> 310 */ 311 virtual Model::UpdateEnvironmentOutcome UpdateEnvironment(const Model::UpdateEnvironmentRequest& request) const; 312 313 /** 314 * <p>Update your FinSpace environment.</p><p><h3>See Also:</h3> <a 315 * href="http://docs.aws.amazon.com/goto/WebAPI/finspace-2021-03-12/UpdateEnvironment">AWS 316 * API Reference</a></p> 317 * 318 * returns a future to the operation so that it can be executed in parallel to other requests. 319 */ 320 virtual Model::UpdateEnvironmentOutcomeCallable UpdateEnvironmentCallable(const Model::UpdateEnvironmentRequest& request) const; 321 322 /** 323 * <p>Update your FinSpace environment.</p><p><h3>See Also:</h3> <a 324 * href="http://docs.aws.amazon.com/goto/WebAPI/finspace-2021-03-12/UpdateEnvironment">AWS 325 * API Reference</a></p> 326 * 327 * Queues the request into a thread executor and triggers associated callback when operation has finished. 328 */ 329 virtual void UpdateEnvironmentAsync(const Model::UpdateEnvironmentRequest& request, const UpdateEnvironmentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; 330 331 332 void OverrideEndpoint(const Aws::String& endpoint); 333 private: 334 void init(const Aws::Client::ClientConfiguration& clientConfiguration); 335 void CreateEnvironmentAsyncHelper(const Model::CreateEnvironmentRequest& request, const CreateEnvironmentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; 336 void DeleteEnvironmentAsyncHelper(const Model::DeleteEnvironmentRequest& request, const DeleteEnvironmentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; 337 void GetEnvironmentAsyncHelper(const Model::GetEnvironmentRequest& request, const GetEnvironmentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; 338 void ListEnvironmentsAsyncHelper(const Model::ListEnvironmentsRequest& request, const ListEnvironmentsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; 339 void ListTagsForResourceAsyncHelper(const Model::ListTagsForResourceRequest& request, const ListTagsForResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; 340 void TagResourceAsyncHelper(const Model::TagResourceRequest& request, const TagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; 341 void UntagResourceAsyncHelper(const Model::UntagResourceRequest& request, const UntagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; 342 void UpdateEnvironmentAsyncHelper(const Model::UpdateEnvironmentRequest& request, const UpdateEnvironmentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; 343 344 Aws::String m_uri; 345 Aws::String m_configScheme; 346 std::shared_ptr<Aws::Utils::Threading::Executor> m_executor; 347 }; 348 349 } // namespace finspace 350 } // namespace Aws 351