Skip to content

create_contact

create_contact(
    alias: ContactAlias,
    type: ContactType,
    plan: Plan,
    *,
    config_overrides: Optional[SSMContactsClientConfig] = None,
    display_name: Optional[ContactName] = None,
    tags: Optional[TagsList] = None,
    idempotency_token: Optional[IdempotencyToken] = None,
) -> CreateContactResult

Contacts are either the contacts that Incident Manager engages during an incident or the escalation plans that Incident Manager uses to engage contacts in phases during an incident.

Parameters:

  • alias (ContactAlias) –

    The short name to quickly identify a contact or escalation plan. The contact alias must be unique and identifiable.

  • display_name (Optional[ContactName], default: None ) –

    The full name of the contact or escalation plan.

  • type (ContactType) –

    The type of contact to create.

    • PERSONAL: A single, individual contact.

    • ESCALATION: An escalation plan.

    • ONCALL_SCHEDULE: An on-call schedule.

  • plan (Plan) –

    A list of stages. A contact has an engagement plan with stages that contact specified contact channels. An escalation plan uses stages that contact specified contacts.

  • tags (Optional[TagsList], default: None ) –

    Adds a tag to the target. You can only tag resources created in the first Region of your replication set.

  • 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 create_contact(
    self,
    alias: "capo_ssm_contacts.types.contact_alias.ContactAlias",
    type: "capo_ssm_contacts.types.contact_type.ContactType",
    plan: "capo_ssm_contacts.types.plan.Plan",
    *,
    config_overrides: Optional[SSMContactsClientConfig] = None,
    display_name: Optional[
        "capo_ssm_contacts.types.contact_name.ContactName"
    ] = None,
    tags: Optional["capo_ssm_contacts.types.tags_list.TagsList"] = None,
    idempotency_token: Optional[
        "capo_ssm_contacts.types.idempotency_token.IdempotencyToken"
    ] = None,
) -> "capo_ssm_contacts.types.create_contact_result.CreateContactResult":
    """<p>Contacts are either the contacts that Incident Manager engages during an incident or the escalation plans that Incident Manager uses to engage contacts in phases during an incident.</p>

    Args:
        alias: <p>The short name to quickly identify a contact or escalation plan. The contact alias must be unique and identifiable.</p>
        display_name: <p>The full name of the contact or escalation plan.</p>
        type: <p>The type of contact to create.</p> <ul> <li> <p> <code>PERSONAL</code>: A single, individual contact.</p> </li> <li> <p> <code>ESCALATION</code>: An escalation plan.</p> </li> <li> <p> <code>ONCALL_SCHEDULE</code>: An on-call schedule.</p> </li> </ul>
        plan: <p>A list of stages. A contact has an engagement plan with stages that contact specified contact channels. An escalation plan uses stages that contact specified contacts.</p>
        tags: <p>Adds a tag to the target. You can only tag resources created in the first Region of your replication set.</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.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Request would cause a service quota to be exceeded.</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.create_contact_request.CreateContactRequest]",
    ) -> OperationResponse[
        "capo_ssm_contacts.types.create_contact_result.CreateContactResult"
    ]:
        import capo_ssm_contacts._operations.ssm_contacts.create_contact

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateContact")
    )
    input_: capo_ssm_contacts.types.create_contact_request.CreateContactRequest = {
        "alias": alias,
        "type": type,
        "plan": plan,
    }
    if display_name is not None:
        input_["display_name"] = display_name
    if tags is not None:
        input_["tags"] = tags
    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