EventData constructor
EventData({})
Constructs a new EventData instance.
TheImplementation
EventData({
required String uuid,
required this.type,
required Iterable<int> data,
Iterable<int> metadata = const [],
this.contentType = ContentTypes.ApplicationJson,
}) : _uuid = uuid,
data = UnmodifiableListView(data),
metadata = UnmodifiableListView(metadata) {
if (uuid.isEmpty) {
throw GrpcError.invalidArgument(
"Member 'uuid' can not be empty",
);
}
if (contentType != ContentTypes.ApplicationJson &&
contentType != ContentTypes.ApplicationOctetStream) {
throw GrpcError.invalidArgument(
'Only ${ContentTypes.ApplicationJson} or '
'${ContentTypes.ApplicationOctetStream} are acceptable values.',
);
}
}