createEventIntegration method
Creates an EventIntegration, given a specified name, description, and a reference to an Amazon EventBridge bus in your account and a partner event source that pushes events to that bus. No objects are created in the your account, only metadata that is persisted on the EventIntegration control plane.
May throw AccessDeniedException.
May throw DuplicateResourceException.
May throw InternalServiceError.
May throw InvalidRequestException.
May throw ResourceQuotaExceededException.
May throw ThrottlingException.
Parameter eventBridgeBus :
The EventBridge bus.
Parameter eventFilter :
The event filter.
Parameter name :
The name of the event integration.
Parameter clientToken :
A unique, case-sensitive identifier that you provide to ensure the
idempotency of the request. If not provided, the Amazon Web Services SDK
populates this field. For more information about idempotency, see Making
retries safe with idempotent APIs.
Parameter description :
The description of the event integration.
Parameter tags :
The tags used to organize, track, or control access for this resource. For
example, { "tags": {"key1":"value1", "key2":"value2"} }.
Implementation
Future<CreateEventIntegrationResponse> createEventIntegration({
required String eventBridgeBus,
required EventFilter eventFilter,
required String name,
String? clientToken,
String? description,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'EventBridgeBus': eventBridgeBus,
'EventFilter': eventFilter,
'Name': name,
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
if (description != null) 'Description': description,
if (tags != null) 'Tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/eventIntegrations',
exceptionFnMap: _exceptionFns,
);
return CreateEventIntegrationResponse.fromJson(response);
}