o
    ¨Ýjìq  ã                   @  sp  d dl mZ d dlmZ d dlmZ d dlZddlmZ ddl	m
Z
mZmZmZmZmZmZ ddlmZmZ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mZ ddl m!Z!m"Z" ddl#m$Z$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/m0Z0 ddgZ1G dd„ deƒZ2G dd„ deƒZ3G dd„ dƒZ4G dd„ dƒZ5G dd„ dƒZ6G dd„ dƒZ7dS ) é    )Úannotations)ÚDict)ÚLiteralNé   )Ú_legacy_response)ÚBodyÚOmitÚQueryÚHeadersÚNotGivenÚomitÚ	not_given)Úpath_templateÚmaybe_transformÚasync_maybe_transform)Úcached_property)ÚSyncAPIResourceÚAsyncAPIResource)Úto_streamed_response_wrapperÚ"async_to_streamed_response_wrapper)ÚSyncCursorPageÚAsyncCursorPage)ÚAsyncPaginatorÚmake_request_options)Úcredential_list_paramsÚcredential_create_paramsÚcredential_update_params)Ú
Credential)ÚVaultStatusFilterParam)ÚCredentialDeleted)ÚCredentialAuthCreateParam)ÚCredentialAuthRotateParamÚCredentialsÚAsyncCredentialsc                
   @  ó¦   e Zd Zed3dd„ƒZed4dd„ƒZeddded	œd5dd„Zdddedœd6dd„Z	eeddded œd7d"d#„Z
eeeeeddded$œ	d8d.d/„Zdddedœd9d1d2„ZdS ):r"   ÚreturnÚCredentialsWithRawResponsec                 C  ó   t | ƒS ©a  
        This property can be used as a prefix for any HTTP method call to return
        the raw response object instead of the parsed content.

        For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
        )r&   ©Úself© r+   új/var/www/html/chatgpt/venv/lib/python3.10/site-packages/openai/resources/beta/agents/vaults/credentials.pyÚwith_raw_response!   ó   zCredentials.with_raw_responseÚ CredentialsWithStreamingResponsec                 C  r'   ©zÌ
        An alternative to `.with_raw_response` that doesn't eagerly read the response body.

        For more information, see https://www.github.com/openai/openai-python#with_streaming_response
        )r/   r)   r+   r+   r,   Úwith_streaming_response+   ó   z#Credentials.with_streaming_responseN©ÚmetadataÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚvault_idÚstrÚauthr    Únamer4   úDict[str, str] | Omitr5   úHeaders | Noner6   úQuery | Noner7   úBody | Noner8   ú(float | httpx2.Timeout | None | NotGivenr   c          	   
   C  s^   |s	t d|›�ƒ‚ddi|pi ¥}| jtd|d�t|||dœtjƒt||||ddid	�td
�S )áE  Creates a vault credential.

        Secret values are write-only and are never returned.
        See
        [vaults](https://developers.openai.com/api/docs/guides/agents-api/tools/vaults).

        Args:
          auth: The authentication method and write-only secret values to store.

          name: The name is trimmed before storage. It must contain 1 to 256 UTF-8 bytes after
              trimming.

          metadata: Up to 16 string key-value pairs, with keys up to 64 and values up to 512
              characters. Defaults to an empty map.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        ú7Expected a non-empty value for `vault_id` but received úOpenAI-Betaú	agents=v1ú/vaults/{vault_id}/credentials©r9   ©r;   r<   r4   Úbearer_authT©r5   r6   r7   r8   Úsecurity©ÚbodyÚoptionsÚcast_to)Ú
