
    4Rj0y                       d dl mZ d dlmZmZmZ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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l0m1Z1 ddl2m3Z3 ddl4m5Z5 ddl6m7Z7 ddl8m9Z9 ddgZ: G d de      Z; G d de       Z< G d d      Z= G d d      Z> G d d      Z? G d  d!      Z@y)"    )annotations)AnyListOptionalcast)chain)LiteralN   )_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)resource_add_paramsresource_list_paramsresource_update_params)AnthropicBetaParam)ResourceUpdateResponse)ResourceRetrieveResponse)BetaManagedAgentsFileResource) BetaManagedAgentsSessionResource)&BetaManagedAgentsDeleteSessionResource	ResourcesAsyncResourcesc                  J   e Zd Zedd       Zedd       Zeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 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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
        )ResourcesWithRawResponseselfs    s/var/www/html/meridian/meridian-ai/venv/lib/python3.12/site-packages/anthropic/resources/beta/sessions/resources.pywith_raw_responsezResources.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
        )ResourcesWithStreamingResponser0   s    r2   with_streaming_responsez!Resources.with_streaming_response)   s     .d33r4   Nbetasextra_headersextra_query
extra_bodytimeoutc               ~   |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 }t        t        | j                  t        d||      t        ||||	      t        t        t              
            S )  
        Get Session Resource

        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
        9Expected a non-empty value for `session_id` but received :Expected a non-empty value for `resource_id` but received anthropic-beta,c              3  2   K   | ]  }t        |        y wNstr.0es     r2   	<genexpr>z%Resources.retrieve.<locals>.<genexpr>T        5Lc!f5L   managed-agents-2026-04-01;/v1/sessions/{session_id}/resources/{resource_id}?beta=true
session_idresource_idr;   r<   r=   r>   optionscast_to
ValueErrorr   r   joinr   r   r   r&   _getr   r    r   r1   rS   rR   r:   r;   r<   r=   r>   s           r2   retrievezResources.retrieve2   s    6 XYcXfghhYZeYhijj	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`$IIQ) +
 -"/[U_ip 1  
 	
r4   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 }t        t        | j                  t        d||      t        d	|it        j                        t        ||||
      t        t        t                          S ):  
        Update Session Resource

        Args:
          authorization_token: New authorization token for the resource. Currently only `github_repository`
              resources support token rotation.

          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
        rA   rB   rC   rD   c              3  2   K   | ]  }t        |        y wrF   rG   rI   s     r2   rL   z#Resources.update.<locals>.<genexpr>   rM   rN   rO   rP   rQ   authorization_tokenrT   bodyrV   rW   )rY   r   r   rZ   r   r   r   r%   _postr   r   r#   ResourceUpdateParamsr    r   	r1   rS   rR   ra   r:   r;   r<   r=   r>   s	            r2   updatezResources.updatem   s   > XYcXfghhYZeYhijj	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`"JJQ) +
 %*,?@BXBmBm -"/[U_ip /  
 	
r4   limitpager:   r;   r<   r=   r>   c                  |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        t        t              
      S )e  
        List Session Resources

        Args:
          limit: Maximum number of resources to return per page (max 1000). If omitted, returns
              all resources.

          page: Opaque cursor from a previous response's next_page field.

          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
        rA   rC   rD   c              3  2   K   | ]  }t        |        y wrF   rG   rI   s     r2   rL   z!Resources.list.<locals>.<genexpr>   rM   rN   rO   -/v1/sessions/{session_id}/resources?beta=truerR   ri   rj   r;   r<   r=   r>   queryrj   rV   model)rY   r   r   rZ   r   r   _get_api_listr   r   r(   r    r   r"   ResourceListParamsr   r   	r1   rR   ri   rj   r:   r;   r<   r=   r>   s	            r2   listzResources.list   s    B XYcXfghh	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`!!IV`a @A(+'%%!& $ );; 5! " 
 	
r4   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 Session Resource

        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
        rA   rB   rC   rD   c              3  2   K   | ]  }t        |        y wrF   rG   rI   s     r2   rL   z#Resources.delete.<locals>.<genexpr>  rM   rN   rO   rP   rQ   rT   rU   
