
    zvhjK                       d dl mZ d dlmZ d dlmZ d dlZddlmZ ddl	m
Z
mZ ddlmZmZmZmZmZmZ dd	l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 m!Z!m"Z"m#Z#m$Z$ ddl%m&Z&m'Z' ddl(m)Z)m*Z* ddl+m,Z, ddl-m.Z. ddl/m0Z0 ddgZ1 G d de      Z2 G d de      Z3 G d d      Z4 G d d      Z5 G d d      Z6 G d d      Z7y)     )annotations)List)LiteralN   )_legacy_response)container_list_paramscontainer_create_params)	NOT_GIVENBodyQueryHeadersNoneTypeNotGiven)maybe_transformasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper   )Files
AsyncFilesFilesWithRawResponseAsyncFilesWithRawResponseFilesWithStreamingResponseAsyncFilesWithStreamingResponse)SyncCursorPageAsyncCursorPage)AsyncPaginatormake_request_options)ContainerListResponse)ContainerCreateResponse)ContainerRetrieveResponse
ContainersAsyncContainersc                     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/containers.pyfileszContainers.files#   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
        )ContainersWithRawResponser+   s    r-   with_raw_responsezContainers.with_raw_response'   s     )..r/   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
        )ContainersWithStreamingResponser+   s    r-   with_streaming_responsez"Containers.with_streaming_response1   s     /t44r/   Nexpires_afterfile_idsextra_headersextra_query
extra_bodytimeoutc          
         | j                  dt        |||dt        j                        t	        ||||      t
              S )  
        Create Container

        Args:
          name: Name of the container to create.

          expires_after: Container expiration time in seconds relative to the 'anchor' time.

          file_ids: IDs of files to copy to the container.

          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
        /containersnamer9   r:   r;   r<   r=   r>   bodyoptionscast_to)_postr   r	   ContainerCreateParamsr!   r#   r,   rC   r9   r:   r;   r<   r=   r>   s           r-   createzContainers.create:   sX    > zz  %2 (
 (== )+Q[el ,  
 	
r/   rD   c          	     r    |st        d|      | j                  d| t        ||||      t              S )F  
        Retrieve Container

        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
        ;Expected a non-empty value for `container_id` but received /containers/rD   rG   rH   
