
    Yj^                    t   d dl 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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% ddl&m'Z'm(Z(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)Optional)LiteralN   )_legacy_response)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)SyncNextCursorPageAsyncNextCursorPage)AsyncPaginatormake_request_options)Role)role_list_paramsrole_create_paramsrole_update_params)RoleDeleteResponseRoles
AsyncRolesc                  @   e Zd Zedd       Zedd       Ze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
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    q/var/www/html/vmm-quimica/venv/lib/python3.12/site-packages/openai/resources/admin/organization/projects/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descriptionextra_headersextra_query
extra_bodytimeoutc                   |st        d|      | j                  t        d|      t        |||dt        j
                        t        ||||ddi      t              S )	  
        Creates a custom role for a project.

        Args:
          permissions: Permissions to grant to the role.

          role_name: Unique name for the role.

          description: Optional description of the role.

          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
        9Expected a non-empty value for `project_id` but received /projects/{project_id}/roles
project_idpermissions	role_namer1   admin_api_key_authTr2   r3   r4   r5   securitybodyoptionscast_to)
ValueError_postr   r   r   RoleCreateParamsr   r   	r(   r;   r=   r>   r1   r2   r3   r4   r5   s	            r)   createzRoles.create-   s    @ XYcXfghhzz8ZP #.!*#.
 #33 )+'%.5 #  
 	
r+   r2   r3   r4   r5   c                   |st        d|      |st        d|      | j                  t        d||      t        ||||ddi      t              S )	M  
        Retrieves a project role.

        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
        r8   6Expected a non-empty value for `role_id` but received &/projects/{project_id}/roles/{role_id}r;   role_idr?   Tr@   rD   rE   rF   _getr   r   r   r(   rQ   r;   r2   r3   r4   r5   s          r)   retrievezRoles.retrievec   sy    0 XYcXfghhUV]U`abbyyBzcjk(+'%.5   

 
	
r+   r1   r=   r>   r2   r3   r4   r5   c                   |st        d|      |st        d|      | j                  t        d||      t        |||dt        j
                        t        ||||	ddi      t        	      S )
  
        Updates an existing project role.

        Args:
          description: New description for the role.

          permissions: Updated set of permissions for the role.

          role_name: New name for the role.

          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
        r8   rN   rO   rP   r1   r=   r>   r?   Tr@   rB   )rF   rG   r   r   r   RoleUpdateParamsr   r   
r(   rQ   r;   r1   r=   r>   r2   r3   r4   r5   s
             r)   updatezRoles.update   s    B XYcXfghhUV]U`abbzzBzcjk #.#.!*
 #33 )+'%.5 #  
 	
r+   afterlimitorderr2   r3   r4   r5   c                   |st        d|      | j                  t        d|      t        t           t        ||||t        |||dt        j                        ddi      t              S 	an  Lists the roles configured for a project.

        Args:
          after: Cursor for pagination.

        Provide the value from the previous response's `next`
              field to continue listing roles.

          limit: A limit on the number of roles to return. Defaults to 1000.

          order: Sort order for the returned 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
        r8   r9   r:   )r_   r`   ra   r?   T)r2   r3   r4   r5   queryrA   )pagerD   model)	rF   _get_api_listr   r   r   r   r   r   RoleListParams	r(   r;   r_   r`   ra   r2   r3   r4   r5   s	            r)   listz
Roles.list   s    D XYcXfghh!!8ZP#D)(+'%%!&!&!&
 %33 /5 % " 
 	
r+   c                   |st        d|      |st        d|      | j                  t        d||      t        ||||ddi      t              S )	Y  
        Deletes a custom role from a project.

        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
        r8   rN   rO   rP   r?   Tr@   rR   rF   _deleter   r   r    rU   s          r)   deletezRoles.delete   sy    0 XYcXfghhUV]U`abb||Bzcjk(+'%.5 '  

 
	
r+   )returnr&   )rp   r.   r;   strr=   zSequenceNotStr[str]r>   rr   r1   Optional[str] | Omitr2   Headers | Noner3   Query | Noner4   Body | Noner5   (float | httpx2.Timeout | None | NotGivenrp   r   rQ   rr   r;   rr   r2   rt   r3   ru   r4   rv   r5   rw   rp   r   rQ   rr   r;   rr   r1   rs   r=   z$Optional[SequenceNotStr[str]] | Omitr>   rs   r2   rt   r3   ru   r4   rv   r5   rw   rp   r   )r;   rr   r_   
str | Omitr`   
int | Omitra   Literal['asc', 'desc'] | Omitr2   rt   r3   ru   r4   rv   r5   rw   rp   zSyncNextCursorPage[Role]rQ   rr   r;   rr   r2   rt   r3   ru   r4   rv   r5   rw   rp   r    __name__
__module____qualname__r   r*   r/   r   r   rJ   rV   r]   rj   ro    r+   r)   r!   r!      s@   * * 0 0 -1 )-$("&<E4
4
 )	4

 4
 *4
 &4
 "4
  4
 :4
 
