Dataset.fromJson constructor
Dataset.fromJson(
- Object? j
Implementation
factory Dataset.fromJson(Object? j) {
final json = j as Map<String, Object?>;
return Dataset(
name: switch (json['name']) {
null => '',
Object $1 => decodeString($1),
},
displayName: switch (json['displayName']) {
null => '',
Object $1 => decodeString($1),
},
description: switch (json['description']) {
null => '',
Object $1 => decodeString($1),
},
metadataSchemaUri: switch (json['metadataSchemaUri']) {
null => '',
Object $1 => decodeString($1),
},
metadata: switch (json['metadata']) {
null => null,
Object $1 => protobuf.Value.fromJson($1),
},
dataItemCount: switch (json['dataItemCount']) {
null => 0,
Object $1 => decodeInt64($1),
},
createTime: switch (json['createTime']) {
null => null,
Object $1 => protobuf.Timestamp.fromJson($1),
},
updateTime: switch (json['updateTime']) {
null => null,
Object $1 => protobuf.Timestamp.fromJson($1),
},
etag: switch (json['etag']) {
null => '',
Object $1 => decodeString($1),
},
labels: switch (json['labels']) {
null => {},
Map<String, Object?> $1 => {
for (final e in $1.entries)
decodeString(e.key): decodeString(e.value),
},
_ => throw const FormatException('"labels" is not an object'),
},
savedQueries: switch (json['savedQueries']) {
null => [],
List<Object?> $1 => [for (final i in $1) SavedQuery.fromJson(i)],
_ => throw const FormatException('"savedQueries" is not a list'),
},
encryptionSpec: switch (json['encryptionSpec']) {
null => null,
Object $1 => EncryptionSpec.fromJson($1),
},
metadataArtifact: switch (json['metadataArtifact']) {
null => '',
Object $1 => decodeString($1),
},
modelReference: switch (json['modelReference']) {
null => '',
Object $1 => decodeString($1),
},
satisfiesPzs: switch (json['satisfiesPzs']) {
null => false,
Object $1 => decodeBool($1),
},
satisfiesPzi: switch (json['satisfiesPzi']) {
null => false,
Object $1 => decodeBool($1),
},
);
}