
    b6i6                         d dl 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mZ dd	lmZ dd
lmZ  e j"                  e j$                  d      Z G d d      Z G d d      Zy)    N   )AsyncClientWrapperSyncClientWrapper)RequestOptions) WorkspaceApiKeyListResponseModel)"WorkspaceCreateApiKeyResponseModel   )AsyncRawApiKeysClientRawApiKeysClient)YBodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissions)`BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissions.c                      e Zd ZdefdZedefd       Zdddede	j                  e   defd	Zedd
dededede	j                  e   de	j                  e   defdZdddedede	j                  e   de	j&                  fdZedd
dededededede	j                  e   de	j                  e   de	j&                  fdZy)ApiKeysClientclient_wrapperc                &    t        |      | _        y N)r   )r   _raw_clientselfr   s     v/root/.openclaw/workspace/visionaryfx/venv/lib/python3.12/site-packages/elevenlabs/service_accounts/api_keys/client.py__init__zApiKeysClient.__init__   s    +>J    returnc                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawApiKeysClient
        r   r   s    r   with_raw_responsezApiKeysClient.with_raw_response        r   Nrequest_optionsservice_account_user_idr    c                T    | j                   j                  ||      }|j                  S )ag  
        Get all API keys for a service account

        Parameters
        ----------
        service_account_user_id : str

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

        Returns
        -------
        WorkspaceApiKeyListResponseModel
            Successful Response

        Examples
        --------
        from elevenlabs import ElevenLabs

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.service_accounts.api_keys.list(
            service_account_user_id="service_account_user_id",
        )
        r   r   listdatar   r!   r    	_responses       r   r$   zApiKeysClient.list$   s+    : $$))*ASb)c	~~r   character_limitr    namepermissionsr)   c                Z    | j                   j                  |||||      }|j                  S )aQ  
        Create a new API key for a service account

        Parameters
        ----------
        service_account_user_id : str

        name : str

        permissions : BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissions
            The permissions of the XI API.

        character_limit : typing.Optional[int]
            The character limit of the XI API key. If provided this will limit the usage of this api key to n characters per month where n is the chosen value. Requests that incur charges will fail after reaching this monthly limit.

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

        Returns
        -------
        WorkspaceCreateApiKeyResponseModel
            Successful Response

        Examples
        --------
        from elevenlabs import ElevenLabs

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.service_accounts.api_keys.create(
            service_account_user_id="service_account_user_id",
            name="name",
        )
        r*   r+   r)   r    r   creater%   r   r!   r*   r+   r)   r    r'   s          r   r/   zApiKeysClient.createD   s;    X $$++##++ , 
	 ~~r   
api_key_idc                V    | j                   j                  |||      }|j                  S )a  
        Delete an existing API key for a service account

        Parameters
        ----------
        service_account_user_id : str

        api_key_id : str

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

        Returns
        -------
        typing.Any
            Successful Response

        Examples
        --------
        from elevenlabs import ElevenLabs

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.service_accounts.api_keys.delete(
            service_account_user_id="service_account_user_id",
            api_key_id="api_key_id",
        )
        r   r   deleter%   r   r!   r1   r    r'   s        r   r4   zApiKeysClient.deletey   s.    @ $$++,CZap+q	~~r   
is_enabledc          	      ^    | j                   j                  |||||||      }|j                  S )aP  
        Update an existing API key for a service account

        Parameters
        ----------
        service_account_user_id : str

        api_key_id : str

        is_enabled : bool
            Whether to enable or disable the API key.

        name : str
            The name of the XI API key to use (used for identification purposes only).

        permissions : BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissions
            The permissions of the XI API.

        character_limit : typing.Optional[int]
            The character limit of the XI API key. If provided this will limit the usage of this api key to n characters per month where n is the chosen value. Requests that incur charges will fail after reaching this monthly limit.

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

        Returns
        -------
        typing.Any
            Successful Response

        Examples
        --------
        from elevenlabs import ElevenLabs

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.service_accounts.api_keys.update(
            service_account_user_id="service_account_user_id",
            api_key_id="api_key_id",
            is_enabled=True,
            name="Sneaky Fox",
        )
        r6   r*   r+   r)   r    r   updater%   	r   r!   r1   r6   r*   r+   r)   r    r'   s	            r   r:   zApiKeysClient.update   sA    l $$++#!#++ , 
	 ~~r   )__name__
__module____qualname__r   r   propertyr   r   strtypingOptionalr   r   r$   OMITr   intr   r/   Anyr4   boolr   r:    r   r   r   r      sf   K*; K  #3     cg'*@FP^@_	)L 15;?3!$3 	3
 o3  -3  83 
,3l tx!'*!8;!QWQ`Q`aoQp!	!V 15;??!$? ?
 ? ? v?  -?  8? 
?r   r   c                      e Zd ZdefdZedefd       Zdddede	j                  e   defd	Zedd
dededede	j                  e   de	j                  e   defdZdddedede	j                  e   de	j&                  fdZedd
dededededede	j                  e   de	j                  e   de	j&                  fdZy)AsyncApiKeysClientr   c                &    t        |      | _        y r   )r
   r   r   s     r   r   zAsyncApiKeysClient.__init__   s    0Or   r   c                     | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawApiKeysClient
        r   r   s    r   r   z$AsyncApiKeysClient.with_raw_response   r   r   Nr   r!   r    c                p   K   | j                   j                  ||       d{   }|j                  S 7 w)a  
        Get all API keys for a service account

        Parameters
        ----------
        service_account_user_id : str

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

        Returns
        -------
        WorkspaceApiKeyListResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.service_accounts.api_keys.list(
                service_account_user_id="service_account_user_id",
            )


        asyncio.run(main())
        r   Nr#   r&   s       r   r$   zAsyncApiKeysClient.list   s9     J **//0GYh/ii	~~ js   !646r(   r*   r+   r)   c                v   K   | j                   j                  |||||       d{   }|j                  S 7 w)a  
        Create a new API key for a service account

        Parameters
        ----------
        service_account_user_id : str

        name : str

        permissions : BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissions
            The permissions of the XI API.

        character_limit : typing.Optional[int]
            The character limit of the XI API key. If provided this will limit the usage of this api key to n characters per month where n is the chosen value. Requests that incur charges will fail after reaching this monthly limit.

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

        Returns
        -------
        WorkspaceCreateApiKeyResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.service_accounts.api_keys.create(
                service_account_user_id="service_account_user_id",
                name="name",
            )


        asyncio.run(main())
        r-   Nr.   r0   s          r   r/   zAsyncApiKeysClient.create  sI     h **11##++ 2 
 
	 ~~
s   $979r1   c                r   K   | j                   j                  |||       d{   }|j                  S 7 w)a  
        Delete an existing API key for a service account

        Parameters
        ----------
        service_account_user_id : str

        api_key_id : str

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

        Returns
        -------
        typing.Any
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.service_accounts.api_keys.delete(
                service_account_user_id="service_account_user_id",
                api_key_id="api_key_id",
            )


        asyncio.run(main())
        r   Nr3   r5   s        r   r4   zAsyncApiKeysClient.deleteR  s;     P **112I:gv1ww	~~ xs   "757r6   c          	      z   K   | j                   j                  |||||||       d{   }|j                  S 7 w)a  
        Update an existing API key for a service account

        Parameters
        ----------
        service_account_user_id : str

        api_key_id : str

        is_enabled : bool
            Whether to enable or disable the API key.

        name : str
            The name of the XI API key to use (used for identification purposes only).

        permissions : BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissions
            The permissions of the XI API.

        character_limit : typing.Optional[int]
            The character limit of the XI API key. If provided this will limit the usage of this api key to n characters per month where n is the chosen value. Requests that incur charges will fail after reaching this monthly limit.

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

        Returns
        -------
        typing.Any
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.service_accounts.api_keys.update(
                service_account_user_id="service_account_user_id",
                api_key_id="api_key_id",
                is_enabled=True,
                name="Sneaky Fox",
            )


        asyncio.run(main())
        r8   Nr9   r;   s	            r   r:   zAsyncApiKeysClient.update}  sO     | **11#!#++ 2 
 
	 ~~
s   &;9;)r<   r=   r>   r   r   r?   r
   r   r@   rA   rB   r   r   r$   rC   r   rD   r   r/   rE   r4   rF   r   r:   rG   r   r   rI   rI      so   P*< P  #8     cg&'*&@FP^@_&	)&\ 15;?;!$; 	;
 o;  -;  8; 
,;| tx)'*)8;)QWQ`Q`aoQp)	)f 15;?G!$G G
 G G vG  -G  8G 
Gr   rI   )rA   core.client_wrapperr   r   core.request_optionsr   +types.workspace_api_key_list_response_modelr   -types.workspace_create_api_key_response_modelr   
raw_clientr
   r   ptypes.body_create_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_post_permissionsr   ztypes.body_edit_service_account_api_key_v_1_service_accounts_service_account_user_id_api_keys_api_key_id_patch_permissionsr   castrE   rC   r   rI   rG   r   r   <module>rX      sT     H 2 [ _ ?
 v{{6::s#F FRf fr   