
    b\jl                       S SK Jr  S SKJrJrJr  S SKJr  S SKrSSK	J
r
  SSKJr  SSKJrJrJrJrJrJrJrJr  SS	KJrJrJrJrJrJr  SS
KJr  SSKJ r J!r!  SSK"J#r#J$r$J%r%J&r&J'r'J(r(J)r)J*r*J+r+J,r,  SSK-J.r.J/r/  SSK0J1r1J2r2  SSK3J4r4J5r5J6r6  SSK7J8r9  SSK:J;r;  SSK<J=r=  SSK>J?r?  SS/r@ " S S\ 5      rA " S S\!5      rB " S S5      rC " S S5      rD " S S5      rE " S S5      rFg)     )annotations)ListMappingcast)chainN   )_legacy_response)deepcopy_with_paths)BodyOmitQueryHeadersNotGiven	FileTypesomit	not_given)is_givenextract_filespath_templatemaybe_transformstrip_not_givenasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)
BinaryAPIResponseAsyncBinaryAPIResponseStreamedBinaryAPIResponseAsyncStreamedBinaryAPIResponseto_streamed_response_wrapperto_custom_raw_response_wrapper"async_to_streamed_response_wrapper#to_custom_streamed_response_wrapper$async_to_custom_raw_response_wrapper)async_to_custom_streamed_response_wrapper)SyncPage	AsyncPage)file_list_paramsfile_upload_params)AsyncPaginatormerge_headersmake_request_options)!stainless_helper_header_from_file)DeletedFile)FileMetadata)AnthropicBetaParamFiles
AsyncFilesc            
      T   \ rS rSr\SS j5       r\SS j5       r\\\\\SSS\S.	                   SS jjr	\SSS\S.             SS jjr