ValueErrorÚ_postr   r   r   ÚCredentialCreateParamsr   r   ©	r*   r9   r;   r<   r4   r5   r6   r7   r8   r+   r+   r,   Úcreate4   s*   %
ýúûïzCredentials.create©r5   r6   r7   r8   Úcredential_idc             	   C  ó`   |s	t d|›�ƒ‚|st d|›�ƒ‚ddi|pi ¥}| jtd||d�t||||ddid	�td
�S )áÕ  Retrieves vault credential metadata without returning secret values.

        See
        [vaults](https://developers.openai.com/api/docs/guides/agents-api/tools/vaults).

        Args:
          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        rC   ú<Expected a non-empty value for `credential_id` but received rD   rE   ú./vaults/{vault_id}/credentials/{credential_id}©r9   rV   rI   TrJ   ©rN   rO   ©rP   Ú_getr   r   r   ©r*   rV   r9   r5   r6   r7   r8   r+   r+   r,   Úretrievep   ó$   ÿûõzCredentials.retrieve©r;   r4   r5   r6   r7   r8   ú CredentialAuthRotateParam | Omitc          	   
   C  sp   |s	t d|›�ƒ‚|st d|›�ƒ‚ddi|pi ¥}| jtd||d�t||dœtjƒt||||dd	id
�td�S )áã  Updates credential metadata or rotates its write-only secret.

        See
        [vaults](https://developers.openai.com/api/docs/guides/agents-api/tools/vaults).

        Args:
          auth: Replacement values for the credential's existing authentication method.

          metadata: Replaces all metadata. Omit to preserve it, or pass {} to clear it. Up to 16
              string key-value pairs, with keys up to 64 and values up to 512 characters.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        rC   rY   rD   rE   rZ   r[   ©r;   r4   rI   TrJ   rL   )rP   rQ   r   r   r   ÚCredentialUpdateParamsr   r   ©	r*   rV   r9   r;   r4   r5   r6   r7   r8   r+   r+   r,   Úupdate�   s0   !ÿþûûîzCredentials.update©	ÚafterÚlimitr4   ÚorderÚstatusr5   r6   r7   r8   rj   ú
str | Omitrk   ú
int | Omitrl   úLiteral['asc', 'desc'] | Omitrm   úVaultStatusFilterParam | OmitúSyncCursorPage[Credential]c       	         C  óh   |s	t d|›�ƒ‚ddi|pi ¥}| jtd|d�tt t|||	|
t|||||dœtjƒddid	�td
�S ©aO  
        Lists a vault's credentials using ID-based pagination without returning secret
        values. See
        [vaults](https://developers.openai.com/api/docs/guides/agents-api/tools/vaults).

        Args:
          after: Return resources after this resource ID in the selected order.

          limit: The maximum number of resources to return, between 1 and 100. Defaults to 20.

          metadata: Exact string matches supplied as `metadata[key]=value`. All supplied pairs must
              match. Up to 16 pairs, with keys from 1 to 64 characters and values up to 512
              characters. Filtering is eventually consistent; metadata changes may take time
              to appear.

          order: The order in which resources are returned. Defaults to `desc`.

              - `asc` - Returns resources in ascending order.
              - `desc` - Returns resources in descending order.

          status: Filter by one status or a list, such as `status=active` or
              `status[]=active&status[]=archived`. Both statuses are included by default.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        rC   rD   rE   rF   rG   )rj   rk   r4   rl   rm   rI   T)r5   r6   r7   r8   ÚqueryrK   )ÚpagerN   Úmodel)	rP   Ú_get_api_listr   r   r   r   r   r   ÚCredentialListParams©r*   r9   rj   rk   r4   rl   rm   r5   r6   r7   r8   r+   r+   r,   ÚlistØ   ó0   /
ûø
ñìzCredentials.listr   c             	   C  rW   )á¬  Deletes a vault credential.

        See
        [vaults](https://developers.openai.com/api/docs/guides/agents-api/tools/vaults).

        Args:
          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        rC   rY   rD   rE   rZ   r[   rI   TrJ   r\   ©rP   Ú_deleter   r   r   r_   r+   r+   r,   Údelete!  ra   zCredentials.delete)r%   r&   )r%   r/   ©r9   r:   r;   r    r<   r:   r4   r=   r5   r>   r6   r?   r7   r@   r8   rA   r%   r   ©rV   r:   r9   r:   r5   r>   r6   r?   r7   r@   r8   rA   r%   r   ©rV   r:   r9   r:   r;   rc   r4   r=   r5   r>   r6   r?   r7   r@   r8   rA   r%   r   )r9   r:   rj   rn   rk   ro   r4   r=   rl   rp   rm   rq   r5   r>   r6   r?   r7   r@   r8   rA   r%   rr   ©rV   r:   r9   r:   r5   r>   r6   r?   r7   r@   r8   rA   r%   r   ©Ú__name__Ú
__module__Ú__qualname__r   r-   r1   r   r   rT   r`   rh   r{   r€   r+   r+   r+   r,   r"       óL    	ôCö2ô?òPöc                
   @  r$   ):r#   r%   ÚAsyncCredentialsWithRawResponsec                 C  r'   r(   )rŠ   r)   r+   r+   r,   r-   P  r.   z"AsyncCredentials.with_raw_responseÚ%AsyncCredentialsWithStreamingResponsec                 C  r'   r0   )r‹   r)   r+   r+   r,   r1   Z  r2   z(AsyncCredentials.with_streaming_responseNr3   r9   r:   r;   r    r<   r4   r=   r5   r>   r6   r?   r7   r@   r8   rA   r   c          	   
   Ã  sl   �|s
