StoragePoolDisk.fromJson constructor

StoragePoolDisk.fromJson(
  1. Object? j
)

Implementation

factory StoragePoolDisk.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return StoragePoolDisk(
    attachedInstances: switch (json['attachedInstances']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"attachedInstances" is not a list'),
    },
    creationTimestamp: switch (json['creationTimestamp']) {
      null => null,
      Object $1 => decodeString($1),
    },
    disk: switch (json['disk']) {
      null => null,
      Object $1 => decodeString($1),
    },
    name: switch (json['name']) {
      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),
    },
    resourcePolicies: switch (json['resourcePolicies']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"resourcePolicies" is not a list'),
    },
    sizeGb: switch (json['sizeGb']) {
      null => null,
      Object $1 => decodeInt64($1),
    },
    status: switch (json['status']) {
      null => null,
      Object $1 => decodeString($1),
    },
    type: switch (json['type']) {
      null => null,
      Object $1 => decodeString($1),
    },
    usedBytes: switch (json['usedBytes']) {
      null => null,
      Object $1 => decodeInt64($1),
    },
  );
}