Image.fromJson constructor

Image.fromJson(
  1. Object? j
)

Implementation

factory Image.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return Image(
    architecture: switch (json['architecture']) {
      null => null,
      Object $1 => decodeString($1),
    },
    archiveSizeBytes: switch (json['archiveSizeBytes']) {
      null => null,
      Object $1 => decodeInt64($1),
    },
    creationTimestamp: switch (json['creationTimestamp']) {
      null => null,
      Object $1 => decodeString($1),
    },
    deprecated: switch (json['deprecated']) {
      null => null,
      Object $1 => DeprecationStatus.fromJson($1),
    },
    description: switch (json['description']) {
      null => null,
      Object $1 => decodeString($1),
    },
    diskSizeGb: switch (json['diskSizeGb']) {
      null => null,
      Object $1 => decodeInt64($1),
    },
    enableConfidentialCompute: switch (json['enableConfidentialCompute']) {
      null => null,
      Object $1 => decodeBool($1),
    },
    family: switch (json['family']) {
      null => null,
      Object $1 => decodeString($1),
    },
    guestOsFeatures: switch (json['guestOsFeatures']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) GuestOsFeature.fromJson(i)],
      _ => throw const FormatException('"guestOsFeatures" is not a list'),
    },
    id: switch (json['id']) {
      null => null,
      Object $1 => decodeUint64($1),
    },
    imageEncryptionKey: switch (json['imageEncryptionKey']) {
      null => null,
      Object $1 => CustomerEncryptionKey.fromJson($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'),
    },
    licenseCodes: switch (json['licenseCodes']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeInt64(i)],
      _ => throw const FormatException('"licenseCodes" is not a list'),
    },
    licenses: switch (json['licenses']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"licenses" is not a list'),
    },
    name: switch (json['name']) {
      null => null,
      Object $1 => decodeString($1),
    },
    params: switch (json['params']) {
      null => null,
      Object $1 => ImageParams.fromJson($1),
    },
    rawDisk: switch (json['rawDisk']) {
      null => null,
      Object $1 => RawDisk.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),
    },
    shieldedInstanceInitialState:
        switch (json['shieldedInstanceInitialState']) {
          null => null,
          Object $1 => InitialStateConfig.fromJson($1),
        },
    sourceDisk: switch (json['sourceDisk']) {
      null => null,
      Object $1 => decodeString($1),
    },
    sourceDiskEncryptionKey: switch (json['sourceDiskEncryptionKey']) {
      null => null,
      Object $1 => CustomerEncryptionKey.fromJson($1),
    },
    sourceDiskId: switch (json['sourceDiskId']) {
      null => null,
      Object $1 => decodeString($1),
    },
    sourceImage: switch (json['sourceImage']) {
      null => null,
      Object $1 => decodeString($1),
    },
    sourceImageEncryptionKey: switch (json['sourceImageEncryptionKey']) {
      null => null,
      Object $1 => CustomerEncryptionKey.fromJson($1),
    },
    sourceImageId: switch (json['sourceImageId']) {
      null => null,
      Object $1 => decodeString($1),
    },
    sourceSnapshot: switch (json['sourceSnapshot']) {
      null => null,
      Object $1 => decodeString($1),
    },
    sourceSnapshotEncryptionKey:
        switch (json['sourceSnapshotEncryptionKey']) {
          null => null,
          Object $1 => CustomerEncryptionKey.fromJson($1),
        },
    sourceSnapshotId: switch (json['sourceSnapshotId']) {
      null => null,
      Object $1 => decodeString($1),
    },
    sourceType: switch (json['sourceType']) {
      null => null,
      Object $1 => decodeString($1),
    },
    status: switch (json['status']) {
      null => null,
      Object $1 => decodeString($1),
    },
    storageLocations: switch (json['storageLocations']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"storageLocations" is not a list'),
    },
  );
}