createSlackChannelConfiguration method

Future<void> createSlackChannelConfiguration({
  1. required String channelId,
  2. required String channelRoleArn,
  3. required NotificationSeverityLevel notifyOnCaseSeverity,
  4. required String teamId,
  5. String? channelName,
  6. bool? notifyOnAddCorrespondenceToCase,
  7. bool? notifyOnCreateOrReopenCase,
  8. bool? notifyOnResolveCase,
})

Creates a Slack channel configuration for your Amazon Web Services account.

  • You can add up to 5 Slack workspaces for your account.
  • You can add up to 20 Slack channels for your account.
A Slack channel can have up to 100 Amazon Web Services accounts. This means that only 100 accounts can add the same Slack channel to the Amazon Web Services Support App. We recommend that you only add the accounts that you need to manage support cases for your organization. This can reduce the notifications about case updates that you receive in the Slack channel.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ServiceQuotaExceededException. May throw ValidationException.

Parameter channelId : The channel ID in Slack. This ID identifies a channel within a Slack workspace.

Parameter channelRoleArn : The Amazon Resource Name (ARN) of an IAM role that you want to use to perform operations on Amazon Web Services. For more information, see Managing access to the Amazon Web Services Support App in the Amazon Web Services Support User Guide.

Parameter notifyOnCaseSeverity : The case severity for a support case that you want to receive notifications.

If you specify high or all, you must specify true for at least one of the following parameters:

  • notifyOnAddCorrespondenceToCase
  • notifyOnCreateOrReopenCase
  • notifyOnResolveCase
If you specify none, the following parameters must be null or false:
  • notifyOnAddCorrespondenceToCase
  • notifyOnCreateOrReopenCase
  • notifyOnResolveCase

Parameter teamId : The team ID in Slack. This ID uniquely identifies a Slack workspace, such as T012ABCDEFG.

Parameter channelName : The name of the Slack channel that you configure for the Amazon Web Services Support App.

Parameter notifyOnAddCorrespondenceToCase : Whether you want to get notified when a support case has a new correspondence.

Parameter notifyOnCreateOrReopenCase : Whether you want to get notified when a support case is created or reopened.

Parameter notifyOnResolveCase : Whether you want to get notified when a support case is resolved.

Implementation

Future<void> createSlackChannelConfiguration({
  required String channelId,
  required String channelRoleArn,
  required NotificationSeverityLevel notifyOnCaseSeverity,
  required String teamId,
  String? channelName,
  bool? notifyOnAddCorrespondenceToCase,
  bool? notifyOnCreateOrReopenCase,
  bool? notifyOnResolveCase,
}) async {
  final $payload = <String, dynamic>{
    'channelId': channelId,
    'channelRoleArn': channelRoleArn,
    'notifyOnCaseSeverity': notifyOnCaseSeverity.value,
    'teamId': teamId,
    if (channelName != null) 'channelName': channelName,
    if (notifyOnAddCorrespondenceToCase != null)
      'notifyOnAddCorrespondenceToCase': notifyOnAddCorrespondenceToCase,
    if (notifyOnCreateOrReopenCase != null)
      'notifyOnCreateOrReopenCase': notifyOnCreateOrReopenCase,
    if (notifyOnResolveCase != null)
      'notifyOnResolveCase': notifyOnResolveCase,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/control/create-slack-channel-configuration',
    exceptionFnMap: _exceptionFns,
  );
}