
    Ii-p                       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Z3 G d de      Z4 G d de      Z5 G d d      Z6 G d d      Z7 G d d      Z8 G d d      Z9y)    )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            	      B   e Zd Zedd       Zedd       Zeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	eeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ
eeeeddded		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd
Zeddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)r&   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
        )UserProfilesWithRawResponseselfs    m/volume1/homes/robertsu/coba/app/.venv/lib/python3.12/site-packages/anthropic/resources/beta/user_profiles.pywith_raw_responsezUserProfiles.with_raw_response   s     +400    c                    t        |       S 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
        )!UserProfilesWithStreamingResponser,   s    r.   with_streaming_responsez$UserProfiles.with_streaming_response&   s     166r0   Nexternal_idmetadatabetasextra_headersextra_query
extra_bodytimeoutc          
     &   i t        dt        |      r#dj                  t        d |D        dg            nt        i      |xs i }ddi|xs i }| j                  dt        ||dt        j                        t        ||||      t              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.

          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  2   K   | ]  }t        |        y wNstr.0es     r.   	<genexpr>z&UserProfiles.create.<locals>.<genexpr>T        5Lec!fe   user-profiles-2026-03-24/v1/user_profiles?beta=truer6   r7   r9   r:   r;   r<   bodyoptionscast_to)r   r   joinr   r   _postr   r   UserProfileCreateParamsr"   r$   r-   r6   r7   r8   r9   r:   r;   r<   s           r.   createzUserProfiles.create/   s    D	
$ '*hhu5Le5LOiNj/k&l"	
 "	
 *+E_-J][]_zz) #. ( +BB )+Q[el $  
 	
r0   r8   r9   r:   r;   r<   c          
     $   |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d|      t        ||||      t        	      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 r?   r@   c              3  2   K   | ]  }t        |        y wrB   rC   rE   s     r.   rH   z(UserProfiles.retrieve.<locals>.<genexpr>   rI   rJ   rK   -/v1/user_profiles/{user_profile_id}?beta=trueuser_profile_idrN   rQ   rR   

ValueErrorr   r   rS   r   r   _getr   r"   r$   r-   r_   r8   r9   r:   r;   r<   s          r.   retrievezUserProfiles.retrievek   s    4 ]^m]pqrr	
$ '*hhu5Le5LOiNj/k&l"	
 "	
 *+E_-J][]_yyI[jk(+Q[el $  
 	
r0   c          
     \   |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d|      t        ||dt        j                        t        ||||	      t        
      S )a  
        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.

          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
        r[   r?   r@   c              3  2   K   | ]  }t        |        y wrB   rC   rE   s     r.   rH   z&UserProfiles.update.<locals>.<genexpr>   rI   rJ   rK   r]   r^   rM   rN   rO   )rb   r   r   rS   r   r   rT   r   r   r    UserProfileUpdateParamsr"   r$   	r-   r_   r6   r7   r8   r9   r:   r;   r<   s	            r.   updatezUserProfiles.update   s    H ]^m]pqrr	
$ '*hhu5Le5LOiNj/k&l"	
 "	
 *+E_-J][]_zzI[jk #. ( +BB )+Q[el $  
 	
r0   limitorderpager8   r9   r:   r;   r<   c               @   i t        dt        |      r#dj                  t        d |D        dg            nt        i      |xs i }ddi|xs i }| j                  dt        t           t        ||||t        |||dt        j                              t              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
        r?   r@   c              3  2   K   | ]  }t        |        y wrB   rC   rE   s     r.   rH   z$UserProfiles.list.<locals>.<genexpr>   rI   rJ   rK   rL   rm   rn   ro   r9   r:   r;   r<   queryro   rQ   model)r   r   rS   r   r   _get_api_listr   r$   r"   r   r   UserProfileListParams	r-   rm   rn   ro   r8   r9   r:   r;   r<   s	            r.   listzUserProfiles.list   s    D	
