Skip to content

create_microsoft_teams_channel_configuration async

create_microsoft_teams_channel_configuration(
    channel_id: TeamsChannelId,
    team_id: UUID,
    tenant_id: UUID,
    iam_role_arn: Arn,
    configuration_name: ConfigurationName,
    *,
    config_overrides: Optional[AsyncchatbotClientConfig] = None,
    channel_name: Optional[TeamsChannelName] = None,
    team_name: Optional[TeamName] = None,
    sns_topic_arns: Optional[SnsTopicArnList] = None,
    logging_level: Optional[CustomerCwLogLevel] = None,
    guardrail_policy_arns: Optional[GuardrailPolicyArnList] = None,
    user_authorization_required: Optional[BooleanAccountPreference] = None,
    tags: Optional[Tags] = None,
) -> CreateTeamsChannelConfigurationResult

Creates an AWS Chatbot configuration for Microsoft Teams.

Parameters:

  • channel_id (TeamsChannelId) –

    The ID of the Microsoft Teams channel.

  • channel_name (Optional[TeamsChannelName], default: None ) –

    The name of the Microsoft Teams channel.

  • team_id (UUID) –

    The ID of the Microsoft Teams authorized with AWS Chatbot.

    To get the team ID, you must perform the initial authorization flow with Microsoft Teams in the AWS Chatbot console. Then you can copy and paste the team ID from the console. For more information, see Step 1: Configure a Microsoft Teams client in the AWS Chatbot Administrator Guide.

  • team_name (Optional[TeamName], default: None ) –

    The name of the Microsoft Teams Team.

  • tenant_id (UUID) –

    The ID of the Microsoft Teams tenant.

  • 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 (Arn) –

    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.

  • configuration_name (ConfigurationName) –

    The name of the configuration.

  • 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.

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

    A map of tags assigned to a resource. A tag is a string-to-string map of key-value pairs.

Raises:

Source code in docs_src/capo_chatbot/_services/async_chatbot.py
async def create_microsoft_teams_channel_configuration(
    self,
    channel_id: "capo_chatbot.types.teams_channel_id.TeamsChannelId",
    team_id: "capo_chatbot.types.uuid.UUID",
    tenant_id: "capo_chatbot.types.uuid.UUID",
    iam_role_arn: "capo_chatbot.types.arn.Arn",
    configuration_name: "capo_chatbot.types.configuration_name.ConfigurationName",
    *,
    config_overrides: Optional[AsyncchatbotClientConfig] = None,
    channel_name: Optional[
        "capo_chatbot.types.teams_channel_name.TeamsChannelName"
    ] = None,
    team_name: Optional["capo_chatbot.types.team_name.TeamName"] = None,
    sns_topic_arns: Optional[
        "capo_chatbot.types.sns_topic_arn_list.SnsTopicArnList"
    ] = 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,
    tags: Optional["capo_chatbot.types.tags.Tags"] = None,
) -> "capo_chatbot.types.create_teams_channel_configuration_result.CreateTeamsChannelConfigurationResult":
    """<p>Creates an AWS Chatbot configuration for Microsoft Teams.</p>

    Args:
        channel_id: <p>The ID of the Microsoft Teams channel.</p>
        channel_name: <p>The name of the Microsoft Teams channel.</p>
        team_id: <p> The ID of the Microsoft Teams authorized with AWS Chatbot.</p> <p>To get the team ID, you must perform the initial authorization flow with Microsoft Teams in the AWS Chatbot console. Then you can copy and paste the team ID from the console. For more information, see <a href="https://docs.aws.amazon.com/chatbot/latest/adminguide/teams-setup.html#teams-client-setup">Step 1: Configure a Microsoft Teams client</a> in the <i> AWS Chatbot Administrator Guide</i>. </p>
        team_name: <p>The name of the Microsoft Teams Team.</p>
        tenant_id: <p>The ID of the Microsoft Teams tenant.</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>
        configuration_name: <p>The name of the configuration.</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>
        tags: <p>A map of tags assigned to a resource. A tag is a string-to-string map of key-value pairs.</p>

    Raises:
        capo_chatbot.errors.conflict_exception.ConflictException: <p>There was an issue processing your request.</p>
        capo_chatbot.errors.create_teams_channel_configuration_exception.CreateTeamsChannelConfigurationException: <p>We can’t process your request right now because of a server issue. Try again later.</p>
        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.limit_exceeded_exception.LimitExceededException: <p>You have exceeded a service limit for AWS Chatbot.</p>
        capo_chatbot.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_chatbot.types.create_teams_channel_configuration_request.CreateTeamsChannelConfigurationRequest]",
    ) -> AsyncOperationResponse[
        "capo_chatbot.types.create_teams_channel_configuration_result.CreateTeamsChannelConfigurationResult"
    ]:
        import capo_chatbot._operations.wheatley_orchestration_20171011.create_microsoft_teams_channel_configuration

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

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

        return capo_chatbot.types.create_teams_channel_configuration_request.redact_sensitive(
            input_
        )

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

        return capo_chatbot.types.create_teams_channel_configuration_result.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateMicrosoftTeamsChannelConfiguration",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_chatbot.types.create_teams_channel_configuration_request.CreateTeamsChannelConfigurationRequest = {
        "channel_id": channel_id,
        "team_id": team_id,
        "tenant_id": tenant_id,
        "iam_role_arn": iam_role_arn,
        "configuration_name": configuration_name,
    }
    if channel_name is not None:
        input_["channel_name"] = channel_name
    if team_name is not None:
        input_["team_name"] = team_name
    if sns_topic_arns is not None:
        input_["sns_topic_arns"] = sns_topic_arns
    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
    if tags is not None:
        input_["tags"] = tags

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