o
    î6Wj…z  ã                   @  st  d dl mZ d dl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(m)Z) ddl*m+Z+m,Z, ddl-m.Z. ddl/m0Z0 ddl1m2Z2 ddgZ3G dd„ deƒZ4G dd„ deƒZ5G dd„ dƒZ6G dd„ dƒZ7G dd„ dƒZ8G dd„ dƒZ9dS )é    )Úannotations)ÚDictÚListÚOptional)Ú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)Úuser_profile_list_paramsÚuser_profile_create_paramsÚuser_profile_update_params)ÚAsyncPaginatorÚmake_request_options)ÚAnthropicBetaParam)ÚBetaUserProfile)ÚBetaUserProfileEnrollmentURLÚUserProfilesÚAsyncUserProfilesc                
   @  ó¶   e Zd Zed3dd„ƒZed4dd„ƒZeeeeeddded	œ	d5dd„Zedddedœd6d!d"„Z	eeeeeddded	œ	d7d$d%„Z
eeeeddded&œd8d.d/„Zedddedœd9d1d2„ZdS ):r%   ÚreturnÚUserProfilesWithRawResponsec                 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© r.   úu/home/esfera/Documents/content_generation/venv/lib/python3.10/site-packages/anthropic/resources/beta/user_profiles.pyÚwith_raw_response   ó   zUserProfiles.with_raw_responseÚ!UserProfilesWithStreamingResponsec                 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
        )r2   r,   r.   r.   r/   Úwith_streaming_response&   ó   z$UserProfiles.with_streaming_responseN©	Úexternal_idÚmetadataÚnameÚrelationshipÚbetasÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutr7   úOptional[str] | Omitr8   úDict[str, str] | Omitr9   r:   ú0Literal['external', 'resold', 'internal'] | Omitr;   úList[AnthropicBetaParam] | Omitr<   úHeaders | Noner=   úQuery | Noner>   úBody | Noner?   ú'float | httpx.Timeout | None | NotGivenr#   c       	   
   	   C  s|   i t dt|ƒrd tdd„ |D ƒdgƒ¡ntiƒ¥|pi ¥}ddi|p$i ¥}| jdt||||dœtjƒt	||||	d�t
d	�S )
áã  
        Create User Profile

        Args:
          external_id: Platform's own identifier for this user. Not enforced unique. Maximum 255
              characters.

          metadata: Free-form key-value data to attach to this user profile. Maximum 16 keys, with
              keys up to 64 characters and values up to 512 characters. Values must be
              non-empty strings.

          name: Display name of the entity this profile represents. Required when relationship
              is `resold` (the resold-to company's name); optional otherwise. Maximum 255
              characters.

          relationship: How the entity behind a user profile relates to the platform that owns the API
              key. `external`: an individual end-user of the platform. `resold`: a company the
              platform resells Claude access to. `internal`: the platform's own usage.

          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                 s  ó   � | ]}t |ƒV  qd S ©N©Ústr©Ú.0Úer.   r.   r/   Ú	<genexpr>^   ó   € z&UserProfiles.create.<locals>.<genexpr>úuser-profiles-2026-03-24ú/v1/user_profiles?beta=true©r7   r8   r9   r:   ©r<   r=   r>   r?   ©ÚbodyÚoptionsÚcast_to)r   r   Újoinr   r   Ú_postr   r   ÚUserProfileCreateParamsr!   r#   ©
r-   r7   r8   r9   r:   r;   r<   r=   r>   r?   r.   r.   r/   Úcreate/   s6   ,ÿýÿÿø
üù	ÿòzUserProfiles.create©r;   r<   r=   r>   r?   Úuser_profile_idrN   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||||d	�t	d
�S )á–  
        Get User Profile

        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 `user_profile_id` but received rI   rJ   c                 s  rK   rL   rM   rO   r.   r.   r/   rR   –   rS   z(UserProfiles.retrieve.<locals>.<genexpr>rT   ú-/v1/user_profiles/{user_profile_id}?beta=true©rb   rW   ©rZ   r[   ©
Ú
ValueErrorr   r   r\   r   r   Ú_getr   r!   r#   ©r-   rb   r;   r<   r=   r>   r?   r.   r.   r/   Úretrievew   s*   ÿýÿÿø

ÿûzUserProfiles.retrieveú:Optional[Literal['external', 'resold', 'internal']] | Omitc       	      	   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 )áõ  
        Update User Profile

        Args:
          external_id: If present, replaces the stored external_id. Omit to leave unchanged. Maximum
              255 characters.

          metadata: Key-value pairs to merge into the stored metadata. Keys provided overwrite
              existing values. To remove a key, set its value to an empty string. Keys not
              provided are left unchanged. Maximum 16 keys, with keys up to 64 characters and
              values up to 512 characters.

          name: If present, replaces the stored name. Omit to leave unchanged. Maximum 255
              characters.

          relationship: How the entity behind a user profile relates to the platform that owns the API
              key. `external`: an individual end-user of the platform. `resold`: a company the
              platform resells Claude access to. `internal`: the platform's own usage.

          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
        re   rI   rJ   c                 s  rK   rL   rM   rO   r.   r.   r/   rR   Ø   rS   z&UserProfiles.update.<locals>.<genexpr>rT   rf   rg   rV   rW   rX   )rj   r   r   r\   r   r   r]   r   r   r   ÚUserProfileUpdateParamsr!   r#   ©r-   rb   r7   r8   r9   r:   r;   r<   r=   r>   r?   r.   r.   r/   Úupdate¦   s:   -ÿýÿÿø

