
    b?i                         S SK Jr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KJr  S SKJr  \S   r " S S	5      rg
)    )AnyDictListOptionalUnioncast)LiteralNotRequired	TypedDict)request)Domain)Record)PaginationHelper)enforcedopportunisticc                   4   \ rS rSr " S S\5      r " S S\5      r " S S\5      r " S S	\5      r " S
 S\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\S\4S j5       r\
S\S\4S j5       rSrg)Domains   c                   J    \ rS rSr% \\   \S'    \\   \S'    \\   \S'   Srg)Domains.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/domains/_domains.py
ListParamsr      s6    3	 3	
 C  	r$   r&   c                   B    \ rS rSr% Sr\\S'    \\   \S'    \	\S'   Sr
g)Domains.ListResponse!   z
ListResponse type that wraps a list of domain objects with pagination metadata

Attributes:
    object (str): The object type, always "list"
    data (List[Domain]): A list of domain objects
    has_more (bool): Whether there are more results available
objectdatahas_morer   N)r   r   r   r   __doc__r"   r!   r   r   boolr#   r   r$   r%   ListResponser(   !   s0    	 	 6l	 	r$   r/   c                   p    \ rS rSr% Sr\\S'    \\S'    \\S'    \\S'    \\S'    \\\	   S4   \S	'   S
r
g)Domains.CreateDomainResponse8   a  
CreateDomainResponse is the type that wraps the response of the domain that was created

Attributes:
    id (str): The ID of the created domain
    name (str): The name of the created domain
    created_at (str): When the domain was created
    status (str): Status of the domain
    region (str): The region where emails will be sent from
    records (Union[List[Record], None]): The list of domain records
idname
created_atstatusregionNrecordsr   )r   r   r   r   r-   r"   r!   r   r   r   r#   r   r$   r%   CreateDomainResponser1   8   s^    
	 	 		 	 	 	 tF|T)**	r$   r9   c                   V    \ rS rSr% \\S'    \\   \S'    \\   \S'    \\   \S'   Sr	g)Domains.UpdateParams^   r3   click_trackingopen_trackingtlsr   N)
r   r   r   r   r"   r!   r
   r.   
TlsOptionsr#   r   r$   r%   UpdateParamsr;   ^   sB    	 $D))	 #4((	 $$		r$   rA   c                   D    \ rS rSr% \\S'    \\   \S'    \\   \S'   Srg)Domains.CreateParamsw   r4   r7   custom_return_pathr   N)r   r   r   r   r"   r!   r
   r#   r   r$   r%   CreateParamsrC   w   s0    		 C  	 (,,	r$   rF   paramsreturnc                     Sn[         R                  [        R                     " U[	        [
        [        [        4   U5      SS9R                  5       nU$ )z
Create a domain through the Resend Email API.
see more: https://resend.com/docs/api-reference/domains/create-domain

Args:
    params (CreateParams): The domain creation parameters

Returns:
    CreateDomainResponse: The created domain response
/domainspostpathrG   verb)r   Requestr   r9   r   r   r   perform_with_contentclsrG   rM   resps       r%   createDomains.create   sK     w;;<d4S>6:



  	 r$   c                     SUS    3n[         R                  [           " U[        [        [
        [
        4   U5      SS9R                  5       nU$ )z
Update an existing domain.
see more: https://resend.com/docs/api-reference/domains/update-domain

Args:
    params (UpdateParams): The domain update parameters

Returns:
    Domain: The updated domain object
	/domains/r3   patchrL   )r   rO   r   r   r   r   rP   rQ   s       r%   updateDomains.update   sP     6$<.)v&d4S>6:



  	 r$   	domain_idc                 f    SU 3n[         R                  [           " U0 SS9R                  5       nU$ )z
Retrieve a single domain for the authenticated user.
see more: https://resend.com/docs/api-reference/domains/get-domain

Args:
    domain_id (str): The domain ID

Returns:
    Domain: The domain object
rW   getrL   r   rO   r   rP   rR   r[   rM   rS   s       r%   r]   Domains.get   s=     9+&v&bu



  	 r$   Nc                     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 domains for the authenticated user.
see more: https://resend.com/docs/api-reference/domains/list-domains

Args:
    params (Optional[ListParams]): Optional pagination parameters
        - limit: Number of domains to retrieve (max 100, min 1).
          If not provided, all domains will be returned without pagination.
        - after: ID after which to retrieve more domains
        - before: ID before which to retrieve more domains

Returns:
    ListResponse: A list of domain objects
rJ   Nr]   rL   )
r   r   r   r   build_paginated_pathr   rO   r   r/   rP   )rR   rG   	base_pathquery_paramsrM   rS   s         r%   listDomains.list   sd      	7=tDcNF3444YMw334bu



  	 r$   c                 f    SU 3n[         R                  [           " U0 SS9R                  5       nU$ )z
Remove an existing domain.
see more: https://resend.com/docs/api-reference/domains/delete-domain

Args:
    domain_id (str): The domain ID

Returns:
    Domain: The removed domain object
rW   deleterL   r^   r_   s       r%   removeDomains.remove   s=     9+&v&bx



  	 r$   c                 h    SU S3n[         R                  [           " U0 SS9R                  5       nU$ )z
Verify an existing domain.
see more: https://resend.com/docs/api-reference/domains/verify-domain

Args:
    domain_id (str): The domain ID

Returns:
    Domain: The verified domain object
rW   z/verifyrK   rL   r^   r_   s       r%   verifyDomains.verify   s?     9+W-v&bv



  	 r$   r   )N)r   r   r   r   r   r&   r/   r9   rA   rF   classmethodrT   r   rY   r"   r]   r   re   ri   rl   r#   r   r$   r%   r   r      s   Y $y .$y $Ly 2y " L -A  " L V  " C F  " (:. ,  . s v  " s v  r$   r   N)typingr   r   r   r   r   r   typing_extensionsr	   r
   r   resendr   resend.domains._domainr   resend.domains._recordr   resend.pagination_helperr   r@   r   r   r$   r%   <module>ru      s4    9 9 = =  ) ) 501
k kr$   