createSink method

  1. @override
Future<LogSink> createSink(
  1. CreateSinkRequest request
)
override

Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's writer_identity is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.

Throws a http.ClientException if there were problems communicating with the API service. Throws a ServiceException if the API method failed for any reason.

Implementation

@override
Future<LogSink> createSink(CreateSinkRequest request) async {
  if (isClosed) throw StateError('Service is closed');

  if (_createSink case final createSink?) {
    return createSink(request);
  }
  throw UnsupportedError('createSink');
}