
    Ii                       d dl mZ d dlmZmZ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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/m0Z0 ddgZ1 G d de      Z2 G d de      Z3 G d d      Z4 G d d      Z5 G d d      Z6 G d d      Z7y)    )annotations)DictListOptional)chainN   )_legacy_response)BodyOmitQueryHeadersNotGivenomit	not_given)is_givenpath_templatemaybe_transformstrip_not_givenasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)SyncPageCursorAsyncPageCursor)AsyncPaginatormake_request_options)credential_list_paramscredential_create_paramscredential_update_params)AnthropicBetaParam)BetaManagedAgentsCredential)"BetaManagedAgentsDeletedCredentialCredentialsAsyncCredentialsc            	         e Zd Zedd       Zedd       Zeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	eeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd	Z
eeeeddded
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)r%   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/anthropics/anthropic-sdk-python#accessing-raw-response-data-eg-headers
        )CredentialsWithRawResponseselfs    r/volume1/homes/robertsu/coba/app/.venv/lib/python3.12/site-packages/anthropic/resources/beta/vaults/credentials.pywith_raw_responsezCredentials.with_raw_response   s     *$//    c                    t        |       S z
        An alternative to `.with_raw_response` that doesn't eagerly read the response body.

        For more information, see https://www.github.com/anthropics/anthropic-sdk-python#with_streaming_response
        ) CredentialsWithStreamingResponser+   s    r-   with_streaming_responsez#Credentials.with_streaming_response%   s     055r/   Ndisplay_namemetadatabetasextra_headersextra_query
extra_bodytimeoutc          
     ^   |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d|      t        |||dt        j                        t        ||||		      t        
      S )  
        Create Credential

        Args:
          auth: Authentication details for creating a credential.

          display_name: Human-readable name for the credential. Up to 255 characters.

          metadata: Arbitrary key-value metadata to attach to the credential. Maximum 16 pairs, keys
              up to 64 chars, values up to 512 chars.

          betas: Optional header to specify the beta version(s) you want to use.

          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 anthropic-beta,c              3  2   K   | ]  }t        |        y wNstr.0es     r-   	<genexpr>z%Credentials.create.<locals>.<genexpr>W        5Lec!fe   managed-agents-2026-04-01+/v1/vaults/{vault_id}/credentials?beta=truevault_idauthr5   r6   r8   r9   r:   r;   bodyoptionscast_to)
ValueErrorr   r   joinr   r   _postr   r   r    CredentialCreateParamsr   r#   
r,   rN   rP   r5   r6   r7   r8   r9   r:   r;   s
             r-   createzCredentials.create.   s    H VW_Vbcdd	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`zzGRZ[  $0 (
 )?? )+Q[el 0  
 	
r/   r7   r8   r9   r:   r;   c          
     F   |st        d|      |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d||      t        ||||	      t        
      S )  
        Get Credential

        Args:
          betas: Optional header to specify the beta version(s) you want to use.

          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
        r>   <Expected a non-empty value for `credential_id` but received r?   r@   c              3  2   K   | ]  }t        |        y wrB   rC   rE   s     r-   rH   z'Credentials.retrieve.<locals>.<genexpr>   rI   rJ   rK   ;/v1/vaults/{vault_id}/credentials/{credential_id}?beta=truerN   credential_idrQ   rT   rU   
rV   r   r   rW   r   r   _getr   r   r#   r,   rc   rN   r7   r8   r9   r:   r;   s           r-   retrievezCredentials.retrieveo   s    6 VW_Vbcdd[\i[lmnn	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`yyM!+
 )+Q[el 0  

 
	
r/   rP   r5   r6   r7   r8   r9   r:   r;   c       	   
        |st        d|      |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d||      t        |||d	t        j                        t        |||	|

      t              S )  
        Update Credential

        Args:
          auth: Updated authentication details for a credential.

          display_name: Updated human-readable name for the credential. 1-255 characters.

          metadata: Metadata patch. Set a key to a string to upsert it, or to null to delete it.
              Omitted keys are preserved.

          betas: Optional header to specify the beta version(s) you want to use.

          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
        r>   r_   r?   r@   c              3  2   K   | ]  }t        |        y wrB   rC   rE   s     r-   rH   z%Credentials.update.<locals>.<genexpr>   rI   rJ   rK   ra   rb   rO   rQ   rR   )rV   r   r   rW   r   r   rX   r   r   r!   CredentialUpdateParamsr   r#   r,   rc   rN   rP   r5   r6   r7   r8   r9   r:   r;   s              r-   updatezCredentials.update   s   J VW_Vbcdd[\i[lmnn	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`zzM!+
 ! $0 (
 )?? )+Q[el 0#  
 	
r/   include_archivedlimitpager7   r8   r9   r:   r;   c               v   |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d|      t        t           t        ||||	t        |||dt        j                        	      t        
      S )  
        List Credentials

        Args:
          include_archived: Whether to include archived credentials in the results.

          limit: Maximum number of credentials to return per page. Defaults to 20, maximum 100.

          page: Opaque pagination token from a previous `list_credentials` response.

          betas: Optional header to specify the beta version(s) you want to use.

          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
        r>   r?   r@   c              3  2   K   | ]  }t        |        y wrB   rC   rE   s     r-   rH   z#Credentials.list.<locals>.<genexpr>  rI   rJ   rK   rL   rM   rq   rr   rs   r8   r9   r:   r;   queryrs   rT   model)rV   r   r   rW   r   r   _get_api_listr   r   r#   r   r   r   CredentialListParams
