o
    ùT·j$k  ã                   @  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)ÚOptional)Ú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d/dd„ƒZed0dd„ƒZddded	œd1dd„Zddded	œd2dd„Zddded	œd3dd„Z	e
e
e
e
ddded œd4d*d+„Zddded	œd5d-d.„ZdS )6r"   Ú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+   úr/home/dinkstrade/pdmp-scanner/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©Úextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚvault_idÚstrÚauthr    Únamer4   úHeaders | Noner5   úQuery | Noner6   úBody | Noner7   ú(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 )á³  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.

          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©r8   ©r:   r;   Úbearer_authT©r4   r5   r6   r7   Úsecurity©ÚbodyÚoptionsÚcast_to)Ú
ValueErrorÚ_postr   r   r   ÚCredentialCreateParamsr   r   ©r*   r8   r:   r;   r4   r5   r6   r7   r+   r+   r,   Úcreate4   s(   !
þûûðzCredentials.createÚ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
        rA   ú<Expected a non-empty value for `credential_id` but received rB   rC   ú./vaults/{vault_id}/credentials/{credential_id}©r8   rS   rG   TrH   ©rL   rM   ©rN   Ú_getr   r   r   ©r*   rS   r8   r4   r5   r6   r7   r+   r+   r,   Úretrievek   ó$   ÿûõzCredentials.retriever!   c             
   C  sn   |s	t d|›�ƒ‚|st d|›�ƒ‚ddi|pi ¥}| jtd||d�td|itjƒt||||dd	id
�td�S )áF  
        Rotates a vault credential's write-only secret and returns only credential
        metadata. See
        [vaults](https://developers.openai.com/api/docs/guides/agents-api/tools/vaults).

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

          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
        rA   rV   rB   rC   rW   rX   r:   rG   TrH   rJ   )rN   rO   r   r   r   ÚCredentialUpdateParamsr   r   ©r*   rS   r8   r:   r4   r5   r6   r7   r+   r+   r,   Úupdate˜   s&   ÿûôzCredentials.update©ÚafterÚlimitÚorderÚstatusr4   r5   r6   r7   rd   ú
str | Omitre   úOptional[int] | Omitrf   úLiteral['asc', 'desc'] | Omitrg   úVaultStatusFilterParam | OmitúSyncCursorPage[Credential]c          
      C  óf   |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 ©a„  
        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. Defaults to 20. Values are clamped
              between 1 and 100.

          order: Sort order by the `created_at` timestamp. Use `asc` for ascending order or
              `desc` for descending order. 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
        rA   rB   rC   rD   rE   )rd   re   rf   rg   rG   T)r4   r5   r6   r7   ÚqueryrI   )ÚpagerL   Úmodel)	rN   Ú_get_api_listr   r   r   r   r   r   ÚCredentialListParams©
r*   r8   rd   re   rf   rg   r4   r5   r6   r7   r+   r+   r,   ÚlistÉ   ó.   +
üù	òízCredentials.listr   c             	   C  rT   )á¬  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
        rA   rV   rB   rC   rW   rX   rG   TrH   rY   ©rN   Ú_deleter   r   r   r\   r+   r+   r,   Údelete  r^   zCredentials.delete)r%   r&   )r%   r/   ©r8   r9   r:   r    r;   r9   r4   r<   r5   r=   r6   r>   r7   r?   r%   r   ©rS   r9   r8   r9   r4   r<   r5   r=   r6   r>   r7   r?   r%   r   ©rS   r9   r8   r9   r:   r!   r4   r<   r5   r=   r6   r>   r7   r?   r%   r   )r8   r9   rd   rh   re   ri   rf   rj   rg   rk   r4   r<   r5   r=   r6   r>   r7   r?   r%   rl   ©rS   r9   r8   r9   r4   r<   r5   r=   r6   r>   r7   r?   r%   r   ©Ú__name__Ú
