createSlackChannelConfiguration method

Future<CreateSlackChannelConfigurationResult> createSlackChannelConfiguration({
  1. required String configurationName,
  2. required String iamRoleArn,
  3. required String slackChannelId,
  4. required String slackTeamId,
  5. List<String>? guardrailPolicyArns,
  6. String? loggingLevel,
  7. String? slackChannelName,
  8. List<String>? snsTopicArns,
  9. List<Tag>? tags,
  10. bool? userAuthorizationRequired,
})

Creates an AWS Chatbot confugration for Slack.

May throw ConflictException. May throw CreateSlackChannelConfigurationException. May throw InvalidParameterException. May throw InvalidRequestException. May throw LimitExceededException.

Parameter configurationName : The name of the configuration.

Parameter iamRoleArn : 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.

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

Parameter slackTeamId : The ID of the Slack workspace authorized with AWS Chatbot.

Parameter guardrailPolicyArns : 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.

Parameter loggingLevel : Logging levels include ERROR, INFO, or NONE.

Parameter slackChannelName : The name of the Slack channel.

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

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

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

Implementation

Future<CreateSlackChannelConfigurationResult>
    createSlackChannelConfiguration({
  required String configurationName,
  required String iamRoleArn,
  required String slackChannelId,
  required String slackTeamId,
  List<String>? guardrailPolicyArns,
  String? loggingLevel,
  String? slackChannelName,
  List<String>? snsTopicArns,
  List<Tag>? tags,
  bool? userAuthorizationRequired,
}) async {
  final $payload = <String, dynamic>{
    'ConfigurationName': configurationName,
    'IamRoleArn': iamRoleArn,
    'SlackChannelId': slackChannelId,
    'SlackTeamId': slackTeamId,
    if (guardrailPolicyArns != null)
      'GuardrailPolicyArns': guardrailPolicyArns,
    if (loggingLevel != null) 'LoggingLevel': loggingLevel,
    if (slackChannelName != null) 'SlackChannelName': slackChannelName,
    if (snsTopicArns != null) 'SnsTopicArns': snsTopicArns,
    if (tags != null) 'Tags': tags,
    if (userAuthorizationRequired != null)
      'UserAuthorizationRequired': userAuthorizationRequired,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/create-slack-channel-configuration',
    exceptionFnMap: _exceptionFns,
  );
  return CreateSlackChannelConfigurationResult.fromJson(response);
}