Skip to content

get_bot_aliases async

get_bot_aliases(
    bot_name: BotName,
    *,
    config_overrides: Optional[AsyncLexModelBuildingServiceClientConfig] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
    name_contains: Optional[AliasName] = None,
) -> GetBotAliasesResponse

Returns a list of aliases for a specified Amazon Lex bot.

This operation requires permissions for the lex:GetBotAliases action.

Parameters:

  • bot_name (BotName) –

    The name of the bot.

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

    A pagination token for fetching the next page of aliases. If the response to this call is truncated, Amazon Lex returns a pagination token in the response. To fetch the next page of aliases, specify the pagination token in the next request.

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

    The maximum number of aliases to return in the response. The default is 50. .

  • name_contains (Optional[AliasName], default: None ) –

    Substring to match in bot alias names. An alias will be returned if any part of its name matches the substring. For example, "xyz" matches both "xyzabc" and "abcxyz."

Raises:

  • BadRequestException –

    The request is not well formed. For example, a value is invalid or a required field is missing. Check the field values, and try again.

  • InternalFailureException –

    An internal Amazon Lex error occurred. Try your request again.

  • LimitExceededException –

    The request exceeded a limit. Try your request again.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_lex_model_building_service/_services/async_lex_model_building_service.py
async def get_bot_aliases(
    self,
    bot_name: "capo_lex_model_building_service.types.bot_name.BotName",
    *,
    config_overrides: Optional[AsyncLexModelBuildingServiceClientConfig] = None,
    next_token: Optional[
        "capo_lex_model_building_service.types.next_token.NextToken"
    ] = None,
    max_results: Optional[
        "capo_lex_model_building_service.types.max_results.MaxResults"
    ] = None,
    name_contains: Optional[
        "capo_lex_model_building_service.types.alias_name.AliasName"
    ] = None,
) -> "capo_lex_model_building_service.types.get_bot_aliases_response.GetBotAliasesResponse":
    """<p>Returns a list of aliases for a specified Amazon Lex bot.</p> <p>This operation requires permissions for the <code>lex:GetBotAliases</code> action.</p>

    Args:
        bot_name: <p>The name of the bot.</p>
        next_token: <p>A pagination token for fetching the next page of aliases. If the response to this call is truncated, Amazon Lex returns a pagination token in the response. To fetch the next page of aliases, specify the pagination token in the next request. </p>
        max_results: <p>The maximum number of aliases to return in the response. The default is 50. . </p>
        name_contains: <p>Substring to match in bot alias names. An alias will be returned if any part of its name matches the substring. For example, "xyz" matches both "xyzabc" and "abcxyz."</p>

    Raises:
        capo_lex_model_building_service.errors.bad_request_exception.BadRequestException: <p>The request is not well formed. For example, a value is invalid or a required field is missing. Check the field values, and try again.</p>
        capo_lex_model_building_service.errors.internal_failure_exception.InternalFailureException: <p>An internal Amazon Lex error occurred. Try your request again.</p>
        capo_lex_model_building_service.errors.limit_exceeded_exception.LimitExceededException: <p>The request exceeded a limit. Try your request again.</p>
        capo_lex_model_building_service.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_lex_model_building_service.types.get_bot_aliases_request.GetBotAliasesRequest]",
    ) -> AsyncOperationResponse[
        "capo_lex_model_building_service.types.get_bot_aliases_response.GetBotAliasesResponse"
    ]:
        import capo_lex_model_building_service._operations.aws_deep_sense_model_building_service.get_bot_aliases

        (
            output,
            http_response,
        ) = await capo_lex_model_building_service._operations.aws_deep_sense_model_building_service.get_bot_aliases.async_get_bot_aliases(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetBotAliases")
    )
    input_: capo_lex_model_building_service.types.get_bot_aliases_request.GetBotAliasesRequest = {
        "bot_name": bot_name
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if name_contains is not None:
        input_["name_contains"] = name_contains

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