Skip to content

start_protected_query async

start_protected_query(
    type: ProtectedQueryType,
    membership_identifier: MembershipIdentifier,
    sql_parameters: ProtectedQuerySQLParameters,
    *,
    config_overrides: Optional[AsyncCleanRoomsClientConfig] = None,
    result_configuration: Optional[ProtectedQueryResultConfiguration] = None,
    compute_configuration: Optional[ComputeConfiguration] = None,
    query_compute_payer_account_id: Optional[AccountId] = None,
) -> StartProtectedQueryOutput

Creates a protected query that is started by Clean Rooms.

Parameters:

Raises:

Source code in docs_src/capo_cleanrooms/_services/async_clean_rooms.py
async def start_protected_query(
    self,
    type: "capo_cleanrooms.types.protected_query_type.ProtectedQueryType",
    membership_identifier: "capo_cleanrooms.types.membership_identifier.MembershipIdentifier",
    sql_parameters: "capo_cleanrooms.types.protected_query_sql_parameters.ProtectedQuerySQLParameters",
    *,
    config_overrides: Optional[AsyncCleanRoomsClientConfig] = None,
    result_configuration: Optional[
        "capo_cleanrooms.types.protected_query_result_configuration.ProtectedQueryResultConfiguration"
    ] = None,
    compute_configuration: Optional[
        "capo_cleanrooms.types.compute_configuration.ComputeConfiguration"
    ] = None,
    query_compute_payer_account_id: Optional[
        "capo_cleanrooms.types.account_id.AccountId"
    ] = None,
) -> "capo_cleanrooms.types.start_protected_query_output.StartProtectedQueryOutput":
    """<p>Creates a protected query that is started by Clean Rooms.</p>

    Args:
        type: <p>The type of the protected query to be started.</p>
        membership_identifier: <p>A unique identifier for the membership to run this query against. Currently accepts a membership ID.</p>
        sql_parameters: <p>The protected SQL query parameters.</p>
        result_configuration: <p>The details needed to write the query results.</p>
        compute_configuration: <p> The compute configuration for the protected query.</p>
        query_compute_payer_account_id: <p>The account ID of the member that pays for the query compute costs.</p>

    Raises:
        capo_cleanrooms.errors.access_denied_exception.AccessDeniedException: <p>Caller does not have sufficient access to perform this action.</p>
        capo_cleanrooms.errors.internal_server_exception.InternalServerException: <p>Unexpected error during processing of request.</p>
        capo_cleanrooms.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource which does not exist.</p>
        capo_cleanrooms.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Request denied because service quota has been exceeded.</p>
        capo_cleanrooms.errors.throttling_exception.ThrottlingException: <p>Request was denied due to request throttling.</p>
        capo_cleanrooms.errors.validation_exception.ValidationException: <p>The input fails to satisfy the specified constraints.</p>
        capo_cleanrooms.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cleanrooms.types.start_protected_query_input.StartProtectedQueryInput]",
    ) -> AsyncOperationResponse[
        "capo_cleanrooms.types.start_protected_query_output.StartProtectedQueryOutput"
    ]:
        import capo_cleanrooms._operations.aws_bastion_control_plane_service_lambda.start_protected_query

        (
            output,
            http_response,
        ) = await capo_cleanrooms._operations.aws_bastion_control_plane_service_lambda.start_protected_query.async_start_protected_query(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_cleanrooms.types.start_protected_query_input.StartProtectedQueryInput",
    ) -> dict[str, Any]:
        import capo_cleanrooms.types.start_protected_query_input

        return capo_cleanrooms.types.start_protected_query_input.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_cleanrooms.types.start_protected_query_output.StartProtectedQueryOutput",
    ) -> dict[str, Any]:
        import capo_cleanrooms.types.start_protected_query_output

        return capo_cleanrooms.types.start_protected_query_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "StartProtectedQuery",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_cleanrooms.types.start_protected_query_input.StartProtectedQueryInput = {
        "type": type,
        "membership_identifier": membership_identifier,
        "sql_parameters": sql_parameters,
    }
    if result_configuration is not None:
        input_["result_configuration"] = result_configuration
    if compute_configuration is not None:
        input_["compute_configuration"] = compute_configuration
    if query_compute_payer_account_id is not None:
        input_["query_compute_payer_account_id"] = query_compute_payer_account_id

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