
    zvhR                       d dl mZ d dl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 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 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. ddl/m0Z0 ddl1m2Z2 ddl3m4Z4 ddgZ5 G d de!      Z6 G d de"      Z7 G d d      Z8 G d d      Z9 G d d      Z: G d d      Z;y)     )annotations)Mappingcast)LiteralN   )_legacy_response   )ContentAsyncContentContentWithRawResponseAsyncContentWithRawResponseContentWithStreamingResponse!AsyncContentWithStreamingResponse)	NOT_GIVENBodyQueryHeadersNoneTypeNotGiven	FileTypes)extract_filesmaybe_transformdeepcopy_minimalasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)SyncCursorPageAsyncCursorPage)AsyncPaginatormake_request_options)file_list_paramsfile_create_params)FileListResponse)FileCreateResponse)FileRetrieveResponseFiles
AsyncFilesc                     e Zd Zedd       Zedd       Zedd       Zeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	eeeddded		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd
Z
ddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)r)   c                ,    t        | j                        S N)r
   _clientselfs    _/var/www/html/luna/venv/lib/python3.12/site-packages/openai/resources/containers/files/files.pycontentzFiles.content#   s    t||$$    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/openai/openai-python#accessing-raw-response-data-eg-headers
        )FilesWithRawResponser/   s    r1   with_raw_responsezFiles.with_raw_response'   s     $D))r3   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/openai/openai-python#with_streaming_response
        )FilesWithStreamingResponser/   s    r1   with_streaming_responsezFiles.with_streaming_response1   s     *$//r3   Nfilefile_idextra_headersextra_query
extra_bodytimeoutc               ,   |st        d|      t        ||d      }t        t        t        t
        t        f   |      dgg      }	ddi|xs i }| j                  d| dt        |t        j                        |	t        ||||	      t        
      S )<  
        Create a Container File

        You can send either a multipart/form-data request with the raw file content, or
        a JSON request with a file ID.

        Args:
          file: The File object (not file name) to be uploaded.

          file_id: Name of the file to create.

          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
        ;Expected a non-empty value for `container_id` but received r=   r>   r=   pathsContent-Typemultipart/form-data/containers//filesr?   r@   rA   rB   bodyfilesoptionscast_to)
ValueErrorr   r   r   r   strobject_postr   r%   FileCreateParamsr#   r'   
r0   container_idr=   r>   r?   r@   rA   rB   rO   rP   s
             r1   createzFiles.create:   s    @ Z[gZjkll"
 d73;#7>xjQ ()>X=CVTVXzz<./ '9'J'JK(+Q[el '  
 	
r3   rM   c          	         |st        d|      |st        d|      | j                  d| d| t        ||||      t              S )K  
        Retrieve Container File

        Args:
          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
        rE   6Expected a non-empty value for `file_id` but received rK   /files/rM   rQ   rR   rS   _getr#   r(   r0   r>   rY   r?   r@   rA   rB   s          r1   retrievezFiles.retrieveq   sr    0 Z[gZjkllUV]U`abbyy<.y9(+Q[el )  
 	
r3   afterlimitorderr?   r@   rA   rB   c                   |st        d|      | j                  d| dt        t           t	        ||||t        |||dt        j                              t              S a  List Container files

        Args:
          after: A cursor for use in pagination.

        `after` is an object ID that defines your place
              in the list. For instance, if you make a list request and receive 100 objects,
              ending with obj_foo, your subsequent call can include after=obj_foo in order to
              fetch the next page of the list.

          limit: A limit on the number of objects to be returned. Limit can range between 1 and
              100, and the default is 20.

          order: Sort order by the `created_at` timestamp of the objects. `asc` for ascending
              order and `desc` for descending order.

          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
        rE   rK   rL   )re   rf   rg   )r?   r@   rA   rB   query)pagerQ   model)rS   _get_api_listr    r&   r#   r   r$   FileListParams	r0   rY   re   rf   rg   r?   r@   rA   rB   s	            r1   listz
