
    ̺ii                       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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K.J/r/J0r0  SSK1J2r2J3r3  SSK4J5r6  SSK7J8r8  SSK9J:r:  SSK;J<r<  SS/r= " S S\5      r> " S S\5      r? " S S5      r@ " S S5      rA " S S5      rB " S S5      rCg)    )annotations)ListMappingcast)chainN   )_legacy_response)BodyOmitQueryHeadersNotGiven	FileTypesomit	not_given)is_givenextract_filesmaybe_transformstrip_not_givendeepcopy_minimal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make_request_options)!stainless_helper_header_from_file)DeletedFile)FileMetadata)AnthropicBetaParamFiles
AsyncFilesc            	      N   \ 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)r/   &   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    ]/var/www/piano.thomer.com/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
)FilesWithStreamingResponser6   s    r8   with_streaming_responseFiles.with_streaming_response1   s     *$//r;   Nafter_id	before_idlimitbetasextra_headersextra_query
extra_bodytimeoutc               R   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S.[        R                  5      S9[        S9$ )	  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`.

  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     r8   	<genexpr>Files.list.<locals>.<genexpr>d        5Lec!ffe   files-api-2025-04-14/v1/files?beta=truerB   rC   rD   rF   rG   rH   rI   querypageoptionsmodel)r   r   joinr   r   _get_api_listr%   r-   r*   r   r'   FileListParams	r7   rB   rC   rD   rE   rF   rG   rH   rI   s	            r8   list
Files.list:   s    N	
$ '*hhu5Le5LOeNf/g&h"	
 "	
 *+A[mFYWY[!!!,'(+'%%$,%.!&
 %33 # " 
 	
r;   rE   rF   rG   rH   rI   c          
     0   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3[        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 rL   rM   c              3  8   #    U  H  n[        U5      v   M     g 7frO   rP   rR   s     r8   rU   Files.delete.<locals>.<genexpr>   rW   rX   rY   
/v1/files/
?beta=truerF   rG   rH   rI   r`   cast_to	
ValueErrorr   r   rb   r   r   _deleter*   r,   r7   file_idrE   rF   rG   rH   rI   s          r8   deleteFiles.delete   s    8 UV]U`abb	
$ '*hhu5Le5LOeNf/g&h"	
 "	
 *+A[mFYWY[||	,(+Q[    
 	
r;   c          
     N   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	3[        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
rk   Acceptapplication/binaryrL   rM   c              3  8   #    U  H  n[        U5      v   M     g 7frO   rP   rR   s     r8   rU   !Files.download.<locals>.<genexpr>   rW   rX   rY   rn   /content?beta=truerp   rq   )	rt   r   r   rb   r   r   _getr*   r   rv   s          r8   downloadFiles.download   s    8 UV]U`abb!#7QM<ORQ	
$ '*hhu5Le5LOeNf/g&h"	
 "	
 *+A[mFYWY[yy	!34(+Q[ &  
 	
r;   c          
     0   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3[        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
rk   rL   rM   c              3  8   #    U  H  n[        U5      v   M     g 7frO   rP   rR   s     r8   rU   *Files.retrieve_metadata.<locals>.<genexpr>  rW   rX   rY   rn   ro   rp   rq   	rt   r   r   rb   r   r   r   r*   r-   rv   s          r8   retrieve_metadataFiles.retrieve_metadata   s    8 UV]U`abb	
$ '*hhu5Le5LOeNf/g&h"	
 "	
 *+A[mFYWY[yy	,(+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0 [        U5      EUEn[        SU0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
rL   rM   c              3  8   #    U  H  n[        U5      v   M     g 7frO   rP   rR   s     r8   rU   Files.upload.<locals>.<genexpr>3  rW   rX   rY   filepathsmultipart/form-dataContent-TyperZ   rp   bodyfilesr`   rr   )r   r   rb   r   r   "_stainless_helper_header_from_filer   r   r   r   rQ   object_postr   r(   FileUploadParamsr*   r-   	r7   r   rE   rF   rG   rH   rI   r   r   s	            r8   uploadFiles.upload  s    8	
$ '*hhu5Le5LOeNf/g&h"	
 "	
 *+A[mFYWY[U=dCU}U/d73;#7>xjQ )>n%zz! '9'J'JK(+Q[ !  
 	
r;    )returnr5   )r   r>   )rB   
str | OmitrC   r   rD   
int | OmitrE   List[AnthropicBetaParam] | OmitrF   Headers | NonerG   Query | NonerH   Body | NonerI   'float | httpx.Timeout | None | NotGivenr   zSyncPage[FileMetadata]rw   rQ   rE   r   rF   r   rG   r   rH   r   rI   r   r   r,   )rw   rQ   rE   r   rF   r   rG   r   rH   r   rI   r   r   r   rw   rQ   rE   r   rF   r   rG   r   rH   r   rI   r   r   r-   r   r   rE   r   rF   r   rG   r   rH   r   rI   r   r   r-   __name__
__module____qualname____firstlineno__r   r9   r?   r   r   rf   rx   r   r   r   __static_attributes__r   r;   r8   r/   r/   &   s(   * * 0 0  $ $ 15 )-$("&;DD
 D
 	D

 D
 /D
 &D
 "D
  D
 9D
 
 D
T 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            	      N   \ 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)r0   iM  c                    [        U 5      $ r4   )AsyncFilesWithRawResponser6   s    r8   r9   AsyncFiles.with_raw_responseN  s     )..r;   c                    [        U 5      $ r=   )AsyncFilesWithStreamingResponser6   s    r8   r?   "AsyncFiles.with_streaming_responseX  s     /t44r;   NrA   c               R   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S.[        R                  5      S9[        S9$ )	rK   rL   rM   c              3  8   #    U  H  n[        U5      v   M     g 7frO   rP   rR   s     r8   rU   "AsyncFiles.list.<locals>.<genexpr>  rW   rX   rY   rZ   r[   r\   r^   )r   r   rb   r   r   rc   r&   r-   r*   r   r'   rd   re   s	            r8   rf   AsyncFiles.lista  s    N	
$ '*hhu5Le5LOeNf/g&h"	
 "	
 *+A[mFYWY[!!!<((+'%%$,%.!&
 %33 # " 
 	
r;   rh   c          
     L  #    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3[        X4XVS9[        S	9I S
h  vN $  N7f)rj   rk   rL   rM   c              3  8   #    U  H  n[        U5      v   M     g 7frO   rP   rR   s     r8   rU   $AsyncFiles.delete.<locals>.<genexpr>  rW   rX   rY   rn   ro   rp   rq   Nrs   rv   s          r8   rx   AsyncFiles.delete  s     8 UV]U`abb	
$ '*hhu5Le5LOeNf/g&h"	
 "	
 *+A[mFYWY[\\	,(+Q[   " 
 
 	
 
   BB$B"B$c          
     j  #    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	3[        X4XVS
9[        S9I Sh  vN $  N7f)r{   rk   r|   r}   rL   rM   c              3  8   #    U  H  n[        U5      v   M     g 7frO   rP   rR   s     r8   rU   &AsyncFiles.download.<locals>.<genexpr>  rW   rX   rY   rn   r   rp   rq   N)	rt   r   r   rb   r   r   r   r*   r   rv   s          r8   r   AsyncFiles.download  s     8 UV]U`abb!#7QM<ORQ	
$ '*hhu5Le5LOeNf/g&h"	
 "	
 *+A[mFYWY[YY	!34(+Q[ +  
 
 	
 
s   B*B3,B1-B3c          
     L  #    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3[        X4XVS9[        S	9I S
h  vN $  N7f)r   rk   rL   rM   c              3  8   #    U  H  n[        U5      v   M     g 7frO   rP   rR   s     r8   rU   /AsyncFiles.retrieve_metadata.<locals>.<genexpr>+  rW   rX   rY   rn   ro   rp   rq   Nr   rv   s          r8   r   AsyncFiles.retrieve_metadata
  s     8 UV]U`abb	
$ '*hhu5Le5LOeNf/g&h"	
 "	
 *+A[mFYWY[YY	,(+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0 [        U5      EUEn[        SU0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   rL   rM   c              3  8   #    U  H  n[        U5      v   M     g 7frO   rP   rR   s     r8   rU   $AsyncFiles.upload.<locals>.<genexpr>Z  rW   rX   rY   r   r   r   r   rZ   Nrp   r   )r   r   rb   r   r   r   r   r   r   r   rQ   r   r   r   r(   r   r*   r-   r   s	            r8   r   AsyncFiles.upload;  s    8	
$ '*hhu5Le5LOeNf/g&h"	
 "	
 *+A[mFYWY[U=dCU}U/d73;#7>xjQ )>n%ZZ!,T3E3V3VWW(+Q[ !   
 
 	
W
s$   CC6C2
C6-C4.C64C6r   )r   r   )r   r   )rB   r   rC   r   rD   r   rE   r   rF   r   rG   r   rH   r   rI   r   r   z5AsyncPaginator[FileMetadata, AsyncPage[FileMetadata]]r   )rw   rQ   rE   r   rF   r   rG   r   rH   r   rI   r   r   r   r   r   r   r   r;   r8   r0   r0   M  s(   / / 5 5  $ $ 15 )-$("&;DD
 D
 	D

 D
 /D
 &D
 "D
  D
 9D
 
?D
T 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)r5   it  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 rO   )
_filesr	   to_raw_response_wrapperrf   rx   r    r   r   r   r   r7   r   s     r8   __init__FilesWithRawResponse.__init__u  s    $<<JJ
	 '>>LL
 7NN
 "2!I!I##"
 '>>LL
r;   r   rx   r   rf   r   r   Nr   r/   r   Noner   r   r   r   r   r   r   r;   r8   r5   r5   t      
r;   r5   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 rO   )
r   r	   async_to_raw_response_wrapperrf   rx   r#   r   r   r   r   r   s     r8   r   "AsyncFilesWithRawResponse.__init__  s    $BBJJ
	 'DDLL
 =NN"
 "2!O!O##"
 'DDLL
r;   r   Nr   r0   r   r   r   r   r;   r8   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 rO   )	r   r   rf   rx   r"   r   r   r   r   r   s     r8   r   #FilesWithStreamingResponse.__init__  st    0JJ
	 3LL
 <NN%
 ">##"
 3LL
r;   r   Nr   r   r   r;   r8   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 rO   )	r   r!   rf   rx   r$   r   r   r   r   r   s     r8   r   (AsyncFilesWithStreamingResponse.__init__  sv    6JJ
	 9LL
 BNN*
 "D##"
 9LL
r;   r   Nr   r   r   r;   r8   r   r     r   r;   r   )D
__future__r   typingr   r   r   	itertoolsr   httpx 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*   lib._stainless_helpersr+   r   types.beta.deleted_filer,   types.beta.file_metadatar-   types.anthropic_beta_paramr.   __all__r/   r0   r5   r   r>   r   r   r;   r8   <module>r      s    # & &     V V V x x & :   . > @ m 2 4 <L
!d
O d
N	d
! d
N	
 
,
 
,
 
,
 
r;   