Skip to content

start_engagement

start_engagement(
    contact_id: SsmContactsArn,
    sender: Sender,
    subject: Subject,
    content: Content,
    *,
    config_overrides: Optional[SSMContactsClientConfig] = None,
    public_subject: Optional[PublicSubject] = None,
    public_content: Optional[PublicContent] = None,
    incident_id: Optional[IncidentId] = None,
    idempotency_token: Optional[IdempotencyToken] = None,
) -> StartEngagementResult

Starts an engagement to a contact or escalation plan. The engagement engages each contact specified in the incident.

Parameters:

  • contact_id (SsmContactsArn) –

    The Amazon Resource Name (ARN) of the contact being engaged.

  • sender (Sender) –

    The user that started the engagement.

  • subject (Subject) –

    The secure subject of the message that was sent to the contact. Use this field for engagements to VOICE or EMAIL.

  • content (Content) –

    The secure content of the message that was sent to the contact. Use this field for engagements to VOICE or EMAIL.

  • public_subject (Optional[PublicSubject], default: None ) –

    The insecure subject of the message that was sent to the contact. Use this field for engagements to SMS.

  • public_content (Optional[PublicContent], default: None ) –

    The insecure content of the message that was sent to the contact. Use this field for engagements to SMS.

  • incident_id (Optional[IncidentId], default: None ) –

    The ARN of the incident that the engagement is part of.

  • idempotency_token (Optional[IdempotencyToken], default: None ) –

    A token ensuring that the operation is called only once with the specified details.

Raises:

Source code in docs_src/capo_ssm_contacts/_services/ssm_contacts.py
def start_engagement(
    self,
    contact_id: "capo_ssm_contacts.types.ssm_contacts_arn.SsmContactsArn",
    sender: "capo_ssm_contacts.types.sender.Sender",
    subject: "capo_ssm_contacts.types.subject.Subject",
    content: "capo_ssm_contacts.types.content.Content",
    *,
    config_overrides: Optional[SSMContactsClientConfig] = None,
    public_subject: Optional[
        "capo_ssm_contacts.types.public_subject.PublicSubject"
    ] = None,
    public_content: Optional[
        "capo_ssm_contacts.types.public_content.PublicContent"
    ] = None,
    incident_id: Optional["capo_ssm_contacts.types.incident_id.IncidentId"] = None,
    idempotency_token: Optional[
        "capo_ssm_contacts.types.idempotency_token.IdempotencyToken"
    ] = None,
) -> "capo_ssm_contacts.types.start_engagement_result.StartEngagementResult":
    """<p>Starts an engagement to a contact or escalation plan. The engagement engages each contact specified in the incident.</p>

    Args:
        contact_id: <p>The Amazon Resource Name (ARN) of the contact being engaged.</p>
        sender: <p>The user that started the engagement.</p>
        subject: <p>The secure subject of the message that was sent to the contact. Use this field for engagements to <code>VOICE</code> or <code>EMAIL</code>.</p>
        content: <p>The secure content of the message that was sent to the contact. Use this field for engagements to <code>VOICE</code> or <code>EMAIL</code>.</p>
        public_subject: <p>The insecure subject of the message that was sent to the contact. Use this field for engagements to <code>SMS</code>.</p>
        public_content: <p>The insecure content of the message that was sent to the contact. Use this field for engagements to <code>SMS</code>.</p>
        incident_id: <p>The ARN of the incident that the engagement is part of.</p>
        idempotency_token: <p>A token ensuring that the operation is called only once with the specified details.</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.data_encryption_exception.DataEncryptionException: <p>The operation failed to due an encryption key error.</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.
    """

    def _handler(
        req: "OperationRequest[capo_ssm_contacts.types.start_engagement_request.StartEngagementRequest]",
    ) -> OperationResponse[
        "capo_ssm_contacts.types.start_engagement_result.StartEngagementResult"
    ]:
        import capo_ssm_contacts._operations.ssm_contacts.start_engagement

        output, http_response = (
            capo_ssm_contacts._operations.ssm_contacts.start_engagement.start_engagement(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartEngagement")
    )
    input_: capo_ssm_contacts.types.start_engagement_request.StartEngagementRequest = {
        "contact_id": contact_id,
        "sender": sender,
        "subject": subject,
        "content": content,
    }
    if public_subject is not None:
        input_["public_subject"] = public_subject
    if public_content is not None:
        input_["public_content"] = public_content
    if incident_id is not None:
        input_["incident_id"] = incident_id
    if idempotency_token is None:
        idempotency_token = str(uuid.uuid4())
    input_["idempotency_token"] = idempotency_token

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