rY   r   r   rZ   r   r   _deleter   r    r)   r\   s           r2   deletezResources.delete   s    6 XYcXfghhYZeYhijj	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`||M%'
 )+Q[el ;  

 
	
r4   
mount_pathr:   r;   r<   r=   r>   c          
     ^   |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 )2  
        Add Session Resource

        Args:
          file_id: ID of a previously uploaded file.

          mount_path: Mount path in the container. Defaults to `/mnt/session/uploads/<file_id>`.

          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
        rA   rC   rD   c              3  2   K   | ]  }t        |        y wrF   rG   rI   s     r2   rL   z Resources.add.<locals>.<genexpr>N  rM   rN   rO   rn   ro   file_idtyper   rT   rb   )rY   r   r   rZ   r   r   rd   r   r   r!   ResourceAddParamsr    r'   
r1   rR   r   r   r   r:   r;   r<   r=   r>   s
             r2   addzResources.add(  s    B XYcXfghh	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`zzIV`a & ",
 $55 )+Q[el 2  
 	
r4   )returnr/   )r   r7   rS   rH   rR   rH   r:   List[AnthropicBetaParam] | Omitr;   Headers | Noner<   Query | Noner=   Body | Noner>   'float | httpx.Timeout | None | NotGivenr   r&   rS   rH   rR   rH   ra   rH   r:   r   r;   r   r<   r   r=   r   r>   r   r   r%   )rR   rH   ri   
int | Omitrj   
str | Omitr:   r   r;   r   r<   r   r=   r   r>   r   r   z0SyncPageCursor[BetaManagedAgentsSessionResource]rS   rH   rR   rH   r:   r   r;   r   r<   r   r=   r   r>   r   r   r)   rR   rH   r   rH   r   zLiteral['file']r   zOptional[str] | Omitr:   r   r;   r   r<   r   r=   r   r>   r   r   r'   __name__
__module____qualname__r   r3   r8   r   r   r]   rg   rx   r~   r    r4   r2   r*   r*      so   . . 4 4 26 )-$("&;D9
9
 	9

 /9
 &9
 "9
  9
 99
 
"9
B 26 )-$("&;D@
@
 	@

 !@
 /@
 &@
 "@
  @
 9@
 
 @
L !15 )-$("&;DA
A
 	A

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

 /4
 &4
 "4
  4
 94
 
04
x ,015 )-$("&;D<
<
 	<

 <
 )<
 /<
 &<
 "<
  <
 9<
 
'<
r4   c                  J   e Zd Zedd       Zedd       Zeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 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ddded
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)r+   c                    t        |       S r.   )AsyncResourcesWithRawResponser0   s    r2   r3   z AsyncResources.with_raw_responseh  s     -T22r4   c                    t        |       S r6   )#AsyncResourcesWithStreamingResponser0   s    r2   r8   z&AsyncResources.with_streaming_responser  s     3488r4   Nr9   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 }t        t        | j                  t        d||      t        ||||	      t        t        t              
       d{         S 7 w)r@   rA   rB   rC   rD   c              3  2   K   | ]  }t        |        y wrF   rG   rI   s     r2   rL   z*AsyncResources.retrieve.<locals>.<genexpr>  rM   rN   rO   rP   rQ   rT   rU   NrX   r\   s           r2   r]   zAsyncResources.retrieve{  s    6 XYcXfghhYZeYhijj	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`$))Q) +
 -"/[U_ip 1   
 	
s   B>C C	
	C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 }t        t        | j                  t        d||      t        d	|it        j                         d
{   t        ||||      t        t        t                     d
{         S 7 67 
w)r_   rA   rB   rC   rD   c              3  2   K   | ]  }t        |        y wrF   rG   rI   s     r2   rL   z(AsyncResources.update.<locals>.<genexpr>  rM   rN   rO   rP   rQ   ra   NrT   rb   )rY   r   r   rZ   r   r   r   r%   rd   r   r   r#   re   r    r   rf   s	            r2   rg   zAsyncResources.update  s,    > XYcXfghhYZeYhijj	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`"**Q) +
 1*,?@BXBmBm  -"/[U_ip /   
 	
