
    YjN                       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 ddl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 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l.m/Z/ ddgZ0 G d de      Z1 G d de      Z2 G d d      Z3 G d d      Z4 G d d      Z5 G d d      Z6y)    )annotations)OptionalN   )_legacy_response   )Roles
AsyncRolesRolesWithRawResponseAsyncRolesWithRawResponseRolesWithStreamingResponseAsyncRolesWithStreamingResponse)BodyOmitQueryHeadersNotGivenSequenceNotStromit	not_given)path_templatemaybe_transformasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)SyncConversationCursorPageAsyncConversationCursorPage)AsyncPaginatormake_request_options)user_list_paramsuser_update_params)OrganizationUser)UserDeleteResponseUsers
AsyncUsersc            	         e Zd Zedd       Zedd       Zedd       Zddded	 	 	 	 	 	 	 	 	 	 	 ddZe	e	e	e	ddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ
e	e	e	ddded		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd
Zddded	 	 	 	 	 	 	 	 	 	 	 ddZy)r&   c                ,    t        | j                        S N)r   _clientselfs    n/var/www/html/vmm-quimica/venv/lib/python3.12/site-packages/openai/resources/admin/organization/users/users.pyroleszUsers.roles!   s    T\\""    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/openai/openai-python#accessing-raw-response-data-eg-headers
        )UsersWithRawResponser,   s    r.   with_raw_responsezUsers.with_raw_response%   s     $D))r0   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/openai/openai-python#with_streaming_response
        )UsersWithStreamingResponser,   s    r.   with_streaming_responsezUsers.with_streaming_response/   s     *$//r0   Nextra_headersextra_query
extra_bodytimeoutc                   |st        d|      | j                  t        d|      t        ||||ddi      t              S )Y  
        Retrieves a user by their identifier.

        Args:
          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
        6Expected a non-empty value for `user_id` but received /organization/users/{user_id}user_idadmin_api_key_authTr:   r;   r<   r=   securityoptionscast_to
ValueError_getr   r!   r$   r-   rC   r:   r;   r<   r=   s         r.   retrievezUsers.retrieve8   s^    . UV]U`abbyy97K(+'%.5 %  

 
	
r0   developer_personarolerole_idtechnical_levelr:   r;   r<   r=   c                   |st        d|      | j                  t        d|      t        ||||dt        j
                        t        ||||	ddi      t              S )	'  
        Modifies a user's role in the organization.

        Args:
          developer_persona: Developer persona metadata.

          role: `owner` or `reader`

          role_id: Role ID to assign to the user.

          technical_level: Technical level metadata.

          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   rP   rQ   rR   rS   rD   TrE   bodyrH   rI   )rK   _postr   r   r#   UserUpdateParamsr!   r$   
r-   rC   rP   rQ   rR   rS   r:   r;   r<   r=   s
             r.   updatezUsers.update]   s    F UV]U`abbzz97K ): &'6	 #33 )+'%.5 %%  
 	
r0   afteremailslimitr:   r;   r<   r=   c                   | j                  dt        t           t        ||||t	        |||dt
        j                        ddi      t              S ao  
        Lists all of the users in the organization.

        Args:
          after: A cursor for use in pagination. `after` is an object ID that defines your place
              in the list. For instance, if you make a list request and receive 100 objects,
              ending with obj_foo, your subsequent call can include after=obj_foo in order to
              fetch the next page of the list.

          emails: Filter by the email address of users.

          limit: A limit on the number of objects to be returned. Limit can range between 1 and
              100, and the default is 20.

          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
        z/organization/users)r^   r_   r`   rD   T)r:   r;   r<   r=   queryrF   )pagerH   model)_get_api_listr   r$   r!   r   r"   UserListParamsr-   r^   r_   r`   r:   r;   r<   r=   s           r.   listz
Users.list   sm    F !!!+,<=(+'%%!&"(!&
 %33 /5 #% " 
 	
r0   c                   |st        d|      | j                  t        d|      t        ||||ddi      t              S )Y  
        Deletes a user from the organization.

        Args:
          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   rD   TrE   rG   rK   _deleter   r!   r%   rM   s         r.   deletezUsers.delete   s^    . UV]U`abb||97K(+'%.5 '  

 
	
r0   )returnr   )ro   r3   )ro   r7   rC   strr:   Headers | Noner;   Query | Noner<   Body | Noner=   (float | httpx2.Timeout | None | NotGivenro   r$   rC   rq   rP   Optional[str] | OmitrQ   rw   rR   rw   rS   rw   r:   rr   r;   rs   r<   rt   r=   ru   ro   r$   )r^   
str | Omitr_   SequenceNotStr[str] | Omitr`   
int | Omitr:   rr   r;   rs   r<   rt   r=   ru   ro   z,SyncConversationCursorPage[OrganizationUser]rC   rq   r:   rr   r;   rs   r<   rt   r=   ru   ro   r%   __name__
__module____qualname__r   r/   r4   r8   r   rN   r   r\   ri   rn    r0   r.   r&   r&       s   # # * * 0 0 )-$("&<E#
#
 &#
 "#
  #
 :#
 
