Skip to content

list_contacts async

list_contacts(
    *,
    config_overrides: Optional[AsyncSSMContactsClientConfig] = None,
    next_token: Optional[PaginationToken] = None,
    max_results: Optional[MaxResults] = None,
    alias_prefix: Optional[ContactAlias] = None,
    type: Optional[ContactType] = None,
) -> ListContactsResult

Lists all contacts and escalation plans in Incident Manager.

Parameters:

  • next_token (Optional[PaginationToken], default: None ) –

    The pagination token to continue to the next page of results.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of contacts and escalation plans per page of results.

  • alias_prefix (Optional[ContactAlias], default: None ) –

    Used to list only contacts who's aliases start with the specified prefix.

  • type (Optional[ContactType], default: None ) –

    The type of contact.

Raises:

Source code in docs_src/capo_ssm_contacts/_services/async_ssm_contacts.py
async def list_contacts(
    self,
    *,
    config_overrides: Optional[AsyncSSMContactsClientConfig] = None,
    next_token: Optional[
        "capo_ssm_contacts.types.pagination_token.PaginationToken"
    ] = None,
    max_results: Optional["capo_ssm_contacts.types.max_results.MaxResults"] = None,
    alias_prefix: Optional[
        "capo_ssm_contacts.types.contact_alias.ContactAlias"
    ] = None,
    type: Optional["capo_ssm_contacts.types.contact_type.ContactType"] = None,
) -> "capo_ssm_contacts.types.list_contacts_result.ListContactsResult":
    """<p>Lists all contacts and escalation plans in Incident Manager.</p>

    Args:
        next_token: <p>The pagination token to continue to the next page of results.</p>
        max_results: <p>The maximum number of contacts and escalation plans per page of results.</p>
        alias_prefix: <p>Used to list only contacts who's aliases start with the specified prefix.</p>
        type: <p>The type of contact.</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.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.list_contacts_request.ListContactsRequest]",
    ) -> AsyncOperationResponse[
        "capo_ssm_contacts.types.list_contacts_result.ListContactsResult"
    ]:
        import capo_ssm_contacts._operations.ssm_contacts.list_contacts

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListContacts")
    )
    input_: capo_ssm_contacts.types.list_contacts_request.ListContactsRequest = {}
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if alias_prefix is not None:
        input_["alias_prefix"] = alias_prefix
    if type is not None:
        input_["type"] = type

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