AllocationAggregateReservation.fromJson constructor

AllocationAggregateReservation.fromJson(
  1. Object? j
)

Implementation

factory AllocationAggregateReservation.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return AllocationAggregateReservation(
    inUseResources: switch (json['inUseResources']) {
      null => [],
      List<Object?> $1 => [
        for (final i in $1)
          AllocationAggregateReservationReservedResourceInfo.fromJson(i),
      ],
      _ => throw const FormatException('"inUseResources" is not a list'),
    },
    reservedResources: switch (json['reservedResources']) {
      null => [],
      List<Object?> $1 => [
        for (final i in $1)
          AllocationAggregateReservationReservedResourceInfo.fromJson(i),
      ],
      _ => throw const FormatException('"reservedResources" is not a list'),
    },
    vmFamily: switch (json['vmFamily']) {
      null => null,
      Object $1 => decodeString($1),
    },
    workloadType: switch (json['workloadType']) {
      null => null,
      Object $1 => decodeString($1),
    },
  );
}