
    2RjW                       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 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! 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l0m1Z1m2Z2 ddl3m4Z4 ddl5m6Z6 ddl7m8Z8 ddgZ9 G d de%      Z: 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)deepcopy_with_paths)	BodyOmitQueryHeadersNoneTypeNotGiven	FileTypesomit	not_given)extract_filespath_templatemaybe_transform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    o/var/www/html/meridian/meridian-ai/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_response2   s     *$//r6   Nfilefile_idextra_headersextra_query
extra_bodytimeoutc               J   |st        d|      t        ||ddgg      }t        t        t        t
        t        f   |      dgg      }	|	r
ddi|xs i }| j                  t        d|      t        |t        j                        |	t        ||||d	d
i      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bearer_authTrB   rC   rD   rE   securitybodyfilesoptionscast_to)
ValueErrorr   r   r   r   strobject_postr   r   r(   FileCreateParamsr&   r*   
r3   rP   r@   rA   rB   rC   rD   rE   rU   rV   s
             r4   createzFiles.create;   s    @ Z[gZjkll"" XJ
 d73;#7>xjQ ,-B\}GZXZ\Mzz<<X '9'J'JK(+'%'. '  
 	
r6   rB   rC   rD   rE   c                   |st        d|      |st        d|      | j                  t        d||      t        ||||ddi      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   TrR   rW   rX   rY   _getr   r&   r+   r3   rA   rP   rB   rC   rD   rE   s          r4   retrievezFiles.retrievex   sz    0 Z[gZjkllUV]U`abbyyFUakrs(+'%'. )  

 
	
r6   afterlimitorderrB   rC   rD   rE   c                   |st        d|      | j                  t        d|      t        t           t        ||||t        |||dt        j                        ddi      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   )rl   rm   rn   rQ   T)rB   rC   rD   rE   queryrS   )pagerW   model)	rY   _get_api_listr   r#   r)   r&   r   r'   FileListParams	r3   rP   rl   rm   rn   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        ||||ddi	      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   rc   Accept*/*rd   re   rQ   TrR   rf   rY   _deleter   r&   r   ri   s          r4   deletezFiles.delete   s    0 Z[gZjkllUV]U`abb!5B]-@bB||FUakrs(+'%'.   

 
	
r6   )returnr
   )r   r9   )r   r=   rP   rZ   r@   zFileTypes | OmitrA   
str | OmitrB   Headers | NonerC   Query | NonerD   Body | NonerE   'float | httpx.Timeout | None | NotGivenr   r*   rA   rZ   rP   rZ   rB   r   rC   r   rD   r   rE   r   r   r+   )rP   rZ   rl   r   rm   
int | Omitrn   Literal['asc', 'desc'] | OmitrB   r   rC   r   rD   r   rE   r   r   z SyncCursorPage[FileListResponse]rA   rZ   rP   rZ   rB   r   rC   r   rD   r   rE   r   r   None__name__
__module____qualname__r   r5   r:   r>   r   r   r_   rj   rw   r~    r6   r4   r,   r,   #   s   % % * * 0 0 "&" )-$("&;D;
;
 	;

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

 ;
 -;
 &;
 ";
  ;
 9;
 
*;
H )-$("&;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               z  K   |st        d|      t        ||ddgg      }t        t        t        t
        t        f   |      dgg      }	|	r
ddi|xs i }| j                  t        d|      t        |t        j                         d	{   |	t        ||||d
di      t               d	{   S 7 (7 w)rG   rH   rI   r@   rJ   rL   rM   rN   rO   NrQ   TrR   rT   )rY   r   r   r   r   rZ   r[   r\   r   r   r(   r]   r&   r*   r^   s
             r4   r_   zAsyncFiles.create  s     @ Z[gZjkll"" XJ
 d73;#7>xjQ ,-B\}GZXZ\MZZ<<X,T3E3V3VWW(+'%'. '   
 
 	
W
s$   BB;B7
#B;2B93B;9B;r`   c                  K   |st        d|      |st        d|      | j                  t        d||      t        ||||ddi      t               d	{   S 7 w)
rb   rH   rc   rd   re   rQ   TrR   rf   Nrg   ri   s          r4   rj   zAsyncFiles.retrieve\  s     0 Z[gZjkllUV]U`abbYYFUakrs(+'%'. )  

 

 
	
 

s   AA!AA!rk   c                   |st        d|      | j                  t        d|      t        t           t        ||||t        |||dt        j                        ddi      t              S rp   )	rY   rt   r   r$   r)   r&   r   r'   ru   rv   s	            r4   rw   zAsyncFiles.list  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        ||||ddi	      t        
       d{   S 7 w)ry   rH   rc   rz   r{   rd   re   rQ   TrR   rf   Nr|   ri   s          r4   r~   zAsyncFiles.delete  s     0 Z[gZjkllUV]U`abb!5B]-@bB\\FUakrs(+'%'.  " 

 

 
	
 

s   A"A+$A)%A+)r   r   )r   r   )r   r   r   r   )rP   rZ   rl   r   rm   r   rn   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;
;
 	;

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

 ;
 -;
 &;
 ";
  ;
 9;
 
M;
H )-$("&;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_   rj   rw   r~   r3   rV   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rV   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_   rj   rw   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rV   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_   rj   rw   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_   rj   rw   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   r   r   _typesr   r   r   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-   r9   r   r=   r   r   r6   r4   <module>r      s    #   %  !  + a a a [ [ ' ; Z : A E D H LL
!a
O a
Ha
! a
H; ;,@ @,A A,F Fr6   