4
z )-$("&<E&
&
 	&
 &&
 "&
  &
 :&
 
&
Z -1<@*. )-$("&<E7
7
 	7

 *7
 :7
 (7
 &7
 "7
  7
 :7
 
7
z ! /3 )-$("&<E7
7
 	7

 7
 -7
 &7
 "7
  7
 :7
 
"7
@ )-$("&<E&
&
 	&
 &&
 "&
  &
 :&
 
&
r+   c                  @   e Zd Zedd       Zedd       Ze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
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_response1  s     /t44r+   Nr0   c                  K   |st        d|      | j                  t        d|      t        |||dt        j
                         d{   t        ||||ddi      t        	       d{   S 7 '7 w)
r7   r8   r9   r:   r<   Nr?   Tr@   rB   )rF   rG   r   r   r   rH   r   r   rI   s	            r)   rJ   zAsyncRoles.create:  s     @ XYcXfghhZZ8ZP,#.!*#.
 #33  )+'%.5 #   
 
 	

s$   A	A7A3
"A7.A5/A75A7rK   c                  K   |st        d|      |st        d|      | j                  t        d||      t        ||||ddi      t               d	{   S 7 w)
rM   r8   rN   rO   rP   r?   Tr@   rR   NrS   rU   s          r)   rV   zAsyncRoles.retrievep  s     0 XYcXfghhUV]U`abbYYBzcjk(+'%.5   

 

 
	
 

   AA!AA!rW   c                 K   |st        d|      |st        d|      | j                  t        d||      t        |||dt        j
                         d{   t        ||||	ddi	      t        
       d{   S 7 '7 w)rY   r8   rN   rO   rP   rZ   Nr?   Tr@   rB   )rF   rG   r   r   r   r[   r   r   r\   s
             r)   r]   zAsyncRoles.update  s     B XYcXfghhUV]U`abbZZBzcjk,#.#.!*
 #33  )+'%.5 #   
 
 	

s$   ABB
"B?B BBr^   c                   |st        d|      | j                  t        d|      t        t           t        ||||t        |||dt        j                        ddi      t              S rc   )	rF   rg   r   r   r   r   r   r   rh   ri   s	            r)   rj   zAsyncRoles.list  s    D XYcXfghh!!8ZP$T*(+'%%!&!&!&
 %33 /5 % " 
 	
r+   c                  K   |st        d|      |st        d|      | j                  t        d||      t        ||||ddi      t               d	{   S 7 w)
rl   r8   rN   rO   rP   r?   Tr@   rR   Nrm   rU   s          r)   ro   zAsyncRoles.delete
  s     0 XYcXfghhUV]U`abb\\Bzcjk(+'%.5 ' " 

 

 
	
 

r   )rp   r   )rp   r   rq   rx   ry   )r;   rr   r_   rz   r`   r{   ra   r|   r2   rt   r3   ru   r4   rv   r5   rw   rp   z/AsyncPaginator[Role, AsyncNextCursorPage[Role]]r}   r~   r   r+   r)   r"   r"   &  s@   / / 5 5 -1 )-$("&<E4
4
 )	4

 4
 *4
 &4
 "4
  4
 :4
 
4
z )-$("&<E&
&
 	&
 &&
 "&
  &
 :&
 
&
Z -1<@*. )-$("&<E7
7
 	7

 *7
 :7
 (7
 &7
 "7
  7
 :7
 
7
z ! /3 )-$("&<E7
7
 	7

 7
 -7
 &7
 "7
  7
 :7
 
97
@ )-$("&<E&
&
 	&
 &&
 "&
  &
 :&
 
&
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 N)_rolesr   to_raw_response_wrapperrJ   rV   r]   rj   ro   r(   roless     r)   __init__zRolesWithRawResponse.__init__4  s    &>>LL
 )@@NN
 '>>LL
 %<<JJ
	 '>>LL
r+   Nr   r!   rp   Noner   r   r   r   r   r+   r)   r&   r&   3      
r+   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 r   )r   r   async_to_raw_response_wrapperrJ   rV   r]   rj   ro   r   s     r)   r   z"AsyncRolesWithRawResponse.__init__I  s    &DDLL
 )FFNN
 'DDLL
 %BBJJ
	 'DDLL
r+   Nr   r"   rp   r   r   r   r+   r)   r   r   H  r   r+   r   c                      e Zd ZddZy)r.   c                   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        y r   )r   r   rJ   rV   r]   rj   ro   r   s     r)   r   z#RolesWithStreamingResponse.__init__^  sp    2LL
 5NN
 3LL
 1JJ
	 3LL
r+   Nr   r   r   r+   r)   r.   r.   ]  r   r+   r.   c                      e Zd ZddZy)r   c                   || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        t        |j                        | _        y r   )r   r   rJ   rV   r]   rj   ro   r   s     r)   r   z(AsyncRolesWithStreamingResponse.__init__s  sp    8LL
 ;NN
 9LL
 7JJ
	 9LL
r+   Nr   r   r   r+   r)   r   r   r  r   r+   r   )3
__future__r   typingr   typing_extensionsr   httpx2 r   _typesr   r	   r
   r   r   r   r   r   _utilsr   r   r   _compatr   	_resourcer   r   	_responser   r   
paginationr   r   _base_clientr   r   types.admin.organization.roler   !types.admin.organization.projectsr   r   r   6types.admin.organization.projects.role_delete_responser    __all__r!   r"   r&   r   r.   r   r   r+   r)   <module>r      s    #  %  " ] ] ] M M ( < [ C B 3 k k ZL
!J
O J
ZJ
! J
Z
 
*
 
*
 
*
 
r+   