s$   B3C05C,6-C0#C.
$	C0.C0rh   c                  |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        t        t              
      S )rl   rA   rC   rD   c              3  2   K   | ]  }t        |        y wrF   rG   rI   s     r2   rL   z&AsyncResources.list.<locals>.<genexpr>  rM   rN   rO   rn   ro   rp   rq   rs   )rY   r   r   rZ   r   r   ru   r   r   r(   r    r   r"   rv   r   r   rw   s	            r2   rx   zAsyncResources.list  s    B XYcXfghh	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`!!IV`a !AB(+'%%!& $ );; 5! " 
 	
r4   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)rz   rA   rB   rC   rD   c              3  2   K   | ]  }t        |        y wrF   rG   rI   s     r2   rL   z(AsyncResources.delete.<locals>.<genexpr>]  rM   rN   rO   rP   rQ   rT   rU   Nr|   r\   s           r2   r~   zAsyncResources.delete;  s     6 XYcXfghhYZeYhijj	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`\\M%'
 )+Q[el ; " 

 

 
	
 

s   B&B/(B-)B/r   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   rA   rC   rD   c              3  2   K   | ]  }t        |        y wrF   rG   rI   s     r2   rL   z%AsyncResources.add.<locals>.<genexpr>  rM   rN   rO   rn   ro   r   NrT   rb   )rY   r   r   rZ   r   r   rd   r   r   r!   r   r    r'   r   s
             r2   r   zAsyncResources.addq  s     B XYcXfghh	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`ZZIV`a,& ",
 $55  )+Q[el 2   
 
 	

s$   BCC
C<C=CC)r   r   )r   r   r   r   )rR   rH   ri   r   rj   r   r:   r   r;   r   r<   r   r=   r   r>   r   r   zcAsyncPaginator[BetaManagedAgentsSessionResource, AsyncPageCursor[BetaManagedAgentsSessionResource]]r   r   r   r   r4   r2   r+   r+   g  sp   3 3 9 9 26 )-$("&;D9
9
 	9

 /9
 &9
 "9
  9
 99
 
"9
B 26 )-$("&;D@
@
 	@

 !@
 /@
 &@
 "@
  @
 9@
 
 @
L !15 )-$("&;DA
A
 	A

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

 /4
 &4
 "4
  4
 94
 
04
x ,015 )-$("&;D<
<
 	<

 <
 )<
 /<
 &<
 "<
  <
 9<
 
'<
r4   c                      e Zd ZddZy)r/   c                z   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        t        j                  |j                        | _        y rF   )
_resourcesr   to_raw_response_wrapperr]   rg   rx   r~   r   r1   	resourcess     r2   __init__z!ResourcesWithRawResponse.__init__  s    #(@@
 '>>
 %<<NN
	 '>>
 $;;MM
r4   Nr   r*   r   Noner   r   r   r   r   r4   r2   r/   r/         
r4   r/   c                      e Zd ZddZy)r   c                z   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        t        j                  |j                        | _        y rF   )r   r   async_to_raw_response_wrapperr]   rg   rx   r~   r   r   s     r2   r   z&AsyncResourcesWithRawResponse.__init__  s    #(FF
 'DD
 %BBNN
	 'DD
 $AAMM
r4   Nr   r+   r   r   r   r   r4   r2   r   r     r   r4   r   c                      e Zd ZddZy)r7   c                   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        y rF   )r   r   r]   rg   rx   r~   r   r   s     r2   r   z'ResourcesWithStreamingResponse.__init__  sv    #4
 3
 1NN
	 3
 0MM
r4   Nr   r   r   r4   r2   r7   r7     r   r4   r7   c                      e Zd ZddZy)r   c                   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        y rF   )r   r   r]   rg   rx   r~   r   r   s     r2   r   z,AsyncResourcesWithStreamingResponse.__init__  sv    #:
 9
 7NN
	 9
 6MM
r4   Nr   r   r   r4   r2   r   r     r   r4   r   )A
__future__r   typingr   r   r   r   	itertoolsr   typing_extensionsr	   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.sessionsr!   r"   r#   types.anthropic_beta_paramr$   ,types.beta.sessions.resource_update_responser%   .types.beta.sessions.resource_retrieve_responser&   5types.beta.sessions.beta_managed_agents_file_resourcer'   8types.beta.sessions.beta_managed_agents_session_resourcer(   ?types.beta.sessions.beta_managed_agents_delete_session_resourcer)   __all__r*   r+   r/   r   r7   r   r   r4   r2   <module>r      s    # , ,  %  ! L L L g g ' ; Z : A e e = S W c i v(
)F
 F
R
F
% F
R

 
*
 
*
 
*
 
r4   