\SSS\S.             SS	 jjr\SSS\S.             SS
 jjr\SSS\S.             SS jjrSrg)r1   +   c                    [        U 5      $ z
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
)FilesWithRawResponseselfs    T/var/www/website/venv/lib/python3.13/site-packages/anthropic/resources/beta/files.pywith_raw_responseFiles.with_raw_response,   s     $D))    c                    [        U 5      $ 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
)FilesWithStreamingResponser8   s    r:   with_streaming_responseFiles.with_streaming_response6   s     *$//r=   N	after_id	before_idlimitscope_idbetasextra_headersextra_query
extra_bodytimeoutc       	        T   0 [        S[        U5      (       a#  SR                  [        S U 5       S/5      5      O[        05      EU=(       d    0 EnSS0U=(       d    0 EnU R                  S[        [           [        UUUU	[        UUUUS.[        R                  5      S9[        S9$ )	J  List Files

Args:
  after_id: ID of the object to use as a cursor for pagination.

When provided, returns the
      page of results immediately after this object.

  before_id: ID of the object to use as a cursor for pagination. When provided, returns the
      page of results immediately before this object.

  limit: Number of items to return per page.

      Defaults to `20`. Ranges from `1` to `1000`.

  scope_id: Filter by scope ID. Only returns files associated with the specified scope
      (e.g., a session 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
anthropic-beta,c              3  8   #    U  H  n[        U5      v   M     g 7fNstr.0es     r:   	<genexpr>Files.list.<locals>.<genexpr>m        5Lec!ffe   files-api-2025-04-14/v1/files?beta=truerD   rE   rF   rG   rI   rJ   rK   rL   querypageoptionsmodel)r   r   joinr   r   _get_api_listr&   r/   r,   r   r(   FileListParams
r9   rD   rE   rF   rG   rH   rI   rJ   rK   rL   s
             r:   list
Files.list?   s    V	
$ '*hhu5Le5LOeNf/g&h"	
 "	
 *+A[mFYWY[!!!,'(+'%%$,%.!&$,	 %33 % " 
 	
r=   rH   rI   rJ   rK   rL   c          
     8   U(       d  [        SU< 35      e0 [        S[        U5      (       a#  SR                  [	        S U 5       S/5      5      O[
        05      EU=(       d    0 EnSS0U=(       d    0 EnU R                  [        SUS9[        X4XVS9[        S	9$ )
m  
Delete File

Args:
  file_id: ID of the File.

  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
6Expected a non-empty value for `file_id` but received rO   rP   c              3  8   #    U  H  n[        U5      v   M     g 7frR   rS   rU   s     r:   rX   Files.delete.<locals>.<genexpr>   rZ   r[   r\   /v1/files/{file_id}?beta=truefile_idrI   rJ   rK   rL   rc   cast_to

ValueErrorr   r   re   r   r   _deleter   r,   r.   r9   rs   rH   rI   rJ   rK   rL   s          r:   deleteFiles.delete   s    8 UV]U`abb	
$ '*hhu5Le5LOeNf/g&h"	
 "	
 *+A[mFYWY[||97K(+Q[    
 	
r=   c          
     V   U(       d  [        SU< 35      eSS0U=(       d    0 En0 [        S[        U5      (       a#  SR                  [	        S U 5       S/5      5      O[
        05      EU=(       d    0 EnSS0U=(       d    0 EnU R                  [        SUS	9[        X4XVS
9[        S9$ )o  
Download File

Args:
  file_id: ID of the File.

  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
rn   Acceptapplication/binaryrO   rP   c              3  8   #    U  H  n[        U5      v   M     g 7frR   rS   rU   s     r:   rX   !Files.download.<locals>.<genexpr>   rZ   r[   r\   %/v1/files/{file_id}/content?beta=truerr   rt   ru   )
rx   r   r   re   r   r   _getr   r,   r   rz   s          r:   downloadFiles.download   s    8 UV]U`abb!#7QM<ORQ	
$ '*hhu5Le5LOeNf/g&h"	
 "	
 *+A[mFYWY[yyA7S(+Q[ &  
 	
r=   c          
     8   U(       d  [        SU< 35      e0 [        S[        U5      (       a#  SR                  [	        S U 5       S/5      5      O[
        05      EU=(       d    0 EnSS0U=(       d    0 EnU R                  [        SUS9[        X4XVS9[        S	9$ )
s  
Get File Metadata

Args:
  file_id: ID of the File.

  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
rn   rO   rP   c              3  8   #    U  H  n[        U5      v   M     g 7frR   rS   rU   s     r:   rX   *Files.retrieve_metadata.<locals>.<genexpr>  rZ   r[   r\   rq   rr   rt   ru   
rx   r   r   re   r   r   r   r   r,   r/   rz   s          r:   retrieve_metadataFiles.retrieve_metadata   s    8 UV]U`abb	
$ '*hhu5Le5LOeNf/g&h"	
 "	
 *+A[mFYWY[yy97K(+Q[ !  
 	
r=   c                  0 [        S[        U5      (       a#  SR                  [        S U 5       S/5      5      O[        05      EU=(       d    0 EnSS0U=(       d    0 En[        [        U5      U5      n[        SU0S//5      n[        [        [        [        [        4   U5      S//S9nSUS'   U R                  S	[        U[        R                   5      U[#        X4XVS
9[$        S9$ )m  
Upload File

Args:
  file: The file to upload

  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
rO   rP   c              3  8   #    U  H  n[        U5      v   M     g 7frR   rS   rU   s     r:   rX   Files.upload.<locals>.<genexpr>=  rZ   r[   r\   filepathsmultipart/form-dataContent-Typer]   rt   bodyfilesrc   rv   )r   r   re   r   r   r+   "_stainless_helper_header_from_filer
   r   r   r   rT   object_postr   r)   FileUploadParamsr,   r/   	r9   r   rH   rI   rJ   rK   rL   r   r   s	            r:   uploadFiles.upload  s   8	
$ '*hhu5Le5LOeNf/g&h"	
 "	
 *+A[mFYWY[%&H&NP]^"FD>VH:>d73;#7>xjQ )>n%zz! '9'J'JK(+Q[ !  
 	
r=    )returnr7   )r   r@   )rD   
str | OmitrE   r   rF   
int | OmitrG   r   rH   List[AnthropicBetaParam] | OmitrI   Headers | NonerJ   Query | NonerK   Body | NonerL   'float | httpx.Timeout | None | NotGivenr   zSyncPage[FileMetadata]rs   rT   rH   r   rI   r   rJ   r   rK   r   rL   r   r   r.   )rs   rT   rH   r   rI   r   rJ   r   rK   r   rL   r   r   r   rs   rT   rH   r   rI   r   rJ   r   rK   r   rL   r   r   r/   r   r   rH   r   rI   r   rJ   r   rK   r   rL   r   r   r/   __name__
__module____qualname____firstlineno__r   r;   rA   r   r   ri   r{   r   r   r   __static_attributes__r   r=   r:   r1   r1   +   s6   * * 0 0  $ $ #15 )-$("&;DI
 I
 	I

 I
 I
 /I
 &I
 "I
  I
 9I
 
 I
^ 26 )-$("&;D/
/
 /	/
 &/
 "/
  /
 9/
 
/
j 26 )-$("&;D0
0
 /	0
 &0
 "0
  0
 90
 
0
l 26 )-$("&;D/
/
 /	/
 &/
 "/
  /
 9/
 
/
j 26 )-$("&;D6
 6
 /	6
 &6
 "6
  6
 96
 
6
 6
r=   c            
      T   \ rS rSr\SS j5       r\SS j5       r\\\\\SSS\S.	                   SS jjr	\SSS\S.             SS jjr
\SSS\S.             SS	 jjr\SSS\S.             SS
 jjr\SSS\S.             SS jjrSrg)r2   iW  c                    [        U 5      $ r6   )AsyncFilesWithRawResponser8   s    r:   r;   AsyncFiles.with_raw_responseX  s     )..r=   c                    [        U 5      $ r?   )AsyncFilesWithStreamingResponser8   s    r:   rA   "AsyncFiles.with_streaming_responseb  s     /t44r=   NrC   c       	        T   0 [        S[        U5      (       a#  SR                  [        S U 5       S/5      5      O[        05      EU=(       d    0 EnSS0U=(       d    0 EnU R                  S[        [           [        UUUU	[        UUUUS.[        R                  5      S9[        S9$ )	rN   rO   rP   c              3  8   #    U  H  n[        U5      v   M     g 7frR   rS   rU   s     r:   rX   "AsyncFiles.list.<locals>.<genexpr>  rZ   r[   r\   r]   r^   r_   ra   )r   r   re   r   r   rf   r'   r/   r,   r   r(   rg   rh   s
             r:   ri   AsyncFiles.listk  s    V	
$ '*hhu5Le5LOeNf/g&h"	
 "	
 *+A[mFYWY[!!!<((+'%%$,%.!&$,	 %33 % " 
 	
r=   rk   c          
     T  #    U(       d  [        SU< 35      e0 [        S[        U5      (       a#  SR                  [	        S U 5       S/5      5      O[
        05      EU=(       d    0 EnSS0U=(       d    0 EnU R                  [        SUS9[        X4XVS9[        S	9I S
h  vN $  N7f)rm   rn   rO   rP   c              3  8   #    U  H  n[        U5      v   M     g 7frR   rS   rU   s     r:   rX   $AsyncFiles.delete.<locals>.<genexpr>  rZ   r[   r\   rq   rr   rt   ru   Nrw   rz   s          r:   r{   AsyncFiles.delete  s     8 UV]U`abb	
$ '*hhu5Le5LOeNf/g&h"	
 "	
 *+A[mFYWY[\\97K(+Q[   " 
 
 	
 
   BB(!B&"B(c          
     r  #    U(       d  [        SU< 35      eSS0U=(       d    0 En0 [        S[        U5      (       a#  SR                  [	        S U 5       S/5      5      O[
        05      EU=(       d    0 EnSS0U=(       d    0 EnU R                  [        SUS	9[        X4XVS
9[        S9I Sh  vN $  N7f)r~   rn   r   r   rO   rP   c              3  8   #    U  H  n[        U5      v   M     g 7frR   rS   rU   s     r:   rX   &AsyncFiles.download.<locals>.<genexpr>	  rZ   r[   r\   r   rr   rt   ru   N)
rx   r   r   re   r   r   r   r   r,   r   rz   s          r:   r   AsyncFiles.download  s     8 UV]U`abb!#7QM<ORQ	
$ '*hhu5Le5LOeNf/g&h"	
 "	
 *+A[mFYWY[YYA7S(+Q[ +  
 
 	
 
s   B.B70B51B7c          
     T  #    U(       d  [        SU< 35      e0 [        S[        U5      (       a#  SR                  [	        S U 5       S/5      5      O[
        05      EU=(       d    0 EnSS0U=(       d    0 EnU R                  [        SUS9[        X4XVS9[        S	9I S
h  vN $  N7f)r   rn   rO   rP   c              3  8   #    U  H  n[        U5      v   M     g 7frR   rS   rU   s     r:   rX   /AsyncFiles.retrieve_metadata.<locals>.<genexpr>:  rZ   r[   r\   rq   rr   rt   ru   Nr   rz   s          r:   r   AsyncFiles.retrieve_metadata  s     8 UV]U`abb	
$ '*hhu5Le5LOeNf/g&h"	
 "	
 *+A[mFYWY[YY97K(+Q[ !  
 
 	
 
r   c                 #    0 [        S[        U5      (       a#  SR                  [        S U 5       S/5      5      O[        05      EU=(       d    0 EnSS0U=(       d    0 En[        [        U5      U5      n[        SU0S//5      n[        [        [        [        [        4   U5      S//S9nSUS'   U R                  S	[        U[        R                   5      I S
h  vN U[#        X4XVS9[$        S9I S
h  vN $  N N7f)r   rO   rP   c              3  8   #    U  H  n[        U5      v   M     g 7frR   rS   rU   s     r:   rX   $AsyncFiles.upload.<locals>.<genexpr>i  rZ   r[   r\   r   r   r   r   r]   Nrt   r   )r   r   re   r   r   r+   r   r
   r   r   r   rT   r   r   r   r)   r   r,   r/   r   s	            r:   r   AsyncFiles.uploadJ  s    8	
$ '*hhu5Le5LOeNf/g&h"	
 "	
 *+A[mFYWY[%&H&NP]^"FD>VH:>d73;#7>xjQ )>n%ZZ!,T3E3V3VWW(+Q[ !   
 
 	
W
s$   CC?C;
C?6C=7C?=C?r   )r   r   )r   r   )rD   r   rE   r   rF   r   rG   r   rH   r   rI   r   rJ   r   rK   r   rL   r   r   z5AsyncPaginator[FileMetadata, AsyncPage[FileMetadata]]r   )rs   rT   rH   r   rI   r   rJ   r   rK   r   rL   r   r   r   r   r   r   r   r=   r:   r2   r2   W  s6   / / 5 5  $ $ #15 )-$("&;DI
 I
 	I

 I
 I
 /I
 &I
 "I
  I
 9I
 
?I
^ 26 )-$("&;D/
/
 /	/
 &/
 "/
  /
 9/
 
/
j 26 )-$("&;D0
0
 /	0
 &0
 "0
  0
 90
 
 0
l 26 )-$("&;D/
/
 /	/
 &/
 "/
  /
 9/
 
/
j 26 )-$("&;D6
 6
 /	6
 &6
 "6
  6
 96
 
6
 6
r=   c                      \ rS rSrSS jrSrg)r7   i  c                v   Xl         [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        UR                  [        5      U l        [        R                  " UR                  5      U l        [        R                  " UR                  5      U l	        g rR   )
_filesr	   to_raw_response_wrapperri   r{   r!   r   r   r   r   r9   r   s     r:   __init__FilesWithRawResponse.__init__  s    $<<JJ
	 '>>LL
 7NN
 "2!I!I##"
 '>>LL
r=   r   r{   r   ri   r   r   Nr   r1   r   Noner   r   r   r   r   r   r   r=   r:   r7   r7         
r=   r7   c                      \ rS rSrSS jrSrg)r   i  c                v   Xl         [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        UR                  [        5      U l        [        R                  " UR                  5      U l        [        R                  " UR                  5      U l	        g rR   )
r   r	   async_to_raw_response_wrapperri   r{   r$   r   r   r   r   r   s     r:   r   "AsyncFilesWithRawResponse.__init__  s    $BBJJ
	 'DDLL
 =NN"
 "2!O!O##"
 'DDLL
r=   r   Nr   r2   r   r   r   r   r=   r:   r   r     r   r=   r   c                      \ rS rSrSS jrSrg)r@   i  c                   Xl         [        UR                  5      U l        [        UR                  5      U l        [	        UR
                  [        5      U l        [        UR                  5      U l        [        UR                  5      U l        g rR   )	r   r    ri   r{   r#   r   r   r   r   r   s     r:   r   #FilesWithStreamingResponse.__init__  st    0JJ
	 3LL
 <NN%
 ">##"
 3LL
r=   r   Nr   r   r   r=   r:   r@   r@     r   r=   r@   c                      \ rS rSrSS jrSrg)r   i  c                   Xl         [        UR                  5      U l        [        UR                  5      U l        [	        UR
                  [        5      U l        [        UR                  5      U l        [        UR                  5      U l        g rR   )	r   r"   ri   r{   r%   r   r   r   r   r   s     r:   r   (AsyncFilesWithStreamingResponse.__init__  sv    6JJ
	 9LL
 BNN*
 "D##"
 9LL
r=   r   Nr   r   r   r=   r:   r   r     r   r=   r   )G
__future__r   typingr   r   r   	itertoolsr   httpx r	   r   r
   _typesr   r   r   r   r   r   r   r   _utilsr   r   r   r   r   r   _compatr   	_resourcer   r   	_responser   r   r   r   r    r!   r"   r#   r$   r%   
paginationr&   r'   
types.betar(   r)   _base_clientr*   r+   r,   lib._stainless_helpersr-   r   types.beta.deleted_filer.   types.beta.file_metadatar/   types.anthropic_beta_paramr0   __all__r1   r2   r7   r   r@   r   r   r=   r:   <module>r      s    # & &     ) V V V u u & :   . > 
 n 2 4 <L
!i
O i
X	i
! i
X	
 
,
 
,
 
,
 
r=   