#
R 37%)(,04 )-$("&<E8
8
 0	8

 #8
 &8
 .8
 &8
 "8
  8
 :8
 
8
z !-1  )-$("&<E6
 6
 +	6

 6
 &6
 "6
  6
 :6
 
66
| )-$("&<E#
#
 &#
 "#
  #
 :#
 
#
r0   c            	         e Zd Zedd       Zedd       Zedd       Zddded	 	 	 	 	 	 	 	 	 	 	 ddZe	e	e	e	ddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ
e	e	e	ddded		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd
Zddded	 	 	 	 	 	 	 	 	 	 	 ddZy)r'   c                ,    t        | j                        S r*   )r	   r+   r,   s    r.   r/   zAsyncUsers.roles   s    $,,''r0   c                    t        |       S r2   )AsyncUsersWithRawResponser,   s    r.   r4   zAsyncUsers.with_raw_response   s     )..r0   c                    t        |       S r6   )AsyncUsersWithStreamingResponser,   s    r.   r8   z"AsyncUsers.with_streaming_response  s     /t44r0   Nr9   c                  K   |st        d|      | j                  t        d|      t        ||||ddi      t               d{   S 7 w)	r?   r@   rA   rB   rD   TrE   rG   NrJ   rM   s         r.   rN   zAsyncUsers.retrieve  sl     . UV]U`abbYY97K(+'%.5 %  

 

 
	
 

   AA	A
ArO   c                  K   |st        d|      | j                  t        d|      t        ||||dt        j
                         d{   t        ||||	ddi      t        	       d{   S 7 '7 w)
rU   r@   rA   rB   rV   NrD   TrE   rW   )rK   rY   r   r   r#   rZ   r!   r$   r[   s
             r.   r\   zAsyncUsers.update2  s     F UV]U`abbZZ97K,): &'6	 #33  )+'%.5 %%   
 
 	

s$   A
A8A4
"A8/A60A86A8r]   c                   | j                  dt        t           t        ||||t	        |||dt
        j                        ddi      t              S rb   )rf   r   r$   r!   r   r"   rg   rh   s           r.   ri   zAsyncUsers.listl  sm    F !!!,-=>(+'%%!&"(!&
 %33 /5 #% " 
 	
r0   c                  K   |st        d|      | j                  t        d|      t        ||||ddi      t               d{   S 7 w)	rk   r@   rA   rB   rD   TrE   rG   Nrl   rM   s         r.   rn   zAsyncUsers.delete  sl     . UV]U`abb\\97K(+'%.5 ' " 

 

 
	
 

r   )ro   r	   )ro   r   )ro   r   rp   rv   )r^   rx   r_   ry   r`   rz   r:   rr   r;   rs   r<   rt   r=   ru   ro   zOAsyncPaginator[OrganizationUser, AsyncConversationCursorPage[OrganizationUser]]r{   r|   r   r0   r.   r'   r'      s   ( ( / / 5 5 )-$("&<E#
#
 &#
 "#
  #
 :#
 
#
R 37%)(,04 )-$("&<E8
8
 0	8

 #8
 &8
 .8
 &8
 "8
  8
 :8
 
8
z !-1  )-$("&<E6
 6
 +	6

 6
 &6
 "6
  6
 :6
 
Y6
| )-$("&<E#
#
 &#
 "#
  #
 :#
 
#
r0   c                  &    e Zd ZddZedd       Zy)r3   c                2   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        y r*   )_usersr   to_raw_response_wrapperrN   r\   ri   rn   r-   userss     r.   __init__zUsersWithRawResponse.__init__  ss    (@@NN
 '>>LL
 %<<JJ
	 '>>LL
r0   c                @    t        | j                  j                        S r*   )r
   r   r/   r,   s    r.   r/   zUsersWithRawResponse.roles  s    #DKK$5$566r0   Nr   r&   ro   None)ro   r
   r}   r~   r   r   r   r/   r   r0   r.   r3   r3     s    
  7 7r0   r3   c                  &    e Zd ZddZedd       Zy)r   c                2   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        y r*   )r   r   async_to_raw_response_wrapperrN   r\   ri   rn   r   s     r.   r   z"AsyncUsersWithRawResponse.__init__  ss    (FFNN
 'DDLL
 %BBJJ
	 'DDLL
r0   c                @    t        | j                  j                        S r*   )r   r   r/   r,   s    r.   r/   zAsyncUsersWithRawResponse.roles  s    ():):;;r0   Nr   r'   ro   r   )ro   r   r   r   r0   r.   r   r     s    
  < <r0   r   c                  &    e Zd ZddZedd       Zy)r7   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        y r*   )r   r   rN   r\   ri   rn   r   s     r.   r   z#UsersWithStreamingResponse.__init__  s[    4NN
 3LL
 1JJ
	 3LL
r0   c                @    t        | j                  j                        S r*   )r   r   r/   r,   s    r.   r/   z UsersWithStreamingResponse.roles  s    )$++*;*;<<r0   Nr   )ro   r   r   r   r0   r.   r7   r7     s    
  = =r0   r7   c                  &    e Zd ZddZedd       Zy)r   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        y r*   )r   r   rN   r\   ri   rn   r   s     r.   r   z(AsyncUsersWithStreamingResponse.__init__  s[    :NN
 9LL
 7JJ
	 9LL
r0   c                @    t        | j                  j                        S r*   )r   r   r/   r,   s    r.   r/   z%AsyncUsersWithStreamingResponse.roles  s    .t{{/@/@AAr0   Nr   )ro   r   r   r   r0   r.   r   r     s    
  B Br0   r   )7
__future__r   typingr   httpx2 r   r/   r   r	   r
   r   r   r   _typesr   r   r   r   r   r   r   r   _utilsr   r   r   _compatr   	_resourcer   r   	_responser   r   
paginationr   r   _base_clientr    r!   types.admin.organizationr"   r#   *types.admin.organization.organization_userr$   -types.admin.organization.user_delete_responser%   __all__r&   r'   r3   r   r7   r   r   r0   r.   <module>r      s    #   "  ^ ] ] M M ( < [ S B N L QL
!R
O R
jR
! R
j7 7,< <,= =,B Br0   