
    iT                       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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/m0Z0m1Z1 ddl2m3Z3 ddl4m5Z5 ddl6m7Z7 ddgZ8 G d de$      Z9 G d de%      Z: G d d      Z; G d d      Z< G d d      Z= G d d      Z>y)     )annotations)Mappingcast)LiteralN   )_legacy_response   )ContentAsyncContentContentWithRawResponseAsyncContentWithRawResponseContentWithStreamingResponse!AsyncContentWithStreamingResponse)	BodyOmitQueryHeadersNoneTypeNotGiven	FileTypesomit	not_given)extract_filespath_template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    x/Users/manta/Documents/Projects/TheRoad-I1/.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
        )FilesWithRawResponser2   s    r4   with_raw_responsezFiles.with_raw_response'   s     $D))r6   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
        )FilesWithStreamingResponser2   s    r4   with_streaming_responsezFiles.with_streaming_response1   s     *$//r6   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      }	|	r
ddi|xs i }| j                  t        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@   rA   r@   pathsContent-Typemultipart/form-data /containers/{container_id}/filescontainer_idrB   rC   rD   rE   bodyfilesoptionscast_to)
ValueErrorr   r   r   r   strobject_postr   r   r(   FileCreateParamsr&   r*   
r3   rP   r@   rA   rB   rC   rD   rE   rS   rT   s
             r4   createzFiles.create:   s    @ Z[gZjkll"
 d73;#7>xjQ ,-B\}GZXZ\Mzz<<X '9'J'JK(+Q[el '  
 	
r6   rQ   c          	         |st        d|      |st        d|      | j                  t        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
        rH   6Expected a non-empty value for `file_id` but received */containers/{container_id}/files/{file_id}rP   rA   rQ   rU   rV   rW   _getr   r&   r+   r3   rA   rP   rB   rC   rD   rE   s          r4   retrievezFiles.retriever   sq    0 Z[gZjkllUV]U`abbyyFUakrs(+Q[el )  
 	
r6   afterlimitorderrB   rC   rD   rE   c                   |st        d|      | j                  t        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
        rH   rN   rO   )ri   rj   rk   )rB   rC   rD   rE   query)pagerU   model)	rW   _get_api_listr   r#   r)   r&   r   r'   FileListParams	r3   rP   ri   rj   rk   rB   rC   rD   rE   s	            r4   listz
Files.list   s    L Z[gZjkll!!<<X 01(+'%%!&!&!&
 %33 ## " 
 	
r6   c          	         |st        d|      |st        d|      ddi|xs i }| j                  t        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
        rH   r`   Accept*/*ra   rb   rQ   rc   rW   _deleter   r&   r   rf   s          r4   deletezFiles.delete   s    0 Z[gZjkllUV]U`abb!5B]-@bB||FUakrs(+Q[el   
 	
r6   )returnr
   )r|   r9   )r|   r=   rP   rX   r@   zFileTypes | OmitrA   
str | OmitrB   Headers | NonerC   Query | NonerD   Body | NonerE   'float | httpx.Timeout | None | NotGivenr|   r*   rA   rX   rP   rX   rB   r   rC   r   rD   r   rE   r   r|   r+   )rP   rX   ri   r~   rj   
int | Omitrk   Literal['asc', 'desc'] | OmitrB   r   rC   r   rD   r   rE   r   r|   z SyncCursorPage[FileListResponse]rA   rX   rP   rX   rB   r   rC   r   rD   r   rE   r   r|   None__name__
__module____qualname__r   r5   r:   r>   r   r   r]   rg   rt   r{    r6   r4   r,   r,   "   s   % % * * 0 0 "&" )-$("&;D6
6
 	6

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

 :
 -:
 &:
 ":
  :
 9:
 
*:
F )-$("&;D#
#
 	#
 &#
 "#
  #
 9#
 
#
r6   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 r0   )r   r1   r2   s    r4   r5   zAsyncFiles.content   s    DLL))r6   c                    t        |       S r8   )AsyncFilesWithRawResponser2   s    r4   r:   zAsyncFiles.with_raw_response   s     )..r6   c                    t        |       S r<   )AsyncFilesWithStreamingResponser2   s    r4   r>   z"AsyncFiles.with_streaming_response  s     /t44r6   Nr?   c               n  K   |st        d|      t        ||d      }t        t        t        t
        t        f   |      dgg      }	|	r
ddi|xs i }| j                  t        d|      t        |t        j                         d	{   |	t        ||||
      t               d	{   S 7 %7 w)rG   rH   rI   r@   rJ   rL   rM   rN   rO   NrQ   rR   )rW   r   r   r   r   rX   rY   rZ   r   r   r(   r[   r&   r*   r\   s
             r4   r]   zAsyncFiles.create  s     @ Z[gZjkll"
 d73;#7>xjQ ,-B\}GZXZ\MZZ<<X,T3E3V3VWW(+Q[el '   
 
 	
W
s$   B	B5B1
 B5,B3-B53B5rQ   c          	        K   |st        d|      |st        d|      | j                  t        d||      t        ||||      t               d{   S 7 w)r_   rH   r`   ra   rb   rQ   rc   Nrd   rf   s          r4   rg   zAsyncFiles.retrieveH  s     0 Z[gZjkllUV]U`abbYYFUakrs(+Q[el )  
 
 	
 
s   AAAArh   c                   |st        d|      | j                  t        d|      t        t           t        ||||t        |||dt        j                              t              S rm   )	rW   rq   r   r$   r)   r&   r   r'   rr   rs   s	            r4   rt   zAsyncFiles.listl  s    L Z[gZjkll!!<<X !12(+'%%!&!&!&
 %33 ## " 
 	
r6   c          	        K   |st        d|      |st        d|      ddi|xs i }| j                  t        d||      t        ||||      t               d	{   S 7 w)
rv   rH   r`   rw   rx   ra   rb   rQ   rc   Nry   rf   s          r4   r{   zAsyncFiles.delete  s     0 Z[gZjkllUV]U`abb!5B]-@bB\\FUakrs(+Q[el  " 
 
 	
 
s   AA(!A&"A()r|   r   )r|   r   )r|   r   r}   r   )rP   rX   ri   r~   rj   r   rk   r   rB   r   rC   r   rD   r   rE   r   r|   zCAsyncPaginator[FileListResponse, AsyncCursorPage[FileListResponse]]r   r   r   r6   r4   r-   r-      s   * * / / 5 5 "&" )-$("&;D6
6
 	6

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

 :
 -:
 &:
 ":
  :
 9:
 
M:
F )-$("&;D#
#
 	#
 &#
 "#
  #
 9#
 
#
r6   c                  &    e Zd ZddZedd       Zy)r9   c                2   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        y r0   )_filesr   to_raw_response_wrapperr]   rg   rt   r{   r3   rT   s     r4   __init__zFilesWithRawResponse.__init__  ss    &>>LL
 )@@NN
 %<<JJ
	 '>>LL
r6   c                @    t        | j                  j                        S r0   )r   r   r5   r2   s    r4   r5   zFilesWithRawResponse.content  s    %dkk&9&9::r6   NrT   r,   r|   r   )r|   r   r   r   r   r   r   r5   r   r6   r4   r9   r9     s    
  ; ;r6   r9   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 r0   )r   r   async_to_raw_response_wrapperr]   rg   rt   r{   r   s     r4   r   z"AsyncFilesWithRawResponse.__init__  ss    &DDLL
 )FFNN
 %BBJJ
	 'DDLL
r6   c                @    t        | j                  j                        S r0   )r   r   r5   r2   s    r4   r5   z!AsyncFilesWithRawResponse.content  s    *4;;+>+>??r6   NrT   r-   r|   r   )r|   r   r   r   r6   r4   r   r     s    
  @ @r6   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 r0   )r   r!   r]   rg   rt   r{   r   s     r4   r   z#FilesWithStreamingResponse.__init__  s[    2LL
 5NN
 1JJ
	 3LL
r6   c                @    t        | j                  j                        S r0   )r   r   r5   r2   s    r4   r5   z"FilesWithStreamingResponse.content  s    +DKK,?,?@@r6   Nr   )r|   r   r   r   r6   r4   r=   r=     s    
  A Ar6   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 r0   )r   r"   r]   rg   rt   r{   r   s     r4   r   z(AsyncFilesWithStreamingResponse.__init__  s[    8LL
 ;NN
 7JJ
	 9LL
r6   c                @    t        | j                  j                        S r0   )r   r   r5   r2   s    r4   r5   z'AsyncFilesWithStreamingResponse.content!  s    01D1DEEr6   Nr   )r|   r   r   r   r6   r4   r   r     s    
  F Fr6   r   )?
__future__r   typingr   r   typing_extensionsr   httpx r   r5   r
   r   r   r   r   r   _typesr   r   r   r   r   r   r   r   r   _utilsr   r   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-   r9   r   r=   r   r   r6   r4   <module>r      s    #   %  !  b a a m m ' ; Z : A E D H LL
!S
O S
lS
! S
l; ;,@ @,A A,F Fr6   