Skip to content

start_campaign

start_campaign(
    id: CampaignId, *, config_overrides: Optional[ConnectCampaignsClientConfig] = None
) -> None

Starts a campaign for the specified Amazon Connect account.

Raises:

Source code in docs_src/capo_connectcampaigns/_services/connect_campaigns.py
def start_campaign(
    self,
    id: "capo_connectcampaigns.types.campaign_id.CampaignId",
    *,
    config_overrides: Optional[ConnectCampaignsClientConfig] = None,
) -> None:
    """Starts a campaign 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.conflict_exception.ConflictException: The request could not be processed because of conflict in the current state of the resource.
        capo_connectcampaigns.errors.internal_server_exception.InternalServerException: Request processing failed because of an error or failure with the service.
        capo_connectcampaigns.errors.invalid_campaign_state_exception.InvalidCampaignStateException: The request could not be processed because of conflict in the current state of the campaign.
        capo_connectcampaigns.errors.resource_not_found_exception.ResourceNotFoundException: The specified resource was not found.
        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.
    """

    def _handler(
        req: "OperationRequest[capo_connectcampaigns.types.start_campaign_request.StartCampaignRequest]",
    ) -> OperationResponse[None]:
        import capo_connectcampaigns._operations.amazon_connect_campaign_service.start_campaign

        output, http_response = (
            capo_connectcampaigns._operations.amazon_connect_campaign_service.start_campaign.start_campaign(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartCampaign")
    )
    input_: capo_connectcampaigns.types.start_campaign_request.StartCampaignRequest = {
        "id": id
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output