
    Ii                       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 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&m'Z'm(Z( ddl)m*Z*m+Z+ ddl,m-Z- ddl.m/Z/ ddl0m%Z% ddl1m2Z2 ddgZ3 G d de      Z4 G d de      Z5 G d d      Z6 G d d      Z7 G d d      Z8 G d d      Z9y)    )annotations)DictListOptional)chainN   )_legacy_response)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)BetaCloudConfigParamsenvironment_list_paramsenvironment_create_paramsenvironment_update_params)AsyncPaginatormake_request_options)AnthropicBetaParam)BetaEnvironment)r   )BetaEnvironmentDeleteResponseEnvironmentsAsyncEnvironmentsc            
         e Zd Zedd       Zedd       Zeeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	eeeeeddded		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd	Z
eeeeddded
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)r&   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
        )EnvironmentsWithRawResponseselfs    l/volume1/homes/robertsu/coba/app/.venv/lib/python3.12/site-packages/anthropic/resources/beta/environments.pywith_raw_responsezEnvironments.with_raw_response!   s     +400    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/anthropics/anthropic-sdk-python#with_streaming_response
        )!EnvironmentsWithStreamingResponser,   s    r.   with_streaming_responsez$Environments.with_streaming_response+   s     166r0   Nconfigdescriptionmetadatabetasextra_headersextra_query
extra_bodytimeoutc       	   
     *   i t        dt        |      r#dj                  t        d |D        dg            nt        i      |xs i }ddi|xs i }| j                  dt        ||||dt        j                        t        ||||	      t              S )	  
        Create a new environment with the specified configuration.

        Args:
          name: Human-readable name for the environment

          config: Request params for `cloud` environment configuration.

              Fields default to null; on update, omitted fields preserve the existing value.

          description: Optional description of the environment

          metadata: User-provided metadata key-value pairs

          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              3  2   K   | ]  }t        |        y wNstr.0es     r.   	<genexpr>z&Environments.create.<locals>.<genexpr>^        5Lec!fe   managed-agents-2026-04-01/v1/environments?beta=truenamer6   r7   r8   r:   r;   r<   r=   bodyoptionscast_to)r   r   joinr   r   _postr   r   EnvironmentCreateParamsr"   r$   
r-   rO   r6   r7   r8   r9   r:   r;   r<   r=   s
             r.   createzEnvironments.create4   s    N	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`zz(  $#. (	 *AA )+Q[el $  
 	
r0   r9   r:   r;   r<   r=   c          
     $   |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d|      t        ||||      t        	      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 r@   rA   c              3  2   K   | ]  }t        |        y wrC   rD   rF   s     r.   rI   z(Environments.retrieve.<locals>.<genexpr>   rJ   rK   rL   +/v1/environments/{environment_id}?beta=trueenvironment_idrP   rS   rT   

ValueErrorr   r   rU   r   r   _getr   r"   r$   r-   ra   r9   r:   r;   r<   r=   s          r.   retrievezEnvironments.retrievew   s    4 \]k\nopp	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`yyGXfg(+Q[el $  
 	
r0   	r6   r7   r8   rO   r9   r:   r;   r<   r=   c       	   
     `   |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d|      t        ||||dt        j                        t        |||	|
	      t        
      S )O  
        Update an existing environment's configuration.

        Args:
          config: Request params for `cloud` environment configuration.

              Fields default to null; on update, omitted fields preserve the existing value.

          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

          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
        r]   r@   rA   c              3  2   K   | ]  }t        |        y wrC   rD   rF   s     r.   rI   z&Environments.update.<locals>.<genexpr>   rJ   rK   rL   r_   r`   r6   r7   r8   rO   rP   rQ   )rd   r   r   rU   r   r   rV   r   r   r    EnvironmentUpdateParamsr"   r$   r-   ra   r6   r7   r8   rO   r9   r:   r;   r<   r=   s              r.   updatezEnvironments.update   s    R \]k\nopp	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`zzGXfg $#. ( 	 *AA )+Q[el $  
 	
r0   include_archivedlimitpager9   r:   r;   r<   r=   c               @   i t        dt        |      r#dj                  t        d |D        dg            nt        i      |xs i }ddi|xs i }| j                  dt        t           t        ||||t        |||dt        j                              t              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
        r@   rA   c              3  2   K   | ]  }t        |        y wrC   rD   rF   s     r.   rI   z$Environments.list.<locals>.<genexpr>  rJ   rK   rL   rM   rq   rr   rs   r:   r;   r<   r=   queryrs   rS   model)r   r   rU   r   r   _get_api_listr   r$   r"   r   r   EnvironmentListParams	r-   rq   rr   rs   r9   r:   r;   r<   r=   s	            r.   listzEnvironments.list   s    F	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`!!(0(+'%%,<!& $
 ,AA "# " 
 	
