createDestination method

Future<CreateDestinationResponse> createDestination({
  1. required String deliveryDestinationArn,
  2. required DeliveryDestinationType deliveryDestinationType,
  3. required String name,
  4. required String roleArn,
  5. String? clientToken,
  6. String? description,
  7. Map<String, String>? tags,
})

Create a notification destination such as Kinesis Data Streams that receive events and notifications from Managed integrations. Managed integrations uses the destination to determine where to deliver notifications.

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

Parameter deliveryDestinationArn : The Amazon Resource Name (ARN) of the customer-managed destination.

Parameter deliveryDestinationType : The destination type for the customer-managed destination.

Parameter name : The name of the customer-managed destination.

Parameter roleArn : The Amazon Resource Name (ARN) of the delivery destination role.

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 description : The description of the customer-managed destination.

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

Implementation

Future<CreateDestinationResponse> createDestination({
  required String deliveryDestinationArn,
  required DeliveryDestinationType deliveryDestinationType,
  required String name,
  required String roleArn,
  String? clientToken,
  String? description,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'DeliveryDestinationArn': deliveryDestinationArn,
    'DeliveryDestinationType': deliveryDestinationType.value,
    'Name': name,
    'RoleArn': roleArn,
    'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (description != null) 'Description': description,
    if (tags != null) 'Tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/destinations',
    exceptionFnMap: _exceptionFns,
  );
  return CreateDestinationResponse.fromJson(response);
}