
    b?i                         S SK JrJrJrJrJr  S SKJrJr  S SK	J
r
  S SKJrJr  S SKJr   " S S\5      r " S S	\5      r " S
 S5      rg)    )AnyDictListOptionalcast)NotRequired	TypedDict)request)EmailAttachmentEmailAttachmentDetails)PaginationHelperc                   J    \ rS rSr% \\   \S'    \\   \S'    \\   \S'   Srg)_ListParams   limitafterbefore N)	__name__
__module____qualname____firstlineno__r   int__annotations__str__static_attributes__r       ^/var/www/html/livechat/backend/venv/lib/python3.13/site-packages/resend/emails/_attachments.pyr   r      s6    s s r   r   c                   >    \ rS rSr% \\S'    \\   \S'    \\S'   Sr	g)_ListResponse   objectdatahas_morer   N)
r   r   r   r   r   r   r   r   boolr   r   r   r   r    r       s*    K 
 Nr   r    c                       \ rS rSrSr " S S\5      r " S S\5      r\	S\
S\
S	\4S
 j5       r\	SS\
S\\   S	\4S jj5       rSrg)Attachments)   zV
Attachments class that provides methods for retrieving attachments from sent emails.
c                       \ rS rSrSrSrg)Attachments.ListParams.   a`  
ListParams is the class that wraps the parameters for the list method.

Attributes:
    limit (NotRequired[int]): The maximum number of attachments to return. Maximum 100, minimum 1.
    after (NotRequired[str]): Return attachments after this cursor for pagination.
    before (NotRequired[str]): Return attachments before this cursor for pagination.
r   Nr   r   r   r   __doc__r   r   r   r   
ListParamsr*   .       	r   r.   c                       \ rS rSrSrSrg)Attachments.ListResponse8   a  
ListResponse is the type that wraps the response for listing attachments.

Attributes:
    object (str): The object type: "list"
    data (List[EmailAttachment]): The list of attachment objects.
    has_more (bool): Whether there are more attachments available for pagination.
r   Nr,   r   r   r   ListResponser1   8   r/   r   r3   email_idattachment_idreturnc                 l    SU SU 3n[         R                  [           " U0 SS9R                  5       nU$ )aR  
Retrieve a single attachment from a sent email.
see more: https://resend.com/docs/api-reference/attachments/retrieve-sent-email-attachment

Args:
    email_id (str): The ID of the sent email
    attachment_id (str): The ID of the attachment to retrieve

Returns:
    EmailAttachmentDetails: The attachment details including download URL
/emails/z/attachments/getpathparamsverb)r
   Requestr   perform_with_content)clsr4   r5   r;   resps        r   r9   Attachments.getB   sH     (=@56
 

 	 	
 r   Nr<   c                     SU S3nU(       a  [        [        [        [        4   U5      OSn[        R                  " X45      n[
        R                  [        R                     " U0 SS9R                  5       nU$ )aH  
Retrieve a list of attachments from a sent email.
see more: https://resend.com/docs/api-reference/attachments/list-sent-email-attachments

Args:
    email_id (str): The ID of the sent email
    params (Optional[ListParams]): The list parameters for pagination

Returns:
    ListResponse: A paginated list of attachment objects
r8   z/attachmentsNr9   r:   )
r   r   r   r   build_paginated_pathr
   r>   r'   r3   r?   )r@   r4   r<   	base_pathquery_paramsr;   rA   s          r   listAttachments.listW   sq     xj5	7=tDcNF3444YM{778
 

 	 	
 r   r   )N)r   r   r   r   r-   r   r.   r    r3   classmethodr   r   r9   r   rG   r   r   r   r   r'   r'   )   sw    [ }  3 s 7M  ( C *)=   r   r'   N)typingr   r   r   r   r   typing_extensionsr   r	   resendr
   resend.emails._received_emailr   r   resend.pagination_helperr   r   r    r'   r   r   r   <module>rO      s>    2 2 4 C 5) I C Cr   