copyWith method

CallToolResultResponse copyWith({
  1. Object? id,
  2. Map<String, Object?>? result,
})

A copy with the given properties replaced; everything else, unknown keys included, is kept.

Implementation

CallToolResultResponse copyWith({
  Object? id,
  Map<String, Object?>? result,
}) =>
    CallToolResultResponse.fromJson({
      ...toJson(),
      if (id != null) 'id': $encode(id),
      if (result != null) 'result': $encode(result),
    });