üù	ÿòzUserProfiles.update©ÚlimitÚorderÚpager;   r<   r=   r>   r?   rt   ú
int | Omitru   úLiteral['asc', 'desc'] | Omitrv   ú
str | OmitúSyncPageCursor[BetaUserProfile]c          	      C  ó€   i t dt|ƒrd tdd„ |D ƒdgƒ¡ntiƒ¥|pi ¥}ddi|p$i ¥}| jdtt t||||t	|||dœt
jƒd�td	�S )
á  
        List User Profiles

        Args:
          limit: Query parameter for limit

          order: Query parameter for order

          page: Query parameter for page

          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   c                 s  rK   rL   rM   rO   r.   r.   r/   rR     rS   z$UserProfiles.list.<locals>.<genexpr>rT   rU   ©rt   ru   rv   ©r<   r=   r>   r?   Úquery©rv   rZ   Úmodel)r   r   r\   r   r   Ú_get_api_listr   r#   r!   r   r   ÚUserProfileListParams©	r-   rt   ru   rv   r;   r<   r=   r>   r?   r.   r.   r/   Úlistñ   ó<   "ÿýÿÿø
ýúûïzUserProfiles.listr$   c                C  rc   )á›  
        Create Enrollment URL

        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
        re   rI   rJ   c                 s  rK   rL   rM   rO   r.   r.   r/   rR   Q  rS   z5UserProfiles.create_enrollment_url.<locals>.<genexpr>rT   ú</v1/user_profiles/{user_profile_id}/enrollment_url?beta=truerg   rW   rh   ©
rj   r   r   r\   r   r   r]   r   r!   r$   rl   r.   r.   r/   Úcreate_enrollment_url2  s.   ÿýÿÿø
ÿÿùz"UserProfiles.create_enrollment_url)r(   r)   )r(   r2   ©r7   r@   r8   rA   r9   r@   r:   rB   r;   rC   r<   rD   r=   rE   r>   rF   r?   rG   r(   r#   ©rb   rN   r;   rC   r<   rD   r=   rE   r>   rF   r?   rG   r(   r#   ©rb   rN   r7   r@   r8   rA   r9   r@   r:   rn   r;   rC   r<   rD   r=   rE   r>   rF   r?   rG   r(   r#   )rt   rw   ru   rx   rv   ry   r;   rC   r<   rD   r=   rE   r>   rF   r?   rG   r(   rz   ©rb   rN   r;   rC   r<   rD   r=   rE   r>   rF   r?   rG   r(   r$   ©Ú__name__Ú
__module__Ú__qualname__r   r0   r4   r   r   r`   rm   rr   r…   rŠ   r.   r.   r.   r/   r%      ó\    	óLö3òNôEöc                
   @  r'   ):r&   r(   Ú AsyncUserProfilesWithRawResponsec                 C  r*   r+   )r”   r,   r.   r.   r/   r0   e  r1   z#AsyncUserProfiles.with_raw_responseÚ&AsyncUserProfilesWithStreamingResponsec                 C  r*   r3   )r•   r,   r.   r.   r/   r4   o  r5   z)AsyncUserProfiles.with_streaming_responseNr6   r7   r@   r8   rA   r9   r:   rB   r;   rC   r<   rD   r=   rE   r>   rF   r?   rG   r#   c       	   
   	   Ã  sŠ   �i t dt|ƒrd tdd„ |D ƒdgƒ¡ntiƒ¥|pi ¥}ddi|p%i ¥}| jdt||||dœtjƒI dH t	||||	d	�t
d
�I dH S )rH   rI   rJ   c                 s  rK   rL   rM   rO   r.   r.   r/   rR   §  rS   z+AsyncUserProfiles.create.<locals>.<genexpr>rT   rU   rV   NrW   rX   )r   r   r\   r   r   r]   r   r   r^   r!   r#   r_   r.   r.   r/   r`   x  s8   €,ÿýÿÿø
üù	ÿòzAsyncUserProfiles.createra   rb   rN   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||||d	�t	d
�I dH S )rd   re   rI   rJ   c                 s  rK   rL   rM   rO   r.   r.   r/   rR   ß  rS   z-AsyncUserProfiles.retrieve.<locals>.<genexpr>rT   rf   rg   rW   rh   Nri   rl   r.   r.   r/   rm   À  s,   €ÿýÿÿø

