AnalysisSetGeneralSubscriptionsParams.fromJson constructor

AnalysisSetGeneralSubscriptionsParams.fromJson(
  1. JsonDecoder jsonDecoder,
  2. String jsonPath,
  3. Object? json
)

Implementation

factory AnalysisSetGeneralSubscriptionsParams.fromJson(
    JsonDecoder jsonDecoder, String jsonPath, Object? json) {
  json ??= {};
  if (json is Map) {
    List<GeneralAnalysisService> subscriptions;
    if (json.containsKey('subscriptions')) {
      subscriptions = jsonDecoder.decodeList(
          '$jsonPath.subscriptions',
          json['subscriptions'],
          (String jsonPath, Object? json) =>
              GeneralAnalysisService.fromJson(jsonDecoder, jsonPath, json));
    } else {
      throw jsonDecoder.mismatch(jsonPath, 'subscriptions');
    }
    return AnalysisSetGeneralSubscriptionsParams(subscriptions);
  } else {
    throw jsonDecoder.mismatch(
        jsonPath, 'analysis.setGeneralSubscriptions params', json);
  }
}