/** * 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 RedshiftDataAPIService { /** *

You can use the Amazon Redshift Data API to run queries on Amazon Redshift * tables. You can run SQL statements, which are committed if the statement * succeeds.

For more information about the Amazon Redshift Data API and * CLI usage examples, see Using the * Amazon Redshift Data API in the Amazon Redshift Management Guide. *

*/ class AWS_REDSHIFTDATAAPISERVICE_API RedshiftDataAPIServiceClient : 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 RedshiftDataAPIServiceClientConfiguration ClientConfigurationType; typedef RedshiftDataAPIServiceEndpointProvider 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. */ RedshiftDataAPIServiceClient(const Aws::RedshiftDataAPIService::RedshiftDataAPIServiceClientConfiguration& clientConfiguration = Aws::RedshiftDataAPIService::RedshiftDataAPIServiceClientConfiguration(), 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. */ RedshiftDataAPIServiceClient(const Aws::Auth::AWSCredentials& credentials, std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG), const Aws::RedshiftDataAPIService::RedshiftDataAPIServiceClientConfiguration& clientConfiguration = Aws::RedshiftDataAPIService::RedshiftDataAPIServiceClientConfiguration()); /** * 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 */ RedshiftDataAPIServiceClient(const std::shared_ptr& credentialsProvider, std::shared_ptr endpointProvider = Aws::MakeShared(ALLOCATION_TAG), const Aws::RedshiftDataAPIService::RedshiftDataAPIServiceClientConfiguration& clientConfiguration = Aws::RedshiftDataAPIService::RedshiftDataAPIServiceClientConfiguration()); /* 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. */ RedshiftDataAPIServiceClient(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. */ RedshiftDataAPIServiceClient(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 */ RedshiftDataAPIServiceClient(const std::shared_ptr& credentialsProvider, const Aws::Client::ClientConfiguration& clientConfiguration); /* End of legacy constructors due deprecation */ virtual ~RedshiftDataAPIServiceClient(); /** *

Runs one or more SQL statements, which can be data manipulation language * (DML) or data definition language (DDL). Depending on the authorization method, * use one of the following combinations of request parameters:

  • *

    Secrets Manager - when connecting to a cluster, provide the * secret-arn of a secret stored in Secrets Manager which has * username and password. The specified secret contains * credentials to connect to the database you specify. When you are * connecting to a cluster, you also supply the database name, If you provide a * cluster identifier (dbClusterIdentifier), it must match the cluster * identifier stored in the secret. When you are connecting to a serverless * workgroup, you also supply the database name.

  • Temporary * credentials - when connecting to your data warehouse, choose one of the * following options:

    • When connecting to a serverless workgroup, * specify the workgroup name and database name. The database user name is derived * from the IAM identity. For example, arn:iam::123456789012:user:foo * has the database user name IAM:foo. Also, permission to call the * redshift-serverless:GetCredentials operation is required.

    • *
    • When connecting to a cluster as an IAM identity, specify the cluster * identifier and the database name. The database user name is derived from the IAM * identity. For example, arn:iam::123456789012:user:foo has the * database user name IAM:foo. Also, permission to call the * redshift:GetClusterCredentialsWithIAM operation is required.

      *
    • When connecting to a cluster as a database user, specify the * cluster identifier, the database name, and the database user name. Also, * permission to call the redshift:GetClusterCredentials operation is * required.

For more information about the Amazon * Redshift Data API and CLI usage examples, see Using the * Amazon Redshift Data API in the Amazon Redshift Management Guide. *

See Also:

AWS * API Reference

*/ virtual Model::BatchExecuteStatementOutcome BatchExecuteStatement(const Model::BatchExecuteStatementRequest& request) const; /** * A Callable wrapper for BatchExecuteStatement that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::BatchExecuteStatementOutcomeCallable BatchExecuteStatementCallable(const BatchExecuteStatementRequestT& request) const { return SubmitCallable(&RedshiftDataAPIServiceClient::BatchExecuteStatement, request); } /** * An Async wrapper for BatchExecuteStatement that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void BatchExecuteStatementAsync(const BatchExecuteStatementRequestT& request, const BatchExecuteStatementResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&RedshiftDataAPIServiceClient::BatchExecuteStatement, request, handler, context); } /** *

Cancels a running query. To be canceled, a query must be running.

For * more information about the Amazon Redshift Data API and CLI usage examples, see * Using * the Amazon Redshift Data API in the Amazon Redshift Management Guide. *

See Also:

AWS * API Reference

*/ virtual Model::CancelStatementOutcome CancelStatement(const Model::CancelStatementRequest& request) const; /** * A Callable wrapper for CancelStatement that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::CancelStatementOutcomeCallable CancelStatementCallable(const CancelStatementRequestT& request) const { return SubmitCallable(&RedshiftDataAPIServiceClient::CancelStatement, request); } /** * An Async wrapper for CancelStatement that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void CancelStatementAsync(const CancelStatementRequestT& request, const CancelStatementResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&RedshiftDataAPIServiceClient::CancelStatement, request, handler, context); } /** *

Describes the details about a specific instance when a query was run by the * Amazon Redshift Data API. The information includes when the query started, when * it finished, the query status, the number of rows returned, and the SQL * statement.

For more information about the Amazon Redshift Data API and * CLI usage examples, see Using the * Amazon Redshift Data API in the Amazon Redshift Management Guide. *

See Also:

AWS * API Reference

*/ virtual Model::DescribeStatementOutcome DescribeStatement(const Model::DescribeStatementRequest& request) const; /** * A Callable wrapper for DescribeStatement that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::DescribeStatementOutcomeCallable DescribeStatementCallable(const DescribeStatementRequestT& request) const { return SubmitCallable(&RedshiftDataAPIServiceClient::DescribeStatement, request); } /** * An Async wrapper for DescribeStatement that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void DescribeStatementAsync(const DescribeStatementRequestT& request, const DescribeStatementResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&RedshiftDataAPIServiceClient::DescribeStatement, request, handler, context); } /** *

Describes the detailed information about a table from metadata in the * cluster. The information includes its columns. A token is returned to page * through the column list. Depending on the authorization method, use one of the * following combinations of request parameters:

  • Secrets Manager * - when connecting to a cluster, provide the secret-arn of a secret * stored in Secrets Manager which has username and * password. The specified secret contains credentials to connect to * the database you specify. When you are connecting to a cluster, you * also supply the database name, If you provide a cluster identifier * (dbClusterIdentifier), it must match the cluster identifier stored * in the secret. When you are connecting to a serverless workgroup, you also * supply the database name.

  • Temporary credentials - when * connecting to your data warehouse, choose one of the following options:

      *
    • When connecting to a serverless workgroup, specify the workgroup name * and database name. The database user name is derived from the IAM identity. For * example, arn:iam::123456789012:user:foo has the database user name * IAM:foo. Also, permission to call the * redshift-serverless:GetCredentials operation is required.

    • *
    • When connecting to a cluster as an IAM identity, specify the cluster * identifier and the database name. The database user name is derived from the IAM * identity. For example, arn:iam::123456789012:user:foo has the * database user name IAM:foo. Also, permission to call the * redshift:GetClusterCredentialsWithIAM operation is required.

      *
    • When connecting to a cluster as a database user, specify the * cluster identifier, the database name, and the database user name. Also, * permission to call the redshift:GetClusterCredentials operation is * required.

For more information about the Amazon * Redshift Data API and CLI usage examples, see Using the * Amazon Redshift Data API in the Amazon Redshift Management Guide. *

See Also:

AWS * API Reference

*/ virtual Model::DescribeTableOutcome DescribeTable(const Model::DescribeTableRequest& request) const; /** * A Callable wrapper for DescribeTable that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::DescribeTableOutcomeCallable DescribeTableCallable(const DescribeTableRequestT& request) const { return SubmitCallable(&RedshiftDataAPIServiceClient::DescribeTable, request); } /** * An Async wrapper for DescribeTable that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void DescribeTableAsync(const DescribeTableRequestT& request, const DescribeTableResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&RedshiftDataAPIServiceClient::DescribeTable, request, handler, context); } /** *

Runs an SQL statement, which can be data manipulation language (DML) or data * definition language (DDL). This statement must be a single SQL statement. * Depending on the authorization method, use one of the following combinations of * request parameters:

  • Secrets Manager - when connecting to a * cluster, provide the secret-arn of a secret stored in Secrets * Manager which has username and password. The specified * secret contains credentials to connect to the database you specify. * When you are connecting to a cluster, you also supply the database name, If you * provide a cluster identifier (dbClusterIdentifier), it must match * the cluster identifier stored in the secret. When you are connecting to a * serverless workgroup, you also supply the database name.

  • *

    Temporary credentials - when connecting to your data warehouse, choose one of * the following options:

    • When connecting to a serverless * workgroup, specify the workgroup name and database name. The database user name * is derived from the IAM identity. For example, * arn:iam::123456789012:user:foo has the database user name * IAM:foo. Also, permission to call the * redshift-serverless:GetCredentials operation is required.

    • *
    • When connecting to a cluster as an IAM identity, specify the cluster * identifier and the database name. The database user name is derived from the IAM * identity. For example, arn:iam::123456789012:user:foo has the * database user name IAM:foo. Also, permission to call the * redshift:GetClusterCredentialsWithIAM operation is required.

      *
    • When connecting to a cluster as a database user, specify the * cluster identifier, the database name, and the database user name. Also, * permission to call the redshift:GetClusterCredentials operation is * required.

For more information about the Amazon * Redshift Data API and CLI usage examples, see Using the * Amazon Redshift Data API in the Amazon Redshift Management Guide. *

See Also:

AWS * API Reference

*/ virtual Model::ExecuteStatementOutcome ExecuteStatement(const Model::ExecuteStatementRequest& request) const; /** * A Callable wrapper for ExecuteStatement that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::ExecuteStatementOutcomeCallable ExecuteStatementCallable(const ExecuteStatementRequestT& request) const { return SubmitCallable(&RedshiftDataAPIServiceClient::ExecuteStatement, request); } /** * An Async wrapper for ExecuteStatement that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void ExecuteStatementAsync(const ExecuteStatementRequestT& request, const ExecuteStatementResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&RedshiftDataAPIServiceClient::ExecuteStatement, request, handler, context); } /** *

Fetches the temporarily cached result of an SQL statement. A token is * returned to page through the statement results.

For more information * about the Amazon Redshift Data API and CLI usage examples, see Using the * Amazon Redshift Data API in the Amazon Redshift Management Guide. *

See Also:

AWS * API Reference

*/ virtual Model::GetStatementResultOutcome GetStatementResult(const Model::GetStatementResultRequest& request) const; /** * A Callable wrapper for GetStatementResult that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::GetStatementResultOutcomeCallable GetStatementResultCallable(const GetStatementResultRequestT& request) const { return SubmitCallable(&RedshiftDataAPIServiceClient::GetStatementResult, request); } /** * An Async wrapper for GetStatementResult that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void GetStatementResultAsync(const GetStatementResultRequestT& request, const GetStatementResultResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&RedshiftDataAPIServiceClient::GetStatementResult, request, handler, context); } /** *

List the databases in a cluster. A token is returned to page through the * database list. Depending on the authorization method, use one of the following * combinations of request parameters:

  • Secrets Manager - when * connecting to a cluster, provide the secret-arn of a secret stored * in Secrets Manager which has username and password. * The specified secret contains credentials to connect to the * database you specify. When you are connecting to a cluster, you * also supply the database name, If you provide a cluster identifier * (dbClusterIdentifier), it must match the cluster identifier stored * in the secret. When you are connecting to a serverless workgroup, you also * supply the database name.

  • Temporary credentials - when * connecting to your data warehouse, choose one of the following options:

      *
    • When connecting to a serverless workgroup, specify the workgroup name * and database name. The database user name is derived from the IAM identity. For * example, arn:iam::123456789012:user:foo has the database user name * IAM:foo. Also, permission to call the * redshift-serverless:GetCredentials operation is required.

    • *
    • When connecting to a cluster as an IAM identity, specify the cluster * identifier and the database name. The database user name is derived from the IAM * identity. For example, arn:iam::123456789012:user:foo has the * database user name IAM:foo. Also, permission to call the * redshift:GetClusterCredentialsWithIAM operation is required.

      *
    • When connecting to a cluster as a database user, specify the * cluster identifier, the database name, and the database user name. Also, * permission to call the redshift:GetClusterCredentials operation is * required.

For more information about the Amazon * Redshift Data API and CLI usage examples, see Using the * Amazon Redshift Data API in the Amazon Redshift Management Guide. *

See Also:

AWS * API Reference

*/ virtual Model::ListDatabasesOutcome ListDatabases(const Model::ListDatabasesRequest& request) const; /** * A Callable wrapper for ListDatabases that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::ListDatabasesOutcomeCallable ListDatabasesCallable(const ListDatabasesRequestT& request) const { return SubmitCallable(&RedshiftDataAPIServiceClient::ListDatabases, request); } /** * An Async wrapper for ListDatabases that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void ListDatabasesAsync(const ListDatabasesRequestT& request, const ListDatabasesResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&RedshiftDataAPIServiceClient::ListDatabases, request, handler, context); } /** *

Lists the schemas in a database. A token is returned to page through the * schema list. Depending on the authorization method, use one of the following * combinations of request parameters:

  • Secrets Manager - when * connecting to a cluster, provide the secret-arn of a secret stored * in Secrets Manager which has username and password. * The specified secret contains credentials to connect to the * database you specify. When you are connecting to a cluster, you * also supply the database name, If you provide a cluster identifier * (dbClusterIdentifier), it must match the cluster identifier stored * in the secret. When you are connecting to a serverless workgroup, you also * supply the database name.

  • Temporary credentials - when * connecting to your data warehouse, choose one of the following options:

      *
    • When connecting to a serverless workgroup, specify the workgroup name * and database name. The database user name is derived from the IAM identity. For * example, arn:iam::123456789012:user:foo has the database user name * IAM:foo. Also, permission to call the * redshift-serverless:GetCredentials operation is required.

    • *
    • When connecting to a cluster as an IAM identity, specify the cluster * identifier and the database name. The database user name is derived from the IAM * identity. For example, arn:iam::123456789012:user:foo has the * database user name IAM:foo. Also, permission to call the * redshift:GetClusterCredentialsWithIAM operation is required.

      *
    • When connecting to a cluster as a database user, specify the * cluster identifier, the database name, and the database user name. Also, * permission to call the redshift:GetClusterCredentials operation is * required.

For more information about the Amazon * Redshift Data API and CLI usage examples, see Using the * Amazon Redshift Data API in the Amazon Redshift Management Guide. *

See Also:

AWS * API Reference

*/ virtual Model::ListSchemasOutcome ListSchemas(const Model::ListSchemasRequest& request) const; /** * A Callable wrapper for ListSchemas that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::ListSchemasOutcomeCallable ListSchemasCallable(const ListSchemasRequestT& request) const { return SubmitCallable(&RedshiftDataAPIServiceClient::ListSchemas, request); } /** * An Async wrapper for ListSchemas that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void ListSchemasAsync(const ListSchemasRequestT& request, const ListSchemasResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&RedshiftDataAPIServiceClient::ListSchemas, request, handler, context); } /** *

List of SQL statements. By default, only finished statements are shown. A * token is returned to page through the statement list.

For more * information about the Amazon Redshift Data API and CLI usage examples, see Using the * Amazon Redshift Data API in the Amazon Redshift Management Guide. *

See Also:

AWS * API Reference

*/ virtual Model::ListStatementsOutcome ListStatements(const Model::ListStatementsRequest& request) const; /** * A Callable wrapper for ListStatements that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::ListStatementsOutcomeCallable ListStatementsCallable(const ListStatementsRequestT& request) const { return SubmitCallable(&RedshiftDataAPIServiceClient::ListStatements, request); } /** * An Async wrapper for ListStatements that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void ListStatementsAsync(const ListStatementsRequestT& request, const ListStatementsResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&RedshiftDataAPIServiceClient::ListStatements, request, handler, context); } /** *

List the tables in a database. If neither SchemaPattern nor * TablePattern are specified, then all tables in the database are * returned. A token is returned to page through the table list. Depending on the * authorization method, use one of the following combinations of request * parameters:

  • Secrets Manager - when connecting to a cluster, * provide the secret-arn of a secret stored in Secrets Manager which * has username and password. The specified secret * contains credentials to connect to the database you specify. When * you are connecting to a cluster, you also supply the database name, If you * provide a cluster identifier (dbClusterIdentifier), it must match * the cluster identifier stored in the secret. When you are connecting to a * serverless workgroup, you also supply the database name.

  • *

    Temporary credentials - when connecting to your data warehouse, choose one of * the following options:

    • When connecting to a serverless * workgroup, specify the workgroup name and database name. The database user name * is derived from the IAM identity. For example, * arn:iam::123456789012:user:foo has the database user name * IAM:foo. Also, permission to call the * redshift-serverless:GetCredentials operation is required.

    • *
    • When connecting to a cluster as an IAM identity, specify the cluster * identifier and the database name. The database user name is derived from the IAM * identity. For example, arn:iam::123456789012:user:foo has the * database user name IAM:foo. Also, permission to call the * redshift:GetClusterCredentialsWithIAM operation is required.

      *
    • When connecting to a cluster as a database user, specify the * cluster identifier, the database name, and the database user name. Also, * permission to call the redshift:GetClusterCredentials operation is * required.

For more information about the Amazon * Redshift Data API and CLI usage examples, see Using the * Amazon Redshift Data API in the Amazon Redshift Management Guide. *

See Also:

AWS * API Reference

*/ virtual Model::ListTablesOutcome ListTables(const Model::ListTablesRequest& request) const; /** * A Callable wrapper for ListTables that returns a future to the operation so that it can be executed in parallel to other requests. */ template Model::ListTablesOutcomeCallable ListTablesCallable(const ListTablesRequestT& request) const { return SubmitCallable(&RedshiftDataAPIServiceClient::ListTables, request); } /** * An Async wrapper for ListTables that queues the request into a thread executor and triggers associated callback when operation has finished. */ template void ListTablesAsync(const ListTablesRequestT& request, const ListTablesResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const { return SubmitAsync(&RedshiftDataAPIServiceClient::ListTables, request, handler, context); } void OverrideEndpoint(const Aws::String& endpoint); std::shared_ptr& accessEndpointProvider(); private: friend class Aws::Client::ClientWithAsyncTemplateMethods; void init(const RedshiftDataAPIServiceClientConfiguration& clientConfiguration); RedshiftDataAPIServiceClientConfiguration m_clientConfiguration; std::shared_ptr m_executor; std::shared_ptr m_endpointProvider; }; } // namespace RedshiftDataAPIService } // namespace Aws