ServerSetSubscriptionsParams.fromJson constructor
ServerSetSubscriptionsParams.fromJson(
- JsonDecoder jsonDecoder,
- String jsonPath,
- Object? json
)
Implementation
factory ServerSetSubscriptionsParams.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
List<ServerService> subscriptions;
if (json.containsKey('subscriptions')) {
subscriptions = jsonDecoder.decodeList(
'$jsonPath.subscriptions',
json['subscriptions'],
(String jsonPath, Object? json) =>
ServerService.fromJson(jsonDecoder, jsonPath, json));
} else {
throw jsonDecoder.mismatch(jsonPath, 'subscriptions');
}
return ServerSetSubscriptionsParams(subscriptions);
} else {
throw jsonDecoder.mismatch(
jsonPath, 'server.setSubscriptions params', json);
}
}