createNotificationConfiguration method

Future<CreateNotificationConfigurationResponse> createNotificationConfiguration({
  1. required String description,
  2. required String name,
  3. AggregationDuration? aggregationDuration,
  4. Map<String, String>? tags,
})

Creates a new NotificationConfiguration.

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

Parameter description : The description of the NotificationConfiguration.

Parameter name : The name of the NotificationConfiguration. Supports RFC 3986's unreserved characters.

Parameter aggregationDuration : The aggregation preference of the NotificationConfiguration.

  • Values:
    • LONG
      • Aggregate notifications for long periods of time (12 hours).
    • SHORT
      • Aggregate notifications for short periods of time (5 minutes).
    • NONE
      • Don't aggregate notifications.

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

Implementation

Future<CreateNotificationConfigurationResponse>
    createNotificationConfiguration({
  required String description,
  required String name,
  AggregationDuration? aggregationDuration,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'description': description,
    'name': name,
    if (aggregationDuration != null)
      'aggregationDuration': aggregationDuration.value,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/notification-configurations',
    exceptionFnMap: _exceptionFns,
  );
  return CreateNotificationConfigurationResponse.fromJson(response);
}