createSlackChannelConfiguration method
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.
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
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,
);
}