r,   rN   rq   rr   rs   r7   r8   r9   r:   r;   s
             r-   listzCredentials.list   s    F VW_Vbcdd	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`!!GRZ[ ;<(+'%%,<!& $
 +?? .# " 
 	
r/   c          
     F   |st        d|      |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d||      t        ||||	      t        
      S )  
        Delete Credential

        Args:
          betas: Optional header to specify the beta version(s) you want to use.

          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
        r>   r_   r?   r@   c              3  2   K   | ]  }t        |        y wrB   rC   rE   s     r-   rH   z%Credentials.delete.<locals>.<genexpr>S  rI   rJ   rK   ra   rb   rQ   rd   
rV   r   r   rW   r   r   _deleter   r   r$   rg   s           r-   deletezCredentials.delete1  s    6 VW_Vbcdd[\i[lmnn	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`||M!+
 )+Q[el 7  

 
	
r/   c          
     F   |st        d|      |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d||      t        ||||	      t        
      S )  
        Archive Credential

        Args:
          betas: Optional header to specify the beta version(s) you want to use.

          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
        r>   r_   r?   r@   c              3  2   K   | ]  }t        |        y wrB   rC   rE   s     r-   rH   z&Credentials.archive.<locals>.<genexpr>  rI   rJ   rK   C/v1/vaults/{vault_id}/credentials/{credential_id}/archive?beta=truerb   rQ   rd   