__module__Ú__qualname__r   r-   r1   r   rR   r]   rb   r   ru   rz   r+   r+   r+   r,   r"       óD    	õ>ö5õ5óKöc                	   @  r$   )6r#   r%   ÚAsyncCredentialsWithRawResponsec                 C  r'   r(   )r„   r)   r+   r+   r,   r-   <  r.   z"AsyncCredentials.with_raw_responseÚ%AsyncCredentialsWithStreamingResponsec                 C  r'   r0   )r…   r)   r+   r+   r,   r1   F  r2   z(AsyncCredentials.with_streaming_responseNr3   r8   r9   r:   r    r;   r4   r<   r5   r=   r6   r>   r7   r?   r   c             
   Ã  sj   �|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 )r@   rA   rB   rC   rD   rE   rF   NrG   TrH   rJ   )rN   rO   r   r   r   rP   r   r   rQ   r+   r+   r,   rR   O  s*   €!
þûûðzAsyncCredentials.createrS   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 )rU   rA   rV   rB   rC   rW   rX   rG   TrH   rY   NrZ   r\   r+   r+   r,   r]   †  ó&   €ÿûõzAsyncCredentials.retriever!   c             
   Ã  s|   �|s
t d|›�ƒ‚|st d|›�ƒ‚ddi|pi ¥}| jtd||d�td|itjƒI dH t||||d	d
id�td�I dH S )r_   rA   rV   rB   rC   rW   rX   r:   NrG   TrH   rJ   )rN   rO   r   r   r   r`   r   r   ra   r+   r+   r,   rb   ³  s(   €ÿûôzAsyncCredentials.updaterc   rd   rh   re   ri   rf   rj   rg   rk   ú7AsyncPaginator[Credential, AsyncCursorPage[Credential]]c          
      C  rm   rn   )	rN   rr   r   r   r   r   r   r   rs   rt   r+   r+   r,   ru   ä  rv   zAsyncCredentials.listr   c             	   Ã  r†   )rw   rA   rV   rB   rC   rW   rX   rG   TrH   rY   Nrx   r\   r+   r+   r,   rz   (  r‡   zAsyncCredentials.delete)r%   r„   )r%   r…   r{   r|   r}   )r8   r9   rd   rh   re   ri   rf   rj   rg   rk   r4   r<   r5   r=   r6   r>   r7   r?   r%   rˆ   r~   r   r+   r+   r+   r,   r#   ;  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   Úto_raw_response_wrapperrR   r]   rb   ru   rz   ©r*   rŠ   r+   r+   r,   Ú__init__W  ó    ÿÿÿÿ
ÿz#CredentialsWithRawResponse.__init__N©rŠ   r"   r%   r‹   ©r€   r�   r‚   r‘   r+   r+   r+   r,   r&   V  ó    r&   c                   @  r‰   )	r„   rŠ   r#   r%   r‹   c                 C  rŒ   r�   )rŽ   r   Úasync_to_raw_response_wrapperrR   r]   rb   ru   rz   r�   r+   r+   r,   r‘   l  r’   z(AsyncCredentialsWithRawResponse.__init__N©rŠ   r#   r%   r‹   r”   r+   r+   r+   r,   r„   k  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   rR   r]   rb   ru   rz   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   rR   r]   rb   ru   rz   r�   r+   r+   r,   r‘   –  r™   z.AsyncCredentialsWithStreamingResponse.__init__Nr—   r”   r+   r+   r+   r,   r…   •  r•   r…   )8Ú
__future__r   Útypingr   Útyping_extensionsr   Úhttpx2Ú r   Ú_typesr   r   r	   r
   r   r   r   Ú_utilsr   r   r   Ú_compatr   Ú	_resourcer   r   Ú	_responser   r   Ú
paginationr   r   Ú_base_clientr   r   Útypes.beta.agents.vaultsr   r   r   Ú#types.beta.agents.vaults.credentialr   Ú+types.beta.agents.vault_status_filter_paramr   Ú+types.beta.agents.vaults.credential_deletedr   Ú5types.beta.agents.vaults.credential_auth_create_paramr    Ú5types.beta.agents.vaults.credential_auth_rotate_paramr!   Ú__all__r"   r#   r&   r„   r/   r…   r+   r+   r+   r,   Ú<module>   s:   $    