
    b?ie                     h    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  SSKJr   " S S5      rg	)
    )AnyDictListOptionalcast)NotRequired	TypedDict)request)PaginationHelper   )Topicc                   F   \ rS rSr " S S\5      r " S S\5      r " S S\5      r " S S	\S
S9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\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)Topics   c                   $    \ rS rSr% Sr\\S'   Srg)Topics.CreateTopicResponse   z
CreateTopicResponse is the type that wraps the response of the topic that was created

Attributes:
    id (str): The ID of the created topic
id N__name__
__module____qualname____firstlineno____doc__str__annotations____static_attributes__r       Y/var/www/html/livechat/backend/venv/lib/python3.13/site-packages/resend/topics/_topics.pyCreateTopicResponser          	 	r   r!   c                   >    \ rS rSr% \\S'    \\S'    \\   \S'   Srg)Topics.CreateParams   namedefault_subscriptiondescriptionr   N)r   r   r   r   r   r   r   r   r   r   r    CreateParamsr$      s+    		 "!	 !%%	r   r)   c                   $    \ rS rSr% Sr\\S'   Srg)Topics.UpdateTopicResponse)   z
UpdateTopicResponse is the type that wraps the response of the topic that was updated

Attributes:
    id (str): The ID of the updated topic
r   r   Nr   r   r   r    UpdateTopicResponser+   )   r"   r   r-   c                   ,    \ rS rSr% \\S'    \\S'   Srg)Topics.UpdateParams6   r&   r(   r   N)r   r   r   r   r   r   r   r   r   r    UpdateParamsr/   6   s    		 	r   r1   F)totalc                   <    \ rS rSr% Sr\\S'    \\S'    \\S'   Srg)Topics.RemoveTopicResponse@   z
RemoveTopicResponse is the type that wraps the response of the topic that was removed

Attributes:
    object (str): The object type, "topic"
    id (str): The ID of the removed topic
    deleted (bool): Whether the topic was deleted
objectr   deletedr   N)	r   r   r   r   r   r   r   boolr   r   r   r    RemoveTopicResponser4   @   s+    	 	 	 	r   r9   c                   J    \ rS rSr% \\   \S'    \\   \S'    \\   \S'   Srg)Topics.ListParamsW   limitafterbeforer   N)	r   r   r   r   r   intr   r   r   r   r   r    
ListParamsr;   W   s6    3	 3	
 C  	r   rA   c                   B    \ rS rSr% Sr\\S'    \\   \S'    \	\S'   Sr
g)Topics.ListResponsei   z
ListResponse type that wraps a list of topic objects with pagination metadata

Attributes:
    object (str): The object type, always "list"
    data (List[Topic]): A list of topic objects
    has_more (bool): Whether there are more results available
r6   datahas_morer   N)r   r   r   r   r   r   r   r   r   r8   r   r   r   r    ListResponserC   i   s0    	 	 5k	 	r   rG   paramsreturnc                     Sn[         R                  [        R                     " U[	        [
        [        [        4   U5      SS9R                  5       nU$ )a  
Create a topic.
see more: https://resend.com/docs/api-reference/topics/create-topic

Args:
    params (CreateParams): The topic creation parameters
        - name: The topic name (max 50 characters)
        - default_subscription: The default subscription preference ("opt_in" or "opt_out")
        - description: Optional topic description (max 200 characters)

Returns:
    CreateTopicResponse: The created topic response with the topic ID
/topicspostpathrH   verb)r
   Requestr   r!   r   r   r   perform_with_content)clsrH   rN   resps       r    createTopics.create   sK      v99:d4S>6:



  	 r   r   c                 f    SU 3n[         R                  [           " U0 SS9R                  5       nU$ )z
Retrieve a single topic by its ID.
see more: https://resend.com/docs/api-reference/topics/get-topic

Args:
    id (str): The topic ID

Returns:
    Topic: The topic object
/topics/getrM   )r
   rP   r   rQ   rR   r   rN   rS   s       r    rX   
Topics.get   s<     "u%bu

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

Args:
    id (str): The topic ID
    params (UpdateParams): The topic update parameters
        - name: Optional topic name (max 50 characters)
        - description: Optional topic description (max 200 characters)

Returns:
    UpdateTopicResponse: The updated topic response with the topic ID
rW   patchrM   )r
   rP   r   r-   r   r   r   rQ   )rR   r   rH   rN   rS   s        r    updateTopics.update   sQ     "v99:d4S>6:



  	 r   c                 z    SU 3n[         R                  [        R                     " U0 SS9R	                  5       nU$ )z
Delete a single topic.
see more: https://resend.com/docs/api-reference/topics/delete-topic

Args:
    id (str): The topic ID

Returns:
    RemoveTopicResponse: The removed topic response
rW   deleterM   )r
   rP   r   r9   rQ   rY   s       r    removeTopics.remove   sB     "v99:bx



  	 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 topics.
see more: https://resend.com/docs/api-reference/topics/list-topics

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

Returns:
    ListResponse: A list of topic objects
rK   NrX   rM   )
r   r   r   r   build_paginated_pathr
   rP   r   rG   rQ   )rR   rH   	base_pathquery_paramsrN   rS   s         r    listTopics.list   sd      	7=tDcNF3444YMv223bu



  	 r   r   )N)r   r   r   r   r	   r!   r)   r-   r1   r9   rA   rG   classmethodrT   r   r   rX   r]   ra   r   rg   r   r   r   r    r   r      s   i y i y i .Y $y . L -@  * S U  "  \ 6I  (   3  " (:. ,  r   r   N)typingr   r   r   r   r   typing_extensionsr   r	   resendr
   resend.pagination_helperr   _topicr   r   r   r   r    <module>ro      s#    2 2 4  5 Z Zr   