BatchGetDocumentsRequest.fromJson constructor
BatchGetDocumentsRequest.fromJson(
- Object? j
Implementation
factory BatchGetDocumentsRequest.fromJson(Object? j) {
final json = j as Map<String, Object?>;
return BatchGetDocumentsRequest(
database: switch (json['database']) {
null => '',
Object $1 => decodeString($1),
},
documents: switch (json['documents']) {
null => [],
List<Object?> $1 => [for (final i in $1) decodeString(i)],
_ => throw const FormatException('"documents" is not a list'),
},
mask: switch (json['mask']) {
null => null,
Object $1 => DocumentMask.fromJson($1),
},
transaction: switch (json['transaction']) {
null => null,
Object $1 => decodeBytes($1),
},
newTransaction: switch (json['newTransaction']) {
null => null,
Object $1 => TransactionOptions.fromJson($1),
},
readTime: switch (json['readTime']) {
null => null,
Object $1 => Timestamp.fromJson($1),
},
);
}