o
    î6Wj1�  ã                   @  s”  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l
Z
ddlmZ dd	lmZmZmZmZmZmZ dd
lmZmZmZmZmZmZm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/m0Z0 ddl1m2Z2m3Z3 ddl4m5Z5 ddl6m7Z7 ddl8m9Z9 ddgZ:G dd„ de%ƒZ;G dd„ de&ƒZ<G dd„ dƒZ=G dd„ dƒZ>G dd„ dƒZ?G dd „ d ƒZ@dS )!é    )Úannotations)ÚDictÚListÚOptional)Úchain)ÚLiteralNé   )Ú_legacy_responseé   )ÚWorkÚ	AsyncWorkÚWorkWithRawResponseÚAsyncWorkWithRawResponseÚWorkWithStreamingResponseÚAsyncWorkWithStreamingResponse)ÚBodyÚOmitÚQueryÚHeadersÚNotGivenÚomitÚ	not_given)Úis_givenÚpath_templateÚmaybe_transformÚstrip_not_givenÚasync_maybe_transform)Úcached_property)ÚSyncAPIResourceÚAsyncAPIResource)Úto_streamed_response_wrapperÚ"async_to_streamed_response_wrapper)ÚSyncPageCursorÚAsyncPageCursor)Úenvironment_list_paramsÚenvironment_create_paramsÚenvironment_update_params)ÚAsyncPaginatorÚmake_request_options)ÚAnthropicBetaParam)ÚBetaEnvironment)ÚBetaEnvironmentDeleteResponseÚEnvironmentsÚAsyncEnvironmentsc                   @  óÞ   e Zd Zed;dd„ƒZed<dd„ƒZed=d	d
„ƒZeeeeedddedœ	d>d"d#„Z	eddded$œd?d&d'„Z
eeeeeeddded(œ
d@d+d,„Zeeeeddded-œdAd4d5„Zeddded$œdBd7d8„Zeddded$œd?d9d:„ZdS )Cr,   Úreturnr   c                 C  ó
   t | jƒS ©N)r   Ú_client©Úself© r5   ú�/home/esfera/Documents/content_generation/venv/lib/python3.10/site-packages/anthropic/resources/beta/environments/environments.pyÚwork$   ó   
zEnvironments.workÚEnvironmentsWithRawResponsec                 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/anthropics/anthropic-sdk-python#accessing-raw-response-data-eg-headers
        )r9   r3   r5   r5   r6   Úwith_raw_response(   ó   zEnvironments.with_raw_responseÚ!EnvironmentsWithStreamingResponsec                 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/anthropics/anthropic-sdk-python#with_streaming_response
        )r>   r3   r5   r5   r6   Úwith_streaming_response2   ó   z$Environments.with_streaming_responseN©	ÚconfigÚdescriptionÚmetadataÚscopeÚbetasÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚnameÚstrrC   ú1Optional[environment_create_params.Config] | OmitrD   úOptional[str] | OmitrE   úDict[str, str] | OmitrF   ú3Optional[Literal['organization', 'account']] | OmitrG   úList[AnthropicBetaParam] | OmitrH   úHeaders | NonerI   úQuery | NonerJ   úBody | NonerK   ú'float | httpx.Timeout | None | NotGivenr*   c       
      	   C  s~   i t dt|ƒrd tdd„ |D ƒdgƒ¡ntiƒ¥|pi ¥}ddi|p$i ¥}| jdt|||||dœtjƒt	|||	|
