InstantSnapshot.fromJson constructor
InstantSnapshot.fromJson(
- Object? j
Implementation
factory InstantSnapshot.fromJson(Object? j) {
final json = j as Map<String, Object?>;
return InstantSnapshot(
architecture: switch (json['architecture']) {
null => null,
Object $1 => decodeString($1),
},
creationTimestamp: switch (json['creationTimestamp']) {
null => null,
Object $1 => decodeString($1),
},
description: switch (json['description']) {
null => null,
Object $1 => decodeString($1),
},
diskSizeGb: switch (json['diskSizeGb']) {
null => null,
Object $1 => decodeInt64($1),
},
id: switch (json['id']) {
null => null,
Object $1 => decodeUint64($1),
},
kind: switch (json['kind']) {
null => null,
Object $1 => decodeString($1),
},
labelFingerprint: switch (json['labelFingerprint']) {
null => 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'),
},
name: switch (json['name']) {
null => null,
Object $1 => decodeString($1),
},
params: switch (json['params']) {
null => null,
Object $1 => InstantSnapshotParams.fromJson($1),
},
region: switch (json['region']) {
null => null,
Object $1 => decodeString($1),
},
resourceStatus: switch (json['resourceStatus']) {
null => null,
Object $1 => InstantSnapshotResourceStatus.fromJson($1),
},
satisfiesPzi: switch (json['satisfiesPzi']) {
null => null,
Object $1 => decodeBool($1),
},
satisfiesPzs: switch (json['satisfiesPzs']) {
null => null,
Object $1 => decodeBool($1),
},
selfLink: switch (json['selfLink']) {
null => null,
Object $1 => decodeString($1),
},
selfLinkWithId: switch (json['selfLinkWithId']) {
null => null,
Object $1 => decodeString($1),
},
sourceDisk: switch (json['sourceDisk']) {
null => null,
Object $1 => decodeString($1),
},
sourceDiskId: switch (json['sourceDiskId']) {
null => null,
Object $1 => decodeString($1),
},
sourceInstantSnapshotGroup: switch (json['sourceInstantSnapshotGroup']) {
null => null,
Object $1 => decodeString($1),
},
sourceInstantSnapshotGroupId:
switch (json['sourceInstantSnapshotGroupId']) {
null => null,
Object $1 => decodeString($1),
},
status: switch (json['status']) {
null => null,
Object $1 => decodeString($1),
},
zone: switch (json['zone']) {
null => null,
Object $1 => decodeString($1),
},
);
}