Skip to content

batch_get_prepared_statement async

batch_get_prepared_statement(
    prepared_statement_names: PreparedStatementNameList,
    work_group: WorkGroupName,
    *,
    config_overrides: Optional[AsyncAthenaClientConfig] = None,
) -> BatchGetPreparedStatementOutput

Returns the details of a single prepared statement or a list of up to 256 prepared statements for the array of prepared statement names that you provide. Requires you to have access to the workgroup to which the prepared statements belong. If a prepared statement cannot be retrieved for the name specified, the statement is listed in UnprocessedPreparedStatementNames.

Parameters:

  • prepared_statement_names (PreparedStatementNameList) –

    A list of prepared statement names to return.

  • work_group (WorkGroupName) –

    The name of the workgroup to which the prepared statements belong.

Raises:

  • InternalServerException –

    Indicates a platform issue, which may be due to a transient condition or outage.

  • InvalidRequestException –

    Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_athena/_services/async_athena.py
async def batch_get_prepared_statement(
    self,
    prepared_statement_names: "capo_athena.types.prepared_statement_name_list.PreparedStatementNameList",
    work_group: "capo_athena.types.work_group_name.WorkGroupName",
    *,
    config_overrides: Optional[AsyncAthenaClientConfig] = None,
) -> "capo_athena.types.batch_get_prepared_statement_output.BatchGetPreparedStatementOutput":
    """<p>Returns the details of a single prepared statement or a list of up to 256 prepared statements for the array of prepared statement names that you provide. Requires you to have access to the workgroup to which the prepared statements belong. If a prepared statement cannot be retrieved for the name specified, the statement is listed in <code>UnprocessedPreparedStatementNames</code>.</p>

    Args:
        prepared_statement_names: <p>A list of prepared statement names to return.</p>
        work_group: <p>The name of the workgroup to which the prepared statements belong.</p>

    Raises:
        capo_athena.errors.internal_server_exception.InternalServerException: <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
        capo_athena.errors.invalid_request_exception.InvalidRequestException: <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
        capo_athena.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_athena.types.batch_get_prepared_statement_input.BatchGetPreparedStatementInput]",
    ) -> AsyncOperationResponse[
        "capo_athena.types.batch_get_prepared_statement_output.BatchGetPreparedStatementOutput"
    ]:
        import capo_athena._operations.amazon_athena.batch_get_prepared_statement

        (
            output,
            http_response,
        ) = await capo_athena._operations.amazon_athena.batch_get_prepared_statement.async_batch_get_prepared_statement(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("BatchGetPreparedStatement")
    )
    input_: capo_athena.types.batch_get_prepared_statement_input.BatchGetPreparedStatementInput = {
        "prepared_statement_names": prepared_statement_names,
        "work_group": work_group,
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output