
    _jbl                       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K3J4r4J5r5  SSK6J7r8  SSK9J:r:  SSK;J<r<  SSK=J>r>  SS/r? " S S\ 5      r@ " S S\!5      rA " S S5      rB " S S5      rC " S S5      rD " S S5      rEg)     )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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)r0   '   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    S/home/rurouni/.local/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
)FilesWithStreamingResponser7   s    r9   with_streaming_responseFiles.with_streaming_response2   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     r9   	<genexpr>Files.list.<locals>.<genexpr>i        5Lec!ffe   files-api-2025-04-14/v1/files?beta=truerC   rD   rE   rF   rH   rI   rJ   rK   querypageoptionsmodel)r   r   joinr   r   _get_api_listr&   r.   r+   r   r(   FileListParams
r8   rC   rD   rE   rF   rG   rH   rI   rJ   rK   s
             r9   list
Files.list;   s    V	
$ '*hhu5Le5LOeNf/g&h"	
 "	
 *+A[mFYWY[!!!,'(+'%%$,%.!&$,	 %33 % " 
 	
r<   rG   rH   rI   rJ   rK   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 rN   rO   c              3  8   #    U  H  n[        U5      v   M     g 7frQ   rR   rT   s     r9   rW   Files.delete.<locals>.<genexpr>   rY   rZ   r[   /v1/files/{file_id}?beta=truefile_idrH   rI   rJ   rK   rb   cast_to

ValueErrorr   r   rd   r   r   _deleter   r+   r-   r8   rr   rG   rH   rI   rJ   rK   s          r9   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
rm   Acceptapplication/binaryrN   rO   c              3  8   #    U  H  n[        U5      v   M     g 7frQ   rR   rT   s     r9   rW   !Files.download.<locals>.<genexpr>   rY   rZ   r[   %/v1/files/{file_id}/content?beta=truerq   rs   rt   )
rw   r   r   rd   r   r   _getr   r+   r   ry   s          r9   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
rm   rN   rO   c              3  8   #    U  H  n[        U5      v   M     g 7frQ   rR   rT   s     r9   rW   *Files.retrieve_metadata.<locals>.<genexpr>
  rY   rZ   r[   rp   rq   rs   rt   
rw   r   r   rd   r   r   r   r   r+   r.   ry   s          r9   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0 [        U5      EUE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
rN   rO   c              3  8   #    U  H  n[        U5      v   M     g 7frQ   rR   rT   s     r9   rW   Files.upload.<locals>.<genexpr>9  rY   rZ   r[   filepathsmultipart/form-dataContent-Typer\   rs   bodyfilesrb   ru   )r   r   rd   r   r   "_stainless_helper_header_from_filer
   r   r   r   rS   object_postr   r)   FileUploadParamsr+   r.   	r8   r   rG   rH   rI   rJ   rK   r   r   s	            r9   uploadFiles.upload  s   8	
$ '*hhu5Le5LOeNf/g&h"	
 "	
 *+A[mFYWY[U=dCU}U"FD>VH:>d73;#7>xjQ )>n%zz! '9'J'JK(+Q[ !  
 	
r<    )returnr6   )r   r?   )rC   
str | OmitrD   r   rE   
int | OmitrF   r   rG   List[AnthropicBetaParam] | OmitrH   Headers | NonerI   Query | NonerJ   Body | NonerK   'float | httpx.Timeout | None | NotGivenr   zSyncPage[FileMetadata]rr   rS   rG   r   rH   r   rI   r   rJ   r   rK   r   r   r-   )rr   rS   rG   r   rH   r   rI   r   rJ   r   rK   r   r   r   rr   rS   rG   r   rH   r   rI   r   rJ   r   rK   r   r   r.   r   r   rG   r   rH   r   rI   r   rJ   r   rK   r   r   r.   __name__
__module____qualname____firstlineno__r   r:   r@   r   r   rh   rz   r   r   r   __static_attributes__r   r<   r9   r0   r0   '   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)r1   iS  c                    [        U 5      $ r5   )AsyncFilesWithRawResponser7   s    r9   r:   AsyncFiles.with_raw_responseT  s     )..r<   c                    [        U 5      $ r>   )AsyncFilesWithStreamingResponser7   s    r9   r@   "AsyncFiles.with_streaming_response^  s     /t44r<   NrB   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$ )	rM   rN   rO   c              3  8   #    U  H  n[        U5      v   M     g 7frQ   rR   rT   s     r9   rW   "AsyncFiles.list.<locals>.<genexpr>  rY   rZ   r[   r\   r]   r^   r`   )r   r   rd   r   r   re   r'   r.   r+   r   r(   rf   rg   s
             r9   rh   AsyncFiles.listg  s    V	
$ '*hhu5Le5LOeNf/g&h"	
 "	
 *+A[mFYWY[!!!<((+'%%$,%.!&$,	 %33 % " 
 	
r<   rj   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)rl   rm   rN   rO   c              3  8   #    U  H  n[        U5      v   M     g 7frQ   rR   rT   s     r9   rW   $AsyncFiles.delete.<locals>.<genexpr>  rY   rZ   r[   rp   rq   rs   rt   Nrv   ry   s          r9   rz   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}   rm   r~   r   rN   rO   c              3  8   #    U  H  n[        U5      v   M     g 7frQ   rR   rT   s     r9   rW   &AsyncFiles.download.<locals>.<genexpr>  rY   rZ   r[   r   rq   rs   rt   N)
rw   r   r   rd   r   r   r   r   r+   r   ry   s          r9   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   rm   rN   rO   c              3  8   #    U  H  n[        U5      v   M     g 7frQ   rR   rT   s     r9   rW   /AsyncFiles.retrieve_metadata.<locals>.<genexpr>6  rY   rZ   r[   rp   rq   rs   rt   Nr   ry   s          r9   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0 [        U5      EUE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   rN   rO   c              3  8   #    U  H  n[        U5      v   M     g 7frQ   rR   rT   s     r9   rW   $AsyncFiles.upload.<locals>.<genexpr>e  rY   rZ   r[   r   r   r   r   r\   Nrs   r   )r   r   rd   r   r   r   r
   r   r   r   rS   r   r   r   r)   r   r+   r.   r   s	            r9   r   AsyncFiles.uploadF  s    8	
$ '*hhu5Le5LOeNf/g&h"	
 "	
 *+A[mFYWY[U=dCU}U"FD>VH:>d73;#7>xjQ )>n%ZZ!,T3E3V3VWW(+Q[ !   
 
 	
W
s$   CC9C5
C90C71C97C9r   )r   r   )r   r   )rC   r   rD   r   rE   r   rF   r   rG   r   rH   r   rI   r   rJ   r   rK   r   r   z5AsyncPaginator[FileMetadata, AsyncPage[FileMetadata]]r   )rr   rS   rG   r   rH   r   rI   r   rJ   r   rK   r   r   r   r   r   r   r   r<   r9   r1   r1   S  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)r6   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 rQ   )
_filesr	   to_raw_response_wrapperrh   rz   r!   r   r   r   r   r8   r   s     r9   __init__FilesWithRawResponse.__init__  s    $<<JJ
	 '>>LL
 7NN
 "2!I!I##"
 '>>LL
