
    b\j                       S SK Jr  S SKJrJr  S SKJr  S SKrSSKJ	r	  SSK
JrJrJrJrJrJrJr  SSKJrJrJrJrJr  SS	KJr  SS
KJrJr  SSKJrJr  SSK J!r!J"r"J#r#J$r$J%r%J&r&  SSK'J(r(J)r)  SSK*J+r+J,r,J-r-  SSK.J/r/J0r0  SSK1J2r2  SSK3J4r4  SSK5J6r6  SS/r7 " S S\5      r8 " S S\5      r9 " S S5      r: " S S5      r; " S S5      r< " S S5      r=g)     )annotations)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   )CertificatesAsyncCertificatesCertificatesWithRawResponse AsyncCertificatesWithRawResponse!CertificatesWithStreamingResponse&AsyncCertificatesWithStreamingResponse)SyncPageCursorAsyncPageCursor)tunnel_list_paramstunnel_create_paramstunnel_rotate_token_params)AsyncPaginatormake_request_options)
BetaTunnel)AnthropicBetaParam)BetaTunnelTokenTunnelsAsyncTunnelsc            	         \ rS rSr\SS j5       r\SS j5       r\SS j5       r\\SSS\	S.             SS jjr
\SSS\	S.             SS	 jjr\\\\SSS\	S
.                 SS jjr\SSS\	S.             SS jjr\SSS\	S.             SS jjr\\SSS\	S.               SS jjrSrg)r+   "   c                ,    [        U R                  5      $ N)r   _clientselfs    ^/var/www/website/venv/lib/python3.13/site-packages/anthropic/resources/beta/tunnels/tunnels.pycertificatesTunnels.certificates#   s    DLL))    c                    [        U 5      $ z
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
)TunnelsWithRawResponser2   s    r4   with_raw_responseTunnels.with_raw_response'   s     &d++r7   c                    [        U 5      $ 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
)TunnelsWithStreamingResponser2   s    r4   with_streaming_responseTunnels.with_streaming_response1   s     ,D11r7   Ndisplay_namebetasextra_headersextra_query
extra_bodytimeoutc               2   0 [        S[        U5      (       a#  SR                  [        S U 5       S/5      5      O[        05      EU=(       d    0 EnSS0U=(       d    0 EnU R                  S[        SU0[        R                  5      [        X4XVS9[        S9$ )	Z  The Tunnels API is in research preview.

It requires the
`anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a
deprecation period. It supersedes the Admin API endpoints at
`/v1/organizations/tunnels`, which remain available during a migration window.

Creates a tunnel. Creation allocates a fresh hostname and provisions the tunnel;
it is not idempotent. The new tunnel rejects MCP traffic until at least one CA
certificate is added.

Args:
  display_name: Optional human-readable name for the tunnel (1-255 characters).

  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  8   #    U  H  n[        U5      v   M     g 7fr0   str.0es     r4   	<genexpr>!Tunnels.create.<locals>.<genexpr>a        5Lec!ffe   mcp-tunnels-2026-06-22/v1/tunnels?beta=truerC   rE   rF   rG   rH   bodyoptionscast_to)r   r   joinr   r   _postr   r$   TunnelCreateParamsr'   r(   r3   rC   rD   rE   rF   rG   rH   s          r4   createTunnels.create:   s    H	
$ '*hhu5Le5LOgNh/i&j"	
 "	
 *+C]H[Y[]zz# .,!?AUAhAhi(+Q[   
 	
r7   rD   rE   rF   rG   rH   c          
     8   U(       d  [        SU< 35      e0 [        S[        U5      (       a#  SR                  [	        S U 5       S/5      5      O[
        05      EU=(       d    0 EnSS0U=(       d    0 EnU R                  [        SUS9[        X4XVS9[        S	9$ )
k  The Tunnels API is in research preview.

It requires the
`anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a
deprecation period. It supersedes the Admin API endpoints at
`/v1/organizations/tunnels`, which remain available during a migration window.

Fetches a tunnel 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
8Expected a non-empty value for `tunnel_id` but received rK   rL   c              3  8   #    U  H  n[        U5      v   M     g 7fr0   rN   rP   s     r4   rS   #Tunnels.retrieve.<locals>.<genexpr>   rU   rV   rW   !/v1/tunnels/{tunnel_id}?beta=true	tunnel_idrY   r\   r]   

ValueErrorr   r   r^   r   r   _getr   r'   r(   r3   rl   rD   rE   rF   rG   rH   s          r4   retrieveTunnels.retriever   s    @ WXaWdeff	
$ '*hhu5Le5LOgNh/i&j"	
 "	
 *+C]H[Y[]yy=S(+Q[   
 	
r7   include_archivedlimitpagerD   rE   rF   rG   rH   c               R   0 [        S[        U5      (       a#  SR                  [        S U 5       S/5      5      O[        05      EU=(       d    0 EnSS0U=(       d    0 EnU R                  S[        [           [        UUUU[        UUUS.[        R                  5      S9[        S9$ )	  The Tunnels API is in research preview.

It requires the
`anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a
deprecation period. It supersedes the Admin API endpoints at
`/v1/organizations/tunnels`, which remain available during a migration window.

Lists tunnels. Results are ordered by creation time, newest first; archived
tunnels are excluded unless include_archived is set.

Args:
  include_archived: Whether to include archived tunnels in the results. Defaults to false.

  limit: Maximum number of tunnels to return per page. Defaults to 20, maximum 1000.

  page: Opaque pagination cursor from a previous `list_tunnels` 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
rK   rL   c              3  8   #    U  H  n[        U5      v   M     g 7fr0   rN   rP   s     r4   rS   Tunnels.list.<locals>.<genexpr>   rU   rV   rW   rX   ru   rv   rw   rE   rF   rG   rH   queryrw   r\   model)r   r   r^   r   r   _get_api_listr!   r(   r'   r   r#   TunnelListParams	r3   ru   rv   rw   rD   rE   rF   rG   rH   s	            r4   listTunnels.list   s    R	
$ '*hhu5Le5LOgNh/i&j"	
 "	
 *+C]H[Y[]!!#
+(+'%%,<!& $
 '77 # " 
 	
r7   c          
     8   U(       d  [        SU< 35      e0 [        S[        U5      (       a#  SR                  [	        S U 5       S/5      5      O[
        05      EU=(       d    0 EnSS0U=(       d    0 EnU R                  [        SUS9[        X4XVS9[        S	9$ )
x  The Tunnels API is in research preview.

It requires the
`anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a
deprecation period. It supersedes the Admin API endpoints at
`/v1/organizations/tunnels`, which remain available during a migration window.

Archives a tunnel. Archival is irreversible: every non-archived certificate on
the tunnel is archived in the same operation, the hostname is retired and never
re-allocated, and the tunnel token is invalidated. Retrying against an
already-archived tunnel returns the existing record unchanged.

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
rg   rK   rL   c              3  8   #    U  H  n[        U5      v   M     g 7fr0   rN   rP   s     r4   rS   "Tunnels.archive.<locals>.<genexpr>  rU   rV   rW   )/v1/tunnels/{tunnel_id}/archive?beta=truerk   rY   rm   
ro   r   r   r^   r   r   r_   r   r'   r(   rq   s          r4   archiveTunnels.archive   s    F WXaWdeff	
$ '*hhu5Le5LOgNh/i&j"	
 "	
 *+C]H[Y[]zzEQZ[(+Q[   
 	
r7   c          
     8   U(       d  [        SU< 35      e0 [        S[        U5      (       a#  SR                  [	        S U 5       S/5      5      O[
        05      EU=(       d    0 EnSS0U=(       d    0 EnU R                  [        SUS9[        X4XVS9[        S	9$ )
G  The Tunnels API is in research preview.

It requires the
`anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a
deprecation period. It supersedes the Admin API endpoints at
`/v1/organizations/tunnels`, which remain available during a migration window.

Reveals a tunnel's connector token. The value is fetched live on each call;
Anthropic does not store it. Repeated calls return the same value until the
token is rotated. Exposed as POST so the token does not appear in intermediary
access logs.

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
rg   rK   rL   c              3  8   #    U  H  n[        U5      v   M     g 7fr0   rN   rP   s     r4   rS   'Tunnels.reveal_token.<locals>.<genexpr>O  rU   rV   rW   ./v1/tunnels/{tunnel_id}/reveal_token?beta=truerk   rY   rm   
ro   r   r   r^   r   r   r_   r   r'   r*   rq   s          r4   reveal_tokenTunnels.reveal_token'  s    F WXaWdeff	
$ '*hhu5Le5LOgNh/i&j"	
 "	
 *+C]H[Y[]zzJV_`(+Q[ $  
 	
r7   reasonrD   rE   rF   rG   rH   c               n   U(       d  [        SU< 35      e0 [        S[        U5      (       a#  SR                  [	        S U 5       S/5      5      O[
        05      EU=(       d    0 EnSS0U=(       d    0 EnU R                  [        SUS9[        SU0[        R                  5      [        XEXgS	9[        S
9$ )~  The Tunnels API is in research preview.

It requires the
`anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a
deprecation period. It supersedes the Admin API endpoints at
`/v1/organizations/tunnels`, which remain available during a migration window.

Rotates a tunnel's connector token. Rotation invalidates the current token for
new connections and returns a fresh value; established connections are not
severed. A connector restarted after rotation must use the new value.

Args:
  reason: Optional free-text reason for the rotation, recorded for audit.

  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
rg   rK   rL   c              3  8   #    U  H  n[        U5      v   M     g 7fr0   rN   rP   s     r4   rS   'Tunnels.rotate_token.<locals>.<genexpr>  rU   rV   rW   ./v1/tunnels/{tunnel_id}/rotate_token?beta=truerk   r   rY   rZ   )ro   r   r   r^   r   r   r_   r   r   r%   TunnelRotateTokenParamsr'   r*   r3   rl   r   rD   rE   rF   rG   rH   s           r4   rotate_tokenTunnels.rotate_token_  s    J WXaWdeff	
$ '*hhu5Le5LOgNh/i&j"	
 "	
 *+C]H[Y[]zzJV_` (F!35O5g5gh(+Q[ $  
 	
r7    )returnr   )r   r:   )r   r?   rC   Optional[str] | OmitrD   List[AnthropicBetaParam] | OmitrE   Headers | NonerF   Query | NonerG   Body | NonerH   'float | httpx.Timeout | None | NotGivenr   r(   rl   rO   rD   r   rE   r   rF   r   rG   r   rH   r   r   r(   )ru   bool | Omitrv   
int | Omitrw   
str | OmitrD   r   rE   r   rF   r   rG   r   rH   r   r   zSyncPageCursor[BetaTunnel]rl   rO   rD   r   rE   r   rF   r   rG   r   rH   r   r   r*   rl   rO   r   r   rD   r   rE   r   rF   r   rG   r   rH   r   r   r*   __name__
__module____qualname____firstlineno__r   r5   r;   r@   r   r   rb   rr   r   r   r   r   __static_attributes__r   r7   r4   r+   r+   "   s   * * , , 2 2 .215 )-$("&;D6
 +6
 /	6
 &6
 "6
  6
 96
 
6
x 26 )-$("&;D3
3
 /	3
 &3
 "3
  3
 93
 
3
p )- 15 )-$("&;DF
 &F
 	F

 F
 /F
 &F
 "F
  F
 9F
 
$F
X 26 )-$("&;D6
6
 /	6
 &6
 "6
  6
 96
 
6
x 26 )-$("&;D6
6
 /	6
 &6
 "6
  6
 96
 
6
x (,15 )-$("&;D9
9
 %	9

 /9
 &9
 "9
  9
 99
 
9
 9
r7   c            	         \ rS rSr\SS j5       r\SS j5       r\SS j5       r\\SSS\	S.             SS jjr
\SSS\	S.             SS	 jjr\\\\SSS\	S
.                 SS jjr\SSS\	S.             SS jjr\SSS\	S.             SS jjr\\SSS\	S.               SS jjrSrg)r,   i  c                ,    [        U R                  5      $ r0   )r   r1   r2   s    r4   r5   AsyncTunnels.certificates  s     ..r7   c                    [        U 5      $ r9   )AsyncTunnelsWithRawResponser2   s    r4   r;   AsyncTunnels.with_raw_response  s     +400r7   c                    [        U 5      $ r>   )!AsyncTunnelsWithStreamingResponser2   s    r4   r@   $AsyncTunnels.with_streaming_response  s     166r7   NrB   c               b  #    0 [        S[        U5      (       a#  SR                  [        S U 5       S/5      5      O[        05      EU=(       d    0 EnSS0U=(       d    0 EnU R                  S[        SU0[        R                  5      I Sh  vN [        X4XVS9[        S	9I Sh  vN $  N N7f)
rJ   rK   rL   c              3  8   #    U  H  n[        U5      v   M     g 7fr0   rN   rP   s     r4   rS   &AsyncTunnels.create.<locals>.<genexpr>  rU   rV   rW   rX   rC   NrY   rZ   )r   r   r^   r   r   r_   r   r$   r`   r'   r(   ra   s          r4   rb   AsyncTunnels.create  s     H	
$ '*hhu5Le5LOgNh/i&j"	
 "	
 *+C]H[Y[]ZZ#,nl-KMaMtMtuu(+Q[    
 
 	
u
s$   BB/B+
B/&B-'B/-B/rd   c          
     T  #    U(       d  [        SU< 35      e0 [        S[        U5      (       a#  SR                  [	        S U 5       S/5      5      O[
        05      EU=(       d    0 EnSS0U=(       d    0 EnU R                  [        SUS9[        X4XVS9[        S	9I S
h  vN $  N7f)rf   rg   rK   rL   c              3  8   #    U  H  n[        U5      v   M     g 7fr0   rN   rP   s     r4   rS   (AsyncTunnels.retrieve.<locals>.<genexpr>  rU   rV   rW   rj   rk   rY   rm   Nrn   rq   s          r4   rr   AsyncTunnels.retrieve  s     @ WXaWdeff	
$ '*hhu5Le5LOgNh/i&j"	
 "	
 *+C]H[Y[]YY=S(+Q[   
 
 	
 
   BB(!B&"B(rt   c               R   0 [        S[        U5      (       a#  SR                  [        S U 5       S/5      5      O[        05      EU=(       d    0 EnSS0U=(       d    0 EnU R                  S[        [           [        UUUU[        UUUS.[        R                  5      S9[        S9$ )	ry   rK   rL   c              3  8   #    U  H  n[        U5      v   M     g 7fr0   rN   rP   s     r4   rS   $AsyncTunnels.list.<locals>.<genexpr>L  rU   rV   rW   rX   r|   r}   r   )r   r   r^   r   r   r   r"   r(   r'   r   r#   r   r   s	            r4   r   AsyncTunnels.list   s    R	
$ '*hhu5Le5LOgNh/i&j"	
 "	
 *+C]H[Y[]!!# ,(+'%%,<!& $
 '77 # " 
 	
r7   c          
     T  #    U(       d  [        SU< 35      e0 [        S[        U5      (       a#  SR                  [	        S U 5       S/5      5      O[
        05      EU=(       d    0 EnSS0U=(       d    0 EnU R                  [        SUS9[        X4XVS9[        S	9I S
h  vN $  N7f)r   rg   rK   rL   c              3  8   #    U  H  n[        U5      v   M     g 7fr0   rN   rP   s     r4   rS   'AsyncTunnels.archive.<locals>.<genexpr>  rU   rV   rW   r   rk   rY   rm   Nr   rq   s          r4   r   AsyncTunnels.archiveh  s     F WXaWdeff	
$ '*hhu5Le5LOgNh/i&j"	
 "	
 *+C]H[Y[]ZZEQZ[(+Q[    
 
 	
 
r   c          
     T  #    U(       d  [        SU< 35      e0 [        S[        U5      (       a#  SR                  [	        S U 5       S/5      5      O[
        05      EU=(       d    0 EnSS0U=(       d    0 EnU R                  [        SUS9[        X4XVS9[        S	9I S
h  vN $  N7f)r   rg   rK   rL   c              3  8   #    U  H  n[        U5      v   M     g 7fr0   rN   rP   s     r4   rS   ,AsyncTunnels.reveal_token.<locals>.<genexpr>  rU   rV   rW   r   rk   rY   rm   Nr   rq   s          r4   r   AsyncTunnels.reveal_token  s     F WXaWdeff	
$ '*hhu5Le5LOgNh/i&j"	
 "	
 *+C]H[Y[]ZZJV_`(+Q[ $   
 
 	
 
r   r   c                 #    U(       d  [        SU< 35      e0 [        S[        U5      (       a#  SR                  [	        S U 5       S/5      5      O[
        05      EU=(       d    0 EnSS0U=(       d    0 EnU R                  [        SUS9[        SU0[        R                  5      I S	h  vN [        XEXgS
9[        S9I S	h  vN $  N N7f)r   rg   rK   rL   c              3  8   #    U  H  n[        U5      v   M     g 7fr0   rN   rP   s     r4   rS   ,AsyncTunnels.rotate_token.<locals>.<genexpr>  rU   rV   rW   r   rk   r   NrY   rZ   )ro   r   r   r^   r   r   r_   r   r   r%   r   r'   r*   r   s           r4   r   AsyncTunnels.rotate_token  s     J WXaWdeff	
$ '*hhu5Le5LOgNh/i&j"	
 "	
 *+C]H[Y[]ZZJV_`,h-?A[AsAstt(+Q[ $   
 
 	
t
s$   B*C,C	
-CCCCr   )r   r   )r   r   )r   r   r   r   )ru   r   rv   r   rw   r   rD   r   rE   r   rF   r   rG   r   rH   r   r   z7AsyncPaginator[BetaTunnel, AsyncPageCursor[BetaTunnel]]r   r   r   r   r7   r4   r,   r,     s   / / 1 1 7 7 .215 )-$("&;D6
 +6
 /	6
 &6
 "6
  6
 96
 
6
x 26 )-$("&;D3
3
 /	3
 &3
 "3
  3
 93
 
3
p )- 15 )-$("&;DF
 &F
 	F

 F
 /F
 &F
 "F
  F
 9F
 
AF
X 26 )-$("&;D6
6
 /	6
 &6
 "6
  6
 96
 
6
x 26 )-$("&;D6
6
 /	6
 &6
 "6
  6
 96
 
6
x (,15 )-$("&;D9
9
 %	9

 /9
 &9
 "9
  9
 99
 
9
 9
r7   c                  2    \ rS rSrSS jr\SS j5       rSrg)r:   i  c                   Xl         [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR
                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        g r0   )	_tunnelsr   to_raw_response_wrapperrb   rr   r   r   r   r   r3   tunnelss     r4   __init__TunnelsWithRawResponse.__init__  s    &>>NN
 )@@
 %<<LL
	 (??OO
 -DD  
 -DD  
r7   c                @    [        U R                  R                  5      $ r0   )r   r   r5   r2   s    r4   r5   #TunnelsWithRawResponse.certificates+  s    *4==+E+EFFr7   r   r   rb   r   rr   r   r   Nr   r+   r   None)r   r   r   r   r   r   r   r   r5   r   r   r7   r4   r:   r:     s    
, G Gr7   r:   c                  2    \ rS rSrSS jr\SS j5       rSrg)r   i0  c                   Xl         [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR
                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        g r0   )	r   r   async_to_raw_response_wrapperrb   rr   r   r   r   r   r   s     r4   r   $AsyncTunnelsWithRawResponse.__init__1  s    &DDNN
 )FF
 %BBLL
	 (EEOO
 -JJ  
 -JJ  
r7   c                @    [        U R                  R                  5      $ r0   )r   r   r5   r2   s    r4   r5   (AsyncTunnelsWithRawResponse.certificatesG  s    /0J0JKKr7   r   Nr   r,   r   r   )r   r   r   r   r7   r4   r   r   0  s    
, L Lr7   r   c                  2    \ rS rSrSS jr\SS j5       rSrg)r?   iL  c                H   Xl         [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l        [        UR
                  5      U l        [        UR                  5      U l        [        UR                  5      U l        g r0   )r   r   rb   rr   r   r   r   r   r   s     r4   r   %TunnelsWithStreamingResponse.__init__M  s    2NN
 5
 1LL
	 4OO
 9  
 9  
r7   c                @    [        U R                  R                  5      $ r0   )r   r   r5   r2   s    r4   r5   )TunnelsWithStreamingResponse.certificatesc  s    01K1KLLr7   r   Nr   )r   r   r   r   r7   r4   r?   r?   L  s    
, M Mr7   r?   c                  2    \ rS rSrSS jr\SS j5       rSrg)r   ih  c                H   Xl         [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l        [        UR
                  5      U l        [        UR                  5      U l        [        UR                  5      U l        g r0   )r   r   rb   rr   r   r   r   r   r   s     r4   r   *AsyncTunnelsWithStreamingResponse.__init__i  s    8NN
 ;
 7LL
	 :OO
 ?  
 ?  
r7   c                @    [        U R                  R                  5      $ r0   )r    r   r5   r2   s    r4   r5   .AsyncTunnelsWithStreamingResponse.certificates  s    5dmm6P6PQQr7   r   Nr   )r   r    r   r   r7   r4   r   r   h  s    
, R Rr7   r   )>
__future__r   typingr   r   	itertoolsr   httpx r   _typesr	   r
   r   r   r   r   r   _utilsr   r   r   r   r   _compatr   	_resourcer   r   	_responser   r   r5   r   r   r   r   r   r    
paginationr!   r"   
types.betar#   r$   r%   _base_clientr&   r'   types.beta.beta_tunnelr(   types.anthropic_beta_paramr)   types.beta.beta_tunnel_tokenr*   __all__r+   r,   r:   r   r?   r   r   r7   r4   <module>r     s    # !   ! L L L g g ' ; Z  ; _ _ A 1 = <n
%v
o v
rv
# v
rG G8L L8M M8R Rr7   