Skip to content

update_slack_channel_configuration async

update_slack_channel_configuration(
    chat_configuration_arn: ChatConfigurationArn,
    slack_channel_id: SlackChannelId,
    *,
    config_overrides: Optional[AsyncchatbotClientConfig] = None,
    slack_channel_name: Optional[SlackChannelDisplayName] = None,
    sns_topic_arns: Optional[SnsTopicArnList] = None,
    iam_role_arn: Optional[Arn] = None,
    logging_level: Optional[CustomerCwLogLevel] = None,
    guardrail_policy_arns: Optional[GuardrailPolicyArnList] = None,
    user_authorization_required: Optional[BooleanAccountPreference] = None,
) -> UpdateSlackChannelConfigurationResult

Updates a Slack channel configuration.

Parameters:

  • chat_configuration_arn (ChatConfigurationArn) –

    The Amazon Resource Name (ARN) of the SlackChannelConfiguration to update.

  • slack_channel_id (SlackChannelId) –

    The ID of the Slack channel.

    To get this ID, open Slack, right click on the channel name in the left pane, then choose Copy Link. The channel ID is the 9-character string at the end of the URL. For example, ABCBBLZZZ.

  • slack_channel_name (Optional[SlackChannelDisplayName], default: None ) –

    The name of the Slack channel.

  • sns_topic_arns (Optional[SnsTopicArnList], default: None ) –

    The Amazon Resource Names (ARNs) of the SNS topics that deliver notifications to AWS Chatbot.

  • iam_role_arn (Optional[Arn], default: None ) –

    A user-defined role that AWS Chatbot assumes. This is not the service-linked role.

    For more information, see IAM policies for AWS Chatbot in the AWS Chatbot Administrator Guide.

  • logging_level (Optional[CustomerCwLogLevel], default: None ) –

    Logging levels include ERROR, INFO, or NONE.

  • guardrail_policy_arns (Optional[GuardrailPolicyArnList], default: None ) –

    The list of IAM policy ARNs that are applied as channel guardrails. The AWS managed AdministratorAccess policy is applied by default if this is not set.

  • user_authorization_required (Optional[BooleanAccountPreference], default: None ) –

    Enables use of a user role requirement in your chat configuration.

Raises:

Source code in docs_src/capo_chatbot/_services/async_chatbot.py
async def update_slack_channel_configuration(
    self,
    chat_configuration_arn: "capo_chatbot.types.chat_configuration_arn.ChatConfigurationArn",
    slack_channel_id: "capo_chatbot.types.slack_channel_id.SlackChannelId",
    *,
    config_overrides: Optional[AsyncchatbotClientConfig] = None,
    slack_channel_name: Optional[
        "capo_chatbot.types.slack_channel_display_name.SlackChannelDisplayName"
    ] = None,
    sns_topic_arns: Optional[
        "capo_chatbot.types.sns_topic_arn_list.SnsTopicArnList"
    ] = None,
    iam_role_arn: Optional["capo_chatbot.types.arn.Arn"] = None,
    logging_level: Optional[
        "capo_chatbot.types.customer_cw_log_level.CustomerCwLogLevel"
    ] = None,
    guardrail_policy_arns: Optional[
        "capo_chatbot.types.guardrail_policy_arn_list.GuardrailPolicyArnList"
    ] = None,
    user_authorization_required: Optional[
        "capo_chatbot.types.boolean_account_preference.BooleanAccountPreference"
    ] = None,
) -> "capo_chatbot.types.update_slack_channel_configuration_result.UpdateSlackChannelConfigurationResult":
    """<p>Updates a Slack channel configuration.</p>

    Args:
        chat_configuration_arn: <p>The Amazon Resource Name (ARN) of the SlackChannelConfiguration to update.</p>
        slack_channel_id: <p>The ID of the Slack channel.</p> <p>To get this ID, open Slack, right click on the channel name in the left pane, then choose Copy Link. The channel ID is the 9-character string at the end of the URL. For example, ABCBBLZZZ. </p>
        slack_channel_name: <p>The name of the Slack channel.</p>
        sns_topic_arns: <p>The Amazon Resource Names (ARNs) of the SNS topics that deliver notifications to AWS Chatbot.</p>
        iam_role_arn: <p>A user-defined role that AWS Chatbot assumes. This is not the service-linked role.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/chatbot/latest/adminguide/chatbot-iam-policies.html">IAM policies for AWS Chatbot</a> in the <i> AWS Chatbot Administrator Guide</i>. </p>
        logging_level: <p>Logging levels include <code>ERROR</code>, <code>INFO</code>, or <code>NONE</code>.</p>
        guardrail_policy_arns: <p>The list of IAM policy ARNs that are applied as channel guardrails. The AWS managed <code>AdministratorAccess</code> policy is applied by default if this is not set. </p>
        user_authorization_required: <p>Enables use of a user role requirement in your chat configuration.</p>

    Raises:
        capo_chatbot.errors.invalid_parameter_exception.InvalidParameterException: <p>Your request input doesn't meet the constraints required by AWS Chatbot.</p>
        capo_chatbot.errors.invalid_request_exception.InvalidRequestException: <p>Your request input doesn't meet the constraints required by AWS Chatbot.</p>
        capo_chatbot.errors.resource_not_found_exception.ResourceNotFoundException: <p>We were unable to find the resource for your request</p>
        capo_chatbot.errors.update_slack_channel_configuration_exception.UpdateSlackChannelConfigurationException: <p>We can’t process your request right now because of a server issue. Try again later.</p>
        capo_chatbot.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_chatbot.types.update_slack_channel_configuration_request.UpdateSlackChannelConfigurationRequest]",
    ) -> AsyncOperationResponse[
        "capo_chatbot.types.update_slack_channel_configuration_result.UpdateSlackChannelConfigurationResult"
    ]:
        import capo_chatbot._operations.wheatley_orchestration_20171011.update_slack_channel_configuration

        (
            output,
            http_response,
        ) = await capo_chatbot._operations.wheatley_orchestration_20171011.update_slack_channel_configuration.async_update_slack_channel_configuration(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_chatbot.types.update_slack_channel_configuration_request.UpdateSlackChannelConfigurationRequest",
    ) -> dict[str, Any]:
        import capo_chatbot.types.update_slack_channel_configuration_request

        return capo_chatbot.types.update_slack_channel_configuration_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_chatbot.types.update_slack_channel_configuration_result.UpdateSlackChannelConfigurationResult",
    ) -> dict[str, Any]:
        import capo_chatbot.types.update_slack_channel_configuration_result

        return capo_chatbot.types.update_slack_channel_configuration_result.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateSlackChannelConfiguration",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_chatbot.types.update_slack_channel_configuration_request.UpdateSlackChannelConfigurationRequest = {
        "chat_configuration_arn": chat_configuration_arn,
        "slack_channel_id": slack_channel_id,
    }
    if slack_channel_name is not None:
        input_["slack_channel_name"] = slack_channel_name
    if sns_topic_arns is not None:
        input_["sns_topic_arns"] = sns_topic_arns
    if iam_role_arn is not None:
        input_["iam_role_arn"] = iam_role_arn
    if logging_level is not None:
        input_["logging_level"] = logging_level
    if guardrail_policy_arns is not None:
        input_["guardrail_policy_arns"] = guardrail_policy_arns
    if user_authorization_required is not None:
        input_["user_authorization_required"] = user_authorization_required

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