r<   r   rz   r   rh   r   r   Nr   r0   r   Noner   r   r   r   r   r   r   r<   r9   r6   r6         
r<   r6   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 rQ   )
r   r	   async_to_raw_response_wrapperrh   rz   r$   r   r   r   r   r   s     r9   r   "AsyncFilesWithRawResponse.__init__  s    $BBJJ
	 'DDLL
 =NN"
 "2!O!O##"
 'DDLL
r<   r   Nr   r1   r   r   r   r   r<   r9   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 rQ   )	r   r    rh   rz   r#   r   r   r   r   r   s     r9   r   #FilesWithStreamingResponse.__init__  st    0JJ
	 3LL
 <NN%
 ">##"
 3LL
r<   r   Nr   r   r   r<   r9   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 rQ   )	r   r"   rh   rz   r%   r   r   r   r   r   s     r9   r   (AsyncFilesWithStreamingResponse.__init__  sv    6JJ
	 9LL
 BNN*
 "D##"
 9LL
r<   r   Nr   r   r   r<   r9   r   r     r   r<   r   )F
__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+   lib._stainless_helpersr,   r   types.beta.deleted_filer-   types.beta.file_metadatar.   types.anthropic_beta_paramr/   __all__r0   r1   r6   r   r?   r   r   r<   r9   <module>r      s    # & &     ) V V V u u & :   . > @ m 2 4 <L
!i
O i
X	i
! i
X	
 
,
 
,
 
,
 
r<   