
    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 " S S5      rg)    )AnyDictListOptionalcast)NotRequired	TypedDict)request)ReceivedEmailAttachmentReceivedEmailAttachmentDetails)PaginationHelperc                   *    \ rS rSr% \\S'   \\S'   Srg)_GetAttachmentResponse   objectdata N)__name__
__module____qualname____firstlineno__str__annotations__r   __static_attributes__r       a/var/www/html/livechat/backend/venv/lib/python3.13/site-packages/resend/attachments/_receiving.pyr   r      s    K
((r   r   c                   J    \ rS rSr% \\   \S'    \\   \S'    \\   \S'   Srg)_ListParams   limitafterbeforer   N)	r   r   r   r   r   intr   r   r   r   r   r   r   r      s6    s s r   r   c                   >    \ rS rSr% \\S'    \\   \S'    \\S'   Sr	g)_ListResponse    r   r   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)	Receiving/   zX
Receiving class that provides methods for retrieving attachments from received emails.
c                       \ rS rSrSrSrg)Receiving.ListParams4   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-   4       	r   r1   c                       \ rS rSrSrSrg)Receiving.ListResponse>   a  
ListResponse is the type that wraps the response for listing attachments.

Attributes:
    object (str): The object type: "list"
    data (List[ReceivedEmailAttachment]): The list of attachment objects.
    has_more (bool): Whether there are more attachments available for pagination.
r   Nr/   r   r   r   ListResponser4   >   r2   r   r6   email_idattachment_idreturnc                 r    SU SU 3n[         R                  [           " U0 SS9R                  5       nUS   $ )aW  
Retrieve a single attachment from a received email.
see more: https://resend.com/docs/api-reference/attachments/retrieve-attachment

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

Returns:
    ReceivedEmailAttachmentDetails: The attachment details including download URL
/emails/receiving/z/attachments/getpathparamsverbr   )r
   Requestr   perform_with_content)clsr7   r8   r>   resps        r   r<   Receiving.getH   sM     $H:]=/J56
 

 	 	 F|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$ )aE  
Retrieve a list of attachments from a received email.
see more: https://resend.com/docs/api-reference/attachments/list-attachments

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

Returns:
    ListResponse: A paginated list of attachment objects
r;   z/attachmentsNr<   r=   )
r   r   r   r   build_paginated_pathr
   rA   r*   r6   rB   )rC   r7   r?   	base_pathquery_paramsr>   rD   s          r   listReceiving.list^   sq     )
,?	7=tDcNF3444YMy556
 

 	 	
 r   r   )N)r   r   r   r   r0   r   r1   r%   r6   classmethodr   r   r<   r   rJ   r   r   r   r   r*   r*   /   sw    [ }  3 s 7U  * 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   r   <module>rR      sJ    2 2 4 K 5)Y )
) I D Dr   