StoragePoolsScopedList.fromJson constructor

StoragePoolsScopedList.fromJson(
  1. Object? j
)

Implementation

factory StoragePoolsScopedList.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return StoragePoolsScopedList(
    storagePools: switch (json['storagePools']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) StoragePool.fromJson(i)],
      _ => throw const FormatException('"storagePools" is not a list'),
    },
    warning: switch (json['warning']) {
      null => null,
      Object $1 => Warning.fromJson($1),
    },
  );
}