o
    +i|b                     @  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	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mZ ddlmZ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- ddl.m/Z/ ddl0m1Z1 ddl2m3Z3 ddl4m5Z5 ddl6m7Z7 ddgZ8G dd de Z9G 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)ListMappingOptionalcast)chainN   )_legacy_response)	BodyOmitQueryHeadersNotGiven	FileTypesSequenceNotStromit	not_given)is_givenextract_filesmaybe_transformstrip_not_givendeepcopy_minimalasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)SyncPageCursorAsyncPageCursor)AsyncPaginatormake_request_options)version_list_paramsversion_create_params)AnthropicBetaParam)VersionListResponse)VersionCreateResponse)VersionDeleteResponse)VersionRetrieveResponseVersionsAsyncVersionsc                   @     e Zd Zed+ddZed,ddZeeddded	d-ddZedddedd.ddZ	eeeddded d/d&d'Z
edddedd0d)d*ZdS )1r)   returnVersionsWithRawResponsec                 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   e/var/www/html/psymed-ai/venv/lib/python3.10/site-packages/anthropic/resources/beta/skills/versions.pywith_raw_response.      zVersions.with_raw_responseVersionsWithStreamingResponsec                 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_response8      z Versions.with_streaming_responseNfilesbetasextra_headersextra_query
extra_bodytimeoutskill_idstrr;   *Optional[SequenceNotStr[FileTypes]] | Omitr<   List[AnthropicBetaParam] | Omitr=   Headers | Noner>   Query | Noner?   Body | Noner@   'float | httpx.Timeout | None | NotGivenr&   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 }td|i}ttt	t
tf |ddggd	}	d
|d< | jd| dt|tj|	t||||dtdS )  
        Create Skill Version

        Args:
          skill_id: Unique identifier for the skill.

              The format and length of IDs may change over time.

          files: Files to upload for the skill.

              All files must be in the same top-level directory and must include a SKILL.md
              file at the root of that directory.

          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
        7Expected a non-empty value for `skill_id` but received anthropic-beta,c                 s      | ]}t |V  qd S NrB   .0er2   r2   r3   	<genexpr>j       z"Versions.create.<locals>.<genexpr>skills-2025-10-02r;   <array>pathsmultipart/form-dataContent-Type/v1/skills//versions?beta=truer=   r>   r?   r@   bodyr;   optionscast_to)
ValueErrorr   r   joinr   r   r   r   r   r   rB   object_postr   r#   VersionCreateParamsr!   r&   
r1   rA   r;   r<   r=   r>   r?   r@   r_   extracted_filesr2   r2   r3   createA   s4   $
 

zVersions.creater<   r=   r>   r?   r@   versionr(   c                C     |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d| d	| d
t||||dtdS )  
        Get Skill Version

        Args:
          skill_id: Unique identifier for the skill.

              The format and length of IDs may change over time.

          version: Version identifier for the skill.

              Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").

          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
        rJ   6Expected a non-empty value for `version` but received rK   rL   c                 s  rM   rN   rO   rP   r2   r2   r3   rS      rT   z$Versions.retrieve.<locals>.<genexpr>rU   r[   
/versions/
?beta=truer]   r`   ra   	rb   r   r   rc   r   r   _getr!   r(   r1   rk   rA   r<   r=   r>   r?   r@   r2   r2   r3   retrieve   .   #
zVersions.retrievelimitpager<   r=   r>   r?   r@   rx   Optional[int] | Omitry   Optional[str] | Omit#SyncPageCursor[VersionListResponse]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d| dtt t	||||t
||d	tjd
tdS )  
        List Skill Versions

        Args:
          skill_id: Unique identifier for the skill.

              The format and length of IDs may change over time.

          limit: Number of items to return per page.

              Defaults to `20`. Ranges from `1` to `1000`.

          page: Optionally set to the `next_page` token 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
        rJ   rK   rL   c                 s  rM   rN   rO   rP   r2   r2   r3   rS      rT   z Versions.list.<locals>.<genexpr>rU   r[   r\   rx   ry   r=   r>   r?   r@   queryry   r`   model)rb   r   r   rc   r   r   _get_api_listr   r%   r!   r   r"   VersionListParams	r1   rA   rx   ry   r<   r=   r>   r?   r@   r2   r2   r3   list   >   &

zVersions.listr'   c                C  rl   )  
        Delete Skill Version

        Args:
          skill_id: Unique identifier for the skill.

              The format and length of IDs may change over time.

          version: Version identifier for the skill.

              Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").

          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
        rJ   rn   rK   rL   c                 s  rM   rN   rO   rP   r2   r2   r3   rS   ,  rT   z"Versions.delete.<locals>.<genexpr>rU   r[   ro   rp   r]   rq   	rb   r   r   rc   r   r   _deleter!   r'   rt   r2   r2   r3   delete  rv   zVersions.delete)r,   r-   )r,   r6   rA   rB   r;   rC   r<   rD   r=   rE   r>   rF   r?   rG   r@   rH   r,   r&   rk   rB   rA   rB   r<   rD   r=   rE   r>   rF   r?   rG   r@   rH   r,   r(   )rA   rB   rx   rz   ry   r{   r<   rD   r=   rE   r>   rF   r?   rG   r@   rH   r,   r|   rk   rB   rA   rB   r<   rD   r=   rE   r>   rF   r?   rG   r@   rH   r,   r'   __name__
