WriteResponse.fromJson constructor
WriteResponse.fromJson(
- Object? j
Implementation
factory WriteResponse.fromJson(Object? j) {
final json = j as Map<String, Object?>;
return WriteResponse(
streamId: switch (json['streamId']) {
null => '',
Object $1 => decodeString($1),
},
streamToken: switch (json['streamToken']) {
null => Uint8List(0),
Object $1 => decodeBytes($1),
},
writeResults: switch (json['writeResults']) {
null => [],
List<Object?> $1 => [for (final i in $1) WriteResult.fromJson(i)],
_ => throw const FormatException('"writeResults" is not a list'),
},
commitTime: switch (json['commitTime']) {
null => null,
Object $1 => Timestamp.fromJson($1),
},
);
}