/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include
#include
#include
#include
#include
#include
namespace Aws
{
namespace MigrationHubConfig
{
/**
* The AWS Migration Hub home region APIs are available specifically for working
* with your Migration Hub home region. You can use these APIs to determine a home
* region, as well as to create and work with controls that describe the home
* region.
-
You must make API calls for write actions (create,
* notify, associate, disassociate, import, or put) while in your home region, or a
* HomeRegionNotSetException
error is returned.
-
API
* calls for read actions (list, describe, stop, and delete) are permitted outside
* of your home region.
-
If you call a write API outside the home
* region, an InvalidInputException
is returned.
-
You
* can call GetHomeRegion
action to obtain the account's Migration Hub
* home region.
For specific API usage, see the sections that
* follow in this AWS Migration Hub Home Region API reference.
*/
class AWS_MIGRATIONHUBCONFIG_API MigrationHubConfigClient : public Aws::Client::AWSJsonClient, public Aws::Client::ClientWithAsyncTemplateMethods
{
public:
typedef Aws::Client::AWSJsonClient BASECLASS;
static const char* SERVICE_NAME;
static const char* ALLOCATION_TAG;
typedef MigrationHubConfigClientConfiguration ClientConfigurationType;
typedef MigrationHubConfigEndpointProvider EndpointProviderType;
/**
* Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config
* is not specified, it will be initialized to default values.
*/
MigrationHubConfigClient(const Aws::MigrationHubConfig::MigrationHubConfigClientConfiguration& clientConfiguration = Aws::MigrationHubConfig::MigrationHubConfigClientConfiguration(),
std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG));
/**
* Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config
* is not specified, it will be initialized to default values.
*/
MigrationHubConfigClient(const Aws::Auth::AWSCredentials& credentials,
std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG),
const Aws::MigrationHubConfig::MigrationHubConfigClientConfiguration& clientConfiguration = Aws::MigrationHubConfig::MigrationHubConfigClientConfiguration());
/**
* Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied,
* the default http client factory will be used
*/
MigrationHubConfigClient(const std::shared_ptr& credentialsProvider,
std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG),
const Aws::MigrationHubConfig::MigrationHubConfigClientConfiguration& clientConfiguration = Aws::MigrationHubConfig::MigrationHubConfigClientConfiguration());
/* Legacy constructors due deprecation */
/**
* Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config
* is not specified, it will be initialized to default values.
*/
MigrationHubConfigClient(const Aws::Client::ClientConfiguration& clientConfiguration);
/**
* Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config
* is not specified, it will be initialized to default values.
*/
MigrationHubConfigClient(const Aws::Auth::AWSCredentials& credentials,
const Aws::Client::ClientConfiguration& clientConfiguration);
/**
* Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied,
* the default http client factory will be used
*/
MigrationHubConfigClient(const std::shared_ptr& credentialsProvider,
const Aws::Client::ClientConfiguration& clientConfiguration);
/* End of legacy constructors due deprecation */
virtual ~MigrationHubConfigClient();
/**
* This API sets up the home region for the calling account only.
See
* Also:
AWS
* API Reference
*/
virtual Model::CreateHomeRegionControlOutcome CreateHomeRegionControl(const Model::CreateHomeRegionControlRequest& request) const;
/**
* A Callable wrapper for CreateHomeRegionControl that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::CreateHomeRegionControlOutcomeCallable CreateHomeRegionControlCallable(const CreateHomeRegionControlRequestT& request) const
{
return SubmitCallable(&MigrationHubConfigClient::CreateHomeRegionControl, request);
}
/**
* An Async wrapper for CreateHomeRegionControl that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void CreateHomeRegionControlAsync(const CreateHomeRegionControlRequestT& request, const CreateHomeRegionControlResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&MigrationHubConfigClient::CreateHomeRegionControl, request, handler, context);
}
/**
* This API permits filtering on the ControlId
and
* HomeRegion
fields.
See Also:
AWS
* API Reference
*/
virtual Model::DescribeHomeRegionControlsOutcome DescribeHomeRegionControls(const Model::DescribeHomeRegionControlsRequest& request) const;
/**
* A Callable wrapper for DescribeHomeRegionControls that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::DescribeHomeRegionControlsOutcomeCallable DescribeHomeRegionControlsCallable(const DescribeHomeRegionControlsRequestT& request) const
{
return SubmitCallable(&MigrationHubConfigClient::DescribeHomeRegionControls, request);
}
/**
* An Async wrapper for DescribeHomeRegionControls that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void DescribeHomeRegionControlsAsync(const DescribeHomeRegionControlsRequestT& request, const DescribeHomeRegionControlsResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&MigrationHubConfigClient::DescribeHomeRegionControls, request, handler, context);
}
/**
* Returns the calling account’s home region, if configured. This API is used by
* other AWS services to determine the regional endpoint for calling AWS
* Application Discovery Service and Migration Hub. You must call
* GetHomeRegion
at least once before you call any other AWS
* Application Discovery Service and AWS Migration Hub APIs, to obtain the
* account's Migration Hub home region.
See Also:
AWS
* API Reference
*/
virtual Model::GetHomeRegionOutcome GetHomeRegion(const Model::GetHomeRegionRequest& request) const;
/**
* A Callable wrapper for GetHomeRegion that returns a future to the operation so that it can be executed in parallel to other requests.
*/
template
Model::GetHomeRegionOutcomeCallable GetHomeRegionCallable(const GetHomeRegionRequestT& request) const
{
return SubmitCallable(&MigrationHubConfigClient::GetHomeRegion, request);
}
/**
* An Async wrapper for GetHomeRegion that queues the request into a thread executor and triggers associated callback when operation has finished.
*/
template
void GetHomeRegionAsync(const GetHomeRegionRequestT& request, const GetHomeRegionResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const
{
return SubmitAsync(&MigrationHubConfigClient::GetHomeRegion, request, handler, context);
}
void OverrideEndpoint(const Aws::String& endpoint);
std::shared_ptr& accessEndpointProvider();
private:
friend class Aws::Client::ClientWithAsyncTemplateMethods;
void init(const MigrationHubConfigClientConfiguration& clientConfiguration);
MigrationHubConfigClientConfiguration m_clientConfiguration;
std::shared_ptr m_executor;
std::shared_ptr m_endpointProvider;
};
} // namespace MigrationHubConfig
} // namespace Aws