PredictLongRunningRequest.fromJson constructor

PredictLongRunningRequest.fromJson(
  1. Object? j
)

Implementation

factory PredictLongRunningRequest.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return PredictLongRunningRequest(
    model: switch (json['model']) {
      null => '',
      Object $1 => decodeString($1),
    },
    instances: switch (json['instances']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) Value.fromJson(i)],
      _ => throw const FormatException('"instances" is not a list'),
    },
    parameters: switch (json['parameters']) {
      null => null,
      Object $1 => Value.fromJson($1),
    },
  );
}