o
    ùT·js�  ã                   @  sˆ  d dl mZ d dlmZ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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" ddl#m$Z$m%Z% ddl&m'Z' ddl(m)Z)m*Z*m+Z+ ddl,m-Z- ddl.m/Z/ ddl0m1Z1 ddl2m3Z3 ddl4m5Z5 ddgZ6G dd„ deƒZ7G dd„ deƒZ8G dd„ dƒZ9G dd„ dƒZ:G dd„ dƒZ;G dd „ d ƒZ<dS )!é    )Úannotations)ÚDictÚIterableÚOptional)ÚLiteralNé   )Ú_legacy_response)ÚBodyÚOmitÚQueryÚHeadersÚ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)ÚSyncCursorPageÚAsyncCursorPage)ÚAsyncPaginatorÚmake_request_options)ÚHostedSkillParam)Útemplate_list_paramsÚtemplate_create_paramsÚtemplate_update_params)ÚHostedPluginParam)ÚSetupCommandParam)ÚHostedEnvironmentFileParam)ÚEnvironmentTemplate)ÚEnvironmentTemplateDeletedÚ	TemplatesÚAsyncTemplatesc                   @  óÀ   e Zd Zed=dd„ƒZed>dd„ƒZeeeeeeeeeddded	œd?d%d&„Zddded'œd@d*d+„Z	eeeeeeeeeddded	œdAd.d/„Z
eeeddded0œdBd8d9„Zddded'œdCd;d<„ZdS )Dr&   ÚreturnÚTemplatesWithRawResponsec                 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
        )r*   ©Úself© r/   úv/home/dinkstrade/pdmp-scanner/venv/lib/python3.10/site-packages/openai/resources/beta/agents/environments/templates.pyÚwith_raw_response   ó   zTemplates.with_raw_responseÚTemplatesWithStreamingResponsec                 C  r+   ©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
        )r3   r-   r/   r/   r0   Úwith_streaming_response(   ó   z!Templates.with_streaming_responseN©Úcapability_directoriesÚenvÚfilesÚnameÚnetworkÚpackagesÚpluginsÚsetup_commandsÚskillsÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutr8   ú$Optional[SequenceNotStr[str]] | Omitr9   úOptional[Dict[str, str]] | Omitr:   ú5Optional[Iterable[HostedEnvironmentFileParam]] | Omitr;   úOptional[str] | Omitr<   ú/Optional[template_create_params.Network] | Omitr=   ú0Optional[template_create_params.Packages] | Omitr>   ú,Optional[Iterable[HostedPluginParam]] | Omitr?   ú,Optional[Iterable[SetupCommandParam]] | Omitr@   ú+Optional[Iterable[HostedSkillParam]] | OmitrA   úHeaders | NonerB   úQuery | NonerC   úBody | NonerD   ú(float | httpx2.Timeout | None | NotGivenr$   c                C  sP   ddi|
pi ¥}
| j dt|||||||||	dœ	tjƒt|
|||ddid�td�S )	áÂ  
        Creates reusable environment configuration without returning confidential setup
        commands or environment values. See
        [reusing a hosted setup](https://developers.openai.com/api/docs/guides/agents-api/tools#reuse-a-hosted-plugin-setup).

        Args:
          capability_directories: Directories that contain capabilities exposed to the agent. Defaults to an empty
              list.

          env: Environment variables made available to the agent.

          files: Files available before the agent starts. Defaults to an empty list.

          name: An optional human-readable display name for the template.

          network: Network access policy for the environment. Defaults to disabled for GA requests
              and enabled for alpha/beta requests.

          packages: Packages to install in the environment. Defaults to empty package lists.

          plugins: Plugins provided as inline ZIP archives. Defaults to an empty list.

          setup_commands: Ordered, confidential setup commands. Command bodies are never returned.

          skills: Skills referenced by ID or provided as inline ZIP archives. Defaults to an empty
              list.

          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ú	agents=v1ú/agents/environments/templates©	r8   r9   r:   r;   r<   r=   r>   r?   r@   Úbearer_authT©rA   rB   rC   rD   Úsecurity©ÚbodyÚoptionsÚcast_to)Ú_postr   r   ÚTemplateCreateParamsr   r$   ©r.   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   r/   r/   r0   Úcreate1   s2   6÷ôûézTemplates.create©rA   rB   rC   rD   Úenvironment_template_idÚstrc             	   C  óL   |s	t d|›�ƒ‚ddi|pi ¥}| jtd|d�t||||ddid�td	�S )
á  
        Retrieves reusable environment configuration without returning confidential
        values. See
        [reusing a hosted setup](https://developers.openai.com/api/docs/guides/agents-api/tools#reuse-a-hosted-plugin-setup).

        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
        úFExpected a non-empty value for `environment_template_id` but received rS   rT   ú8/agents/environments/templates/{environment_template_id}©rc   rW   TrX   ©r\   r]   ©Ú