d�t
d	�S )
áç  
        Create a new environment with the specified configuration.

        Args:
          name: Human-readable name for the environment

          config: Environment configuration

          description: Optional description of the environment

          metadata: User-provided metadata key-value pairs

          scope: The visibility scope for this environment. 'organization' makes the environment
              visible to all accounts. 'account' restricts visibility to the owning account
              only. Only applicable for self-hosted environments. If not specified, defaults
              based on organization type.

          betas: Optional header to specify the beta version(s) you want to use.

          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
        úanthropic-betaú,c                 s  ó   � | ]}t |ƒV  qd S r1   ©rM   ©Ú.0Úer5   r5   r6   Ú	<genexpr>i   ó   € z&Environments.create.<locals>.<genexpr>úmanaged-agents-2026-04-01ú/v1/environments?beta=true©rL   rC   rD   rE   rF   ©rH   rI   rJ   rK   ©ÚbodyÚoptionsÚcast_to)r   r   Újoinr   r   Ú_postr   r%   ÚEnvironmentCreateParamsr(   r*   ©r4   rL   rC   rD   rE   rF   rG   rH   rI   rJ   rK   r5   r5   r6   Úcreate;   s8   +ÿýÿÿø
ûø
ÿñzEnvironments.create©rG   rH   rI   rJ   rK   Úenvironment_idc                C  ó‚   |s	t d|›�ƒ‚i tdt|ƒrd tdd„ |D ƒdgƒ¡ntiƒ¥|p%i ¥}ddi|p-i ¥}| jtd|d�t||||d	�t	d
�S )á¬  
        Retrieve a specific environment by ID.

        Args:
          betas: Optional header to specify the beta version(s) you want to use.

          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 `environment_id` but received rX   rY   c                 s  rZ   r1   r[   r\   r5   r5   r6   r_   ¢   r`   z(Environments.retrieve.<locals>.<genexpr>ra   ú+/v1/environments/{environment_id}?beta=true©ro   rd   ©rg   rh   ©
Ú
ValueErrorr   r   ri   r   r   Ú_getr   r(   r*   ©r4   ro   rG   rH   rI   rJ   rK   r5   r5   r6   Úretrieveƒ   s*   ÿýÿÿø

ÿûzEnvironments.retrieve©
rC   rD   rE   rL   rF   rG   rH   rI   rJ   rK   ú1Optional[environment_update_params.Config] | OmitúDict[str, Optional[str]] | Omitc       
      	   C  s˜   |s	t d|›�ƒ‚i tdt|ƒrd tdd„ |D ƒdgƒ¡ntiƒ¥|p%i ¥}ddi|p-i ¥}| jtd|d�t|||||d	œt	j
ƒt||	|
|d
�td�S )á¯  
        Update an existing environment's configuration.

        Args:
          config: Updated environment configuration

          description: Updated description of the environment

          metadata: User-provided metadata key-value pairs. Set a value to null or empty string to
              delete the key.

          name: Updated name for the environment

          scope: The visibility scope for this environment. 'organization' makes the environment
              visible to all accounts. 'account' restricts visibility to the owning account
              only.

          betas: Optional header to specify the beta version(s) you want to use.

          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
        rr   rX   rY   c                 s  rZ   r1   r[   r\   r5   r5   r6   r_   ã   r`   z&Environments.update.<locals>.<genexpr>ra   rs   rt   ©rC   rD   rE   rL   rF   rd   re   )rw   r   r   ri   r   r   rj   r   r   r&   ÚEnvironmentUpdateParamsr(   r*   ©r4   ro   rC   rD   rE   rL   rF   rG   rH   rI   rJ   rK   r5   r5   r6   Úupdate²   s<   ,ÿýÿÿø

ûø
ÿñzEnvironments.update©Úinclude_archivedÚlimitÚpagerG   rH   rI   rJ   rK   r„   úbool | Omitr…   ú
int | Omitr†   úSyncPageCursor[BetaEnvironment]c          	      C  ó€   i t dt|ƒrd tdd„ |D ƒdgƒ¡ntiƒ¥|pi ¥}ddi|p$i ¥}| jdtt t||||t	|||dœt
jƒd�td	�S )
áÁ  
        List environments with pagination support.

        Args:
          include_archived: Include archived environments in the response

          limit: Maximum number of environments to return

          page: Opaque cursor from previous response for pagination. Pass the `next_page` value
              from the previous response.

          betas: Optional header to specify the beta version(s) you want to use.

          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
        rX   rY   c                 s  rZ   r1   r[   r\   r5   r5   r6   r_   #  r`   z$Environments.list.<locals>.<genexpr>ra   rb   ©r„   r…   r†   ©rH   rI   rJ   rK   Úquery©r†   rg   Úmodel)r   r   ri   r   r   Ú_get_api_listr"   r*   r(   r   r$   ÚEnvironmentListParams©	r4   r„   r…   r†   rG   rH   rI   rJ   rK   r5   r5   r6   Úlistý   ó<   #ÿýÿÿø
ýúûïzEnvironments.listr+   c                C  rp   )áÊ  Delete an environment by ID.

        Returns a confirmation of the deletion.

        Args:
          betas: Optional header to specify the beta version(s) you want to use.

          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
        rr   rX   rY   c                 s  rZ   r1   r[   r\   r5   r5   r6   r_   _  r`   z&Environments.delete.<locals>.<genexpr>ra   rs   rt   rd   ru   ©
rw   r   r   ri   r   r   Ú_deleter   r(   r+   ry   r5   r5   r6   Údelete?  s*   ÿýÿÿø

ÿûzEnvironments.deletec                C  rp   )áè  Archive an environment by ID.

        Archived environments cannot be used to create new
        sessions.

        Args:
          betas: Optional header to specify the beta version(s) you want to use.

          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
        rr   rX   rY   c                 s  rZ   r1   r[   r\   r5   r5   r6   r_   �  r`   z'Environments.archive.<locals>.<genexpr>ra   ú3/v1/environments/{environment_id}/archive?beta=truert   rd   ru   ©
rw   r   r   ri   r   r   rj   r   r(   r*   ry   r5   r5   r6   Úarchiveo  s*   ÿýÿÿø

ÿûzEnvironments.archive)r/   r   )r/   r9   )r/   r>   ©rL   rM   rC   rN   rD   rO   rE   rP   rF   rQ   rG   rR   rH   rS   rI   rT   rJ   rU   rK   rV   r/   r*   ©ro   rM   rG   rR   rH   rS   rI   rT   rJ   rU   rK   rV   r/   r*   ©ro   rM   rC   r|   rD   rO   rE   r}   rL   rO   rF   rQ   rG   rR   rH   rS   rI   rT   rJ   rU   rK   rV   r/   r*   )r„   r‡   r…   rˆ   r†   rO   rG   rR   rH   rS   rI   rT   rJ   rU   rK   rV   r/   r‰   ©ro   rM   rG   rR   rH   rS   rI   rT   rJ   rU   rK   rV   r/   r+   ©Ú__name__Ú
__module__Ú__qualname__r   r7   r<   r@   r   r   rm   rz   r‚   r”   r™   r�   r5   r5   r5   r6   r,   #   ón    	òLö3ñNôFö4öc                   @  r.   )Cr-   r/   r   c                 C  r0   r1   )r   r2   r3   r5   r5   r6   r7   ¢  r8   zAsyncEnvironments.workÚ AsyncEnvironmentsWithRawResponsec                 C  r:   r;   )r§   r3   r5   r5   r6   r<   ¦  r=   z#AsyncEnvironments.with_raw_responseÚ&AsyncEnvironmentsWithStreamingResponsec                 C  r:   r?   )r¨   r3   r5   r5   r6   r@   °  rA   z)AsyncEnvironments.with_streaming_responseNrB   rL   rM   rC   rN   rD   rO   rE   rP   rF   rQ   rG   rR   rH   rS   rI   rT   rJ   rU   rK   rV   r*   c       
      	   Ã  sŒ   �i t dt|ƒrd tdd„ |D ƒdgƒ¡ntiƒ¥|pi ¥}ddi|p%i ¥}| jdt|||||dœtjƒI dH t	|||	|