ValueError_getr!   r$   r,   container_idr;   r<   r=   r>   s         r-   retrievezContainers.retrievei   sT    . Z[gZjkllyy<.)(+Q[el .  
 	
r/   afterlimitorderr;   r<   r=   r>   c                   | j                  dt        t           t        ||||t	        |||dt
        j                              t              S a  List Containers

        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
        rA   )rY   rZ   r[   )r;   r<   r=   r>   query)pagerG   model)_get_api_listr   r"   r!   r   r   ContainerListParamsr,   rY   rZ   r[   r;   r<   r=   r>   s           r-   listzContainers.list   sc    J !! 56(+'%%!&!&!&
 *== (# " 
 	
r/   c          	         |st        d|      ddi|xs i }| j                  d| t        ||||      t              S )D  
        Delete Container

        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
        rO   Accept*/*rP   rD   rQ   rS   _deleter!   r   rU   s         r-   deletezContainers.delete   sh    . Z[gZjkll!5B]-@bB||<.)(+Q[el   
 	
r/   )returnr   )rl   r2   )rl   r6   rC   strr9   z/container_create_params.ExpiresAfter | NotGivenr:   zList[str] | NotGivenr;   Headers | Noner<   Query | Noner=   Body | Noner>   'float | httpx.Timeout | None | NotGivenrl   r#   rV   rn   r;   ro   r<   rp   r=   rq   r>   rr   rl   r$   )rY   str | NotGivenrZ   int | NotGivenr[   !Literal['asc', 'desc'] | NotGivenr;   ro   r<   rp   r=   rq   r>   rr   rl   z%SyncCursorPage[ContainerListResponse]rV   rn   r;   ro   r<   rp   r=   rq   r>   rr   rl   None__name__
__module____qualname__r   r.   r3   r7   r
   rL   rW   rd   rk    r/   r-   r%   r%   "   s   # # / / 5 5 JS)2 )-$("&;D-
 -
 G	-

 '-
 &-
 "-
  -
 9-
 
!-
j )-$("&;D

 &
 "
  
 9
 
#
H !* )3< )-$("&;D7
 7
 	7

 17
 &7
 "7
  7
 97
 
/7
~ )-$("&;D 
 
 & 
 " 
   
 9 
 
 
r/   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    r-   r.   zAsyncContainers.files   s    $,,''r/   c                    t        |       S r1   )AsyncContainersWithRawResponser+   s    r-   r3   z!AsyncContainers.with_raw_response   s     .d33r/   c                    t        |       S r5   )$AsyncContainersWithStreamingResponser+   s    r-   r7   z'AsyncContainers.with_streaming_response   s     4D99r/   Nr8   c          
        K   | j                  dt        |||dt        j                         d{   t	        ||||      t
               d{   S 7 $7 w)r@   rA   rB   NrD   rE   )rI   r   r	   rJ   r!   r#   rK   s           r-   rL   zAsyncContainers.create   sq     > ZZ, %2 (
 (==  )+Q[el ,   
 
 	

s!   .AA
AAAArD   c          	        K   |st        d|      | j                  d| t        ||||      t               d{   S 7 w)rN   rO   rP   rD   rQ   NrR   rU   s         r-   rW   zAsyncContainers.retrieve-  sb     . Z[gZjkllYY<.)(+Q[el .  
 
 	
 
s   <AAArX   c                   | j                  dt        t           t        ||||t	        |||dt
        j                              t              S r]   )ra   r   r"   r!   r   r   rb   rc   s           r-   rd   zAsyncContainers.listN  sc    J !! !67(+'%%!&!&!&
 *== (# " 
 	
r/   c          	        K   |st        d|      ddi|xs i }| j                  d| t        ||||      t               d{   S 7 w)rf   rO   rg   rh   rP   rD   rQ   Nri   rU   s         r-   rk   zAsyncContainers.delete  sv     . Z[gZjkll!5B]-@bB\\<.)(+Q[el  " 
 
 	
 
s   AAA	A)rl   r   )rl   r   )rl   r   rm   rs   )rY   rt   rZ   ru   r[   rv   r;   ro   r<   rp   r=   rq   r>   rr   rl   zMAsyncPaginator[ContainerListResponse, AsyncCursorPage[ContainerListResponse]]rw   ry   r}   r/   r-   r&   r&      s   ( ( 4 4 : : JS)2 )-$("&;D-
 -
 G	-

 '-
 &-
 "-
  -
 9-
 
!-
j )-$("&;D

 &
 "
  
 9
 
#
H !* )3< )-$("&;D7
 7
 	7

 17
 &7
 "7
  7
 97
 
W7
~ )-$("&;D 
 
 & 
 " 
   
 9 
 
 
r/   c                  &    e Zd ZddZedd       Zy)r2   c                2   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        y r)   )_containersr   to_raw_response_wrapperrL   rW   rd   rk   r,   
containerss     r-   __init__z"ContainersWithRawResponse.__init__  sz    %&>>
 )@@
 %<<OO
	 '>>
r/   c                @    t        | j                  j                        S r)   )r   r   r.   r+   s    r-   r.   zContainersWithRawResponse.files  s    #D$4$4$:$:;;r/   Nr   r%   rl   rx   )rl   r   rz   r{   r|   r   r   r.   r}   r/   r-   r2   r2     s    
  < <r/   r2   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_wrapperrL   rW   rd   rk   r   s     r-   r   z'AsyncContainersWithRawResponse.__init__  sz    %&DD
 )FF
 %BBOO
	 'DD
r/   c                @    t        | j                  j                        S r)   )r   r   r.   r+   s    r-   r.   z$AsyncContainersWithRawResponse.files  s    ()9)9)?)?@@r/   Nr   r&   rl   rx   )rl   r   r   r}   r/   r-   r   r     s    
  A Ar/   r   c                  &    e Zd ZddZedd       Zy)r6   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        y r)   )r   r   rL   rW   rd   rk   r   s     r-   r   z(ContainersWithStreamingResponse.__init__  sb    %2
 5
 1OO
	 3
r/   c                @    t        | j                  j                        S r)   )r   r   r.   r+   s    r-   r.   z%ContainersWithStreamingResponse.files  s    )$*:*:*@*@AAr/   Nr   )rl   r   r   r}   r/   r-   r6   r6     s    
  B Br/   r6   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   rL   rW   rd   rk   r   s     r-   r   z-AsyncContainersWithStreamingResponse.__init__  sb    %8
 ;
 7OO
	 9
r/   c                @    t        | j                  j                        S r)   )r   r   r.   r+   s    r-   r.   z*AsyncContainersWithStreamingResponse.files  s    .t/?/?/E/EFFr/   Nr   )rl   r   r   r}   r/   r-   r   r     s    
  G Gr/   r   )8
__future__r   typingr   typing_extensionsr   httpx r   typesr   r	   _typesr
   r   r   r   r   r   _utilsr   r   _compatr   	_resourcer   r   	_responser   r   files.filesr   r   r   r   r   r   
paginationr   r   _base_clientr    r!   types.container_list_responser"   types.container_create_responser#   !types.container_retrieve_responser$   __all__r%   r&   r2   r   r6   r   r}   r/   r-   <module>r      s    #  %    C I I < & : Y  : @ B F J*
+A
 A
HA
& A
H< <,A A,B B,G Gr/   