ValueErrorÚ_getr   r   r$   ©r.   rc   rA   rB   rC   rD   r/   r/   r0   Úretrieve‚   ó&   ÿþûôzTemplates.retrieveú/Optional[template_update_params.Network] | Omitú0Optional[template_update_params.Packages] | Omitc                C  sj   |s	t d|›�ƒ‚ddi|pi ¥}| jtd|d�t||||||||	|
dœ	tjƒt||||ddid	�td
�S )á‘  
        Updates reusable environment configuration without returning confidential
        values. See
        [reusing a hosted setup](https://developers.openai.com/api/docs/guides/agents-api/tools#reuse-a-hosted-plugin-setup).

        Args:
          capability_directories: Directories that expose capabilities to the agent.

          env: Replacement confidential environment values.

          files: Replacement file configuration materialized for each new session.

          name: A replacement human-readable display name, or `null` to clear the name.

          network: Network access available after setup completes. Omit to preserve the current
              policy, or pass `null` to reset to disabled for GA requests or enabled for
              alpha/beta requests.

          packages: Packages installed before the runtime network policy applies.

          plugins: Replacement plugin configuration installed for each new session.

          setup_commands: Replacement confidential setup commands, never included in returned resources.

          skills: Replacement skill configuration installed for each new session.

          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
        rg   rS   rT   rh   ri   rV   rW   TrX   rZ   )rl   r^   r   r   r    ÚTemplateUpdateParamsr   r$   ©r.   rc   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   r/   r/   r0   Úupdate¯   s@   6ÿþ÷ôûæzTemplates.update©ÚafterÚlimitÚorderrA   rB   rC   rD   rx   ú
str | Omitry   ú
int | Omitrz   úLiteral['asc', 'desc'] | Omitú#SyncCursorPage[EnvironmentTemplate]c                C  óJ   ddi|pi ¥}| j dtt t||||t|||dœtjƒddid�td�S ©	a‚  Lists reusable environment templates without returning confidential values.

        See
        [reusing a hosted setup](https://developers.openai.com/api/docs/guides/agents-api/tools#reuse-a-hosted-plugin-setup).

        Args:
          after: Return resources after this resource ID in the selected order.

          limit: The maximum number of resources to return, between 1 and 100. Defaults to 20.

          order: The order in which resources are returned. Defaults to `desc`.

              - `asc` - Returns resources in ascending order.
              - `desc` - Returns resources in 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
        rS   rT   rU   )rx   ry   rz   rW   T)rA   rB   rC   rD   ÚqueryrY   )Úpager\   Úmodel)Ú_get_api_listr   r$   r   r   r   ÚTemplateListParams©r.   rx   ry   rz   rA   rB   rC   rD   r/   r/   r0   Úlist  ó(   $ýúóîzTemplates.listr%   c             	   C  re   )
á  
        Deletes reusable environment configuration and all confidential template inputs.
        See
        [reusing a hosted setup](https://developers.openai.com/api/docs/guides/agents-api/tools#reuse-a-hosted-plugin-setup).

        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
        rg   rS   rT   rh   ri   rW   TrX   rj   ©rl   Ú_deleter   r   r%   rn   r/   r/   r0   ÚdeleteA  rp   zTemplates.delete)r)   r*   )r)   r3   ©r8   rE   r9   rF   r:   rG   r;   rH   r<   rI   r=   rJ   r>   rK   r?   rL   r@   rM   rA   rN   rB   rO   rC   rP   rD   rQ   r)   r$   ©rc   rd   rA   rN   rB   rO   rC   rP   rD   rQ   r)   r$   ©rc   rd   r8   rE   r9   rF   r:   rG   r;   rH   r<   rq   r=   rr   r>   rK   r?   rL   r@   rM   rA   rN   rB   rO   rC   rP   rD   rQ   r)   r$   )rx   r{   ry   r|   rz   r}   rA   rN   rB   rO   rC   rP   rD   rQ   r)   r~   ©rc   rd   rA   rN   rB   rO   rC   rP   rD   rQ   r)   r%   ©Ú__name__Ú
