UpcomingMaintenance.fromJson constructor

UpcomingMaintenance.fromJson(
  1. Object? j
)

Implementation

factory UpcomingMaintenance.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return UpcomingMaintenance(
    canReschedule: switch (json['canReschedule']) {
      null => null,
      Object $1 => decodeBool($1),
    },
    latestWindowStartTime: switch (json['latestWindowStartTime']) {
      null => null,
      Object $1 => decodeString($1),
    },
    maintenanceOnShutdown: switch (json['maintenanceOnShutdown']) {
      null => null,
      Object $1 => decodeBool($1),
    },
    maintenanceReasons: switch (json['maintenanceReasons']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"maintenanceReasons" is not a list'),
    },
    maintenanceStatus: switch (json['maintenanceStatus']) {
      null => null,
      Object $1 => decodeString($1),
    },
    type: switch (json['type']) {
      null => null,
      Object $1 => decodeString($1),
    },
    windowEndTime: switch (json['windowEndTime']) {
      null => null,
      Object $1 => decodeString($1),
    },
    windowStartTime: switch (json['windowStartTime']) {
      null => null,
      Object $1 => decodeString($1),
    },
  );
}