U
    ~fhjK                     @  sl  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Z1G dd deZ2G dd deZ3G dd dZ4G dd dZ5G dd dZ6G dd dZ7dS )     )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                
   @  s   e Zd ZeddddZeddddZeddd	d
ZeedddeddddddddddddZdddeddddddddddZ	eeedddedddd ddddd!d"d#d$Z
dddeddddddd%dd&d'ZdS )(r$   r   returnc                 C  s
   t | jS N)r   _clientself r,   J/tmp/pip-unpacked-wheel-rjiviquo/openai/resources/containers/containers.pyfiles#   s    zContainers.filesContainersWithRawResponsec                 C  s   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
        )r/   r*   r,   r,   r-   with_raw_response'   s    zContainers.with_raw_responseContainersWithStreamingResponsec                 C  s   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
        )r2   r*   r,   r,   r-   with_streaming_response1   s    z"Containers.with_streaming_responseNexpires_afterfile_idsextra_headersextra_query
extra_bodytimeoutstr/container_create_params.ExpiresAfter | NotGivenList[str] | NotGivenHeaders | NoneQuery | NoneBody | None'float | httpx.Timeout | None | NotGivenr"   namer6   r7   r8   r9   r:   r;   r'   c             	   C  s.   | j dt|||dtjt||||dtd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rD   r6   r7   r8   r9   r:   r;   bodyoptionscast_to)_postr   r   ContainerCreateParamsr    r"   r+   rD   r6   r7   r8   r9   r:   r;   r,   r,   r-   create:   s"       zContainers.createrH   r#   container_idr8   r9   r:   r;   r'   c                C  s4   |st d|| jd| t||||dtd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/rH   rK   rL   
ValueError_getr    r#   r+   rR   r8   r9   r:   r;   r,   r,   r-   retrievei   s       zContainers.retrieveafterlimitorderr8   r9   r:   r;   str | NotGivenint | NotGiven#Literal[('asc', 'desc')] | NotGivenz%SyncCursorPage[ContainerListResponse]r]   r^   r_   r8   r9   r:   r;   r'   c                C  s4   | j dtt t||||t|||dtjdtd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
        rF   )r]   r^   r_   )r8   r9   r:   r;   query)pagerK   model)_get_api_listr   r!   r    r   r   ContainerListParamsr+   r]   r^   r_   r8   r9   r:   r;   r,   r,   r-   list   s$    %zContainers.listNonec                C  sD   |st d|ddi|pi }| jd| t||||dtd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
        rT   Accept*/*rU   rH   rV   rX   _deleter    r   rZ   r,   r,   r-   delete   s       zContainers.delete__name__
__module____qualname__r   r.   r1   r4   r	   rP   r[   rk   rr   r,   r,   r,   r-   r$   "   s>   	 5$ ?c                
   @  s   e Zd ZeddddZeddddZeddd	d
ZeedddeddddddddddddZdddeddddddddddZ	eeedddedddd ddddd!d"d#d$Z
dddeddddddd%dd&d'ZdS )(r%   r   r&   c                 C  s
   t | jS r(   )r   r)   r*   r,   r,   r-   r.      s    zAsyncContainers.filesAsyncContainersWithRawResponsec                 C  s   t | S r0   )rw   r*   r,   r,   r-   r1      s    z!AsyncContainers.with_raw_response$AsyncContainersWithStreamingResponsec                 C  s   t | S r3   )rx   r*   r,   r,   r-   r4      s    z'AsyncContainers.with_streaming_responseNr5   r<   r=   r>   r?   r@   rA   rB   r"   rC   c             	     s:   | j dt|||dtjI dH t||||dtdI dH S )rE   rF   rG   NrH   rI   )rM   r   r   rN   r    r"   rO   r,   r,   r-   rP      s"       zAsyncContainers.createrH   r#   rQ   c                  s:   |st d|| jd| t||||dtdI dH S )rS   rT   rU   rH   rV   NrW   rZ   r,   r,   r-   r[   -  s       zAsyncContainers.retriever\   r`   ra   rb   zMAsyncPaginator[ContainerListResponse, AsyncCursorPage[ContainerListResponse]]rc   c                C  s4   | j dtt t||||t|||dtjdtdS rd   )rh   r   r!   r    r   r   ri   rj   r,   r,   r-   rk   N  s$    %zAsyncContainers.listrl   c                  sJ   |st d|ddi|pi }| jd| t||||dtdI dH S )rm   rT   rn   ro   rU   rH   rV   Nrp   rZ   r,   r,   r-   rr     s       zAsyncContainers.deleters   r,   r,   r,   r-   r%      s>   	 5$ ?c                   @  s.   e Zd ZdddddZedddd	Zd
S )r/   r$   rl   
containersr'   c                 C  sB   || _ t|j| _t|j| _t|j| _t|j| _d S r(   )_containersr   Zto_raw_response_wrapperrP   r[   rk   rr   r+   rz   r,   r,   r-   __init__  s    z"ContainersWithRawResponse.__init__r   r&   c                 C  s   t | jjS r(   )r   r{   r.   r*   r,   r,   r-   r.     s    zContainersWithRawResponse.filesNrt   ru   rv   r}   r   r.   r,   r,   r,   r-   r/     s   r/   c                   @  s.   e Zd ZdddddZedddd	Zd
S )rw   r%   rl   ry   c                 C  sB   || _ t|j| _t|j| _t|j| _t|j| _d S r(   )r{   r   Zasync_to_raw_response_wrapperrP   r[   rk   rr   r|   r,   r,   r-   r}     s    z'AsyncContainersWithRawResponse.__init__r   r&   c                 C  s   t | jjS r(   )r   r{   r.   r*   r,   r,   r-   r.     s    z$AsyncContainersWithRawResponse.filesNr~   r,   r,   r,   r-   rw     s   rw   c                   @  s.   e Zd ZdddddZedddd	Zd
S )r2   r$   rl   ry   c                 C  s:   || _ t|j| _t|j| _t|j| _t|j| _d S r(   )r{   r   rP   r[   rk   rr   r|   r,   r,   r-   r}     s    z(ContainersWithStreamingResponse.__init__r   r&   c                 C  s   t | jjS r(   )r   r{   r.   r*   r,   r,   r-   r.     s    z%ContainersWithStreamingResponse.filesNr~   r,   r,   r,   r-   r2     s   r2   c                   @  s.   e Zd ZdddddZedddd	Zd
S )rx   r%   rl   ry   c                 C  s:   || _ t|j| _t|j| _t|j| _t|j| _d S r(   )r{   r   rP   r[   rk   rr   r|   r,   r,   r-   r}     s    z-AsyncContainersWithStreamingResponse.__init__r   r&   c                 C  s   t | jjS r(   )r   r{   r.   r*   r,   r,   r-   r.     s    z*AsyncContainersWithStreamingResponse.filesNr~   r,   r,   r,   r-   rx     s   rx   )8
__future__r   typingr   Ztyping_extensionsr   Zhttpx r   typesr   r   _typesr	   r
   r   r   r   r   _utilsr   r   _compatr   Z	_resourcer   r   	_responser   r   Zfiles.filesr   r   r   r   r   r   Z
paginationr   r   Z_base_clientr   r    Ztypes.container_list_responser!   Ztypes.container_create_responser"   Z!types.container_retrieve_responser#   __all__r$   r%   r/   rw   r2   rx   r,   r,   r,   r-   <module>   s2      E E