__module__Ú__qualname__r   r1   r5   r   r   ra   ro   rv   r‡   rŒ   r/   r/   r/   r0   r&      óf    	ïW÷1î[õ@÷c                   @  r(   )Dr'   r)   ÚAsyncTemplatesWithRawResponsec                 C  r+   r,   )r–   r-   r/   r/   r0   r1   p  r2   z AsyncTemplates.with_raw_responseÚ#AsyncTemplatesWithStreamingResponsec                 C  r+   r4   )r—   r-   r/   r/   r0   r5   z  r6   z&AsyncTemplates.with_streaming_responseNr7   r8   rE   r9   rF   r:   rG   r;   rH   r<   rI   r=   rJ   r>   rK   r?   rL   r@   rM   rA   rN   rB   rO   rC   rP   rD   rQ   r$   c                Ã  s^   �ddi|
pi ¥}
| j dt|||||||||	dœ	tjƒI dH t|
|||ddid�td	�I dH S )
rR   rS   rT   rU   rV   NrW   TrX   rZ   )r^   r   r   r_   r   r$   r`   r/   r/   r0   ra   ƒ  s4   €6÷ôûézAsyncTemplates.createrb   rc   rd   c             	   Ã  óT   �|s
t d|›�ƒ‚ddi|pi ¥}| jtd|d�t||||ddid�td	�I d
H S )rf   rg   rS   rT   rh   ri   rW   TrX   rj   Nrk   rn   r/   r/   r0   ro   Ô  ó(   €ÿþûôzAsyncTemplates.retrieverq   rr   c                Ã  sx   �|s
t d|›�ƒ‚ddi|pi ¥}| jtd|d�t||||||||	|
dœ	tjƒI dH t||||dd	id
�td�I dH S )rs   rg   rS   rT   rh   ri   rV   NrW   TrX   rZ   )rl   r^   r   r   r    rt   r   r$   ru   r/   r/   r0   rv     sB   €6ÿþ÷ôûæzAsyncTemplates.updaterw   rx   r{   ry   r|   rz   r}   úIAsyncPaginator[EnvironmentTemplate, AsyncCursorPage[EnvironmentTemplate]]c                C  r   r€   )r„   r   r$   r   r   r   r…   r†   r/   r/   r0   r‡   Y  rˆ   zAsyncTemplates.listr%   c             	   Ã  r˜   )r‰   rg   rS   rT   rh   ri   rW   TrX   rj   NrŠ   rn   r/   r/   r0   rŒ   “  r™   zAsyncTemplates.delete)r)   r–   )r)   r—   r�   rŽ   r�   )rx   r{   ry   r|   rz   r}   rA   rN   rB   rO   rC   rP   rD   rQ   r)   rš   r�   r‘   r/   r/   r/   r0   r'   o  r•   c                   @  ó   e Zd Zddd„ZdS )	r*   Ú	templatesr&   r)   ÚNonec                 C  óP   || _ t |j¡| _t |j¡| _t |j¡| _t |j¡| _t |j¡| _d S ©N)Ú
_templatesr   Úto_raw_response_wrapperra   ro   rv   r‡   rŒ   ©r.   rœ   r/   r/   r0   Ú__init__Â  ó    ÿÿÿÿ
ÿz!TemplatesWithRawResponse.__init__N©rœ   r&   r)   r�   ©r’   r“   r”   r£   r/   r/   r/   r0   r*   Á  ó    r*   c                   @  r›   )	r–   rœ   r'   r)   r�   c                 C  rž   rŸ   )r    r   Úasync_to_raw_response_wrapperra   ro   rv   r‡   rŒ   r¢   r/   r/   r0   r£   ×  r¤   z&AsyncTemplatesWithRawResponse.__init__N©rœ   r'   r)   r�   r¦   r/   r/   r/   r0   r–   Ö  r§   r–   c                   @  r›   )	r3   rœ   r&   r)   r�   c                 C  óF   || _ t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _d S rŸ   )r    r   ra   ro   rv   r‡   rŒ   r¢   r/   r/   r0   r£   ì  ó    ÿÿÿÿ
ÿz'TemplatesWithStreamingResponse.__init__Nr¥   r¦   r/   r/   r/   r0   r3   ë  r§   r3   c                   @  r›   )	r—   rœ   r'   r)   r�   c                 C  rª   rŸ   )r    r   ra   ro   rv   r‡   rŒ   r¢   r/   r/   r0   r£     r«   z,AsyncTemplatesWithStreamingResponse.__init__Nr©   r¦   r/   r/   r/   r0   r—      r§   r—   )=Ú
__future__r   Útypingr   r   r   Útyping_extensionsr   Úhttpx2Ú r   Ú_typesr	   r
   r   r   r   r   r   r   Ú_utilsr   r   r   Ú_compatr   Ú	_resourcer   r   Ú	_responser   r   Ú
paginationr   r   Ú_base_clientr   r   Útypes.beta.hosted_skill_paramr   Útypes.beta.agents.environmentsr   r   r    Útypes.beta.hosted_plugin_paramr!   Útypes.beta.setup_command_paramr"   Ú(types.beta.hosted_environment_file_paramr#   Ú3types.beta.agents.environments.environment_templater$   Ú;types.beta.agents.environments.environment_template_deletedr%   Ú__all__r&   r'   r*   r–   r3   r—   r/   r/   r/   r0   Ú<module>   s<   (  T  T