
    Dj9                        d Z ddlmZ ddlmZ ddlmZmZ  G d de          Z edd           G d	 d
                      Z	dS )a  
Transport-agnostic renderer interface for Apple Notes.

Defines the minimal datasource seam (`NoteDataSource`) that the renderer
requires to resolve:
  - the UTI of an embedded attachment (by identifier), and
  - the mergeable table bytes (gzipped) for table attachments.

Optional richer datasource capabilities (if present) may include:
  - get_primary_asset_url(identifier)
  - get_thumbnail_url(identifier)
  - get_title(identifier)

The renderer never performs I/O; it only calls this interface.
    )annotations)	dataclass)OptionalProtocolc                  "    e Zd ZdZd
dZddZd	S )NoteDataSourcez7Minimal attachment datasource required by the renderer.
identifierstrreturnOptional[str]c                    d S N selfr	   s     k/home/thesage/.hermes/venv/lib/python3.11/site-packages/pyicloud/services/notes/rendering/renderer_iface.pyget_attachment_utiz!NoteDataSource.get_attachment_uti             Optional[bytes]c                    d S r   r   r   s     r   get_mergeable_gzzNoteDataSource.get_mergeable_gz   r   r   N)r	   r
   r   r   )r	   r
   r   r   )__name__
__module____qualname____doc__r   r   r   r   r   r   r      s.        AAGGGGGGGGGGr   r   T)frozenslotsc                  8    e Zd ZU dZdZded<   dZded<   d
d	ZdS )AttachmentRefz:Lightweight reference created while walking AttributeRuns.Nr   r	   uti_hint
datasourceOptional[NoteDataSource]r   c                h    | j         r| j         S |r!| j        r|                    | j                  S d S r   )r!   r	   r   )r   r"   s     r   resolved_utizAttachmentRef.resolved_uti&   sB    = 	!=  	B$/ 	B00AAAtr   )r"   r#   r   r   )r   r   r   r   r	   __annotations__r!   r%   r   r   r   r    r       sR         DD $J$$$$"H""""     r   r    N)
r   
__future__r   dataclassesr   typingr   r   r   r    r   r   r   <module>r*      s      # " " " " " ! ! ! ! ! ! % % % % % % % %H H H H HX H H H $d###       $#  r   