Files.list   s    L Z[gZjkll!!<./ 01(+'%%!&!&!&
 %33 ## " 
 	
r3   c          	         |st        d|      |st        d|      ddi|xs i }| j                  d| d| t        ||||      t              S )	I  
        Delete Container File

        Args:
          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
        rE   r]   Accept*/*rK   r^   rM   r_   rS   _deleter#   r   rb   s          r1   deletezFiles.delete   s    0 Z[gZjkllUV]U`abb!5B]-@bB||<.y9(+Q[el   
 	
r3   )returnr
   )rx   r6   )rx   r:   rY   rT   r=   zFileTypes | NotGivenr>   str | NotGivenr?   Headers | Noner@   Query | NonerA   Body | NonerB   'float | httpx.Timeout | None | NotGivenrx   r'   r>   rT   rY   rT   r?   r{   r@   r|   rA   r}   rB   r~   rx   r(   )rY   rT   re   rz   rf   int | NotGivenrg   !Literal['asc', 'desc'] | NotGivenr?   r{   r@   r|   rA   r}   rB   r~   rx   z SyncCursorPage[FileListResponse]r>   rT   rY   rT   r?   r{   r@   r|   rA   r}   rB   r~   rx   None__name__
__module____qualname__r   r2   r7   r;   r   rZ   rc   rp   rw    r3   r1   r)   r)   "   s   % % * * 0 0 &/"+ )-$("&;D5
5
 #	5

  5
 &5
 "5
  5
 95
 
5
| )-$("&;D"
"
 	"
 &"
 ""
  "
 9"
 
"
P !* )3< )-$("&;D:
:
 	:

 :
 1:
 &:
 ":
  :
 9:
 
*:
F )-$("&;D#
#
 	#
 &#
 "#
  #
 9#
 
#
r3   c                     e Zd Zedd       Zedd       Zedd       Zeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	eeeddded		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd
Z
ddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)r*   c                ,    t        | j                        S r-   )r   r.   r/   s    r1   r2   zAsyncFiles.content   s    DLL))r3   c                    t        |       S r5   )AsyncFilesWithRawResponser/   s    r1   r7   zAsyncFiles.with_raw_response   s     )..r3   c                    t        |       S r9   )AsyncFilesWithStreamingResponser/   s    r1   r;   z"AsyncFiles.with_streaming_response  s     /t44r3   Nr<   c               \  K   |st        d|      t        ||d      }t        t        t        t
        t        f   |      dgg      }	ddi|xs i }| j                  d| dt        |t        j                         d	{   |	t        ||||
      t               d	{   S 7 %7 w)rD   rE   rF   r=   rG   rI   rJ   rK   rL   NrM   rN   )rS   r   r   r   r   rT   rU   rV   r   r%   rW   r#   r'   rX   s
             r1   rZ   zAsyncFiles.create  s     @ Z[gZjkll"
 d73;#7>xjQ ()>X=CVTVXZZ<./,T3E3V3VWW(+Q[el '   
 
 	
W
s$   B B,B(
 B,#B*$B,*B,rM   c          	        K   |st        d|      |st        d|      | j                  d| d| t        ||||      t               d{   S 7 w)r\   rE   r]   rK   r^   rM   r_   Nr`   rb   s          r1   rc   zAsyncFiles.retrieveF  s     0 Z[gZjkllUV]U`abbYY<.y9(+Q[el )  
 
 	
 
s   AAAArd   c                   |st        d|      | j                  d| dt        t           t	        ||||t        |||dt        j                              t              S ri   )rS   rm   r!   r&   r#   r   r$   rn   ro   s	            r1   rp   zAsyncFiles.listj  s    L Z[gZjkll!!<./ !12(+'%%!&!&!&
 %33 ## " 
 	
r3   c          	        K   |st        d|      |st        d|      ddi|xs i }| j                  d| d| t        ||||      t               d	{   S 7 w)
rr   rE   r]   rs   rt   rK   r^   rM   r_   Nru   rb   s          r1   rw   zAsyncFiles.delete  s     0 Z[gZjkllUV]U`abb!5B]-@bB\\<.y9(+Q[el  " 
 
 	
 
s   AA"A A")rx   r   )rx   r   )rx   r   ry   r   )rY   rT   re   rz   rf   r   rg   r   r?   r{   r@   r|   rA   r}   rB   r~   rx   zCAsyncPaginator[FileListResponse, AsyncCursorPage[FileListResponse]]r   r   r   r3   r1   r*   r*      s   * * / / 5 5 &/"+ )-$("&;D5
5
 #	5

  5
 &5
 "5
  5
 95
 
5
| )-$("&;D"
"
 	"
 &"
 ""
  "
 9"
 
"
P !* )3< )-$("&;D:
:
 	:

 :
 1:
 &:
 ":
  :
 9:
 
M:
F )-$("&;D#
#
 	#
 &#
 "#
  #
 9#
 
#
r3   c                  &    e Zd ZddZedd       Zy)r6   c                2   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        y r-   )_filesr   to_raw_response_wrapperrZ   rc   rp   rw   r0   rP   s     r1   __init__zFilesWithRawResponse.__init__  ss    &>>LL
 )@@NN
 %<<JJ
	 '>>LL
r3   c                @    t        | j                  j                        S r-   )r   r   r2   r/   s    r1   r2   zFilesWithRawResponse.content  s    %dkk&9&9::r3   NrP   r)   rx   r   )rx   r   r   r   r   r   r   r2   r   r3   r1   r6   r6     s    
  ; ;r3   r6   c                  &    e Zd ZddZedd       Zy)r   c                2   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        y r-   )r   r   async_to_raw_response_wrapperrZ   rc   rp   rw   r   s     r1   r   z"AsyncFilesWithRawResponse.__init__  ss    &DDLL
 )FFNN
 %BBJJ
	 'DDLL
r3   c                @    t        | j                  j                        S r-   )r   r   r2   r/   s    r1   r2   z!AsyncFilesWithRawResponse.content  s    *4;;+>+>??r3   NrP   r*   rx   r   )rx   r   r   r   r3   r1   r   r     s    
  @ @r3   r   c                  &    e Zd ZddZedd       Zy)r:   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        y r-   )r   r   rZ   rc   rp   rw   r   s     r1   r   z#FilesWithStreamingResponse.__init__  s[    2LL
 5NN
 1JJ
	 3LL
r3   c                @    t        | j                  j                        S r-   )r   r   r2   r/   s    r1   r2   z"FilesWithStreamingResponse.content	  s    +DKK,?,?@@r3   Nr   )rx   r   r   r   r3   r1   r:   r:     s    
  A Ar3   r:   c                  &    e Zd ZddZedd       Zy)r   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        y r-   )r   r   rZ   rc   rp   rw   r   s     r1   r   z(AsyncFilesWithStreamingResponse.__init__  s[    8LL
 ;NN
 7JJ
	 9LL
r3   c                @    t        | j                  j                        S r-   )r   r   r2   r/   s    r1   r2   z'AsyncFilesWithStreamingResponse.content  s    01D1DEEr3   Nr   )rx   r   r   r   r3   r1   r   r     s    
  F Fr3   r   )<
__future__r   typingr   r   typing_extensionsr   httpx r   r2   r
   r   r   r   r   r   _typesr   r   r   r   r   r   r   _utilsr   r   r   r   _compatr   	_resourcer   r   	_responser   r   
paginationr    r!   _base_clientr"   r#   types.containersr$   r%   #types.containers.file_list_responser&   %types.containers.file_create_responser'   'types.containers.file_retrieve_responser(   __all__r)   r*   r6   r   r:   r   r   r3   r1   <module>r      s    #   %  !  V U U ^ ^ ' ; Z : A E D H LL
!R
O R
jR
! R
j; ;,@ @,A A,F Fr3   