r0   c          
     $   |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d|      t        ||||      t        	      S )
  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
        r]   r@   rA   c              3  2   K   | ]  }t        |        y wrC   rD   rF   s     r.   rI   z&Environments.delete.<locals>.<genexpr>O  rJ   rK   rL   r_   r`   rP   rb   
rd   r   r   rU   r   r   _deleter   r"   r%   rf   s          r.   deletezEnvironments.delete/  s    6 \]k\nopp	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`||GXfg(+Q[el 2  
 	
r0   c          
     $   |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d|      t        ||||      t        	      S )
  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
        r]   r@   rA   c              3  2   K   | ]  }t        |        y wrC   rD   rF   s     r.   rI   z'Environments.archive.<locals>.<genexpr>  rJ   rK   rL   3/v1/environments/{environment_id}/archive?beta=truer`   rP   rb   
rd   r   r   rU   r   r   rV   r   r"   r$   rf   s          r.   archivezEnvironments.archive_  s    8 \]k\nopp	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`zzO`no(+Q[el $  
 	
r0   )returnr+   )r   r3   rO   rE   r6   &Optional[BetaCloudConfigParams] | Omitr7   Optional[str] | Omitr8   zDict[str, str] | Omitr9   List[AnthropicBetaParam] | Omitr:   Headers | Noner;   Query | Noner<   Body | Noner=   'float | httpx.Timeout | None | NotGivenr   r$   ra   rE   r9   r   r:   r   r;   r   r<   r   r=   r   r   r$   ra   rE   r6   r   r7   r   r8   zDict[str, Optional[str]] | OmitrO   r   r9   r   r:   r   r;   r   r<   r   r=   r   r   r$   )rq   bool | Omitrr   
int | Omitrs   r   r9   r   r:   r   r;   r   r<   r   r=   r   r   zSyncPageCursor[BetaEnvironment]ra   rE   r9   r   r:   r   r;   r   r<   r   r=   r   r   r%   __name__
__module____qualname__r   r/   r4   r   r   rY   rg   ro   r   r   r    r0   r.   r&   r&       s   1 1 7 7 :>,0*.15 )-$("&;DA
 A
 7	A

 *A
 (A
 /A
 &A
 "A
  A
 9A
 
A
N 26 )-$("&;D-
-
 /	-
 &-
 "-
  -
 9-
 
-
f :>,048%)15 )-$("&;DE
E
 7	E

 *E
 2E
 #E
 /E
 &E
 "E
  E
 9E
 
E
T )- %)15 )-$("&;D@
 &@
 	@

 #@
 /@
 &@
 "@
  @
 9@
 
)@
L 26 )-$("&;D.
.
 /	.
 &.
 ".
  .
 9.
 
'.
h 26 )-$("&;D/
/
 /	/
 &/
 "/
  /
 9/
 
/
r0   c            
         e Zd Zedd       Zedd       Zeeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	eeeeeddded		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd	Z
eeeeddded
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)r'   c                    t        |       S r*   ) AsyncEnvironmentsWithRawResponser,   s    r.   r/   z#AsyncEnvironments.with_raw_response  s     055r0   c                    t        |       S r2   )&AsyncEnvironmentsWithStreamingResponser,   s    r.   r4   z)AsyncEnvironments.with_streaming_response  s     6d;;r0   Nr5   c       	   
     Z  K   i t        dt        |      r#dj                  t        d |D        dg            nt        i      |xs i }ddi|xs i }| j                  dt        ||||dt        j                         d{   t        ||||	      t        	       d{   S 7 $7 w)
r?   r@   rA   c              3  2   K   | ]  }t        |        y wrC   rD   rF   s     r.   rI   z+AsyncEnvironments.create.<locals>.<genexpr>  rJ   rK   rL   rM   rN   NrP   rQ   )r   r   rU   r   r   rV   r   r   rW   r"   r$   rX   s
             r.   rY   zAsyncEnvironments.create  s     N	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`ZZ(, $#. (	 *AA  )+Q[el $   
 
 	

s$   B B+B'
B+"B)#B+)B+rZ   c          
     @  K   |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d|      t        ||||      t        	       d
{   S 7 w)r\   r]   r@   rA   c              3  2   K   | ]  }t        |        y wrC   rD   rF   s     r.   rI   z-AsyncEnvironments.retrieve.<locals>.<genexpr>  rJ   rK   rL   r_   r`   rP   rb   Nrc   rf   s          r.   rg   zAsyncEnvironments.retrieve  s     4 \]k\nopp	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`YYGXfg(+Q[el $  
 
 	
 
   BBBBrh   c       	   
       K   |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d|      t        ||||dt        j                         d	{   t        |||	|

      t               d	{   S 7 $7 w)rj   r]   r@   rA   c              3  2   K   | ]  }t        |        y wrC   rD   rF   s     r.   rI   z+AsyncEnvironments.update.<locals>.<genexpr>E  rJ   rK   rL   r_   r`   rl   NrP   rQ   )rd   r   r   rU   r   r   rV   r   r   r    rm   r"   r$   rn   s              r.   ro   zAsyncEnvironments.update  s    R \]k\nopp	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`ZZGXfg,$#. ( 	 *AA  )+Q[el $   
 
 	

