AttachedDiskInitializeParams.fromJson constructor

AttachedDiskInitializeParams.fromJson(
  1. Object? j
)

Implementation

factory AttachedDiskInitializeParams.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return AttachedDiskInitializeParams(
    architecture: switch (json['architecture']) {
      null => null,
      Object $1 => decodeString($1),
    },
    description: switch (json['description']) {
      null => null,
      Object $1 => decodeString($1),
    },
    diskName: switch (json['diskName']) {
      null => null,
      Object $1 => decodeString($1),
    },
    diskSizeGb: switch (json['diskSizeGb']) {
      null => null,
      Object $1 => decodeInt64($1),
    },
    diskType: switch (json['diskType']) {
      null => null,
      Object $1 => decodeString($1),
    },
    enableConfidentialCompute: switch (json['enableConfidentialCompute']) {
      null => null,
      Object $1 => decodeBool($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'),
    },
    licenses: switch (json['licenses']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"licenses" is not a list'),
    },
    onUpdateAction: switch (json['onUpdateAction']) {
      null => null,
      Object $1 => decodeString($1),
    },
    provisionedIops: switch (json['provisionedIops']) {
      null => null,
      Object $1 => decodeInt64($1),
    },
    provisionedThroughput: switch (json['provisionedThroughput']) {
      null => null,
      Object $1 => decodeInt64($1),
    },
    replicaZones: switch (json['replicaZones']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"replicaZones" is not a list'),
    },
    resourceManagerTags: switch (json['resourceManagerTags']) {
      null => {},
      Map<String, Object?> $1 => {
        for (final e in $1.entries)
          decodeString(e.key): decodeString(e.value),
      },
      _ => throw const FormatException(
        '"resourceManagerTags" is not an object',
      ),
    },
    resourcePolicies: switch (json['resourcePolicies']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"resourcePolicies" is not a list'),
    },
    sourceImage: switch (json['sourceImage']) {
      null => null,
      Object $1 => decodeString($1),
    },
    sourceImageEncryptionKey: switch (json['sourceImageEncryptionKey']) {
      null => null,
      Object $1 => CustomerEncryptionKey.fromJson($1),
    },
    sourceSnapshot: switch (json['sourceSnapshot']) {
      null => null,
      Object $1 => decodeString($1),
    },
    sourceSnapshotEncryptionKey:
        switch (json['sourceSnapshotEncryptionKey']) {
          null => null,
          Object $1 => CustomerEncryptionKey.fromJson($1),
        },
    storagePool: switch (json['storagePool']) {
      null => null,
      Object $1 => decodeString($1),
    },
  );
}