Skip to content

create_contact_channel async

create_contact_channel(
    contact_id: SsmContactsArn,
    name: ChannelName,
    type: ChannelType,
    delivery_address: ContactChannelAddress,
    *,
    config_overrides: Optional[AsyncSSMContactsClientConfig] = None,
    defer_activation: Optional[DeferActivation] = None,
    idempotency_token: Optional[IdempotencyToken] = None,
) -> CreateContactChannelResult

A contact channel is the method that Incident Manager uses to engage your contact.

Parameters:

  • contact_id (SsmContactsArn) –

    The Amazon Resource Name (ARN) of the contact you are adding the contact channel to.

  • name (ChannelName) –

    The name of the contact channel.

  • type (ChannelType) –

    Incident Manager supports three types of contact channels:

    • SMS

    • VOICE

    • EMAIL

  • delivery_address (ContactChannelAddress) –

    The details that Incident Manager uses when trying to engage the contact channel. The format is dependent on the type of the contact channel. The following are the expected formats:

    • SMS - '+' followed by the country code and phone number

    • VOICE - '+' followed by the country code and phone number

    • EMAIL - any standard email format

  • defer_activation (Optional[DeferActivation], default: None ) –

    If you want to activate the channel at a later time, you can choose to defer activation. Incident Manager can't engage your contact channel until it has been activated.

  • 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/async_ssm_contacts.py
async def create_contact_channel(
    self,
    contact_id: "capo_ssm_contacts.types.ssm_contacts_arn.SsmContactsArn",
    name: "capo_ssm_contacts.types.channel_name.ChannelName",
    type: "capo_ssm_contacts.types.channel_type.ChannelType",
    delivery_address: "capo_ssm_contacts.types.contact_channel_address.ContactChannelAddress",
    *,
    config_overrides: Optional[AsyncSSMContactsClientConfig] = None,
    defer_activation: Optional[
        "capo_ssm_contacts.types.defer_activation.DeferActivation"
    ] = None,
    idempotency_token: Optional[
        "capo_ssm_contacts.types.idempotency_token.IdempotencyToken"
    ] = None,
) -> "capo_ssm_contacts.types.create_contact_channel_result.CreateContactChannelResult":
    """<p>A contact channel is the method that Incident Manager uses to engage your contact.</p>

    Args:
        contact_id: <p>The Amazon Resource Name (ARN) of the contact you are adding the contact channel to.</p>
        name: <p>The name of the contact channel.</p>
        type: <p>Incident Manager supports three types of contact channels:</p> <ul> <li> <p> <code>SMS</code> </p> </li> <li> <p> <code>VOICE</code> </p> </li> <li> <p> <code>EMAIL</code> </p> </li> </ul>
        delivery_address: <p>The details that Incident Manager uses when trying to engage the contact channel. The format is dependent on the type of the contact channel. The following are the expected formats:</p> <ul> <li> <p>SMS - '+' followed by the country code and phone number</p> </li> <li> <p>VOICE - '+' followed by the country code and phone number</p> </li> <li> <p>EMAIL - any standard email format</p> </li> </ul>
        defer_activation: <p>If you want to activate the channel at a later time, you can choose to defer activation. Incident Manager can't engage your contact channel until it has been activated.</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.conflict_exception.ConflictException: <p>Updating or deleting a resource causes an inconsistent state.</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.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.create_contact_channel_request.CreateContactChannelRequest]",
    ) -> AsyncOperationResponse[
        "capo_ssm_contacts.types.create_contact_channel_result.CreateContactChannelResult"
    ]:
        import capo_ssm_contacts._operations.ssm_contacts.create_contact_channel

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateContactChannel")
    )
    input_: capo_ssm_contacts.types.create_contact_channel_request.CreateContactChannelRequest = {
        "contact_id": contact_id,
        "name": name,
        "type": type,
        "delivery_address": delivery_address,
    }
    if defer_activation is not None:
        input_["defer_activation"] = defer_activation
    if idempotency_token is None:
        idempotency_token = str(uuid.uuid4())
    input_["idempotency_token"] = idempotency_token

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