ServerCapabilities.fromJson constructor

ServerCapabilities.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory ServerCapabilities.fromJson(Map<String, dynamic> json) {
  final c = schema.ServerCapabilities.fromJson(json);
  return ServerCapabilities(
    tools: c.tools != null,
    toolsListChanged: c.tools?.listChanged ?? false,
    resources: c.resources != null,
    resourcesSubscribe: c.resources?.subscribe ?? false,
    resourcesListChanged: c.resources?.listChanged ?? false,
    prompts: c.prompts != null,
    promptsListChanged: c.prompts?.listChanged ?? false,
    logging: c.logging != null,
    completions: c.completions != null,
    tasks: c.has('tasks') ? Map<String, dynamic>.from(c['tasks'] as Map) : null,
    experimental: c.experimental,
    extensions: c.extensions,
    raw: c,
  );
}