o
    î6Wj0y  ã                   @  sœ  d dl mZ d dlmZ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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) ddl*m+Z+m,Z,m-Z- ddl.m/Z/ ddl0m1Z1 ddl2m3Z3 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)ÚAnyÚListÚOptionalÚcast)Úchain)ÚLiteralNé   )Ú_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)ÚAsyncPaginatorÚmake_request_options)Úresource_add_paramsÚresource_list_paramsÚresource_update_params)ÚAnthropicBetaParam)ÚResourceUpdateResponse)ÚResourceRetrieveResponse)ÚBetaManagedAgentsFileResource)Ú BetaManagedAgentsSessionResource)Ú&BetaManagedAgentsDeleteSessionResourceÚ	ResourcesÚAsyncResourcesc                   @  ó¦   e Zd Zed2dd„ƒZed3dd„ƒZeddded	œd4dd„Zeddded	œd5dd„Z	eeedddedœd6d$d%„Z
eddded	œd7d'd(„Zeeddded)œd8d0d1„ZdS )9r)   ÚreturnÚResourcesWithRawResponsec                 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
        )r-   ©Úself© r2   úz/home/esfera/Documents/content_generation/venv/lib/python3.10/site-packages/anthropic/resources/beta/sessions/resources.pyÚwith_raw_response   ó   zResources.with_raw_responseÚResourcesWithStreamingResponsec                 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
        )r6   r0   r2   r2   r3   Úwith_streaming_response)   ó   z!Resources.with_streaming_responseN©ÚbetasÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚresource_idÚstrÚ
session_idr;   úList[AnthropicBetaParam] | Omitr<   úHeaders | Noner=   úQuery | Noner>   úBody | Noner?   ú'float | httpx.Timeout | None | NotGivenr%   c             
   C  s¢   |s	t d|›�ƒ‚|st d|›�ƒ‚i tdt|ƒr'd tdd„ |D ƒdgƒ¡ntiƒ¥|p.i ¥}ddi|p6i ¥}tt| jt	d||d	�t
||||d
�tttƒd�ƒS )áš  
        Get Session Resource

        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
        ú9Expected a non-empty value for `session_id` but received ú:Expected a non-empty value for `resource_id` but received úanthropic-betaú,c                 s  ó   � | ]}t |ƒV  qd S ©N©rA   ©Ú.0Úer2   r2   r3   Ú	<genexpr>T   ó   € z%Resources.retrieve.<locals>.<genexpr>úmanaged-agents-2026-04-01ú;/v1/sessions/{session_id}/resources/{resource_id}?beta=true©rB   r@   ©r<   r=   r>   r?   ©ÚoptionsÚcast_to©Ú
ValueErrorr   r   Újoinr   r   r   r%   Ú_getr   r   r   ©r1   r@   rB   r;   r<   r=   r>   r?   r2   r2   r3   Úretrieve2   s@   ÿýÿÿø
ýÿÿ÷þzResources.retrieveÚauthorization_tokenr$   c          	      C  s°   |s	t d|›�ƒ‚|st d|›�ƒ‚i tdt|ƒr'd tdd„ |D ƒdgƒ¡ntiƒ¥|p.i ¥}ddi|p6i ¥}tt| jt	d||d	�t
d
|itjƒt||||d�tttƒd�ƒS )á:  
        Update Session Resource

        Args:
          authorization_token: New authorization token for the resource. Currently only `github_repository`
              resources support token rotation.

          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
        rI   rJ   rK   rL   c                 s  rM   rN   rO   rP   r2   r2   r3   rS   “   rT   z#Resources.update.<locals>.<genexpr>rU   rV   rW   rb   rX   ©ÚbodyrZ   r[   )r]   r   r   r^   r   r   r   r$   Ú_postr   r   r"   ÚResourceUpdateParamsr   r   ©	r1   r@   rB   rb   r;   r<   r=   r>   r?   r2   r2   r3   Úupdatem   sF   ÿýÿÿø
ý
ÿÿÿôþzResources.update©ÚlimitÚpager;   r<   r=   r>   r?   rk   ú
int | Omitrl   ú
str | Omitú0SyncPageCursor[BetaManagedAgentsSessionResource]c          	      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t	 t
||||t||d	œtjƒd
�ttt	ƒd�S )áe  
        List Session Resources

        Args:
          limit: Maximum number of resources to return per page (max 1000). If omitted, returns
              all resources.

          page: Opaque cursor from a previous response's next_page field.

          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
        rI   rK   rL   c                 s  rM   rN   rO   rP   r2   r2   r3   rS   Õ   rT   z!Resources.list.<locals>.<genexpr>rU   ú-/v1/sessions/{session_id}/resources?beta=true©rB   ©rk   rl   ©r<   r=   r>   r?   Úquery©rl   rZ   Úmodel)r]   r   r   r^   r   r   Ú_get_api_listr   r   r'   r   r   r!   ÚResourceListParamsr   r   ©	r1   rB   rk   rl   r;   r<   r=   r>   r?   r2   r2   r3   Úlist¯   óB   !ÿýÿÿø

