
    b?is                         S SK JrJrJrJrJr  S SKJrJrJ	r	  S SK
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)LiteralNotRequired	TypedDict)request   )Emailsc                        \ rS rSr% \\S'   Srg)SendEmailResponse
   id N)__name__
__module____qualname____firstlineno__str__annotations____static_attributes__r       X/var/www/html/livechat/backend/venv/lib/python3.13/site-packages/resend/emails/_batch.pyr   r   
   s    Gr   r   c                   0    \ rS rSr% Sr\\S'    \\S'   Srg)BatchValidationError   z
BatchValidationError represents a validation error for a specific email in the batch.

Attributes:
    index (int): The index of the email in the batch that caused the error
    message (str): The validation error message
indexmessager   N)	r   r   r   r   __doc__intr   r   r   r   r   r   r   r      s     J Lr   r   c                       \ rS rSr " S S\5      r " S S\5      r\ SS\\	R                     S\\   S	\4S
 jj5       rSrg)Batch$   c                   B    \ rS rSr% Sr\\   \S'    \\S      \S'   Sr	g)Batch.SendOptions&   a  
SendOptions is the class that wraps the options for the batch 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.
    batch_validation (NotRequired[Literal["strict", "permissive"]]): Batch validation mode.
    Defaults to "strict" when not provided.
idempotency_key)strict
permissivebatch_validationr   N)
r   r   r   r   r!   r	   r   r   r   r   r   r   r   SendOptionsr'   &   s1    		 %S))	 &g.D&EFF	r   r-   c                   >    \ rS rSr% \\   \S'    \\\      \S'   Sr	g)Batch.SendResponse?   dataerrorsr   N)
r   r   r   r   r   r   r   r	   r   r   r   r   r   SendResponser/   ?   s+    $%%	 D!5677	r   r3   Nparamsoptionsreturnc           
          Sn[         R                  [        R                     " U[	        [
        [        [        [        4      U5      S[	        [        [        [        4   U5      S9R                  5       nU$ )aw  
Trigger up to 100 batch emails at once.
see more: https://resend.com/docs/api-reference/emails/send-batch-emails

Args:
    params (List[Emails.SendParams]): The list of emails to send
    options (Optional[SendOptions]): Batch options, including batch_validation mode

Returns:
    SendResponse: A list of email objects, and optionally validation errors in permissive mode
z/emails/batchpost)pathr4   verbr5   )	r   Requestr$   r3   r   r   r   r   perform_with_content)clsr4   r5   r9   resps        r   send
Batch.sendI   sf     u112T#s(^,f5c3h1	

 

  	 r   r   )N)r   r   r   r   r
   r-   r3   classmethodr   r   
SendParamsr   r?   r   r   r   r   r$   r$   $   sY    i 2y  OS&++,7?7L	 r   r$   N)typingr   r   r   r   r   typing_extensionsr   r	   r
   resendr   _emailsr   r   r   r$   r   r   r   <module>rG      s9    2 2 = =  	 9 &< <r   