$ '*hhu5Le5LOiNj/k&l"	
 "	
 *+E_-J][]_!!)0(+'%%!&!& $
 -BB "# " 
 	
r0   c          
     $   |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d|      t        ||||      t        	      S )
  
        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
        r[   r?   r@   c              3  2   K   | ]  }t        |        y wrB   rC   rE   s     r.   rH   z5UserProfiles.create_enrollment_url.<locals>.<genexpr>:  rI   rJ   rK   </v1/user_profiles/{user_profile_id}/enrollment_url?beta=truer^   rN   r`   
rb   r   r   rS   r   r   rT   r   r"   r%   rd   s          r.   create_enrollment_urlz"UserProfiles.create_enrollment_url  s    4 ]^m]pqrr	
$ '*hhu5Le5LOiNj/k&l"	
 "	
 *+E_-J][]_zzN`o )+Q[el 1  
 	
r0   )returnr+   )r   r3   r6   Optional[str] | Omitr7   Dict[str, str] | Omitr8   List[AnthropicBetaParam] | Omitr9   Headers | Noner:   Query | Noner;   Body | Noner<   'float | httpx.Timeout | None | NotGivenr   r$   r_   rD   r8   r   r9   r   r:   r   r;   r   r<   r   r   r$   r_   rD   r6   r   r7   r   r8   r   r9   r   r:   r   r;   r   r<   r   r   r$   )rm   
int | Omitrn   Literal['asc', 'desc'] | Omitro   
str | Omitr8   r   r9   r   r:   r   r;   r   r<   r   r   zSyncPageCursor[BetaUserProfile]r_   rD   r8   r   r9   r   r:   r   r;   r   r<   r   r   r%   __name__
__module____qualname__r   r/   r4   r   r   rW   re   rk   r{   r    r0   r.   r&   r&      sC   1 1 7 7 -1*.15 )-$("&;D:
 *:
 (	:

 /:
 &:
 ":
  :
 9:
 
:
@ 26 )-$("&;D-
-
 /	-
 &-
 "-
  -
 9-
 
-
f -1*.15 )-$("&;D>
>
 *	>

 (>
 />
 &>
 ">
  >
 9>
 
>
F !/315 )-$("&;D?
 ?
 -	?

 ?
 /?
 &?
 "?
  ?
 9?
 
)?
J 26 )-$("&;D/
/
 /	/
 &/
 "/
  /
 9/
 
&/
r0   c            	      B   e Zd Zedd       Zedd       Zeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	eeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ
eeeeddded		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd
Zeddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)r'   c                    t        |       S r*   ) AsyncUserProfilesWithRawResponser,   s    r.   r/   z#AsyncUserProfiles.with_raw_responseN  s     055r0   c                    t        |       S r2   )&AsyncUserProfilesWithStreamingResponser,   s    r.   r4   z)AsyncUserProfiles.with_streaming_responseX  s     6d;;r0   Nr5   c          
     V  K   i t        dt        |      r#dj                  t        d |D        dg            nt        i      |xs i }ddi|xs i }| j                  dt        ||dt        j                         d{   t        ||||      t        	       d{   S 7 $7 w)
r>   r?   r@   c              3  2   K   | ]  }t        |        y wrB   rC   rE   s     r.   rH   z+AsyncUserProfiles.create.<locals>.<genexpr>  rI   rJ   rK   rL   rM   NrN   rO   )r   r   rS   r   r   rT   r   r   rU   r"   r$   rV   s           r.   rW   zAsyncUserProfiles.createa  s     D	
$ '*hhu5Le5LOiNj/k&l"	
 "	
 *+E_-J][]_ZZ),#. ( +BB  )+Q[el $   
 
 	