__module____qualname__r   r4   r8   r   r   ri   ru   r   r   r2   r2   r2   r3   r)   -   @    	F>Kc                   @  r+   )1r*   r,   AsyncVersionsWithRawResponsec                 C  r.   r/   )r   r0   r2   r2   r3   r4   >  r5   zAsyncVersions.with_raw_response"AsyncVersionsWithStreamingResponsec                 C  r.   r7   )r   r0   r2   r2   r3   r8   H  r9   z%AsyncVersions.with_streaming_responseNr:   rA   rB   r;   rC   r<   rD   r=   rE   r>   rF   r?   rG   r@   rH   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 }td|i}ttt	t
tf |ddggd	}	d
|d< | jd| dt|tjI dH |	t||||dtdI dH S )rI   rJ   rK   rL   c                 s  rM   rN   rO   rP   r2   r2   r3   rS   z  rT   z'AsyncVersions.create.<locals>.<genexpr>rU   r;   rV   rW   rY   rZ   r[   r\   Nr]   r^   )rb   r   r   rc   r   r   r   r   r   r   rB   rd   re   r   r#   rf   r!   r&   rg   r2   r2   r3   ri   Q  s6   $
 
zAsyncVersions.createrj   rk   r(   c                     |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d| d	| d
t||||dtdI dH S )rm   rJ   rn   rK   rL   c                 s  rM   rN   rO   rP   r2   r2   r3   rS     rT   z)AsyncVersions.retrieve.<locals>.<genexpr>rU   r[   ro   rp   r]   rq   Nrr   rt   r2   r2   r3   ru     0   #
zAsyncVersions.retrieverw   rx   rz   ry   r{   IAsyncPaginator[VersionListResponse, AsyncPageCursor[VersionListResponse]]c          	      C  r}   )r~   rJ   rK   rL   c                 s  rM   rN   rO   rP   r2   r2   r3   rS     rT   z%AsyncVersions.list.<locals>.<genexpr>rU   r[   r\   r   r   r   )rb   r   r   rc   r   r   r   r   r%   r!   r   r"   r   r   r2   r2   r3   r     r   zAsyncVersions.listr'   c                  r   )r   rJ   rn   rK   rL   c                 s  rM   rN   rO   rP   r2   r2   r3   rS   <  rT   z'AsyncVersions.delete.<locals>.<genexpr>rU   r[   ro   rp   r]   rq   Nr   rt   r2   r2   r3   r     r   zAsyncVersions.delete)r,   r   )r,   r   r   r   )rA   rB   rx   rz   ry   r{   r<   rD   r=   rE   r>   rF   r?   rG   r@   rH   r,   r   r   r   r2   r2   r2   r3   r*   =  r   c                   @     e Zd ZdddZdS )	r-   versionsr)   r,   Nonec                 C  B   || _ t|j| _t|j| _t|j| _t|j| _d S rN   )	_versionsr	   to_raw_response_wrapperri   ru   r   r   r1   r   r2   r2   r3   __init__N     
z VersionsWithRawResponse.__init__Nr   r)   r,   r   r   r   r   r   r2   r2   r2   r3   r-   M      r-   c                   @  r   )	r   r   r*   r,   r   c                 C  r   rN   )r   r	   async_to_raw_response_wrapperri   ru   r   r   r   r2   r2   r3   r   `  r   z%AsyncVersionsWithRawResponse.__init__Nr   r*   r,   r   r   r2   r2   r2   r3   r   _  r   r   c                   @  r   )	r6   r   r)   r,   r   c                 C  :   || _ t|j| _t|j| _t|j| _t|j| _d S rN   )r   r   ri   ru   r   r   r   r2   r2   r3   r   r     
z&VersionsWithStreamingResponse.__init__Nr   r   r2   r2   r2   r3   r6   q  r   r6   c                   @  r   )	r   r   r*   r,   r   c                 C  r   rN   )r   r   ri   ru   r   r   r   r2   r2   r3   r     r   z+AsyncVersionsWithStreamingResponse.__init__Nr   r   r2   r2   r2   r3   r     r   r   )?
__future__r   typingr   r   r   r   	itertoolsr   httpx r	   _typesr
   r   r   r   r   r   r   r   r   _utilsr   r   r   r   r   r   _compatr   	_resourcer   r   	_responser   r   
paginationr   r   _base_clientr    r!   types.beta.skillsr"   r#   types.anthropic_beta_paramr$   'types.beta.skills.version_list_responser%   )types.beta.skills.version_create_responser&   )types.beta.skills.version_delete_responser'   +types.beta.skills.version_retrieve_responser(   __all__r)   r*   r-   r   r6   r   r2   r2   r2   r3   <module>   s:   ,     