Skip to content

stop_engagement async

stop_engagement(
    engagement_id: SsmContactsArn,
    *,
    config_overrides: Optional[AsyncSSMContactsClientConfig] = None,
    reason: Optional[StopReason] = None,
) -> StopEngagementResult

Stops an engagement before it finishes the final stage of the escalation plan or engagement plan. Further contacts aren't engaged.

Parameters:

  • engagement_id (SsmContactsArn) –

    The Amazon Resource Name (ARN) of the engagement.

  • reason (Optional[StopReason], default: None ) –

    The reason that you're stopping the engagement.

Raises:

Source code in docs_src/capo_ssm_contacts/_services/async_ssm_contacts.py
async def stop_engagement(
    self,
    engagement_id: "capo_ssm_contacts.types.ssm_contacts_arn.SsmContactsArn",
    *,
    config_overrides: Optional[AsyncSSMContactsClientConfig] = None,
    reason: Optional["capo_ssm_contacts.types.stop_reason.StopReason"] = None,
) -> "capo_ssm_contacts.types.stop_engagement_result.StopEngagementResult":
    """<p>Stops an engagement before it finishes the final stage of the escalation plan or engagement plan. Further contacts aren't engaged.</p>

    Args:
        engagement_id: <p>The Amazon Resource Name (ARN) of the engagement.</p>
        reason: <p>The reason that you're stopping the engagement.</p>

    Raises:
        capo_ssm_contacts.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this operation.</p>
        capo_ssm_contacts.errors.internal_server_exception.InternalServerException: <p>Unexpected error occurred while processing the request.</p>
        capo_ssm_contacts.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource that doesn't exist.</p>
        capo_ssm_contacts.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_ssm_contacts.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_ssm_contacts.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ssm_contacts.types.stop_engagement_request.StopEngagementRequest]",
    ) -> AsyncOperationResponse[
        "capo_ssm_contacts.types.stop_engagement_result.StopEngagementResult"
    ]:
        import capo_ssm_contacts._operations.ssm_contacts.stop_engagement

        (
            output,
            http_response,
        ) = await capo_ssm_contacts._operations.ssm_contacts.stop_engagement.async_stop_engagement(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StopEngagement")
    )
    input_: capo_ssm_contacts.types.stop_engagement_request.StopEngagementRequest = {
        "engagement_id": engagement_id
    }
    if reason is not None:
        input_["reason"] = reason

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