o
    ØRWj1T  ã                   @  s|  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mZmZmZ dd	l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$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/m0Z0 ddl1m2Z2 ddl3m4Z4 ddgZ5G dd„ deƒZ6G dd„ deƒZ7G dd„ dƒZ8G dd„ dƒZ9G dd„ dƒZ:G dd„ dƒZ;dS ) é    )Úannotations)ÚIterable)ÚLiteralNé   )Ú_legacy_response)Úcontainer_list_paramsÚcontainer_create_params)	ÚBodyÚOmitÚQueryÚHeadersÚNoneTypeÚNotGivenÚSequenceNotStrÚomitÚ	not_given)Úpath_templateÚ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d6dd„ƒZed7dd„ƒZed8d	d
„ƒZeeeeedddedœ	d9d"d#„Z	ddded$œd:d'd(„Z
eeeeddded)œd;d1d2„Zddded$œd<d4d5„ZdS )=r(   Úreturnr   c                 C  ó
   t | jƒS ©N)r   Ú_client©Úself© r1   úu/home/esfera/Documents/content_generation/venv/lib/python3.10/site-packages/openai/resources/containers/containers.pyÚfiles#   ó   
zContainers.filesÚContainersWithRawResponsec                 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
        )r5   r/   r1   r1   r2   Úwith_raw_response'   ó   zContainers.with_raw_responseÚContainersWithStreamingResponsec                 C  r6   ©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
        )r:   r/   r1   r1   r2   Úwith_streaming_response1   ó   z"Containers.with_streaming_responseN©	Úexpires_afterÚfile_idsÚmemory_limitÚnetwork_policyÚskillsÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚnameÚstrr?   ú+container_create_params.ExpiresAfter | Omitr@   úSequenceNotStr[str] | OmitrA   ú(Literal['1g', '4g', '16g', '64g'] | OmitrB   ú,container_create_params.NetworkPolicy | OmitrC   ú.Iterable[container_create_params.Skill] | OmitrD   úHeaders | NonerE   úQuery | NonerF   úBody | NonerG   ú'float | httpx.Timeout | None | NotGivenr&   c       
      
   C  s:   | j dt||||||dœtjƒt|||	|
