AttachedDisk.fromJson constructor

AttachedDisk.fromJson(
  1. Object? j
)

Implementation

factory AttachedDisk.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return AttachedDisk(
    architecture: switch (json['architecture']) {
      null => null,
      Object $1 => decodeString($1),
    },
    autoDelete: switch (json['autoDelete']) {
      null => null,
      Object $1 => decodeBool($1),
    },
    boot: switch (json['boot']) {
      null => null,
      Object $1 => decodeBool($1),
    },
    deviceName: switch (json['deviceName']) {
      null => null,
      Object $1 => decodeString($1),
    },
    diskEncryptionKey: switch (json['diskEncryptionKey']) {
      null => null,
      Object $1 => CustomerEncryptionKey.fromJson($1),
    },
    diskSizeGb: switch (json['diskSizeGb']) {
      null => null,
      Object $1 => decodeInt64($1),
    },
    forceAttach: switch (json['forceAttach']) {
      null => null,
      Object $1 => decodeBool($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'),
    },
    index: switch (json['index']) {
      null => null,
      Object $1 => decodeInt($1),
    },
    initializeParams: switch (json['initializeParams']) {
      null => null,
      Object $1 => AttachedDiskInitializeParams.fromJson($1),
    },
    interface: switch (json['interface']) {
      null => null,
      Object $1 => decodeString($1),
    },
    kind: switch (json['kind']) {
      null => null,
      Object $1 => decodeString($1),
    },
    licenses: switch (json['licenses']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"licenses" is not a list'),
    },
    mode: switch (json['mode']) {
      null => null,
      Object $1 => decodeString($1),
    },
    savedState: switch (json['savedState']) {
      null => null,
      Object $1 => decodeString($1),
    },
    shieldedInstanceInitialState:
        switch (json['shieldedInstanceInitialState']) {
          null => null,
          Object $1 => InitialStateConfig.fromJson($1),
        },
    source: switch (json['source']) {
      null => null,
      Object $1 => decodeString($1),
    },
    type: switch (json['type']) {
      null => null,
      Object $1 => decodeString($1),
    },
  );
}