Skip to content

get_campaign_state_batch async

get_campaign_state_batch(
    campaign_ids: CampaignIdList,
    *,
    config_overrides: Optional[AsyncConnectCampaignsClientConfig] = None,
) -> GetCampaignStateBatchResponse

Get state of campaigns for the specified Amazon Connect account.

Raises:

Source code in docs_src/capo_connectcampaigns/_services/async_connect_campaigns.py
async def get_campaign_state_batch(
    self,
    campaign_ids: "capo_connectcampaigns.types.campaign_id_list.CampaignIdList",
    *,
    config_overrides: Optional[AsyncConnectCampaignsClientConfig] = None,
) -> "capo_connectcampaigns.types.get_campaign_state_batch_response.GetCampaignStateBatchResponse":
    """Get state of campaigns for the specified Amazon Connect account.

    Raises:
        capo_connectcampaigns.errors.access_denied_exception.AccessDeniedException: You do not have sufficient access to perform this action.
        capo_connectcampaigns.errors.internal_server_exception.InternalServerException: Request processing failed because of an error or failure with the service.
        capo_connectcampaigns.errors.throttling_exception.ThrottlingException: The request was denied due to request throttling.
        capo_connectcampaigns.errors.validation_exception.ValidationException: The input fails to satisfy the constraints specified by an AWS service.
        capo_connectcampaigns.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_connectcampaigns.types.get_campaign_state_batch_request.GetCampaignStateBatchRequest]",
    ) -> AsyncOperationResponse[
        "capo_connectcampaigns.types.get_campaign_state_batch_response.GetCampaignStateBatchResponse"
    ]:
        import capo_connectcampaigns._operations.amazon_connect_campaign_service.get_campaign_state_batch

        (
            output,
            http_response,
        ) = await capo_connectcampaigns._operations.amazon_connect_campaign_service.get_campaign_state_batch.async_get_campaign_state_batch(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetCampaignStateBatch")
    )
    input_: capo_connectcampaigns.types.get_campaign_state_batch_request.GetCampaignStateBatchRequest = {
        "campaign_ids": campaign_ids
    }

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