o
    lWi                     @   s   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 dZG dd dZdS )    N)JSONDecodeError   )ApiError)AsyncClientWrapperSyncClientWrapper)AsyncHttpResponseHttpResponse)RequestOptions)construct_type)UnprocessableEntityError)HttpValidationError)(WorkspaceServiceAccountListResponseModelc                   @   <   e Zd ZdefddZdddeje dee	 fdd	Z
dS )
RawServiceAccountsClientclient_wrapperc                C   
   || _ d S N_client_wrapperselfr    r   j/var/www/html/asistente-voz-ia/venv/lib/python3.10/site-packages/elevenlabs/service_accounts/raw_client.py__init__      
z!RawServiceAccountsClient.__init__Nrequest_optionsr   returnc             	   C   s   | j jjdd|d}z>d|j  krdk r+n ntttt| d}t	||dW S |jdkrCt
t|jtttt| dd	| }W n ty[   t|jt|j|jd
w t|jt|j|d
)aI  
        List all service accounts in the workspace

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

        Returns
        -------
        HttpResponse[WorkspaceServiceAccountListResponseModel]
            Successful Response
        v1/service-accountsGETmethodr      ,  type_object_responsedata  headersbodystatus_coder,   r-   )r   httpx_clientrequestr/   typingcastr   r
   jsonr   r   dictr,   r   r   r   textr   r   	_response_data_response_jsonr   r   r   list   s>   

zRawServiceAccountsClient.list)__name__
__module____qualname__r   r   r2   Optionalr	   r   r   r;   r   r   r   r   r          r   c                   @   r   )
AsyncRawServiceAccountsClientr   c                C   r   r   r   r   r   r   r   r   E   r   z&AsyncRawServiceAccountsClient.__init__Nr   r   r   c             	      s   | j jjdd|dI dH }z>d|j  krdk r/n ntttt| d}t	||dW S |jd	krGt
t|jtttt| dd
| }W n ty_   t|jt|j|jdw t|jt|j|d)aN  
        List all service accounts in the workspace

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

        Returns
        -------
        AsyncHttpResponse[WorkspaceServiceAccountListResponseModel]
            Successful Response
        r   r   r    Nr"   r#   r$   r'   r*   r+   r.   )r   r0   r1   r/   r2   r3   r   r
   r4   r   r   r5   r,   r   r   r   r6   r7   r   r   r   r;   H   s@   

z"AsyncRawServiceAccountsClient.list)r<   r=   r>   r   r   r2   r?   r	   r   r   r;   r   r   r   r   rA   D   r@   rA   )r2   json.decoderr   core.api_errorr   core.client_wrapperr   r   core.http_responser   r   core.request_optionsr	   core.unchecked_base_modelr
   !errors.unprocessable_entity_errorr   types.http_validation_errorr   3types.workspace_service_account_list_response_modelr   r   rA   r   r   r   r   <module>   s   4