
    4Rjz                       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            
      Z   e Zd Zedd       Zedd       Zeeeeeddded		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	ee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    n/var/www/html/meridian/meridian-ai/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namerelationship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.

          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              3  2   K   | ]  }t        |        y wNstr.0es     r.   	<genexpr>z&UserProfiles.create.<locals>.<genexpr>^        5Lc!f5L   user-profiles-2026-03-24/v1/user_profiles?beta=truer6   r7   r8   r9   r;   r<   r=   r>   bodyoptionscast_to)r   r   joinr   r   _postr   r   UserProfileCreateParamsr"   r$   
r-   r6   r7   r8   r9   r:   r;   r<   r=   r>   s
             r.   createzUserProfiles.create/   s    X	
$ '*hhu5Le5LOiNj/k&l"	
 "	
 *+E_-J][]_zz) #. ( $0	 +BB )+Q[el $  
 	
r0   r:   r;   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 rA   rB   c              3  2   K   | ]  }t        |        y wrD   rE   rG   s     r.   rJ   z(UserProfiles.retrieve.<locals>.<genexpr>   rK   rL   rM   -/v1/user_profiles/{user_profile_id}?beta=trueuser_profile_idrP   rS   rT   

ValueErrorr   r   rU   r   r   _getr   r"   r$   r-   ra   r:   r;   r<   r=   r>   s          r.   retrievezUserProfiles.retrievew   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 )  
        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
        r]   rA   rB   c              3  2   K   | ]  }t        |        y wrD   rE   rG   s     r.   rJ   z&UserProfiles.update.<locals>.<genexpr>   rK   rL   rM   r_   r`   rO   rP   rQ   )rd   r   r   rU   r   r   rV   r   r   r    UserProfileUpdateParamsr"   r$   r-   ra   r6   r7   r8   r9   r:   r;   r<   r=   r>   s              r.   updatezUserProfiles.update   s    Z ]^m]pqrr	
$ '*hhu5Le5LOiNj/k&l"	
 "	
 *+E_-J][]_zzI[jk #. ( $0	 +BB )+Q[el $  
 	
r0   limitorderpager:   r;   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
        rA   rB   c              3  2   K   | ]  }t        |        y wrD   rE   rG   s     r.   rJ   z$UserProfiles.list.<locals>.<genexpr>  rK   rL   rM   rN   ro   rp   rq   r;   r<   r=   r>   queryrq   rS   model)r   r   rU   r   r   _get_api_listr   r$   r"   r   r   UserProfileListParams	r-   ro   rp   rq   r:   r;   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]   rA   rB   c              3  2   K   | ]  }t        |        y wrD   rE   rG   s     r.   rJ   z5UserProfiles.create_enrollment_url.<locals>.<genexpr>Q  rK   rL   rM   </v1/user_profiles/{user_profile_id}/enrollment_url?beta=truer`   rP   rb   
rd   r   r   rU   r   r   rV   r   r"   r%   rf   s          r.   create_enrollment_urlz"UserProfiles.create_enrollment_url2  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   r   r9   z0Literal['external', 'resold', 'internal'] | Omitr:   List[AnthropicBetaParam] | Omitr;   Headers | Noner<   Query | Noner=   Body | Noner>   'float | httpx.Timeout | None | NotGivenr   r$   ra   rF   r:   r   r;   r   r<   r   r=   r   r>   r   r   r$   ra   rF   r6   r   r7   r   r8   r   r9   z:Optional[Literal['external', 'resold', 'internal']] | Omitr:   r   r;   r   r<   r   r=   r   r>   r   r   r$   )ro   
int | Omitrp   Literal['asc', 'desc'] | Omitrq   
str | Omitr:   r   r;   r   r<   r   r=   r   r>   r   r   zSyncPageCursor[BetaUserProfile]ra   rF   r:   r   r;   r   r<   r   r=   r   r>   r   r   r%   __name__
__module____qualname__r   r/   r4   r   r   rY   rg   rm   r}   r    r0   r.   r&   r&      s   1 1 7 7 -1*.%)IM15 )-$("&;DF
 *F
 (	F

 #F
 GF
 /F
 &F
 "F
  F
 9F
 
F
X 26 )-$("&;D-
-
 /	-
 &-
 "-
  -
 9-
 
-
f -1*.%)SW15 )-$("&;DI
I
 *	I

 (I
 #I
 QI
 /I
 &I
 "I
  I
 9I
 
I
\ !/315 )-$("&;D?
 ?
 -	?

 ?
 /?
 &?
 "?
  ?
 9?
 
)?
J 26 )-$("&;D/
/
 /	/
 &/
 "/
  /
 9/
 
&/
r0   c            
      Z   e Zd Zedd       Zedd       Zeeeeeddded		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	ee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_responsee  s     055r0   c                    t        |       S r2   )&AsyncUserProfilesWithStreamingResponser,   s    r.   r4   z)AsyncUserProfiles.with_streaming_responseo  s     6d;;r0   Nr5   c       	   
     Z  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@   rA   rB   c              3  2   K   | ]  }t        |        y wrD   rE   rG   s     r.   rJ   z+AsyncUserProfiles.create.<locals>.<genexpr>  rK   rL   rM   rN   rO   NrP   rQ   )r   r   rU   r   r   rV   r   r   rW   r"   r$   rX   s
             r.   rY   zAsyncUserProfiles.createx  s     X	
