Scheduling.fromJson constructor

Scheduling.fromJson(
  1. Object? j
)

Implementation

factory Scheduling.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return Scheduling(
    automaticRestart: switch (json['automaticRestart']) {
      null => null,
      Object $1 => decodeBool($1),
    },
    availabilityDomain: switch (json['availabilityDomain']) {
      null => null,
      Object $1 => decodeInt($1),
    },
    exposeHostTopology: switch (json['exposeHostTopology']) {
      null => null,
      Object $1 => decodeBool($1),
    },
    gracefulShutdown: switch (json['gracefulShutdown']) {
      null => null,
      Object $1 => SchedulingGracefulShutdown.fromJson($1),
    },
    hostErrorTimeoutSeconds: switch (json['hostErrorTimeoutSeconds']) {
      null => null,
      Object $1 => decodeInt($1),
    },
    instanceTerminationAction: switch (json['instanceTerminationAction']) {
      null => null,
      Object $1 => decodeString($1),
    },
    localSsdRecoveryTimeout: switch (json['localSsdRecoveryTimeout']) {
      null => null,
      Object $1 => Duration.fromJson($1),
    },
    locationHint: switch (json['locationHint']) {
      null => null,
      Object $1 => decodeString($1),
    },
    maxRunDuration: switch (json['maxRunDuration']) {
      null => null,
      Object $1 => Duration.fromJson($1),
    },
    minNodeCpus: switch (json['minNodeCpus']) {
      null => null,
      Object $1 => decodeInt($1),
    },
    nodeAffinities: switch (json['nodeAffinities']) {
      null => [],
      List<Object?> $1 => [
        for (final i in $1) SchedulingNodeAffinity.fromJson(i),
      ],
      _ => throw const FormatException('"nodeAffinities" is not a list'),
    },
    onHostMaintenance: switch (json['onHostMaintenance']) {
      null => null,
      Object $1 => decodeString($1),
    },
    onInstanceStopAction: switch (json['onInstanceStopAction']) {
      null => null,
      Object $1 => SchedulingOnInstanceStopAction.fromJson($1),
    },
    preemptible: switch (json['preemptible']) {
      null => null,
      Object $1 => decodeBool($1),
    },
    preemptionNoticeDuration: switch (json['preemptionNoticeDuration']) {
      null => null,
      Object $1 => Duration.fromJson($1),
    },
    provisioningModel: switch (json['provisioningModel']) {
      null => null,
      Object $1 => decodeString($1),
    },
    skipGuestOsShutdown: switch (json['skipGuestOsShutdown']) {
      null => null,
      Object $1 => decodeBool($1),
    },
    terminationTime: switch (json['terminationTime']) {
      null => null,
      Object $1 => decodeString($1),
    },
  );
}