NotebookRuntimeTemplate.fromJson constructor
NotebookRuntimeTemplate.fromJson(
- Object? j
Implementation
factory NotebookRuntimeTemplate.fromJson(Object? j) {
final json = j as Map<String, Object?>;
return NotebookRuntimeTemplate(
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),
},
isDefault: switch (json['isDefault']) {
null => false,
Object $1 => decodeBool($1),
},
machineSpec: switch (json['machineSpec']) {
null => null,
Object $1 => MachineSpec.fromJson($1),
},
dataPersistentDiskSpec: switch (json['dataPersistentDiskSpec']) {
null => null,
Object $1 => PersistentDiskSpec.fromJson($1),
},
networkSpec: switch (json['networkSpec']) {
null => null,
Object $1 => NetworkSpec.fromJson($1),
},
serviceAccount: switch (json['serviceAccount']) {
null => '',
Object $1 => decodeString($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'),
},
idleShutdownConfig: switch (json['idleShutdownConfig']) {
null => null,
Object $1 => NotebookIdleShutdownConfig.fromJson($1),
},
eucConfig: switch (json['eucConfig']) {
null => null,
Object $1 => NotebookEucConfig.fromJson($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),
},
notebookRuntimeType: switch (json['notebookRuntimeType']) {
null => NotebookRuntimeType.$default,
Object $1 => NotebookRuntimeType.fromJson($1),
},
shieldedVmConfig: switch (json['shieldedVmConfig']) {
null => null,
Object $1 => ShieldedVmConfig.fromJson($1),
},
networkTags: switch (json['networkTags']) {
null => [],
List<Object?> $1 => [for (final i in $1) decodeString(i)],
_ => throw const FormatException('"networkTags" is not a list'),
},
encryptionSpec: switch (json['encryptionSpec']) {
null => null,
Object $1 => EncryptionSpec.fromJson($1),
},
softwareConfig: switch (json['softwareConfig']) {
null => null,
Object $1 => NotebookSoftwareConfig.fromJson($1),
},
);
}