s$   BCC
C=C>CCrp   c               @   i t        dt        |      r#dj                  t        d |D        dg            nt        i      |xs i }ddi|xs i }| j                  dt        t           t        ||||t        |||dt        j                              t              S )	ru   r@   rA   c              3  2   K   | ]  }t        |        y wrC   rD   rF   s     r.   rI   z)AsyncEnvironments.list.<locals>.<genexpr>  rJ   rK   rL   rM   rw   rx   rz   )r   r   rU   r   r   r|   r   r$   r"   r   r   r}   r~   s	            r.   r   zAsyncEnvironments.list^  s    F	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`!!( 1(+'%%,<!& $
 ,AA "# " 
 	
r0   c          
     @  K   |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d|      t        ||||      t        	       d
{   S 7 w)r   r]   r@   rA   c              3  2   K   | ]  }t        |        y wrC   rD   rF   s     r.   rI   z+AsyncEnvironments.delete.<locals>.<genexpr>  rJ   rK   rL   r_   r`   rP   rb   Nr   rf   s          r.   r   zAsyncEnvironments.delete  s     6 \]k\nopp	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`\\GXfg(+Q[el 2 " 
 
 	
 
r   c          
     @  K   |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d|      t        ||||      t        	       d
{   S 7 w)r   r]   r@   rA   c              3  2   K   | ]  }t        |        y wrC   rD   rF   s     r.   rI   z,AsyncEnvironments.archive.<locals>.<genexpr>  rJ   rK   rL   r   r`   rP   rb   Nr   rf   s          r.   r   zAsyncEnvironments.archive  s     8 \]k\nopp	
$ '*hhu5Le5LOjNk/l&m"	
 "	
 *+F`=K^\^`ZZO`no(+Q[el $   
 
 	
 
r   )r   r   )r   r   r   r   r   )rq   r   rr   r   rs   r   r9   r   r:   r   r;   r   r<   r   r=   r   r   zAAsyncPaginator[BetaEnvironment, AsyncPageCursor[BetaEnvironment]]r   r   r   r0   r.   r'   r'     s   6 6 < < :>,0*.15 )-$("&;DA
 A
 7	A

 *A
 (A
 /A
 &A
 "A
  A
 9A
 
A
N 26 )-$("&;D-
-
 /	-
 &-
 "-
  -
 9-
 
-
f :>,048%)15 )-$("&;DE
E
 7	E

 *E
 2E
 #E
 /E
 &E
 "E
  E
 9E
 
E
T )- %)15 )-$("&;D@
 &@
 	@

 #@
 /@
 &@
 "@
  @
 9@
 
K@
L 26 )-$("&;D.
.
 /	.
 &.
 ".
  .
 9.
 
'.
h 26 )-$("&;D/
/
 /	/
 &/
 "/
  /
 9/
 
/
r0   c                      e Zd ZddZy)r+   c                   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j                        | _        y rC   )	_environmentsr	   to_raw_response_wrapperrY   rg   ro   r   r   r   r-   environmentss     r.   __init__z$EnvironmentsWithRawResponse.__init__  s    )&>>
 )@@!!
 '>>
 %<<
	 '>>
 (??  
r0   Nr   r&   r   Noner   r   r   r   r   r0   r.   r+   r+         
r0   r+   c                      e Zd ZddZy)r   c                   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j                        | _        y rC   )	r   r	   async_to_raw_response_wrapperrY   rg   ro   r   r   r   r   s     r.   r   z)AsyncEnvironmentsWithRawResponse.__init__  s    )&DD
 )FF!!
 'DD
 %BB
	 'DD
 (EE  
r0   Nr   r'   r   r   r   r   r0   r.   r   r     r   r0   r   c                      e Zd ZddZy)r3   c                J   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        t        |j                        | _        y rC   )r   r   rY   rg   ro   r   r   r   r   s     r.   r   z*EnvironmentsWithStreamingResponse.__init__3  s    )2
 5!!
 3
 1
	 3
 4  
r0   Nr   r   r   r0   r.   r3   r3   2  r   r0   r3   c                      e Zd ZddZy)r   c                J   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        t        |j                        | _        y rC   )r   r   rY   rg   ro   r   r   r   r   s     r.   r   z/AsyncEnvironmentsWithStreamingResponse.__init__K  s    )8
 ;!!
 9
 7
	 9
 :  
r0   Nr   r   r   r0   r.   r   r   J  r   r0   r   ):
__future__r   typingr   r   r   	itertoolsr   httpx r	   _typesr
   r   r   r   r   r   r   _utilsr   r   r   r   r   _compatr   	_resourcer   r   	_responser   r   
paginationr   r   
types.betar   r   r   r    _base_clientr!   r"   types.anthropic_beta_paramr#   types.beta.beta_environmentr$   #types.beta.beta_cloud_config_params+types.beta.beta_environment_delete_responser%   __all__r&   r'   r+   r   r3   r   r   r0   r.   <module>r      s    # ' '     K K K f f & : Y 9  A < : H X.
/n
? n
bn
( n
b
 
0
 
0
 
0
 
r0   