putEvents method

Future<PutEventsResponse> putEvents({
  1. required List<PutEventsRequestEntry> entries,
})

Sends custom events to Amazon EventBridge so that they can be matched to rules.

May throw InternalException.

Parameter entries : The entry that defines an event in your system. You can specify several parameters for the entry such as the source and type of the event, resources associated with the event, and so on.

Implementation

Future<PutEventsResponse> putEvents({
  required List<PutEventsRequestEntry> entries,
}) async {
  ArgumentError.checkNotNull(entries, 'entries');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSEvents.PutEvents'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Entries': entries,
    },
  );

  return PutEventsResponse.fromJson(jsonResponse.body);
}