
    !<i                     z    d Z ddlZddlmZ ddlmZmZmZmZm	Z	m
Z
mZ ddlmZmZ  G d deej                  ZdS )z2Base classes and interfaces for FastMCP resources.    N)	Annotated)AnyUrl	BaseModel
ConfigDictFieldUrlConstraintsValidationInfofield_validator)AnnotationsIconc                      e Zd ZU dZ ed          Z edd          Zee	 e
d          f         ed	<    ed
d          Zedz  ed<    edd          Zedz  ed<    edd          Zedz  ed<    eddd          Zeed<    edd          Zee         dz  ed<    edd          Zedz  ed<    edd          ededz  dedefd                        Zej        deez  fd             ZdS )!ResourcezBase class for all resources.T)validate_default.zURI of the resource)defaultdescriptionF)host_requiredurizName of the resourceN)r   r   namez$Human-readable title of the resourcetitlezDescription of the resourcer   z
text/plainz!MIME type of the resource contentzG^[a-zA-Z0-9]+/[a-zA-Z0-9\-+.]+(;\s*[a-zA-Z0-9\-_.]+=[a-zA-Z0-9\-_.]+)*$)r   r   pattern	mime_typez(Optional list of icons for this resourceiconsz%Optional annotations for the resourceannotationsbefore)modeinforeturnc                 ~    |r|S |j                             d          x}rt          |          S t          d          )z*Set default name from URI if not provided.r   z#Either name or uri must be provided)datagetstr
ValueError)clsr   r   r   s       /Users/kimhansen/Desktop/03 Workspace/ceo-agents/chl-effectiveness/mcp-servers/whoop/.venv/lib/python3.11/site-packages/mcp/server/fastmcp/resources/base.pyset_default_namezResource.set_default_name$   sF      	K)--&&&3 	s88O>???    c                 
   K   dS )zRead the resource content.N )selfs    r$   readzResource.read.   s       	r&   )__name__
__module____qualname____doc__r   model_configr   r   r   r   r   __annotations__r   r!   r   r   r   r   listr   r   r   r
   classmethodr	   r%   abcabstractmethodbytesr*   r(   r&   r$   r   r      s        '':t444LBG%PSavBwBwBwC6>>>>>>	?wwwu)?NNND#*NNN*PZ^___E3:___#e0MW[\\\Kt\\\U7Z  Is   
  %uT?ijjjE4:jjj&+eDFm&n&n&nKt#nnn_V(+++@C$J @n @ @ @ @ [ ,+@ 	C%K      r&   r   )r.   r3   typingr   pydanticr   r   r   r   r   r	   r
   	mcp.typesr   r   ABCr   r(   r&   r$   <module>r:      s    8 8 



                        ( ' ' ' ' ' ' '    y#'     r&   