o
    î6Wj®z  ã                   @  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 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&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z. ddl/m0Z0m1Z1 ddl2m3Z3m4Z4 ddl5m6Z6m7Z7 ddl8m9Z9 ddl:m;Z; ddl<m=Z= ddl>m?Z? ddl@mAZA ddgZBG dd„ de"ƒZCG dd„ de#ƒZDG dd„ dƒZEG dd„ dƒZFG dd„ dƒZGG dd „ d ƒZHdS )!é    )Úannotations)ÚListÚMappingÚOptionalÚcast)ÚchainNé   )Ú_legacy_response)Údeepcopy_with_paths)	ÚBodyÚOmitÚQueryÚHeadersÚNotGivenÚ	FileTypesÚSequenceNotStrÚomitÚ	not_given)Úis_givenÚextract_filesÚpath_templateÚmaybe_transformÚstrip_not_givenÚasync_maybe_transform)Úcached_property)ÚSyncAPIResourceÚAsyncAPIResource)
ÚBinaryAPIResponseÚAsyncBinaryAPIResponseÚStreamedBinaryAPIResponseÚAsyncStreamedBinaryAPIResponseÚto_streamed_response_wrapperÚto_custom_raw_response_wrapperÚ"async_to_streamed_response_wrapperÚ#to_custom_streamed_response_wrapperÚ$async_to_custom_raw_response_wrapperÚ)async_to_custom_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ddded	œd/dd„Zeddded	œd0dd„Z	eeedddedœd1d%d&„Z
eddded	œd2d(d)„Zeddded	œd3d+d,„ZdS )4r2   Ú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
        )r6   ©Úself© r;   úw/home/esfera/Documents/content_generation/venv/lib/python3.10/site-packages/anthropic/resources/beta/skills/versions.pyÚwith_raw_response3   ó   zVersions.with_raw_responseÚVersionsWithStreamingResponsec                 C  r7   ©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?   r9   r;   r;   r<   Úwith_streaming_response=   ó   z Versions.with_streaming_responseN©ÚbetasÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚskill_idÚstrÚfilesúSequenceNotStr[FileTypes]rD   úList[AnthropicBetaParam] | OmitrE   úHeaders | NonerF   úQuery | NonerG   úBody | NonerH   ú'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ddggƒ}ttt	t
tf |ƒddggd	�}	d
|d< | jt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©rJ   ©Ú.0Úer;   r;   r<   Ú	<genexpr>o   ó   € z"Versions.create.<locals>.<genexpr>úskills-2025-10-02rK   ú<array>©Úpathsúmultipart/form-dataúContent-Typeú(/v1/skills/{skill_id}/versions?beta=true©rI   ©rE   rF   rG   rH   ©ÚbodyrK   ÚoptionsÚcast_to)Ú
ValueErrorr   r   Újoinr   r   r
   r   r   r   rJ   ÚobjectÚ_postr   r   r,   ÚVersionCreateParamsr*   r/   ©
r:   rI   rK   rD   rE   rF   rG   rH   rh   Úextracted_filesr;   r;   r<   ÚcreateF   s4   $ÿýÿÿø
 

ÿùzVersions.createÚversionr1   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t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
        rS   ú6Expected a non-empty value for `version` but received rT   rU   c                 s  rV   rW   rX   rY   r;   r;   r<   r\   ±   r]   z$Versions.retrieve.<locals>.<genexpr>r^   ú2/v1/skills/{skill_id}/versions/{version}?beta=true©rI   rs   rf   ©ri   rj   ©
rk   r   r   rl   r   r   Ú_getr   r*   r1   ©r:   rs   rI   rD   rE   rF   rG   rH   r;   r;   r<   Úretrieve‡   ó.   #ÿýÿÿø
ÿûzVersions.retrieve©ÚlimitÚpagerD   rE   rF   rG   rH   r€   úOptional[int] | Omitr�   ú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t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
        rS   rT   rU   c                 s  rV   rW   rX   rY   r;   r;   r<   r\   ì   r]   z Versions.list.<locals>.<genexpr>r^   rd   re   ©r€   r�   ©rE   rF   rG   rH   Úquery©r�   ri   Úmodel)rk   r   r   rl   r   r   Ú_get_api_listr   r'   r.   r*   r   r+   ÚVersionListParams©	r:   rI   r€   r�   rD   rE   rF   rG   rH   r;   r;   r<   ÚlistÁ   ó>   &ÿýÿÿø

