SuggestTrialsRequest.fromJson constructor
SuggestTrialsRequest.fromJson(
- Object? j
Implementation
factory SuggestTrialsRequest.fromJson(Object? j) {
final json = j as Map<String, Object?>;
return SuggestTrialsRequest(
parent: switch (json['parent']) {
null => '',
Object $1 => decodeString($1),
},
suggestionCount: switch (json['suggestionCount']) {
null => 0,
Object $1 => decodeInt($1),
},
clientId: switch (json['clientId']) {
null => '',
Object $1 => decodeString($1),
},
contexts: switch (json['contexts']) {
null => [],
List<Object?> $1 => [for (final i in $1) TrialContext.fromJson(i)],
_ => throw const FormatException('"contexts" is not a list'),
},
);
}