
    b?iN                         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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 " S S5      rg)    )AnyDictListOptionalcast)NotRequired	TypedDict)request)EmailAttachmentEmailAttachmentDetailsListReceivedEmailReceivedEmail)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/_receiving.pyr   r      6    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                   J    \ rS rSr% \\   \S'    \\   \S'    \\   \S'   Srg)_AttachmentListParams*   r   r   r   r   Nr   r   r    r!   r+   r+   *   r"   r    r+   c                   >    \ rS rSr% \\S'    \\   \S'    \\S'   Sr	g)_AttachmentListResponse9   r&   r'   r(   r   N)
r   r   r   r   r   r   r   r   r)   r   r   r    r!   r.   r.   9   s*    K 
 Nr    r.   c                       \ rS rSrSr " S S5      r " S S\5      r " S S\5      r	\
S	\S
\4S j5       r\
SS\\   S
\	4S jj5       rSrg)	ReceivingH   zQ
Receiving class that provides methods for retrieving received (inbound) emails.
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   S	S4S jj5       rSrg)Receiving.AttachmentsM   zZ
Attachments class that provides methods for retrieving attachments from received emails.
c                       \ rS rSrSrSrg) Receiving.Attachments.ListParamsR   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!   
ListParamsr7   R       r    r;   c                       \ rS rSrSrSrg)"Receiving.Attachments.ListResponse\   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   Nr9   r   r    r!   ListResponser>   \   r<   r    r@   email_idattachment_idreturnc                 l    SU SU 3n[         R                  [           " U0 SS9R                  5       nU$ )a^  
Retrieve a single attachment from a received email.
see more: https://resend.com/docs/api-reference/attachments/retrieve-received-email-attachment

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

Returns:
    EmailAttachmentDetails: The attachment details including download URL
/emails/receiving/z/attachments/getpathparamsverb)r
   Requestr   perform_with_content)clsrA   rB   rH   resps        r!   rF   Receiving.Attachments.getf   sH     (z}oND??#9: #"$	 
 Kr    NrI   r7   r>   c                     SU S3nU(       a  [        [        [        [        4   U5      OSn[        R                  " X45      n[
        R                  [           " U0 SS9R                  5       nU$ )aT  
Retrieve a list of attachments from a received email.
see more: https://resend.com/docs/api-reference/attachments/list-received-email-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
rE   z/attachmentsNrF   rG   )	r   r   r   r   build_paginated_pathr
   rK   r.   rL   )rM   rA   rI   	base_pathquery_paramsrH   rN   s          r!   listReceiving.Attachments.list{   sl    " -XJlCI;A4S#X7tL#88QD??#:; #"$	 
 Kr    r   N)r   r   r   r   r:   r+   r;   r.   r@   classmethodr   r   rF   r   rT   r   r   r    r!   Attachmentsr4   M   s    		. 		2 	 
	s 	3 	;Q 	 
	( 
 DH		 ?@	 2		 
	r    rX   c                       \ rS rSrSrSrg)Receiving.ListParams   aQ  
ListParams is the class that wraps the parameters for the list method.

Attributes:
    limit (NotRequired[int]): The maximum number of emails to return. Maximum 100, minimum 1.
    after (NotRequired[str]): Return emails after this cursor for pagination.
    before (NotRequired[str]): Return emails before this cursor for pagination.
r   Nr9   r   r    r!   r;   rZ          	r    r;   c                       \ rS rSrSrSrg)Receiving.ListResponse   a  
ListResponse is the type that wraps the response for listing received emails.

Attributes:
    object (str): The object type: "list"
    data (List[ListReceivedEmail]): The list of received email objects.
    has_more (bool): Whether there are more emails available for pagination.
r   Nr9   r   r    r!   r@   r^      r\   r    r@   rA   rC   c                 f    SU 3n[         R                  [           " U0 SS9R                  5       nU$ )z
Retrieve a single received email.
see more: https://resend.com/docs/api-reference/emails/retrieve-received-email

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

Returns:
    ReceivedEmail: The received email object
rE   rF   rG   )r
   rK   r   rL   )rM   rA   rH   rN   s       r!   rF   Receiving.get   sA     $H:.}-
 

 	 	
 r    NrI   c                     SnU(       a  [        [        [        [        4   U5      OSn[        R                  " X#5      n[
        R                  [        R                     " U0 SS9R                  5       nU$ )a  
Retrieve a list of received emails.
see more: https://resend.com/docs/api-reference/emails/list-received-emails

Args:
    params (Optional[ListParams]): The list parameters for pagination

Returns:
    ListResponse: A paginated list of received email objects
z/emails/receivingNrF   rG   )
r   r   r   r   rQ   r
   rK   r1   r@   rL   )rM   rI   rR   rS   rH   rN   s         r!   rT   Receiving.list   sh     (	7=tDcNF3444YMy556
 

 	 	
 r    r   rV   )r   r   r   r   r:   rX   r   r;   r$   r@   rW   r   r   rF   r   rT   r   r   r    r!   r1   r1   H   su    G GR[ }  3 =  & (:. ,  r    r1   N)typingr   r   r   r   r   typing_extensionsr   r	   resendr
   resend.emails._received_emailr   r   r   r   resend.pagination_helperr   r   r$   r+   r.   r1   r   r    r!   <module>ri      s^    2 2 4 M M 6) I I i J Jr    