s$   A>B) B%
B) B'!B)'B)rX   c          
     @  K   |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d|      t        ||||      t        	       d
{   S 7 w)rZ   r[   r?   r@   c              3  2   K   | ]  }t        |        y wrB   rC   rE   s     r.   rH   z-AsyncUserProfiles.retrieve.<locals>.<genexpr>  rI   rJ   rK   r]   r^   rN   r`   Nra   rd   s          r.   re   zAsyncUserProfiles.retrieve  s     4 ]^m]pqrr	
$ '*hhu5Le5LOiNj/k&l"	
 "	
 *+E_-J][]_YYI[jk(+Q[el $  
 
 	
 
   BBBBc          
       K   |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d|      t        ||dt        j                         d	{   t        ||||
      t               d	{   S 7 $7 w)rg   r[   r?   r@   c              3  2   K   | ]  }t        |        y wrB   rC   rE   s     r.   rH   z+AsyncUserProfiles.update.<locals>.<genexpr>  rI   rJ   rK   r]   r^   rM   NrN   rO   )rb   r   r   rS   r   r   rT   r   r   r    ri   r"   r$   rj   s	            r.   rk   zAsyncUserProfiles.update  s     H ]^m]pqrr	
$ '*hhu5Le5LOiNj/k&l"	
 "	
 *+E_-J][]_ZZI[jk,#. ( +BB  )+Q[el $   
 
 	

s$   BCC 
C;C<CCrl   c               @   i t        dt        |      r#dj                  t        d |D        dg            nt        i      |xs i }ddi|xs i }| j                  dt        t           t        ||||t        |||dt        j                              t              S )	rq   r?   r@   c              3  2   K   | ]  }t        |        y wrB   rC   rE   s     r.   rH   z)AsyncUserProfiles.list.<locals>.<genexpr>1  rI   rJ   rK   rL   rs   rt   rv   )r   r   rS   r   r   rx   r   r$   r"   r   r   ry   rz   s	            r.   r{   zAsyncUserProfiles.list  s    D	
$ '*hhu5Le5LOiNj/k&l"	
 "	
 *+E_-J][]_!!) 1(+'%%!&!& $
 -BB "# " 
 	
r0   c          
     @  K   |st        d|      i t        dt        |      r#dj                  t	        d |D        dg            nt
        i      |xs i }ddi|xs i }| j                  t        d|      t        ||||      t        	       d
{   S 7 w)r}   r[   r?   r@   c              3  2   K   | ]  }t        |        y wrB   rC   rE   s     r.   rH   z:AsyncUserProfiles.create_enrollment_url.<locals>.<genexpr>l  rI   rJ   rK   r   r^   rN   r`   Nr   rd   s          r.   r   z'AsyncUserProfiles.create_enrollment_urlM  s     4 ]^m]pqrr	
$ '*hhu5Le5LOiNj/k&l"	
 "	
 *+E_-J][]_ZZN`o )+Q[el 1   
 
 	
 
r   )r   r   )r   r   r   r   r   )rm   r   rn   r   ro   r   r8   r   r9   r   r:   r   r;   r   r<   r   r   zAAsyncPaginator[BetaUserProfile, AsyncPageCursor[BetaUserProfile]]r   r   r   r0   r.   r'   r'   M  sD   6 6 < < -1*.15 )-$("&;D:
 *:
 (	:

 /:
 &:
 ":
  :
 9:
 
:
@ 26 )-$("&;D-
-
 /	-
 &-
 "-
  -
 9-
 
-
f -1*.15 )-$("&;D>
>
 *	>

 (>
 />
 &>
 ">
  >
 9>
 
>
F !/315 )-$("&;D?
 ?
 -	?

 ?
 /?
 &?
 "?
  ?
 9?
 
K?
J 26 )-$("&;D/
/
 /	/
 &/
 "/
  /
 9/
 
&/
r0   c                      e Zd ZddZy)r+   c                z   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        t        j                  |j                        | _        y rB   )_user_profilesr
   to_raw_response_wrapperrW   re   rk   r{   r   r-   user_profiless     r.   __init__z$UserProfilesWithRawResponse.__init__  s    +&>>  
 )@@""
 '>>  
 %<<
	 &6%M%M//&
"r0   Nr   r&   r   Noner   r   r   r   r   r0   r.   r+   r+         
r0   r+   c                      e Zd ZddZy)r   c                z   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        t        j                  |j                        | _        y rB   )r   r
   async_to_raw_response_wrapperrW   re   rk   r{   r   r   s     r.   r   z)AsyncUserProfilesWithRawResponse.__init__  s    +&DD  
 )FF""
 'DD  
 %BB
	 &6%S%S//&
"r0   Nr   r'   r   r   r   r   r0   r.   r   r     r   r0   r   c                      e Zd ZddZy)r3   c                   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        y rB   )r   r   rW   re   rk   r{   r   r   s     r.   r   z*UserProfilesWithStreamingResponse.__init__  s}    +2  
 5""
 3  
 1
	 &B//&
"r0   Nr   r   r   r0   r.   r3   r3     r   r0   r3   c                      e Zd ZddZy)r   c                   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        y rB   )r   r   rW   re   rk   r{   r   r   s     r.   r   z/AsyncUserProfilesWithStreamingResponse.__init__  s}    +8  
 ;""
 9  
 7
	 &H//&
"r0   Nr   r   r   r0   r.   r   r     r   r0   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   r3   r   r   r0   r.   <module>r      s    # ' '  %    K K K f f & : Y 9 j j @ < ; W.
/o
? o
d	o
( o
d	
 
*
 
*
 
*
 
r0   