PredictLongRunningRequest.fromJson constructor
PredictLongRunningRequest.fromJson(
- 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.containsKey('parameters'),
json['parameters'],
)) {
(false, _) => null,
(true, Object? $1) => Value.fromJson($1),
},
);
}