þûûðzVersions.listr0   c                C  rt   )á¨  
        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
        rS   rv   rT   rU   c                 s  rV   rW   rX   rY   r;   r;   r<   r\   1  r]   z"Versions.delete.<locals>.<genexpr>r^   rw   rx   rf   ry   ©
rk   r   r   rl   r   r   Ú_deleter   r*   r0   r|   r;   r;   r<   Údelete  r~   zVersions.deleter   c                C  s¦   |s	t d|›�ƒ‚|st d|›�ƒ‚ddi|pi ¥}i tdt|ƒr/d tdd„ |D ƒd	gƒ¡ntiƒ¥|p6i ¥}dd	i|p>i ¥}| jtd
||d�t||||d�t	d�S )áÈ  
        Download a skill version's content as a zip archive.

        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
        rS   rv   ÚAcceptúapplication/binaryrT   rU   c                 s  rV   rW   rX   rY   r;   r;   r<   r\   l  r]   z$Versions.download.<locals>.<genexpr>r^   ú:/v1/skills/{skill_id}/versions/{version}/content?beta=truerx   rf   ry   )
rk   r   r   rl   r   r   r{   r   r*   r   r|   r;   r;   r<   ÚdownloadA  s4   #ÿýÿÿø
ÿÿùzVersions.download)r5   r6   )r5   r?   ©rI   rJ   rK   rL   rD   rM   rE   rN   rF   rO   rG   rP   rH   rQ   r5   r/   ©rs   rJ   rI   rJ   rD   rM   rE   rN   rF   rO   rG   rP   rH   rQ   r5   r1   )rI   rJ   r€   r‚   r�   rƒ   rD   rM   rE   rN   rF   rO   rG   rP   rH   rQ   r5   r„   ©rs   rJ   rI   rJ   rD   rM   rE   rN   rF   rO   rG   rP   rH   rQ   r5   r0   )rs   rJ   rI   rJ   rD   rM   rE   rN   rF   rO   rG   rP   rH   rQ   r5   r   ©Ú__name__Ú
__module__Ú__qualname__r   r=   rA   r   r   rr   r}   r�   r”   r™   r;   r;   r;   r<   r2   2   óJ    	õFõ>ôKõ?õc                   @  r4   )4r3   r5   ÚAsyncVersionsWithRawResponsec                 C  r7   r8   )r¢   r9   r;   r;   r<   r=   €  r>   zAsyncVersions.with_raw_responseÚ"AsyncVersionsWithStreamingResponsec                 C  r7   r@   )r£   r9   r;   r;   r<   rA   Š  rB   z%AsyncVersions.with_streaming_responseNrC   rI   rJ   rK   rL   rD   rM   rE   rN   rF   rO   rG   rP   rH   rQ   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ddggƒ}ttt	t
tf |ƒddggd	�}	d
|d< | jtd|d�t|tjƒI dH |	t||||d�td�I dH S )rR   rS   rT   rU   c                 s  rV   rW   rX   rY   r;   r;   r<   r\   ¼  r]   z'AsyncVersions.create.<locals>.<genexpr>r^   rK   r_   r`   rb   rc   rd   re   Nrf   rg   )rk   r   r   rl   r   r   r
   r   r   r   rJ   rm   rn   r   r   r,   ro   r*   r/   rp   r;   r;   r<   rr   “  s6   €$ÿýÿÿø
 
