AnalysisUpdateOptionsParams.fromJson constructor

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

Implementation

factory AnalysisUpdateOptionsParams.fromJson(
    JsonDecoder jsonDecoder, String jsonPath, Object? json) {
  json ??= {};
  if (json is Map) {
    AnalysisOptions options;
    if (json.containsKey('options')) {
      options = AnalysisOptions.fromJson(
          jsonDecoder, '$jsonPath.options', json['options']);
    } else {
      throw jsonDecoder.mismatch(jsonPath, 'options');
    }
    return AnalysisUpdateOptionsParams(options);
  } else {
    throw jsonDecoder.mismatch(
        jsonPath, 'analysis.updateOptions params', json);
  }
}