UpsertExamplesRequest.fromJson constructor
UpsertExamplesRequest.fromJson(
- Object? j
Implementation
factory UpsertExamplesRequest.fromJson(Object? j) {
final json = j as Map<String, Object?>;
return UpsertExamplesRequest(
exampleStore: switch (json['exampleStore']) {
null => '',
Object $1 => decodeString($1),
},
examples: switch (json['examples']) {
null => [],
List<Object?> $1 => [for (final i in $1) Example.fromJson(i)],
_ => throw const FormatException('"examples" is not a list'),
},
overwrite: switch (json['overwrite']) {
null => false,
Object $1 => decodeBool($1),
},
);
}