ÿùzAsyncVersions.creaters   r1   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td||d	�t||||d
�t	d�I dH S )ru   rS   rv   rT   rU   c                 s  rV   rW   rX   rY   r;   r;   r<   r\   þ  r]   z)AsyncVersions.retrieve.<locals>.<genexpr>r^   rw   rx   rf   ry   Nrz   r|   r;   r;   r<   r}   Ô  ó0   €#ÿýÿÿø
ÿûzAsyncVersions.retriever   r€   r‚   r�   rƒ   úIAsyncPaginator[VersionListResponse, AsyncPageCursor[VersionListResponse]]c          	      C  r…   )r†   rS   rT   rU   c                 s  rV   rW   rX   rY   r;   r;   r<   r\   9  r]   z%AsyncVersions.list.<locals>.<genexpr>r^   rd   re   r‡   rˆ   rŠ   )rk   r   r   rl   r   r   rŒ   r   r(   r.   r*   r   r+   r�   rŽ   r;   r;   r<   r�     r�   zAsyncVersions.listr0   c                Ã  r¤   )r‘   rS   rv   rT   rU   c                 s  rV   rW   rX   rY   r;   r;   r<   r\   ~  r]   z'AsyncVersions.delete.<locals>.<genexpr>r^   rw   rx   rf   ry   Nr’   r|   r;   r;   r<   r”   T  r¥   zAsyncVersions.deleter   c                Ã  s®   �|s
t d|›�ƒ‚|st d|›�ƒ‚ddi|pi ¥}i tdt|ƒr0d tdd„ |D ƒd	gƒ¡ntiƒ¥|p7i ¥}dd	i|p?i ¥}| jtd
||d�t||||d�t	d�I dH S )r•   rS   rv   r–   r—   rT   rU   c                 s  rV   rW   rX   rY   r;   r;   r<   r\   ¹  r]   z)AsyncVersions.download.<locals>.<genexpr>r^   r˜   rx   rf   ry   N)
rk   r   r   rl   r   r   r{   r   r*   r   r|   r;   r;   r<   r™   Ž  s6   €#ÿýÿÿø
ÿÿùzAsyncVersions.download)r5   r¢   )r5   r£   rš   r›   )rI   rJ   r€   r‚   r�   rƒ   rD   rM   rE   rN   rF   rO   rG   rP   rH   rQ   r5   r¦   rœ   )rs   rJ   rI   rJ   rD   rM   rE   rN   rF   rO   rG   rP   rH   rQ   r5   r   r�   r;   r;   r;   r<   r3     r¡   c                   @  ó   e Zd Zddd„ZdS )	r6   Úversionsr2   r5   ÚNonec                 C  óP   || _ t |j¡| _t |j¡| _t |j¡| _t |j¡| _t|jt	ƒ| _d S rW   )
Ú	_versionsr	   Úto_raw_response_wrapperrr   r}   r�   r”   r"   r™   r   ©r:   r¨   r;   r;   r<   Ú__init__Í  ó"   ÿÿÿÿ
þz VersionsWithRawResponse.__init__N©r¨   r2   r5   r©   ©rž   rŸ   r    r®   r;   r;   r;   r<   r6   Ì  ó    r6   c                   @  r§   )	r¢   r¨   r3   r5   r©   c                 C  rª   rW   )
r«   r	   Úasync_to_raw_response_wrapperrr   r}   r�   r”   r%   r™   r   r­   r;   r;   r<   r®   ã  r¯   z%AsyncVersionsWithRawResponse.__init__N©r¨   r3   r5   r©   r±   r;   r;   r;   r<   r¢   â  r²   r¢   c                   @  r§   )	r?   r¨   r2   r5   r©   c                 C  óH   || _ t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _t|jtƒ| _d S rW   )	r«   r!   rr   r}   r�   r”   r$   r™   r   r­   r;   r;   r<   r®   ù  ó"   ÿÿÿÿ
þz&VersionsWithStreamingResponse.__init__Nr°   r±   r;   r;   r;   r<   r?   ø  r²   r?   c                   @  r§   )	r£   r¨   r3   r5   r©   c                 C  rµ   rW   )	r«   r#   rr   r}   r�   r”   r&   r™   r    r­   r;   r;   r<   r®     r¶   z+AsyncVersionsWithStreamingResponse.__init__Nr´   r±   r;   r;   r;   r<   r£     r²   r£   )IÚ
__future__r   Útypingr   r   r   r   Ú	itertoolsr   ÚhttpxÚ r	   Ú_filesr
   Ú_typesr   r   r   r   r   r   r   r   r   Ú_utilsr   r   r   r   r   r   Ú_compatr   Ú	_resourcer   r   Ú	_responser   r   r   r    r!   r"   r#   r$   r%   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_responser0   Ú+types.beta.skills.version_retrieve_responser1   Ú__all__r2   r3   r6   r¢   r?   r£   r;   r;   r;   r<   Ú<module>   s<   , 0  O  O