
    YjK                    x   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 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l(m)Z) ddl*m+Z+ ddgZ, G d de      Z- G d de      Z. G d d      Z/ G d d      Z0 G d d      Z1 G d d      Z2y)    )annotations)LiteralN   )_legacy_response)BodyOmitQueryHeadersNotGivenomit	not_given)path_templatemaybe_transformasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)SyncNextCursorPageAsyncNextCursorPage)AsyncPaginatormake_request_options)role_list_paramsrole_create_params)RoleListResponse)RoleCreateResponse)RoleDeleteResponse)RoleRetrieveResponseRoles
AsyncRolesc                      e Zd Zed
d       Zedd       Zddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ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        |       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
        )RolesWithRawResponseselfs    n/var/www/html/vmm-quimica/venv/lib/python3.12/site-packages/openai/resources/admin/organization/users/roles.pywith_raw_responsezRoles.with_raw_response   s     $D))    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
        )RolesWithStreamingResponser&   s    r(   with_streaming_responsezRoles.with_streaming_response%   s     *$//r*   Nextra_headersextra_query
extra_bodytimeoutc                   |st        d|      | j                  t        d|      t        d|it        j
                        t        ||||ddi      t              S )	  
        Assigns an organization role to a user within the organization.

        Args:
          role_id: Identifier of the role to assign.

          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}/rolesuser_idrole_idadmin_api_key_authTr0   r1   r2   r3   securitybodyoptionscast_to)
ValueError_postr   r   r   RoleCreateParamsr   r   r'   r9   r:   r0   r1   r2   r3   s          r(   createzRoles.create.   st    4 UV]U`abbzz?Q )W!57I7Z7Z[(+'%.5 '  
 	
r*   c                   |st        d|      |st        d|      | j                  t        d||      t        ||||ddi      t              S )	f  
        Retrieves an organization role assigned to a user.

        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
        r6   6Expected a non-empty value for `role_id` but received -/organization/users/{user_id}/roles/{role_id}r9   r:   r;   Tr<   r@   rA   rB   _getr   r   r   r'   r:   r9   r0   r1   r2   r3   s          r(   retrievezRoles.retrieveW   sz    0 UV]U`abbUV]U`abbyyISZdkl(+'%.5 )  

 
	
r*   afterlimitorderr0   r1   r2   r3   c                   |st        d|      | j                  t        d|      t        t           t        ||||t        |||dt        j                        ddi      t              S 	a  
        Lists the organization roles assigned to a user within the organization.

        Args:
          after: Cursor for pagination. Provide the value from the previous response's `next`
              field to continue listing organization roles.

          limit: A limit on the number of organization role assignments to return.

          order: Sort order for the returned organization roles.

          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
        r6   r7   r8   )rR   rS   rT   r;   T)r0   r1   r2   r3   queryr=   )pager@   model)	rB   _get_api_listr   r   r   r   r   r   RoleListParams	r'   r9   rR   rS   rT   r0   r1   r2   r3   s	            r(   listz