$ '*hhu5Le5LOiNj/k&l"	
 "	
 *+E_-J][]_ZZ),#. ( $0	 +BB  )+Q[el $   
 
 	

s$   B B+B'
B+"B)#B+)B+rZ   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]   rA   rB   c              3  2   K   | ]  }t        |        y wrD   rE   rG   s     r.   rJ   z-AsyncUserProfiles.retrieve.<locals>.<genexpr>  rK   rL   rM   r_   r`   rP   rb   Nrc   rf   s          r.   rg   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)ri   r]   rA   rB   c              3  2   K   | ]  }t        |        y wrD   rE   rG   s     r.   rJ   z+AsyncUserProfiles.update.<locals>.<genexpr>!  rK   rL   rM   r_   r`   rO   NrP   rQ   )rd   r   r   rU   r   r   rV   r   r   r    rk   r"   r$   rl   s              r.   rm   zAsyncUserProfiles.update  s    Z ]^m]pqrr	
$ '*hhu5Le5LOiNj/k&l"	
 "	
 *+E_-J][]_ZZI[jk,#. ( $0	 +BB  )+Q[el $   
 
 	

s$   BCC
C=C>CCrn   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 )	rs   rA   rB   c              3  2   K   | ]  }t        |        y wrD   rE   rG   s     r.   rJ   z)AsyncUserProfiles.list.<locals>.<genexpr>_  rK   rL   rM   rN   ru   rv   rx   )r   r   rU   r   r   rz   r   r$   r"   r   r   r{   r|   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]   rA   rB   c              3  2   K   | ]  }t        |        y wrD   rE   rG   s     r.   rJ   z:AsyncUserProfiles.create_enrollment_url.<locals>.<genexpr>  rK   rL   rM   r   r`   rP   rb   Nr   rf   s          r.   r   z'AsyncUserProfiles.create_enrollment_url{  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   )ro   r   rp   r   rq   r   r:   r   r;   r   r<   r   r=   r   r>   r   r   zAAsyncPaginator[BetaUserProfile, AsyncPageCursor[BetaUserProfile]]r   r   r   r0   r.   r'   r'   d  s   6 6 < < -1*.%)IM15 )-$("&;DF
 *F
 (	F

 #F
 GF
 /F
 &F
 "F
  F
 9F
 
F
X 26 )-$("&;D-
-
 /	-
 &-
 "-
  -
 9-
 
-
f -1*.%)SW15 )-$("&;DI
I
 *	I

 (I
 #I
 QI
 /I
 &I
 "I
  I
 9I
 
I
\ !/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 rD   )_user_profilesr
   to_raw_response_wrapperrY   rg   rm   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 rD   )r   r
   async_to_raw_response_wrapperrY   rg   rm   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 rD   )r   r   rY   rg   rm   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 rD   )r   r   rY   rg   rm   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.
/F
? F
R
F
( F
R

 
*
 
*
 
*
 
r0   