þûûÿðzResources.listr(   c                C  s–   |s	t d|›�ƒ‚|st d|›�ƒ‚i tdt|ƒr'd tdd„ |D ƒdgƒ¡ntiƒ¥|p.i ¥}ddi|p6i ¥}| jtd||d	�t||||d
�t	d�S )á�  
        Delete Session Resource

        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
        rI   rJ   rK   rL   c                 s  rM   rN   rO   rP   r2   r2   r3   rS     rT   z#Resources.delete.<locals>.<genexpr>rU   rV   rW   rX   rY   ©
r]   r   r   r^   r   r   Ú_deleter   r   r(   r`   r2   r2   r3   Údeleteò   s6   ÿýÿÿø
ýÿ÷zResources.delete©Ú
mount_pathr;   r<   r=   r>   r?   Úfile_idÚtypeúLiteral['file']rƒ   úOptional[str] | Omitr&   c          
   	   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 )á2  
        Add Session Resource

        Args:
          file_id: ID of a previously uploaded file.

          mount_path: Mount path in the container. Defaults to `/mnt/session/uploads/<file_id>`.

          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
        rI   rK   rL   c                 s  rM   rN   rO   rP   r2   r2   r3   rS   N  rT   z Resources.add.<locals>.<genexpr>rU   rr   rs   ©r„   r…   rƒ   rX   rd   )r]   r   r   r^   r   r   rf   r   r   r    ÚResourceAddParamsr   r&   ©
r1   rB   r„   r…   rƒ   r;   r<   r=   r>   r?   r2   r2   r3   Úadd(  s8   !ÿýÿÿø

ýúÿózResources.add)r,   r-   )r,   r6   ©r@   rA   rB   rA   r;   rC   r<   rD   r=   rE   r>   rF   r?   rG   r,   r%   ©r@   rA   rB   rA   rb   rA   r;   rC   r<   rD   r=   rE   r>   rF   r?   rG   r,   r$   )rB   rA   rk   rm   rl   rn   r;   rC   r<   rD   r=   rE   r>   rF   r?   rG   r,   ro   ©r@   rA   rB   rA   r;   rC   r<   rD   r=   rE   r>   rF   r?   rG   r,   r(   ©rB   rA   r„   rA   r…   r†   rƒ   r‡   r;   rC   r<   rD   r=   rE   r>   rF   r?   rG   r,   r&   ©Ú__name__Ú
__module__Ú__qualname__r   r4   r8   r   r   ra   ri   r|   r�   rŒ   r2   r2   r2   r3   r)      óL    	õAôFôHõ<óc                   @  r+   )9r*   r,   ÚAsyncResourcesWithRawResponsec                 C  r.   r/   )r–   r0   r2   r2   r3   r4   h  r5   z AsyncResources.with_raw_responseÚ#AsyncResourcesWithStreamingResponsec                 C  r.   r7   )r—   r0   r2   r2   r3   r8   r  r9   z&AsyncResources.with_streaming_responseNr:   r@   rA   rB   r;   rC   r<   rD   r=   rE   r>   rF   r?   rG   r%   c             
   Ã  sª   �|s
t d|›�ƒ‚|st d|›�ƒ‚i tdt|ƒr(d tdd„ |D ƒdgƒ¡ntiƒ¥|p/i ¥}ddi|p7i ¥}tt| jt	d||d	�t
||||d
�tttƒd�I dH ƒS )rH   rI   rJ   rK   rL   c                 s  rM   rN   rO   rP   r2   r2   r3   rS   �  rT   z*AsyncResources.retrieve.<locals>.<genexpr>rU   rV   rW   rX   rY   Nr\   r`   r2   r2   r3   ra   {  sB   €ÿýÿÿø
ýÿÿ
÷þzAsyncResources.retrieverb   r$   c          	      Ã  s¾   �|s
t d|›�ƒ‚|st d|›�ƒ‚i tdt|ƒr(d tdd„ |D ƒdgƒ¡ntiƒ¥|p/i ¥}ddi|p7i ¥}tt| jt	d||d	�t
d
|itjƒI dH t||||d�tttƒd�I dH ƒS )rc   rI   rJ   rK   rL   c                 s  rM   rN   rO   rP   r2   r2   r3   rS   Ü  rT   z(AsyncResources.update.<locals>.<genexpr>rU   rV   rW   rb   NrX   rd   )r]   r   r   r^   r   r   r   r$   rf   r   r   r"   rg   r   r   rh   r2   r2   r3   ri   ¶  sH   €ÿýÿÿø
ý
ÿÿÿ
ôþzAsyncResources.updaterj   rk   rm   rl   rn   úcAsyncPaginator[BetaManagedAgentsSessionResource, AsyncPageCursor[BetaManagedAgentsSessionResource]]c          	      C  rp   )rq   rI   rK   rL   c                 s  rM   rN   rO   rP   r2   r2   r3   rS     rT   z&AsyncResources.list.<locals>.<genexpr>rU   rr   rs   rt   ru   rw   )r]   r   r   r^   r   r   ry   r   r   r'   r   r   r!   rz   r   r   r{   r2   r2   r3   r|   ø  r}   zAsyncResources.listr(   c                Ã  sž   �|s
t d|›�ƒ‚|st d|›�ƒ‚i tdt|ƒr(d tdd„ |D ƒdgƒ¡ntiƒ¥|p/i ¥}ddi|p7i ¥}| jtd||d	�t||||d
�t	d�I dH S )r~   rI   rJ   rK   rL   c                 s  rM   rN   rO   rP   r2   r2   r3   rS   ]  rT   z(AsyncResources.delete.<locals>.<genexpr>rU   rV   rW   rX   rY   Nr   r`   r2   r2   r3   r�   ;  s8   €ÿýÿÿø
ýÿ÷zAsyncResources.deleter‚   r„   r…   r†   rƒ   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ˆ   rI   rK   rL   c                 s  rM   rN   rO   rP   r2   r2   r3   rS   —  rT   z%AsyncResources.add.<locals>.<genexpr>rU   rr   rs   r‰   NrX   rd   )r]   r   r   r^   r   r   rf   r   r   r    rŠ   r   r&   r‹   r2   r2   r3   rŒ   q  s:   €!ÿýÿÿø

ýúÿózAsyncResources.add)r,   r–   )r,   r—   r�   rŽ   )rB   rA   rk   rm   rl   rn   r;   rC   r<   rD   r=   rE   r>   rF   r?   rG   r,   r˜   r�   r�   r‘   r2   r2   r2   r3   r*   g  r•   c                   @  ó   e Zd Zddd„ZdS )	r-   Ú	resourcesr)   r,   ÚNonec                 C  óP   || _ t |j¡| _t |j¡| _t |j¡| _t |j¡| _t |j¡| _d S rN   )Ú
_resourcesr
   Úto_raw_response_wrapperra   ri   r|   r�   rŒ   ©r1   rš   r2   r2   r3   Ú__init__±  ó    ÿÿÿÿ
ÿz!ResourcesWithRawResponse.__init__N©rš   r)   r,   r›   ©r’   r“   r”   r    r2   r2   r2   r3   r-   °  ó    r-   c                   @  r™   )	r–   rš   r*   r,   r›   c                 C  rœ   rN   )r�   r
   Úasync_to_raw_response_wrapperra   ri   r|   r�   rŒ   rŸ   r2   r2   r3   r    Æ  r¡   z&AsyncResourcesWithRawResponse.__init__N©rš   r*   r,   r›   r£   r2   r2   r2   r3   r–   Å  r¤   r–   c                   @  r™   )	r6   rš   r)   r,   r›   c                 C  óF   || _ t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _d S rN   )r�   r   ra   ri   r|   r�   rŒ   rŸ   r2   r2   r3   r    Û  ó    ÿÿÿÿ
ÿz'ResourcesWithStreamingResponse.__init__Nr¢   r£   r2   r2   r2   r3   r6   Ú  r¤   r6   c                   @  r™   )	r—   rš   r*   r,   r›   c                 C  r§   rN   )r�   r   ra   ri   r|   r�   rŒ   rŸ   r2   r2   r3   r    ð  r¨   z,AsyncResourcesWithStreamingResponse.__init__Nr¦   r£   r2   r2   r2   r3   r—   ï  r¤   r—   )AÚ
__future__r   Útypingr   r   r   r   Ú	itertoolsr   Útyping_extensionsr   ÚhttpxÚ r
   Ú_typesr   r   r   r   r   r   r   Ú_utilsr   r   r   r   r   Ú_compatr   Ú	_resourcer   r   Ú	_responser   r   Ú
paginationr   r   Ú_base_clientr   r   Útypes.beta.sessionsr    r!   r"   Útypes.anthropic_beta_paramr#   Ú,types.beta.sessions.resource_update_responser$   Ú.types.beta.sessions.resource_retrieve_responser%   Ú5types.beta.sessions.beta_managed_agents_file_resourcer&   Ú8types.beta.sessions.beta_managed_agents_session_resourcer'   Ú?types.beta.sessions.beta_managed_agents_delete_session_resourcer(   Ú__all__r)   r*   r-   r–   r6   r—   r2   r2   r2   r3   Ú<module>   s>   $  K  K