d	�t
d
�I dH S )rW   rX   rY   c                 s  rZ   r1   r[   r\   r5   r5   r6   r_   ç  r`   z+AsyncEnvironments.create.<locals>.<genexpr>ra   rb   rc   Nrd   re   )r   r   ri   r   r   rj   r   r%   rk   r(   r*   rl   r5   r5   r6   rm   ¹  s:   €+ÿýÿÿø
ûø
ÿñzAsyncEnvironments.creatern   ro   c                Ã  óŠ   �|s
t d|›�ƒ‚i tdt|ƒrd tdd„ |D ƒdgƒ¡ntiƒ¥|p&i ¥}ddi|p.i ¥}| jtd|d�t||||d	�t	d
�I dH S )rq   rr   rX   rY   c                 s  rZ   r1   r[   r\   r5   r5   r6   r_      r`   z-AsyncEnvironments.retrieve.<locals>.<genexpr>ra   rs   rt   rd   ru   Nrv   ry   r5   r5   r6   rz     s,   €ÿýÿÿø

ÿûzAsyncEnvironments.retriever{   r|   r}   c       
      	   Ã  s¦   �|s
t d|›�ƒ‚i tdt|ƒrd tdd„ |D ƒdgƒ¡ntiƒ¥|p&i ¥}ddi|p.i ¥}| jtd|d�t|||||d	œt	j
ƒI d
H t||	|
|d�td�I d
H S )r~   rr   rX   rY   c                 s  rZ   r1   r[   r\   r5   r5   r6   r_   a  r`   z+AsyncEnvironments.update.<locals>.<genexpr>ra   rs   rt   r   Nrd   re   )rw   r   r   ri   r   r   rj   r   r   r&   r€   r(   r*   r�   r5   r5   r6   r‚   0  s>   €,ÿýÿÿø

ûø
ÿñzAsyncEnvironments.updaterƒ   r„   r‡   r…   rˆ   r†   úAAsyncPaginator[BetaEnvironment, AsyncPageCursor[BetaEnvironment]]c          	      C  rŠ   )
r‹   rX   rY   c                 s  rZ   r1   r[   r\   r5   r5   r6   r_   ¡  r`   z)AsyncEnvironments.list.<locals>.<genexpr>ra   rb   rŒ   r�   r�   )r   r   ri   r   r   r‘   r#   r*   r(   r   r$   r’   r“   r5   r5   r6   r”   {  r•   zAsyncEnvironments.listr+   c                Ã  r©   )r–   rr   rX   rY   c                 s  rZ   r1   r[   r\   r5   r5   r6   r_   Ý  r`   z+AsyncEnvironments.delete.<locals>.<genexpr>ra   rs   rt   rd   ru   Nr—   ry   r5   r5   r6   r™   ½  s,   €ÿýÿÿø