t d|›�ƒ‚ddi|pi ¥}| jtd|d�t|||dœtjƒI dH t||||dd	id
�td�I dH S )rB   rC   rD   rE   rF   rG   rH   NrI   TrJ   rL   )rP   rQ   r   r   r   rR   r   r   rS   r+   r+   r,   rT   c  s,   €%
ýúûïzAsyncCredentials.createrU   rV   c             	   Ã  óh   �|s
t d|›�ƒ‚|st d|›�ƒ‚ddi|pi ¥}| jtd||d�t||||ddid	�td
�I dH S )rX   rC   rY   rD   rE   rZ   r[   rI   TrJ   r\   Nr]   r_   r+   r+   r,   r`   Ÿ  ó&   €ÿûõzAsyncCredentials.retrieverb   rc   c          	   
   Ã  s~   �|s
t d|›�ƒ‚|st d|›�ƒ‚ddi|pi ¥}| jtd||d�t||dœtjƒI dH t||||d	d
id�td�I dH S )rd   rC   rY   rD   rE   rZ   r[   re   NrI   TrJ   rL   )rP   rQ   r   r   r   rf   r   r   rg   r+   r+   r,   rh   Ì  s2   €!ÿþûûîzAsyncCredentials.updateri   rj   rn   rk   ro   rl   rp   rm   rq   ú7AsyncPaginator[Credential, AsyncCursorPage[Credential]]c       	         C  rs   rt   )	rP   rx   r   r   r   r   r   r   ry   rz   r+   r+   r,   r{     r|   zAsyncCredentials.listr   c             	   Ã  rŒ   )r}   rC   rY   rD   rE   rZ   r[   rI   TrJ   r\   Nr~   r_   r+   r+   r,   r€   P  r�   zAsyncCredentials.delete)r%   rŠ   )r%   r‹   r�   r‚   rƒ   )r9   r:   rj   rn   rk   ro   r4   r=   rl   rp   rm   rq   r5   r>   r6   r?   r7   r@   r8   rA   r%   rŽ   r„   r…   r+   r+   r+   r,   r#   O  r‰   c                   @  ó   e Zd Zddd„ZdS )	r&   Úcredentialsr"   r%   ÚNonec                 C  óP   || _ t |j¡| _t |j¡| _t |j¡| _t |j¡| _t |j¡| _d S ©N)Ú_credentialsr   Zto_raw_response_wrapperrT   r`   rh   r{   r€   ©r*   r�   r+   r+   r,   Ú__init__  ó    ÿÿÿÿ
ÿz#CredentialsWithRawResponse.__init__N©r�   r"   r%   r‘   ©r†   r‡   rˆ   r–   r+   r+   r+   r,   r&   ~  ó    r&   c                   @  r�   )	rŠ   r�   r#   r%   r‘   c                 C  r’   r“   )r”   r   Zasync_to_raw_response_wrapperrT   r`   rh   r{   r€   r•   r+   r+   r,   r–   ”  r—   z(AsyncCredentialsWithRawResponse.__init__N©r�   r#   r%   r‘   r™   r+   r+   r+   r,   rŠ   “  rš   rŠ   c                   @  r�   )	r/   r�   r"   r%   r‘   c                 C  óF   || _ t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _d S r“   )r”   r   rT   r`   rh   r{   r€   r•   r+   r+   r,   r–   ©  ó    ÿÿÿÿ
ÿz)CredentialsWithStreamingResponse.__init__Nr˜   r™   r+   r+   r+   r,   r/   ¨  rš   r/   c                   @  r�   )	r‹   r�   r#   r%   r‘   c                 C  rœ   r“   )r”   r   rT   r`   rh   r{   r€   r•   r+   r+   r,   r–   ¾  r�   z.AsyncCredentialsWithStreamingResponse.__init__Nr›   r™   r+   r+   r+   r,   r‹   ½  rš   r‹   )8Ú
__future__r   Útypingr   Ztyping_extensionsr   Zhttpx2Ú r   Ú_typesr   r   r	   r
   r   r   r   Z_utilsr   r   r   Z_compatr   Z	_resourcer   r   Ú	_responser   r   Z
paginationr   r   Z_base_clientr   r   Ztypes.beta.agents.vaultsr   r   r   Z#types.beta.agents.vaults.credentialr   Z+types.beta.agents.vault_status_filter_paramr   Z+types.beta.agents.vaults.credential_deletedr   Z5types.beta.agents.vaults.credential_auth_create_paramr    Z5types.beta.agents.vaults.credential_auth_rotate_paramr!   Ú__all__r"   r#   r&   rŠ   r/   r‹   r+   r+   r+   r,   Ú<module>   s:   $  1  1