Skip to content

get_bot_channel_associations async

get_bot_channel_associations(
    bot_name: BotName,
    bot_alias: AliasNameOrListAll,
    *,
    config_overrides: Optional[AsyncLexModelBuildingServiceClientConfig] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
    name_contains: Optional[BotChannelName] = None,
) -> GetBotChannelAssociationsResponse

Returns a list of all of the channels associated with the specified bot.

The GetBotChannelAssociations operation requires permissions for the lex:GetBotChannelAssociations action.

Parameters:

  • bot_name (BotName) –

    The name of the Amazon Lex bot in the association.

  • bot_alias (AliasNameOrListAll) –

    An alias pointing to the specific version of the Amazon Lex bot to which this association is being made.

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

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

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

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

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

    Substring to match in channel association names. An association will be returned if any part of its name matches the substring. For example, "xyz" matches both "xyzabc" and "abcxyz." To return all bot channel associations, use a hyphen ("-") as the nameContains parameter.

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_channel_associations(
    self,
    bot_name: "capo_lex_model_building_service.types.bot_name.BotName",
    bot_alias: "capo_lex_model_building_service.types.alias_name_or_list_all.AliasNameOrListAll",
    *,
    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.bot_channel_name.BotChannelName"
    ] = None,
) -> "capo_lex_model_building_service.types.get_bot_channel_associations_response.GetBotChannelAssociationsResponse":
    """<p> Returns a list of all of the channels associated with the specified bot. </p> <p>The <code>GetBotChannelAssociations</code> operation requires permissions for the <code>lex:GetBotChannelAssociations</code> action.</p>

    Args:
        bot_name: <p>The name of the Amazon Lex bot in the association.</p>
        bot_alias: <p>An alias pointing to the specific version of the Amazon Lex bot to which this association is being made.</p>
        next_token: <p>A pagination token for fetching the next page of associations. If the response to this call is truncated, Amazon Lex returns a pagination token in the response. To fetch the next page of associations, specify the pagination token in the next request. </p>
        max_results: <p>The maximum number of associations to return in the response. The default is 50. </p>
        name_contains: <p>Substring to match in channel association names. An association will be returned if any part of its name matches the substring. For example, "xyz" matches both "xyzabc" and "abcxyz." To return all bot channel associations, use a hyphen ("-") as the <code>nameContains</code> parameter.</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_channel_associations_request.GetBotChannelAssociationsRequest]",
    ) -> AsyncOperationResponse[
        "capo_lex_model_building_service.types.get_bot_channel_associations_response.GetBotChannelAssociationsResponse"
    ]:
        import capo_lex_model_building_service._operations.aws_deep_sense_model_building_service.get_bot_channel_associations

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

    def _redact_output(
        output: "capo_lex_model_building_service.types.get_bot_channel_associations_response.GetBotChannelAssociationsResponse",
    ) -> dict[str, Any]:
        import capo_lex_model_building_service.types.get_bot_channel_associations_response

        return capo_lex_model_building_service.types.get_bot_channel_associations_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetBotChannelAssociations", redact_output=_redact_output),
    )
    input_: capo_lex_model_building_service.types.get_bot_channel_associations_request.GetBotChannelAssociationsRequest = {
        "bot_name": bot_name,
        "bot_alias": bot_alias,
    }
    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