ÿûzAsyncEnvironments.deletec                Ã  r©   )rš   rr   rX   rY   c                 s  rZ   r1   r[   r\   r5   r5   r6   r_     r`   z,AsyncEnvironments.archive.<locals>.<genexpr>ra   r›   rt   rd   ru   Nrœ   ry   r5   r5   r6   r�   í  s,   €ÿýÿÿø

ÿûzAsyncEnvironments.archive)r/   r   )r/   r§   )r/   r¨   rž   rŸ   r    )r„   r‡   r…   rˆ   r†   rO   rG   rR   rH   rS   rI   rT   rJ   rU   rK   rV   r/   rª   r¡   r¢   r5   r5   r5   r6   r-   ¡  r¦   c                   @  ó$   e Zd Zddd„Zeddd	„ƒZd
S )r9   Úenvironmentsr,   r/   ÚNonec                 C  ó^   || _ t |j¡| _t |j¡| _t |j¡| _t |j¡| _t |j¡| _t |j¡| _d S r1   )	Ú_environmentsr	   Úto_raw_response_wrapperrm   rz   r‚   r”   r™   r�   ©r4   r¬   r5   r5   r6   Ú__init__   ó&   ÿÿÿÿÿ
ÿz$EnvironmentsWithRawResponse.__init__r   c                 C  ó   t | jjƒS r1   )r   r¯   r7   r3   r5   r5   r6   r7   6  ó   z EnvironmentsWithRawResponse.workN©r¬   r,   r/   r­   )r/   r   ©r£   r¤   r¥   r²   r   r7   r5   r5   r5   r6   r9     ó    
r9   c                   @  r«   )r§   r¬   r-   r/   r­   c                 C  r®   r1   )	r¯   r	   Úasync_to_raw_response_wrapperrm   rz   r‚   r”   r™   r�   r±   r5   r5   r6   r²   <  r³   z)AsyncEnvironmentsWithRawResponse.__init__r   c                 C  r´   r1   )r   r¯   r7   r3   r5   r5   r6   r7   R  rµ   z%AsyncEnvironmentsWithRawResponse.workN©r¬   r-   r/   r­   )r/   r   r·   r5   r5   r5   r6   r§   ;  r¸   r§   c                   @  r«   )r>   r¬   r,   r/   r­   c                 C  óR   || _ t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _d S r1   )r¯   r    rm   rz   r‚   r”   r™   r�   r±   r5   r5   r6   r²   X  ó&   ÿÿÿÿÿ
ÿz*EnvironmentsWithStreamingResponse.__init__r   c                 C  r´   r1   )r   r¯   r7   r3   r5   r5   r6   r7   n  rµ   z&EnvironmentsWithStreamingResponse.workNr¶   )r/   r   r·   r5   r5   r5   r6   r>   W  r¸   r>   c                   @  r«   )r¨   r¬   r-   r/   r­   c                 C  r»   r1   )r¯   r!   rm   rz   r‚   r”   r™   r�   r±   r5   r5   r6   r²   t  r¼   z/AsyncEnvironmentsWithStreamingResponse.__init__r   c                 C  r´   r1   )r   r¯   r7   r3   r5   r5   r6   r7   Š  rµ   z+AsyncEnvironmentsWithStreamingResponse.workNrº   )r/   r   r·   r5   r5   r5   r6   r¨   s  r¸   r¨   )AÚ
__future__r   Útypingr   r   r   Ú	itertoolsr   Útyping_extensionsr   ÚhttpxÚ r	   r7   r   r   r   r   r   r   Ú_typesr   r   r   r   r   r   r   Ú_utilsr   r   r   r   r   Ú_compatr   Ú	_resourcer   r   Ú	_responser    r!   Ú
paginationr"   r#   Ú
types.betar$   r%   r&   Ú_base_clientr'   r(   Útypes.anthropic_beta_paramr)   Útypes.beta.beta_environmentr*   Ú+types.beta.beta_environment_delete_responser+   Ú__all__r,   r-   r9   r§   r>   r¨   r5   r5   r5   r6   Ú<module>   s>    $      