
    2RjOW                    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%m&Z&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)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_list_paramsrole_create_paramsrole_update_params)Role)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/meridian/meridian-ai/venv/lib/python3.12/site-packages/openai/resources/admin/organization/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                   | j                  dt        |||dt        j                        t	        ||||ddi      t
              S )  
        Creates a custom role for the organization.

        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
        /organization/rolespermissions	role_namer1   admin_api_key_authTr2   r3   r4   r5   securitybodyoptionscast_to)_postr   r   RoleCreateParamsr   r   r(   r:   r;   r1   r2   r3   r4   r5   s           r)   createzRoles.create-   sa    > zz! #.!*#.
 #33 )+'%.5 #  
 	
r+   r2   r3   r4   r5   c                   |st        d|      | j                  t        d|      t        ||||ddi      t              S )S  
        Retrieves an organization 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
        6Expected a non-empty value for `role_id` but received /organization/roles/{role_id}role_idr<   Tr=   rA   rB   
ValueError_getr   r   r   r(   rM   r2   r3   r4   r5   s         r)   retrievezRoles.retrieve`   s^    . UV]U`abbyy97K(+'%.5   

 
	
r+   r1   r:   r;   r2   r3   r4   r5   c                   |st        d|      | j                  t        d|      t        |||dt        j
                        t        ||||ddi      t              S )	  
        Updates an existing organization 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
        rJ   rK   rL   r1   r:   r;   r<   Tr=   r?   )rP   rC   r   r   r   RoleUpdateParamsr   r   	r(   rM   r1   r:   r;   r2   r3   r4   r5   s	            r)   updatezRoles.update   s    @ UV]U`abbzz97K #.#.!*
 #33 )+'%.5 #  
 	
r+   afterlimitorderr2   r3   r4   r5   c                   | j                  dt        t           t        ||||t	        |||dt
        j                        ddi      t              S au  
        Lists the roles configured for the organization.

        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   )r\   r]   r^   r<   T)r2   r3   r4   r5   queryr>   )pagerA   model)_get_api_listr   r   r   r   r   RoleListParamsr(   r\   r]   r^   r2   r3   r4   r5   s           r)   listz
Roles.list   sl    @ !!!#D)(+'%%!&!&!&
 %33 /5 % " 
 	
r+   c                   |st        d|      | j                  t        d|      t        ||||ddi      t              S )`  
        Deletes a custom role 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
        rJ   rK   rL   r<   Tr=   rN   rP   _deleter   r   r    rR   s         r)   deletezRoles.delete   s^    . UV]U`abb||97K(+'%.5 '  

 
	
r+   )returnr&   )rm   r.   r:   zSequenceNotStr[str]r;   strr1   Optional[str] | Omitr2   Headers | Noner3   Query | Noner4   Body | Noner5   'float | httpx.Timeout | None | NotGivenrm   r   rM   ro   r2   rq   r3   rr   r4   rs   r5   rt   rm   r   rM   ro   r1   rp   r:   z$Optional[SequenceNotStr[str]] | Omitr;   rp   r2   rq   r3   rr   r4   rs   r5   rt   rm   r   )r\   
str | Omitr]   
int | Omitr^   Literal['asc', 'desc'] | Omitr2   rq   r3   rr   r4   rs   r5   rt   rm   zSyncNextCursorPage[Role]rM   ro   r2   rq   r3   rr   r4   rs   r5   rt   rm   r    __name__
__module____qualname__r   r*   r/   r   r   rF   rS   rZ   rg   rl    r+   r)   r!   r!      s   * * 0 0 -1 )-$("&;D1
 )1
 	1

 *1
 &1
 "1
  1
 91
 
1
r )-$("&;D#
#
 &#
 "#
  #
 9#
 
#
R -1<@*. )-$("&;D4
4
 *	4

 :4
 (4
 &4
 "4
  4
 94
 
4
r ! /3 )-$("&;D3
 3
 	3

 -3
 &3
 "3
  3
 93
 
"3
v )-$("&;D#
#
 &#
 "#
  #
 9#
 
#
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_response!  s     /t44r+   Nr0   c                  K   | j                  dt        |||dt        j                         d{   t	        ||||ddi      t
               d{   S 7 '7 w)r7   r8   r9   Nr<   Tr=   r?   )rC   r   r   rD   r   r   rE   s           r)   rF   zAsyncRoles.create*  sz     > ZZ!,#.!*#.
 #33  )+'%.5 #   
 
 	

s!   .AA
"AAAArG   c                  K   |st        d|      | j                  t        d|      t        ||||ddi      t               d{   S 7 w)	rI   rJ   rK   rL   r<   Tr=   rN   NrO   rR   s         r)   rS   zAsyncRoles.retrieve]  sl     . UV]U`abbYY97K(+'%.5   

 

 
	
 

   AA	A
ArT   c                  K   |st        d|      | j                  t        d|      t        |||dt        j
                         d{   t        ||||ddi      t        	       d{   S 7 '7 w)
rV   rJ   rK   rL   rW   Nr<   Tr=   r?   )rP   rC   r   r   r   rX   r   r   rY   s	            r)   rZ   zAsyncRoles.update  s     @ UV]U`abbZZ97K,#.#.!*
 #33  )+'%.5 #   
 
 	

s$   A	A7A3
"A7.A5/A75A7r[   c                   | j                  dt        t           t        ||||t	        |||dt
        j                        ddi      t              S r`   )rd   r   r   r   r   r   re   rf   s           r)   rg   zAsyncRoles.list  sl    @ !!!$T*(+'%%!&!&!&
 %33 /5 % " 
 	
r+   c                  K   |st        d|      | j                  t        d|      t        ||||ddi      t               d{   S 7 w)	ri   rJ   rK   rL   r<   Tr=   rN   Nrj   rR   s         r)   rl   zAsyncRoles.delete  sl     . UV]U`abb\\97K(+'%.5 ' " 

 

 
	
 

r   )rm   r   )rm   r   rn   ru   rv   )r\   rw   r]   rx   r^   ry   r2   rq   r3   rr   r4   rs   r5   rt   rm   z/AsyncPaginator[Role, AsyncNextCursorPage[Role]]rz   r{   r   r+   r)   r"   r"     s   / / 5 5 -1 )-$("&;D1
 )1
 	1

 *1
 &1
 "1
  1
 91
 
1
r )-$("&;D#
#
 &#
 "#
  #
 9#
 
#
R -1<@*. )-$("&;D4
4
 *	4

 :4
 (4
 &4
 "4
  4
 94
 
4
r ! /3 )-$("&;D3
 3
 	3

 -3
 &3
 "3
  3
 93
 
93
v )-$("&;D#
#
 &#
 "#
  #
 9#
 
#
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_wrapperrF   rS   rZ   rg   rl   r(   roless     r)   __init__zRolesWithRawResponse.__init__  s    &>>LL
 )@@NN
 '>>LL
 %<<JJ
	 '>>LL
r+   Nr   r!   rm   Noner|   r}   r~   r   r   r+   r)   r&   r&         
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_wrapperrF   rS   rZ   rg   rl   r   s     r)   r   z"AsyncRolesWithRawResponse.__init__)  s    &DDLL
 )FFNN
 'DDLL
 %BBJJ
	 'DDLL
r+   Nr   r"   rm   r   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   rF   rS   rZ   rg   rl   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   rF   rS   rZ   rg   rl   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   httpx 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   r   types.admin.organization.roler   -types.admin.organization.role_delete_responser    __all__r!   r"   r&   r   r.   r   r   r+   r)   <module>r      s    #  %  ! \ \ \ L L ' ; Z B A a a 2 PL
!z
O z
zz
! z
z
 
*
 
*
 
*
 
r+   