
    b?i*                     *   S SK Jr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KJr  S SKJr  S SK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\\   05      r " S S\5      r " S S5      r g)    )AnyDictListOptionalUnioncast)NotRequired	TypedDict)request)
AttachmentRemoteAttachment)Attachments)Email)	Receiving)Tag)PaginationHelperc                   J    \ rS rSr% Sr\\S'    \\\\	\\
4   4      \S'   Srg)EmailTemplate   z
EmailTemplate is the class that wraps template configuration for email sending.

Attributes:
    id (str): The template ID.
    variables (NotRequired[Dict[str, Union[str, int]]]): Optional variables to be used in the template.
id	variables N)__name__
__module____qualname____firstlineno____doc__str__annotations__r	   r   r   int__static_attributes__r       Y/var/www/html/livechat/backend/venv/lib/python3.13/site-packages/resend/emails/_emails.pyr   r      s7     	G 4U38_ 4566r"   r   c                   2    \ rS rSr% \\S'    \\   \S'   Srg)_UpdateParams!   r   scheduled_atr   N)r   r   r   r   r   r   r	   r!   r   r"   r#   r%   r%   !   s    G c""r"   r%   c                   ,    \ rS rSr% \\S'    \\S'   Srg)_UpdateEmailResponse-   objectr   r   Nr   r   r   r   r   r   r!   r   r"   r#   r)   r)   -       K 	Gr"   r)   c                   ,    \ rS rSr% \\S'    \\S'   Srg)_CancelScheduledEmailResponse8   r+   r   r   Nr,   r   r"   r#   r/   r/   8   r-   r"   r/   _SendParamsFromfromc                   F   \ rS rSr% \\\\   4   \S'    \\   \S'    \\\\   \4      \S'    \\\\   \4      \S'    \\\\   \4      \S'    \\   \S'    \\   \S'    \\	\\4      \S	'    \\\\
\4         \S
'    \\\      \S'    \\   \S'    \\   \S'   Srg)_SendParamsDefaultN   tosubjectbccccreply_tohtmltextheadersattachmentstagsr'   templater   N)r   r   r   r   r   r   r   r   r	   r   r   r   r   r   r!   r   r"   r#   r4   r4   N   s#   c49n  
U49c>*	++ 	E$s)S.)** %S	3/00 c
 c
 c3h(( T%
4D(D"EFGG d3i
   c"" -((r"   r4   c                   r   \ rS rSr\r\r " S S\5      r " S S\5      r	 " S S\
5      r " S S	\5      r " S
 S\5      r " S S\5      r " S S\5      r " S S\5      r\ SS\S\\   S\4S jj5       r\S\S\4S j5       r\S\S\4S j5       r\S\S\	4S j5       r\SS\\   S\4S jj5       rSrg)Emails   c                       \ rS rSrSrSrg)#Emails.CancelScheduledEmailResponse   z
CancelScheduledEmailResponse is the type that wraps the response of the email that was canceled

Attributes:
    object (str): The object type
    id (str): The ID of the scheduled email that was canceled
r   Nr   r   r   r   r   r!   r   r"   r#   CancelScheduledEmailResponserE          	r"   rH   c                       \ rS rSrSrSrg)Emails.UpdateEmailResponse   z
UpdateEmailResponse is the type for the updated email response.

Attributes:
    object (str): The object type
    id (str): The ID of the updated email.
r   NrG   r   r"   r#   UpdateEmailResponserK      rI   r"   rM   c                       \ rS rSrSrSrg)Emails.UpdateParams   a  
UpdateParams is the class that wraps the parameters for the update method.

Attributes:
    id (str): The ID of the email to update.
    scheduled_at (NotRequired[str]): Schedule email to be sent later.             The date should be in ISO 8601 format (e.g: 2024-08-05T11:52:01.858Z).
r   NrG   r   r"   r#   UpdateParamsrO      s    	r"   rQ   c                       \ rS rSrSrSrg)Emails.SendParams   a  SendParams is the class that wraps the parameters for the send method.

Attributes:
    from (NotRequired[str]): The email address to send the email from.
    to (Union[str, List[str]]): List of email addresses to send the email to.
    subject (NotRequired[str]): The subject of the email.
    bcc (NotRequired[Union[List[str], str]]): Bcc
    cc (NotRequired[Union[List[str], str]]): Cc
    reply_to (NotRequired[Union[List[str], str]]): Reply to
    html (NotRequired[str]): The HTML content of the email.
    text (NotRequired[str]): The text content of the email.
    headers (NotRequired[Dict[str, str]]): Custom headers to be added to the email.
    attachments (NotRequired[List[Union[Attachment, RemoteAttachment]]]): List of attachments to be added to the email.
    tags (NotRequired[List[Tag]]): List of tags to be added to the email.
    template (NotRequired[EmailTemplate]): Template configuration for sending emails using predefined templates.
r   NrG   r   r"   r#   
SendParamsrS      s    	r"   rU   c                   *    \ rS rSr% Sr\\   \S'   Srg)Emails.SendOptions   aB  
SendOptions is the class that wraps the options for the send method.

Attributes:
    idempotency_key (NotRequired[str]): Unique key that ensures the same operation is not processed multiple times.
    Allows for safe retries without duplicating operations.
    If provided, will be sent as the `Idempotency-Key` header.
idempotency_keyr   N)	r   r   r   r   r   r	   r   r   r!   r   r"   r#   SendOptionsrW      s    	 %S))	r"   rZ   c                   $    \ rS rSr% Sr\\S'   Srg)Emails.SendResponse   z
SendResponse is the type that wraps the response of the email that was sent.

Attributes:
    id (str): The ID of the sent email
r   r   N)r   r   r   r   r   r   r   r!   r   r"   r#   SendResponser\      s    	 	r"   r^   c                   N    \ rS rSr% Sr\\   \S'    \\   \S'    \\   \S'   Sr	g)Emails.ListParams   aV  
ListParams is the class that wraps the parameters for the list method.

