/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
namespace Aws
{
namespace Http
{
class HttpClient;
class HttpClientFactory;
} // namespace Http
namespace Utils
{
template< typename R, typename E> class Outcome;
namespace Threading
{
class Executor;
} // namespace Threading
} // namespace Utils
namespace Auth
{
class AWSCredentials;
class AWSCredentialsProvider;
} // namespace Auth
namespace Client
{
class RetryStrategy;
} // namespace Client
namespace SSO
{
namespace Model
{
class GetRoleCredentialsRequest;
class ListAccountRolesRequest;
class ListAccountsRequest;
class LogoutRequest;
typedef Aws::Utils::Outcome GetRoleCredentialsOutcome;
typedef Aws::Utils::Outcome ListAccountRolesOutcome;
typedef Aws::Utils::Outcome ListAccountsOutcome;
typedef Aws::Utils::Outcome LogoutOutcome;
typedef std::future GetRoleCredentialsOutcomeCallable;
typedef std::future ListAccountRolesOutcomeCallable;
typedef std::future ListAccountsOutcomeCallable;
typedef std::future LogoutOutcomeCallable;
} // namespace Model
class SSOClient;
typedef std::function&) > GetRoleCredentialsResponseReceivedHandler;
typedef std::function&) > ListAccountRolesResponseReceivedHandler;
typedef std::function&) > ListAccountsResponseReceivedHandler;
typedef std::function&) > LogoutResponseReceivedHandler;
/**
* AWS Single Sign-On Portal is a web service that makes it easy for you to
* assign user access to AWS SSO resources such as the user portal. Users can get
* AWS account applications and roles assigned to them and get federated into the
* application.
For general information about AWS SSO, see What
* is AWS Single Sign-On? in the AWS SSO User Guide.
This API
* reference guide describes the AWS SSO Portal operations that you can call
* programatically and includes detailed information on data types and errors.
* AWS provides SDKs that consist of libraries and sample code for
* various programming languages and platforms, such as Java, Ruby, .Net, iOS, or
* Android. The SDKs provide a convenient way to create programmatic access to AWS
* SSO and other AWS services. For more information about the AWS SDKs, including
* how to download and install them, see Tools for Amazon Web Services.
*
*/
class AWS_SSO_API SSOClient : public Aws::Client::AWSJsonClient
{
public:
typedef Aws::Client::AWSJsonClient BASECLASS;
/**
* 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.
*/
SSOClient(const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::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.
*/
SSOClient(const Aws::Auth::AWSCredentials& credentials, const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::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
*/
SSOClient(const std::shared_ptr& credentialsProvider,
const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration());
virtual ~SSOClient();
/**
* Returns the STS short-term credentials for a given role name that is assigned
* to the user.
See Also:
AWS
* API Reference
*/
virtual Model::GetRoleCredentialsOutcome GetRoleCredentials(const Model::GetRoleCredentialsRequest& request) const;
/**
* Returns the STS short-term credentials for a given role name that is assigned
* to the user.
See Also:
AWS
* API Reference
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::GetRoleCredentialsOutcomeCallable GetRoleCredentialsCallable(const Model::GetRoleCredentialsRequest& request) const;
/**
* Returns the STS short-term credentials for a given role name that is assigned
* to the user.
See Also:
AWS
* API Reference
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void GetRoleCredentialsAsync(const Model::GetRoleCredentialsRequest& request, const GetRoleCredentialsResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const;
/**
* Lists all roles that are assigned to the user for a given AWS
* account.
See Also:
AWS
* API Reference
*/
virtual Model::ListAccountRolesOutcome ListAccountRoles(const Model::ListAccountRolesRequest& request) const;
/**
* Lists all roles that are assigned to the user for a given AWS
* account.
See Also:
AWS
* API Reference
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::ListAccountRolesOutcomeCallable ListAccountRolesCallable(const Model::ListAccountRolesRequest& request) const;
/**
* Lists all roles that are assigned to the user for a given AWS
* account.
See Also:
AWS
* API Reference
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void ListAccountRolesAsync(const Model::ListAccountRolesRequest& request, const ListAccountRolesResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const;
/**
* Lists all AWS accounts assigned to the user. These AWS accounts are assigned
* by the administrator of the account. For more information, see Assign
* User Access in the AWS SSO User Guide. This operation returns a
* paginated response.
See Also:
AWS
* API Reference
*/
virtual Model::ListAccountsOutcome ListAccounts(const Model::ListAccountsRequest& request) const;
/**
* Lists all AWS accounts assigned to the user. These AWS accounts are assigned
* by the administrator of the account. For more information, see Assign
* User Access in the AWS SSO User Guide. This operation returns a
* paginated response.
See Also:
AWS
* API Reference
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::ListAccountsOutcomeCallable ListAccountsCallable(const Model::ListAccountsRequest& request) const;
/**
* Lists all AWS accounts assigned to the user. These AWS accounts are assigned
* by the administrator of the account. For more information, see Assign
* User Access in the AWS SSO User Guide. This operation returns a
* paginated response.
See Also:
AWS
* API Reference
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void ListAccountsAsync(const Model::ListAccountsRequest& request, const ListAccountsResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const;
/**
* Removes the client- and server-side session that is associated with the
* user.
See Also:
AWS API
* Reference
*/
virtual Model::LogoutOutcome Logout(const Model::LogoutRequest& request) const;
/**
* Removes the client- and server-side session that is associated with the
* user.
See Also:
AWS API
* Reference
*
* returns a future to the operation so that it can be executed in parallel to other requests.
*/
virtual Model::LogoutOutcomeCallable LogoutCallable(const Model::LogoutRequest& request) const;
/**
* Removes the client- and server-side session that is associated with the
* user.
See Also:
AWS API
* Reference
*
* Queues the request into a thread executor and triggers associated callback when operation has finished.
*/
virtual void LogoutAsync(const Model::LogoutRequest& request, const LogoutResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const;
void OverrideEndpoint(const Aws::String& endpoint);
private:
void init(const Aws::Client::ClientConfiguration& clientConfiguration);
void GetRoleCredentialsAsyncHelper(const Model::GetRoleCredentialsRequest& request, const GetRoleCredentialsResponseReceivedHandler& handler, const std::shared_ptr& context) const;
void ListAccountRolesAsyncHelper(const Model::ListAccountRolesRequest& request, const ListAccountRolesResponseReceivedHandler& handler, const std::shared_ptr& context) const;
void ListAccountsAsyncHelper(const Model::ListAccountsRequest& request, const ListAccountsResponseReceivedHandler& handler, const std::shared_ptr& context) const;
void LogoutAsyncHelper(const Model::LogoutRequest& request, const LogoutResponseReceivedHandler& handler, const std::shared_ptr& context) const;
Aws::String m_uri;
Aws::String m_configScheme;
std::shared_ptr m_executor;
};
} // namespace SSO
} // namespace Aws