ddi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.

          memory_limit: Optional memory limit for the container. Defaults to "1g".

          network_policy: Network access policy for the container.

          skills: An optional list of skills referenced by id or inline data.

          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©rH   r?   r@   rA   rB   rC   Úbearer_authT©rD   rE   rF   rG   Úsecurity©ÚbodyÚoptionsÚcast_to)Ú_postr   r   ÚContainerCreateParamsr$   r&   ©r0   rH   r?   r@   rA   rB   rC   rD   rE   rF   rG   r1   r1   r2   Úcreate:   s*   (ú÷ûìzContainers.create©rD   rE   rF   rG   Úcontainer_idr'   c             	   C  s<   |s	t d|›�ƒ‚| jtd|d�t||||ddi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/{container_id}©rb   rV   TrW   ©r[   r\   ©Ú
ValueErrorÚ_getr   r$   r'   ©r0   rb   rD   rE   rF   rG   r1   r1   r2   Úretrievey   s   
û÷zContainers.retrieve©ÚafterÚlimitrH   ÚorderrD   rE   rF   rG   rn   ú
str | Omitro   ú
int | Omitrp   úLiteral['asc', 'desc'] | Omitú%SyncCursorPage[ContainerListResponse]c          	      C  ó<   | j dtt t||||t||||dœtjƒddi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.

          name: Filter results by container name.

          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
        rT   )rn   ro   rH   rp   rV   T)rD   rE   rF   rG   ÚqueryrX   )Úpager[   Úmodel)Ú_get_api_listr!   r%   r$   r   r   ÚContainerListParams©	r0   rn   ro   rH   rp   rD   rE   rF   rG   r1   r1   r2   Úlistž   ó(   (üù	òízContainers.listÚNonec             	   C  sL   |s	t d|›�ƒ‚ddi|pi ¥}| jtd|d�t||||ddi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
        rd   ÚAcceptú*/*re   rf   rV   TrW   rg   ©ri   Ú_deleter   r$   r   rk   r1   r1   r2   ÚdeleteÜ   s   
û÷zContainers.delete)r+   r   )r+   r5   )r+   r:   ©rH   rI   r?   rJ   r@   rK   rA   rL   rB   rM   rC   rN   rD   rO   rE   rP   rF   rQ   rG   rR   r+   r&   ©rb   rI   rD   rO   rE   rP   rF   rQ   rG   rR   r+   r'   )rn   rq   ro   rr   rH   rq   rp   rs   rD   rO   rE   rP   rF   rQ   rG   rR   r+   rt   ©rb   rI   rD   rO   rE   rP   rF   rQ   rG   rR   r+   r   ©Ú__name__Ú
__module__Ú__qualname__r   r3   r8   r<   r   r   r`   rl   r}   r…   r1   r1   r1   r2   r(   "   óH    	òE÷(ôD÷c                
   @  r*   )=r)   r+   r   c                 C  r,   r-   )r   r.   r/   r1   r1   r2   r3     r4   zAsyncContainers.filesÚAsyncContainersWithRawResponsec                 C  r6   r7   )rŽ   r/   r1   r1   r2   r8     r9   z!AsyncContainers.with_raw_responseÚ$AsyncContainersWithStreamingResponsec                 C  r6   r;   )r�   r/   r1   r1   r2   r<     r=   z'AsyncContainers.with_streaming_responseNr>   rH   rI   r?   rJ   r@   rK   rA   rL   rB   rM   rC   rN   rD   rO   rE   rP   rF   rQ   rG   rR   r&   c       
      
   Ã  sH   �| j dt||||||dœtjƒI dH t|||	|
ddid�td�I dH S )rS   rT   rU   NrV   TrW   rY   )r]   r   r   r^   r$   r&   r_   r1   r1   r2   r`     s,   €(ú÷ûìzAsyncContainers.createra   rb   r'   c             	   Ã  sD   �|s
t d|›�ƒ‚| jtd|d�t||||ddid�td�I dH S )	rc   rd   re   rf   rV   TrW   rg   Nrh   rk   r1   r1   r2   rl   Z  s   €
û÷zAsyncContainers.retrieverm   rn   rq   ro   rr   rp   rs   úMAsyncPaginator[ContainerListResponse, AsyncCursorPage[ContainerListResponse]]c          	      C  ru   rv   )rz   r"   r%   r$   r   r   r{   r|   r1   r1   r2   r}     r~   zAsyncContainers.listr   c             	   Ã  sT   �|s
t d|›�ƒ‚ddi|pi ¥}| jtd|d�t||||ddid�td	�I d
H S )r€   rd   r�   r‚   re   rf   rV   TrW   rg   Nrƒ   rk   r1   r1   r2   r…   ½  s   €
û÷zAsyncContainers.delete)r+   r   )r+   rŽ   )r+   r�   r†   r‡   )rn   rq   ro   rr   rH   rq   rp   rs   rD   rO   rE   rP   rF   rQ   rG   rR   r+   r�   rˆ   r‰   r1   r1   r1   r2   r)     r�   c                   @  ó$   e Zd Zddd„Zeddd	„ƒZd
S )r5   Ú
containersr(   r+   r   c                 C  óB   || _ t |j¡| _t |j¡| _t |j¡| _t |j¡| _d S r-   )Ú_containersr   Úto_raw_response_wrapperr`   rl   r}   r…   ©r0   r’   r1   r1   r2   Ú__init__å  ó   ÿÿÿ
ÿz"ContainersWithRawResponse.__init__r   c                 C  ó   t | jjƒS r-   )r   r”   r3   r/   r1   r1   r2   r3   õ  ó   zContainersWithRawResponse.filesN©r’   r(   r+   r   )r+   r   ©rŠ   r‹   rŒ   r—   r   r3   r1   r1   r1   r2   r5   ä  ó    
r5   c                   @  r‘   )rŽ   r’   r)   r+   r   c                 C  r“   r-   )r”   r   Úasync_to_raw_response_wrapperr`   rl   r}   r…   r–   r1   r1   r2   r—   û  r˜   z'AsyncContainersWithRawResponse.__init__r   c                 C  r™   r-   )r   r”   r3   r/   r1   r1   r2   r3     rš   z$AsyncContainersWithRawResponse.filesN©r’   r)   r+   r   )r+   r   rœ   r1   r1   r1   r2   rŽ   ú  r�   rŽ   c                   @  r‘   )r:   r’   r(   r+   r   c                 C  ó:   || _ t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _d S r-   )r”   r   r`   rl   r}   r…   r–   r1   r1   r2   r—     ó   ÿÿÿ
ÿz(ContainersWithStreamingResponse.__init__r   c                 C  r™   r-   )r   r”   r3   r/   r1   r1   r2   r3   !  rš   z%ContainersWithStreamingResponse.filesNr›   )r+   r   rœ   r1   r1   r1   r2   r:     r�   r:   c                   @  r‘   )r�   r’   r)   r+   r   c                 C  r    r-   )r”   r   r`   rl   r}   r…   r–   r1   r1   r2   r—   '  r¡   z-AsyncContainersWithStreamingResponse.__init__r    c                 C  r™   r-   )r    r”   r3   r/   r1   r1   r2   r3   7  rš   z*AsyncContainersWithStreamingResponse.filesNrŸ   )r+   r    rœ   r1   r1   r1   r2   r�   &  r�   r�   )<Ú
__future__r   Útypingr   Útyping_extensionsr   ÚhttpxÚ r   Útypesr   r   Ú_typesr	   r
   r   r   r   r   r   r   r   Ú_utilsr   r   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)   r5   rŽ   r:   r�   r1   r1   r1   r2   Ú<module>   s4   ,  b b