
    b6i                         d dl Z d dlmZ ddlmZ ddlmZmZ ddlm	Z	m
Z
 ddlmZ ddlmZ dd	lmZ dd
lmZ ddlmZ  G d d      Z G d d      Zy)    N)JSONDecodeError   )ApiError)AsyncClientWrapperSyncClientWrapper)AsyncHttpResponseHttpResponse)RequestOptions)construct_type)UnprocessableEntityError)%GetConversationUsersPageResponseModel)HttpValidationErrorc                      e Zd ZdefdZdddddddddej                  e   dej                  e   dej                  e   dej                  e   d	ej                  e   d
ej                  e   dej                  e	   de
e   fdZy)RawUsersClientclient_wrapperc                    || _         y N_client_wrapperselfr   s     x/root/.openclaw/workspace/visionaryfx/venv/lib/python3.12/site-packages/elevenlabs/conversational_ai/users/raw_client.py__init__zRawUsersClient.__init__   
    -    Nagent_idcall_start_before_unixcall_start_after_unixsearch	page_sizecursorrequest_optionsr   r   r   r    r!   r"   r#   returnc                   | j                   j                  j                  dd||||||d|      }	 d|j                  cxk  rdk  rGn nDt	        j
                  t        t        t        |j                                     }	t        ||	      S |j                  d	k(  rUt        t        |j                        t	        j
                  t        t        t        |j                                     
      |j                         }
t        |j                  t        |j                        |
      # t        $ r6 t        |j                  t        |j                        |j                         w xY w)a  
        Get distinct users from conversations with pagination.

        Parameters
        ----------
        agent_id : typing.Optional[str]
            The id of the agent you're taking the action on.

        call_start_before_unix : typing.Optional[int]
            Unix timestamp (in seconds) to filter conversations up to this start date.

        call_start_after_unix : typing.Optional[int]
            Unix timestamp (in seconds) to filter conversations after to this start date.

        search : typing.Optional[str]
            Search/filter by user ID (exact match).

        page_size : typing.Optional[int]
            How many users to return at maximum. Defaults to 30.

        cursor : typing.Optional[str]
            Used for fetching next page. Cursor is returned in the response.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        HttpResponse[GetConversationUsersPageResponseModel]
            Successful Response
        v1/convai/usersGETr   r   r   r    r!   r"   methodparamsr#      ,  type_object_responsedata  headersbodystatus_coder6   r7   )r   httpx_clientrequestr9   typingcastr   r   jsonr	   r   dictr6   r   r   r   textr   r   r   r   r    r!   r"   r#   	_response_data_response_jsons              r   listzRawUsersClient.list   sN   T ((55==$*@)> &  , > 
		ti++1c19"C ) 0 $YUCC$$+. !2!23+&"5$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   AD- A4D- -?E,)__name__
__module____qualname__r   r   r<   Optionalstrintr
   r	   r   rE    r   r   r   r      s    .*; . *.7;6:'+*.'+;?Op //#&Op !' 4	Op
  &s3Op $Op ??3'Op $Op  8Op 
;	<Opr   r   c                      e Zd ZdefdZdddddddddej                  e   dej                  e   dej                  e   dej                  e   d	ej                  e   d
ej                  e   dej                  e	   de
e   fdZy)AsyncRawUsersClientr   c                    || _         y r   r   r   s     r   r   zAsyncRawUsersClient.__init__g   r   r   Nr   r   r   r   r    r!   r"   r#   r$   c                  K   | j                   j                  j                  dd||||||d|       d{   }	 d|j                  cxk  rdk  rGn nDt	        j
                  t        t        t        |j                                     }	t        ||		      S |j                  d
k(  rUt        t        |j                        t	        j
                  t        t        t        |j                                           |j                         }
t        |j                  t        |j                        |
      7 # t        $ r6 t        |j                  t        |j                        |j                         w xY ww)a  
        Get distinct users from conversations with pagination.

        Parameters
        ----------
        agent_id : typing.Optional[str]
            The id of the agent you're taking the action on.

        call_start_before_unix : typing.Optional[int]
            Unix timestamp (in seconds) to filter conversations up to this start date.

        call_start_after_unix : typing.Optional[int]
            Unix timestamp (in seconds) to filter conversations after to this start date.

        search : typing.Optional[str]
            Search/filter by user ID (exact match).

        page_size : typing.Optional[int]
            How many users to return at maximum. Defaults to 30.

        cursor : typing.Optional[str]
            Used for fetching next page. Cursor is returned in the response.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        AsyncHttpResponse[GetConversationUsersPageResponseModel]
            Successful Response
        r&   r'   r(   r)   Nr,   r-   r.   r1   r4   r5   r8   )r   r:   r;   r9   r<   r=   r   r   r>   r   r   r?   r6   r   r   r   r@   rA   s              r   rE   zAsyncRawUsersClient.listj   s^    T ..;;CC$*@)> &  , D 
 
		ti++1c19"C ) 0 ))%HH$$+. !2!23+&"5$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`nooK
F  	ty'<'<d9K\K\F]dmdrdrss	ts4   4E<D7E<AD: E<A4D: ,E<:?E99E<)rF   rG   rH   r   r   r<   rI   rJ   rK   r
   r   r   rE   rL   r   r   rN   rN   f   s    .*< . *.7;6:'+*.'+;?Op //#&Op !' 4	Op
  &s3Op $Op ??3'Op $Op  8Op 
@	AOpr   rN   )r<   json.decoderr   core.api_errorr   core.client_wrapperr   r   core.http_responser   r	   core.request_optionsr
   core.unchecked_base_modelr   !errors.unprocessable_entity_errorr   0types.get_conversation_users_page_response_modelr   types.http_validation_errorr   r   rN   rL   r   r   <module>rZ      sB     ( & H A 2 7 I e >Sp SplSp Spr   