AssistDescription.fromJson constructor

AssistDescription.fromJson(
  1. JsonDecoder jsonDecoder,
  2. String jsonPath,
  3. Object? json, {
  4. ClientUriConverter? clientUriConverter,
})

Implementation

factory AssistDescription.fromJson(
  JsonDecoder jsonDecoder,
  String jsonPath,
  Object? json, {
  ClientUriConverter? clientUriConverter,
}) {
  json ??= {};
  if (json is! Map) {
    throw jsonDecoder.mismatch(jsonPath, "'AssistDescription'", json);
  }
  String id;
  if (json case {'id': var encodedId}) {
    id = jsonDecoder.decodeString('$jsonPath.id', encodedId);
  } else {
    throw jsonDecoder.mismatch(jsonPath, "'id'", json);
  }
  String message;
  if (json case {'message': var encodedMessage}) {
    message = jsonDecoder.decodeString('$jsonPath.message', encodedMessage);
  } else {
    throw jsonDecoder.mismatch(jsonPath, "'message'", json);
  }
  return AssistDescription(id, message);
}