Stops a campaign for the specified Amazon Connect account.
Raises:
Source code in docs_src/capo_connectcampaignsv2/_services/connect_campaigns_v2.py
| def stop_campaign(
self,
id: "capo_connectcampaignsv2.types.campaign_id.CampaignId",
*,
config_overrides: Optional[ConnectCampaignsV2ClientConfig] = None,
) -> None:
"""Stops a campaign for the specified Amazon Connect account.
Raises:
capo_connectcampaignsv2.errors.access_denied_exception.AccessDeniedException: You do not have sufficient access to perform this action.
capo_connectcampaignsv2.errors.conflict_exception.ConflictException: The request could not be processed because of conflict in the current state of the resource.
capo_connectcampaignsv2.errors.internal_server_exception.InternalServerException: Request processing failed because of an error or failure with the service.
capo_connectcampaignsv2.errors.invalid_campaign_state_exception.InvalidCampaignStateException: The request could not be processed because of conflict in the current state of the campaign.
capo_connectcampaignsv2.errors.resource_not_found_exception.ResourceNotFoundException: The specified resource was not found.
capo_connectcampaignsv2.errors.throttling_exception.ThrottlingException: The request was denied due to request throttling.
capo_connectcampaignsv2.errors.validation_exception.ValidationException: The input fails to satisfy the constraints specified by an AWS service.
capo_connectcampaignsv2.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_connectcampaignsv2.types.stop_campaign_request.StopCampaignRequest]",
) -> OperationResponse[None]:
import capo_connectcampaignsv2._operations.amazon_connect_campaign_service_v2.stop_campaign
output, http_response = (
capo_connectcampaignsv2._operations.amazon_connect_campaign_service_v2.stop_campaign.stop_campaign(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("StopCampaign")
)
input_: capo_connectcampaignsv2.types.stop_campaign_request.StopCampaignRequest = {
"id": id
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|