ÿûzAsyncUserProfiles.retrievern   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 )ro   re   rI   rJ   c                 s  rK   rL   rM   rO   r.   r.   r/   rR   !  rS   z+AsyncUserProfiles.update.<locals>.<genexpr>rT   rf   rg   rV   NrW   rX   )rj   r   r   r\   r   r   r]   r   r   r   rp   r!   r#   rq   r.   r.   r/   rr   ï  s<   €-ÿýÿÿø

üù	ÿòzAsyncUserProfiles.updaters   rt   rw   ru   rx   rv   ry   úAAsyncPaginator[BetaUserProfile, AsyncPageCursor[BetaUserProfile]]c          	      C  r{   )
r|   rI   rJ   c                 s  rK   rL   rM   rO   r.   r.   r/   rR   _  rS   z)AsyncUserProfiles.list.<locals>.<genexpr>rT   rU   r}   r~   r€   )r   r   r\   r   r   r‚   r   r#   r!   r   r   rƒ   r„   r.   r.   r/   r…   :  r†   zAsyncUserProfiles.listr$   c                Ã  r–   )r‡   re   rI   rJ   c                 s  rK   rL   rM   rO   r.   r.   r/   rR   š  rS   z:AsyncUserProfiles.create_enrollment_url.<locals>.<genexpr>rT   rˆ   rg   rW   rh   Nr‰   rl   r.   r.   r/   rŠ   {  s0   €ÿýÿÿø
ÿÿùz'AsyncUserProfiles.create_enrollment_url)r(   r”   )r(   r•   r‹   rŒ   r�   )rt   rw   ru   rx   rv   ry   r;   rC   r<   rD   r=   rE   r>   rF   r?   rG   r(   r—   rŽ   r�   r.   r.   r.   r/   r&   d  r“   c                   @  ó   e Zd Zddd„ZdS )	r)   Úuser_profilesr%   r(   ÚNonec                 C  óP   || _ t |j¡| _t |j¡| _t |j¡| _t |j¡| _t |j¡| _d S rL   )Ú_user_profilesr	   Úto_raw_response_wrapperr`   rm   rr   r…   rŠ   ©r-   r™   r.   r.   r/   Ú__init__®  ó    ÿÿÿÿ
ÿz$UserProfilesWithRawResponse.__init__N©r™   r%   r(   rš   ©r�   r‘   r’   rŸ   r.   r.   r.   r/   r)   ­  ó    r)   c                   @  r˜   )	r”   r™   r&   r(   rš   c                 C  r›   rL   )rœ   r	   Úasync_to_raw_response_wrapperr`   rm   rr   r…   rŠ   rž   r.   r.   r/   rŸ   Ã  r    z)AsyncUserProfilesWithRawResponse.__init__N©r™   r&   r(   rš   r¢   r.   r.   r.   r/   r”   Â  r£   r”   c                   @  r˜   )	r2   r™   r%   r(   rš   c                 C  óF   || _ t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _d S rL   )rœ   r   r`   rm   rr   r…   rŠ   rž   r.   r.   r/   rŸ   Ø  ó    ÿÿÿÿ
ÿz*UserProfilesWithStreamingResponse.__init__Nr¡   r¢   r.   r.   r.   r/   r2   ×  r£   r2   c                   @  r˜   )	r•   r™   r&   r(   rš   c                 C  r¦   rL   )rœ   r   r`   rm   rr   r…   rŠ   rž   r.   r.   r/   rŸ   í  r§   z/AsyncUserProfilesWithStreamingResponse.__init__Nr¥   r¢   r.   r.   r.   r/   r•   ì  r£   r•   ):Ú
__future__r   Útypingr   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   Ú
types.betar   r   r   Ú_base_clientr    r!   Útypes.anthropic_beta_paramr"   Útypes.beta.beta_user_profiler#   Ú+types.beta.beta_user_profile_enrollment_urlr$   Ú__all__r%   r&   r)   r”   r2   r•   r.   r.   r.   r/   Ú<module>   s8   $  K  K