
    +hz'                       d dl mZ d dlmZ d dlmZ d dl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mZmZ erddlmZm Z  ddgZ! G d de      Z" G d de      Z# G d d      Z$ G d d      Z%y)    )annotations)TYPE_CHECKING)LiteralN   )	NOT_GIVENBodyQueryHeadersNotGiven)maybe_transform)SyncAPIResourceAsyncAPIResource)to_raw_response_wrapperasync_to_raw_response_wrapper)SyncCursorPageAsyncCursorPage)AsyncPaginatormake_request_options)MessageFilefile_list_params)OpenAIAsyncOpenAIFiles
AsyncFilesc            	           e Zd ZU ded<   d	 fdZddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d
dZeeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ xZS )r   FilesWithRawResponsewith_raw_responsec                D    t         |   |       t        |       | _        y N)super__init__r   r   selfclient	__class__s     _/var/www/html/venv/lib/python3.12/site-packages/openai/resources/beta/threads/messages/files.pyr!   zFiles.__init__   s     !5d!;    Nextra_headersextra_query
extra_bodytimeoutc          	     r    ddi|xs i }| j                  d| d| d| t        ||||      t              S )M  
        Retrieves a message 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
        OpenAI-Betaassistants=v1	/threads/
/messages//files/r(   optionscast_to_getr   r   r#   file_id	thread_id
message_idr)   r*   r+   r,   s           r&   retrievezFiles.retrieve   s\    2 'QM<ORQyy	{*ZLyI(+Q[el    
 	
r'   afterbeforelimitorderr)   r*   r+   r,   c       	            ddi|xs i }| j                  d| d| dt        t           t        |||	|
t	        ||||dt
        j                              t              S 	a  Returns a list of message 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.

          before: A cursor for use in pagination. `before` 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 before=obj_foo in order to
              fetch the previous 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
        r/   r0   r1   r2   z/files)r?   r@   rA   rB   )r)   r*   r+   r,   query)pager5   model)_get_api_listr   r   r   r   r   FileListParamsr#   r<   r;   r?   r@   rA   rB   r)   r*   r+   r,   s              r&   listz
Files.listA   s    Z 'QM<ORQ!!	{*ZL?,(+'%%!&"(!&!&	 %33 % " 
 	
r'   )r$   r   returnNoner:   strr;   rO   r<   rO   r)   Headers | Noner*   Query | Noner+   Body | Noner,   'float | httpx.Timeout | None | NotGivenrL   r   )r<   rO   r;   rO   r?   str | NotGivenr@   rT   rA   int | NotGivenrB   !Literal['asc', 'desc'] | NotGivenr)   rP   r*   rQ   r+   rR   r,   rS   rL   zSyncCursorPage[MessageFile]	__name__
__module____qualname____annotations__r!   r   r=   rK   __classcell__r%   s   @r&   r   r      s	   ++< )-$("&;D 
 
 	 

  
 & 
 " 
   
 9 
 
 
N !*!* )3< )-$("&;DA
A
 	A

 A
 A
 A
 1A
 &A
 "A
  A
 9A
 
%A
r'   c            	           e Zd ZU ded<   d	 fdZddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d
dZeeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ xZS )r   AsyncFilesWithRawResponser   c                D    t         |   |       t        |       | _        y r   )r    r!   r_   r   r"   s     r&   r!   zAsyncFiles.__init__   s     !:4!@r'   Nr(   c          	        K   ddi|xs i }| j                  d| d| d| t        ||||      t               d{   S 7 w)	r.   r/   r0   r1   r2   r3   r(   r4   Nr7   r9   s           r&   r=   zAsyncFiles.retrieve   sj     2 'QM<ORQYY	{*ZLyI(+Q[el    
 
 	
 
s   <AAAr>   c       	            ddi|xs i }| j                  d| d| dt        t           t        |||	|
t	        ||||dt
        j                              t              S rD   )rH   r   r   r   r   r   rI   rJ   s              r&   rK   zAsyncFiles.list   s    Z 'QM<ORQ!!	{*ZL? -(+'%%!&"(!&!&	 %33 % " 
 	
r'   )r$   r   rL   rM   rN   )r<   rO   r;   rO   r?   rT   r@   rT   rA   rU   rB   rV   r)   rP   r*   rQ   r+   rR   r,   rS   rL   z9AsyncPaginator[MessageFile, AsyncCursorPage[MessageFile]]rW   r]   s   @r&   r   r      s   00A )-$("&;D 
 
 	 

  
 & 
 " 
   
 9 
 
 
N !*!* )3< )-$("&;DA
A
 	A

 A
 A
 A
 1A
 &A
 "A
  A
 9A
 
CA
r'   c                      e Zd ZddZy)r   c                l    t        |j                        | _        t        |j                        | _        y r   )r   r=   rK   r#   filess     r&   r!   zFilesWithRawResponse.__init__   s*    /NN
 ,JJ
	r'   N)rf   r   rL   rM   rX   rY   rZ   r!    r'   r&   r   r          
r'   r   c                      e Zd ZddZy)r_   c                l    t        |j                        | _        t        |j                        | _        y r   )r   r=   rK   re   s     r&   r!   z"AsyncFilesWithRawResponse.__init__   s*    5NN
 2JJ
	r'   N)rf   r   rL   rM   rg   rh   r'   r&   r_   r_      ri   r'   r_   )&
__future__r   typingr   typing_extensionsr   httpx_typesr   r   r	   r
   r   _utilsr   	_resourcer   r   	_responser   r   
paginationr   r   _base_clientr   r   types.beta.threads.messagesr   r   _clientr   r   __all__r   r   r   r_   rh   r'   r&   <module>ry      sn    #   %  A A ' < Q ; B J0L
!j
O j
Zj
! j
Z
 

 
r'   