rV   r   r   rW   r   r   rX   r   r   r#   rg   s           r-   archivezCredentials.archiveg  s    6 VW_Vbcdd[\i[lmnn	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`zzU!+
 )+Q[el 0  

 
	
r/   )returnr*   )r   r2   rN   rD   rP   zcredential_create_params.Authr5   Optional[str] | Omitr6   zDict[str, str] | Omitr7   List[AnthropicBetaParam] | Omitr8   Headers | Noner9   Query | Noner:   Body | Noner;   'float | httpx.Timeout | None | NotGivenr   r#   rc   rD   rN   rD   r7   r   r8   r   r9   r   r:   r   r;   r   r   r#   rc   rD   rN   rD   rP   z$credential_update_params.Auth | Omitr5   r   r6   z)Optional[Dict[str, Optional[str]]] | Omitr7   r   r8   r   r9   r   r:   r   r;   r   r   r#   )rN   rD   rq   bool | Omitrr   
int | Omitrs   
str | Omitr7   r   r8   r   r9   r   r:   r   r;   r   r   z+SyncPageCursor[BetaManagedAgentsCredential]rc   rD   rN   rD   r7   r   r8   r   r9   r   r:   r   r;   r   r   r$   __name__
__module____qualname__r   r.   r3   r   r   r[   rh   ro   r   r   r    r/   r-   r%   r%      s   0 0 6 6 .2*.15 )-$("&;D?
?
 ,	?

 +?
 (?
 /?
 &?
 "?
  ?
 9?
 
%?
L 26 )-$("&;D4
4
 	4

 /4
 &4
 "4
  4
 94
 
%4
v 6:-1>B15 )-$("&;DF
F
 	F

 3F
 +F
 <F
 /F
 &F
 "F
  F
 9F
 
%F
X )- 15 )-$("&;DB
B
 &	B

 B
 B
 /B
 &B
 "B
  B
 9B
 
5B
R 26 )-$("&;D4
4
 	4

 /4
 &4
 "4
  4
 94
 
,4
v 26 )-$("&;D4
4
 	4

 /4
 &4
 "4
  4
 94
 
%4
r/   c            	         e Zd Zedd       Zedd       Zeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	eeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd	Z
eeeeddded
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)r&   c                    t        |       S r)   )AsyncCredentialsWithRawResponser+   s    r-   r.   z"AsyncCredentials.with_raw_response  s     /t44r/   c                    t        |       S r1   )%AsyncCredentialsWithStreamingResponser+   s    r-   r3   z(AsyncCredentials.with_streaming_response  s     5T::r/   Nr4   c          
       K   |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d|      t        |||dt        j                         d	{   t        ||||	
      t               d	{   S 7 $7 w)r=   r>   r?   r@   c              3  2   K   | ]  }t        |        y wrB   rC   rE   s     r-   rH   z*AsyncCredentials.create.<locals>.<genexpr>  rI   rJ   rK   rL   rM   rO   NrQ   rR   )rV   r   r   rW   r   r   rX   r   r   r    rY   r   r#   rZ   s
             r-   r[   zAsyncCredentials.create  s     H VW_Vbcdd	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`ZZGRZ[, $0 (
 )??  )+Q[el 0   
 
 	

s$   BCC
C<C=CCr\   c          
     b  K   |st        d|      |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d||      t        ||||	      t        
       d{   S 7 w)r^   r>   r_   r?   r@   c              3  2   K   | ]  }t        |        y wrB   rC   rE   s     r-   rH   z,AsyncCredentials.retrieve.<locals>.<genexpr>  rI   rJ   rK   ra   rb   rQ   rd   Nre   rg   s           r-   rh   zAsyncCredentials.retrieve  s     6 VW_Vbcdd[\i[lmnn	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`YYM!+
 )+Q[el 0  

 

 
	
 

   B&B/(B-)B/ri   c       	   
       K   |st        d|      |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d||      t        |||d	t        j                         d
{   t        |||	|
      t               d
{   S 7 $7 w)rk   r>   r_   r?   r@   c              3  2   K   | ]  }t        |        y wrB   rC   rE   s     r-   rH   z*AsyncCredentials.update.<locals>.<genexpr>U  rI   rJ   rK   ra   rb   rO   NrQ   rR   )rV   r   r   rW   r   r   rX   r   r   r!   rm   r   r#   rn   s              r-   ro   zAsyncCredentials.update)  s    J VW_Vbcdd[\i[lmnn	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`ZZM!+
 - $0 (
 )??  )+Q[el 0#   
 
 	

s$   B+C-C
.CCCCrp   c               v   |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d|      t        t           t        ||||	t        |||dt        j                        	      t        
      S )ru   r>   r?   r@   c              3  2   K   | ]  }t        |        y wrB   rC   rE   s     r-   rH   z(AsyncCredentials.list.<locals>.<genexpr>  rI   rJ   rK   rL   rM   rw   rx   rz   )rV   r   r   rW   r   r   r|   r   r   r#   r   r   r   r}   r~   s
             r-   r   zAsyncCredentials.listq  s    F VW_Vbcdd	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`!!GRZ[ !<=(+'%%,<!& $
 +?? .# " 
 	
r/   c          
     b  K   |st        d|      |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d||      t        ||||	      t        
       d{   S 7 w)r   r>   r_   r?   r@   c              3  2   K   | ]  }t        |        y wrB   rC   rE   s     r-   rH   z*AsyncCredentials.delete.<locals>.<genexpr>  rI   rJ   rK   ra   rb   rQ   rd   Nr   rg   s           r-   r   zAsyncCredentials.delete  s     6 VW_Vbcdd[\i[lmnn	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`\\M!+
 )+Q[el 7 " 

 

 
	
 

r   c          
     b  K   |st        d|      |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d||      t        ||||	      t        
       d{   S 7 w)r   r>   r_   r?   r@   c              3  2   K   | ]  }t        |        y wrB   rC   rE   s     r-   rH   z+AsyncCredentials.archive.<locals>.<genexpr>  rI   rJ   rK   r   rb   rQ   rd   Nr   rg   s           r-   r   zAsyncCredentials.archive  s     6 VW_Vbcdd[\i[lmnn	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`ZZU!+
 )+Q[el 0   

 

 
	
 

r   )r   r   )r   r   r   r   r   )rN   rD   rq   r   rr   r   rs   r   r7   r   r8   r   r9   r   r:   r   r;   r   r   zYAsyncPaginator[BetaManagedAgentsCredential, AsyncPageCursor[BetaManagedAgentsCredential]]r   r   r   r/   r-   r&   r&     s   5 5 ; ; .2*.15 )-$("&;D?
?
 ,	?

 +?
 (?
 /?
 &?
 "?
  ?
 9?
 
%?
L 26 )-$("&;D4
4
 	4

 /4
 &4
 "4
  4
 94
 
%4
v 6:-1>B15 )-$("&;DF
F
 	F

 3F
 +F
 <F
 /F
 &F
 "F
  F
 9F
 
%F
X )- 15 )-$("&;DB
B
 &	B

 B
 B
 /B
 &B
 "B
  B
 9B
 
cB
R 26 )-$("&;D4
4
 	4

 /4
 &4
 "4
  4
 94
 
,4
v 26 )-$("&;D4
4
 	4

 /4
 &4
 "4
  4
 94
 
%4
r/   c                      e Zd ZddZy)r*   c                   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j                        | _        y rB   )	_credentialsr	   to_raw_response_wrapperr[   rh   ro   r   r   r   r,   credentialss     r-   __init__z#CredentialsWithRawResponse.__init__#  s    '&>>
 )@@  
 '>>
 %<<
	 '>>
 (??
r/   Nr   r%   r   Noner   r   r   r   r   r/   r-   r*   r*   "      
r/   r*   c                      e Zd ZddZy)r   c                   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j                        | _        y rB   )	r   r	   async_to_raw_response_wrapperr[   rh   ro   r   r   r   r   s     r-   r   z(AsyncCredentialsWithRawResponse.__init__;  s    '&DD
 )FF  
 'DD
 %BB
	 'DD
 (EE
r/   Nr   r&   r   r   r   r   r/   r-   r   r   :  r   r/   r   c                      e Zd ZddZy)r2   c                J   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        t        |j                        | _        y rB   )r   r   r[   rh   ro   r   r   r   r   s     r-   r   z)CredentialsWithStreamingResponse.__init__S  s    '2
 5  
 3
 1
	 3
 4
r/   Nr   r   r   r/   r-   r2   r2   R  r   r/   r2   c                      e Zd ZddZy)r   c                J   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        t        |j                        | _        y rB   )r   r   r[   rh   ro   r   r   r   r   s     r-   r   z.AsyncCredentialsWithStreamingResponse.__init__k  s    '8
 ;  
 9
 7
	 9
 :
r/   Nr   r   r   r/   r-   r   r   j  r   r/   r   )8
__future__r   typingr   r   r   	itertoolsr   httpx r	   _typesr
   r   r   r   r   r   r   _utilsr   r   r   r   r   _compatr   	_resourcer   r   	_responser   r   
paginationr   r   _base_clientr   r   types.beta.vaultsr   r    r!   types.anthropic_beta_paramr"   0types.beta.vaults.beta_managed_agents_credentialr#   8types.beta.vaults.beta_managed_agents_deleted_credentialr$   __all__r%   r&   r*   r   r2   r   r   r/   r-   <module>r      s    # ' '   ! L L L g g ' ; Z : A l l = \ k,
-A
/ A
HA
' A
H
 
0
 
0
 
0
 
r/   