createNotificationConfiguration method

Future<CreateNotificationConfigurationResponse> createNotificationConfiguration({
  1. required String destinationName,
  2. required EventType eventType,
  3. String? clientToken,
  4. Map<String, String>? tags,
})

Creates a notification configuration. A configuration is a connection between an event type and a destination that you have already created.

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

Parameter destinationName : The name of the destination for the notification configuration.

Parameter eventType : The type of event triggering a device notification to the customer-managed destination.

Parameter clientToken : An idempotency token. If you retry a request that completed successfully initially using the same client token and parameters, then the retry attempt will succeed without performing any further actions.

Parameter tags : A set of key/value pairs that are used to manage the notification configuration.

Implementation

Future<CreateNotificationConfigurationResponse>
    createNotificationConfiguration({
  required String destinationName,
  required EventType eventType,
  String? clientToken,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'DestinationName': destinationName,
    'EventType': eventType.value,
    'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (tags != null) 'Tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/notification-configurations',
    exceptionFnMap: _exceptionFns,
  );
  return CreateNotificationConfigurationResponse.fromJson(response);
}