Roles.list   s    B UV]U`abb!!?Q#$45(+'%%!&!&!&
 %33 /5 #% " 
 	
r*   c                   |st        d|      |st        d|      | j                  t        d||      t        ||||ddi      t              S )	w  
        Unassigns an organization role from a user within 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
        r6   rI   rJ   rK   r;   Tr<   rL   rB   _deleter   r   r   rO   s          r(   deletezRoles.delete   sz    0 UV]U`abbUV]U`abb||ISZdkl(+'%.5 '  

 
	
r*   )returnr%   )rc   r-   r9   strr:   re   r0   Headers | Noner1   Query | Noner2   Body | Noner3   (float | httpx2.Timeout | None | NotGivenrc   r   r:   re   r9   re   r0   rf   r1   rg   r2   rh   r3   ri   rc   r   )r9   re   rR   
str | OmitrS   
int | OmitrT   Literal['asc', 'desc'] | Omitr0   rf   r1   rg   r2   rh   r3   ri   rc   z$SyncNextCursorPage[RoleListResponse]r:   re   r9   re   r0   rf   r1   rg   r2   rh   r3   ri   rc   r   __name__
__module____qualname__r   r)   r.   r   rF   rP   r   r]   rb    r*   r(   r    r       s   * * 0 0 )-$("&<E'
'
 	'
 &'
 "'
  '
 :'
 
'
` )-$("&<E&
&
 	&
 &&
 "&
  &
 :&
 
&
X ! /3 )-$("&<E6
6
 	6

 6
 -6
 &6
 "6
  6
 :6
 
.6
~ )-$("&<E&
&
 	&
 &&
 "&
  &
 :&
 
&
r*   c                      e Zd Zed
d       Zedd       Zddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ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        |       S r$   )AsyncRolesWithRawResponser&   s    r(   r)   zAsyncRoles.with_raw_response   s     )..r*   c                    t        |       S r,   )AsyncRolesWithStreamingResponser&   s    r(   r.   z"AsyncRoles.with_streaming_response   s     /t44r*   Nr/   c                  K   |st        d|      | j                  t        d|      t        d|it        j
                         d{   t        ||||ddi      t        	       d{   S 7 '7 w)
r5   r6   r7   r8   r:   Nr;   Tr<   r>   )rB   rC   r   r   r   rD   r   r   rE   s          r(   rF   zAsyncRoles.create   s     4 UV]U`abbZZ?Q,i-ACUCfCfgg(+'%.5 '   
 
 	
g
s$   AA5	A1

"A5,A3-A53A5c                  K   |st        d|      |st        d|      | j                  t        d||      t        ||||ddi      t               d	{   S 7 w)
rH   r6   rI   rJ   rK   r;   Tr<   rL   NrM   rO   s          r(   rP   zAsyncRoles.retrieve  s     0 UV]U`abbUV]U`abbYYISZdkl(+'%.5 )  

 

 
	
 

   AA!AA!rQ   c                   |st        d|      | j                  t        d|      t        t           t        ||||t        |||dt        j                        ddi      t              S rV   )	rB   rZ   r   r   r   r   r   r   r[   r\   s	            r(   r]   zAsyncRoles.listE  s    B UV]U`abb!!?Q$%56(+'%%!&!&!&
 %33 /5 #% " 
 	
r*   c                  K   |st        d|      |st        d|      | j                  t        d||      t        ||||ddi      t               d	{   S 7 w)
r_   r6   rI   rJ   rK   r;   Tr<   rL   Nr`   rO   s          r(   rb   zAsyncRoles.delete}  s     0 UV]U`abbUV]U`abb\\ISZdkl(+'%.5 ' " 

 

 
	
 

r{   )rc   rv   )rc   rx   rd   rj   )r9   re   rR   rk   rS   rl   rT   rm   r0   rf   r1   rg   r2   rh   r3   ri   rc   zGAsyncPaginator[RoleListResponse, AsyncNextCursorPage[RoleListResponse]]rn   ro   rs   r*   r(   r!   r!      s   / / 5 5 )-$("&<E'
'
 	'
 &'
 "'
  '
 :'
 
'
` )-$("&<E&
&
 	&
 &&
 "&
  &
 :&
 
&
X ! /3 )-$("&<E6
6
 	6

 6
 -6
 &6
 "6
  6
 :6
 
Q6
~ )-$("&<E&
&
 	&
 &&
 "&
  &
 :&
 
&
r*   c                      e Zd ZddZy)r%   c                2   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        y N)_rolesr   to_raw_response_wrapperrF   rP   r]   rb   r'   roless     r(   __init__zRolesWithRawResponse.__init__  ss    &>>LL
 )@@NN
 %<<JJ
	 '>>LL
r*   Nr   r    rc   Nonerp   rq   rr   r   rs   r*   r(   r%   r%         
r*   r%   c                      e Zd ZddZy)rv   c                2   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        y r   )r   r   async_to_raw_response_wrapperrF   rP   r]   rb   r   s     r(   r   z"AsyncRolesWithRawResponse.__init__  ss    &DDLL
 )FFNN
 %BBJJ
	 'DDLL
r*   Nr   r!   rc   r   r   rs   r*   r(   rv   rv     r   r*   rv   c                      e Zd ZddZy)r-   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        y r   )r   r   rF   rP   r]   rb   r   s     r(   r   z#RolesWithStreamingResponse.__init__  s[    2LL
 5NN
 1JJ
	 3LL
r*   Nr   r   rs   r*   r(   r-   r-     r   r*   r-   c                      e Zd ZddZy)rx   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        y r   )r   r   rF   rP   r]   rb   r   s     r(   r   z(AsyncRolesWithStreamingResponse.__init__  s[    8LL
 ;NN
 7JJ
	 9LL
r*   Nr   r   rs   r*   r(   rx   rx     r   r*   rx   )3
__future__r   typing_extensionsr   httpx2 r   _typesr   r   r	   r
   r   r   r   _utilsr   r   r   _compatr   	_resourcer   r   	_responser   r   
paginationr   r   _base_clientr   r   types.admin.organization.usersr   r   1types.admin.organization.users.role_list_responser   3types.admin.organization.users.role_create_responser   3types.admin.organization.users.role_delete_responser   5types.admin.organization.users.role_retrieve_responser   __all__r    r!   r%   rv   r-   rx   rs   r*   r(   <module>r      s    # %  " M M M M M ( < [ C B T S W W [L
!C
O C
LC
! C
L
 
$
 
$
 
$
 
r*   