Attributes:
    limit (NotRequired[int]): The maximum number of emails to return. Defaults to 10, maximum 100.
    after (NotRequired[str]): Return emails after this cursor for pagination.
    before (NotRequired[str]): Return emails before this cursor for pagination.
limitafterbeforer   N)
r   r   r   r   r   r	   r    r   r   r!   r   r"   r#   
ListParamsr`      s=    	 3	 3	 C  	r"   re   c                   B    \ rS rSr% Sr\\S'    \\   \S'    \	\S'   Sr
g)Emails.ListResponse   z
ListResponse is the type that wraps the response for listing emails.

Attributes:
    object (str): The object type: "list"
    data (List[Email]): The list of email objects.
    has_more (bool): Whether there are more emails available for pagination.
r+   datahas_morer   N)r   r   r   r   r   r   r   r   r   boolr!   r   r"   r#   ListResponserg      s0    	 	 5k	 	r"   rl   Nparamsoptionsreturnc           
          Sn[         R                  [           " U[        [        [
        [
        4   U5      S[        [        [
        [
        4   U5      S9R                  5       nU$ )z
Send an email through the Resend Email API.
see more: https://resend.com/docs/api-reference/emails/send-email

Args:
    params (SendParams): The email parameters
    options (SendOptions): The email options

Returns:
    id: The ID of the sent email
/emailspost)pathrm   verbrn   )r   Requestr   r   r   r   perform_with_content)clsrm   rn   rs   resps        r#   sendEmails.send   s[     u%S#X/c3h1	

 

  	 r"   email_idc                 f    SU 3n[         R                  [           " U0 SS9R                  5       nU$ )z
Retrieve a single email.
see more: https://resend.com/docs/api-reference/emails/retrieve-email

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

Returns:
    Email: The email object that was retrieved
/emails/getrs   rm   rt   )r   ru   r   rv   rw   r{   rs   rx   s       r#   r~   
Emails.get  sA     ($u%
 

 	 	
 r"   c                 h    SU S3n[         R                  [           " U0 SS9R                  5       nU$ )a   
Cancel a scheduled email.
see more: https://resend.com/docs/api-reference/emails/cancel-email

Args:
    email_id (str): The ID of the scheduled email to cancel

Returns:
    CancelScheduledEmailResponse: The response object that contains the ID of the scheduled email that was canceled
r}   z/cancelrr   r   )r   ru   r/   rv   r   s       r#   cancelEmails.cancel,  sD     (7+<=
 

 	 	
 r"   c                     SUS    3n[         R                  [           " U[        [        [
        [
        4   U5      SS9R                  5       nU$ )z
Update an email.
see more: https://resend.com/docs/api-reference/emails/update-email

Args:
    params (UpdateParams): The email parameters to update

Returns:
    Email: The email object that was updated
r}   r   patchr   )r   ru   r)   r   r   r   rv   )rw   rm   rs   rx   s       r#   updateEmails.update@  sU     &,(34S#X/
 

 	 	
 r"   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$ )z
Retrieve a list of emails.
see more: https://resend.com/docs/api-reference/emails/list-emails

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

Returns:
    ListResponse: A paginated list of email objects
rq   Nr~   r   )
r   r   r   r   build_paginated_pathr   ru   rB   rl   rv   )rw   rm   	base_pathquery_paramsrs   rx   s         r#   listEmails.listT  sh     	7=tDcNF3444YMv223
 

 	 	
 r"   r   )N)r   r   r   r   r   r   r/   rH   r)   rM   r%   rQ   r4   rU   r
   rZ   r^   re   rl   classmethodr   ry   r   r   r~   r   r   r   r!   r   r"   r#   rB   rB      s2   KI'D 2 } ' $i "y Y .y . BF*2;*?	 . 3 5  & c &B  & L -@  & (:. ,  r"   rB   N)!typingr   r   r   r   r   r   typing_extensionsr	   r
   resendr   resend.emails._attachmentr   r   resend.emails._attachmentsr   resend.emails._emailr   resend.emails._receivingr   resend.emails._tagr   resend.pagination_helperr   r   r%   r)   r/   r   r1   r4   rB   r   r"   r#   <module>r      s    9 9 4  B 2 & . " 5I &	I 	9 I  C 1 1hf fr"   