Resource.toMCP constructor

Resource.toMCP(
  1. Map<String, Object?> map
)

Implementation

factory Resource.toMCP(Map<String, Object?> map) {
  return Resource(
    icons: (map['icons'] as List<dynamic>?)
        ?.map((e) => Icon.toMCP(e as Map<String, Object?>))
        .toList(),
    name: map['name'] as String,
    title: map['title'] as String?,
    uri: map['uri'] as String,
    description: map['description'] as String?,
    mimeType: map['mimeType'] as String?,
    annotations: map['annotations'] != null
        ? Annotations.toMCP(map['annotations'] as Map<String, Object?>)
        : null,
    size: map['size'] as int?,
    $meta: map['_meta'] != null
        ? MetaObject.toMCP(map['_meta'] as Map<String, Object?>)
        : null,
  );
}