
    _jP                    t   S SK Jr  S SKJr  S SKJr  S SKrSSKJr  SSK	J
r
JrJrJrJrJrJrJr  SSKJrJrJr  SS	KJr  SS
KJrJr  SSKJrJr  SSKJrJ r   SSK!J"r"J#r#  SSK$J%r%  SSK&J'r'J(r(J)r)  SSK*J+r+  SS/r, " S S\5      r- " S S\5      r. " S S5      r/ " S S5      r0 " S S5      r1 " S S5      r2g)    )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                  .   \ rS rSr\SS j5       r\SS j5       r\SSS\S.                 SS jjr	\\\SSS\S.                   SS jjr
\\\SSS\S	.                 SS
 jjrSSS\S.             SS jjrSrg)r!      c                    [        U 5      $ z
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    g/home/rurouni/.local/lib/python3.13/site-packages/openai/resources/admin/organization/projects/roles.pywith_raw_responseRoles.with_raw_response   s     $D))    c                    [        U 5      $ 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_responseRoles.with_streaming_response$   s     *$//r-   Ndescriptionextra_headersextra_query
extra_bodytimeoutc                   U(       d  [        SU< 35      eU R                  [        SUS9[        UUUS.[        R
                  5      [        UUUUSS0S9[        S9$ )	  
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_namer4   admin_api_key_authTr5   r6   r7   r8   securitybodyoptionscast_to)
ValueError_postr   r   r   RoleCreateParamsr   r   	r)   r>   r@   rA   r4   r5   r6   r7   r8   s	            r*   createRoles.create-   s    @ XYcXfghhzz8ZP #.!*#.
 #33 )+'%.5 #  
 	
r-   r4   r@   rA   r5   r6   r7   r8   c                   U(       d  [        SU< 35      eU(       d  [        SU< 35      eU R                  [        SX!S9[        UUUS.[        R
                  5      [        UUUU	SS0S9[        S	9$ )
  
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
r;   6Expected a non-empty value for `role_id` but received &/projects/{project_id}/roles/{role_id}r>   role_idr4   r@   rA   rB   TrC   rE   )rI   rJ   r   r   r   RoleUpdateParamsr   r   
r)   rU   r>   r4   r@   rA   r5   r6   r7   r8   s
             r*   updateRoles.updatec   s    B XYcXfghhUV]U`abbzzBzk #.#.!*
 #33 )+'%.5 #  
 	
r-   afterlimitorderr5   r6   r7   r8   c                   U(       d  [        SU< 35      eU R                  [        SUS9[        [           [        UUUU[        UUUS.[        R                  5      SS0S9[        S9$ 	a  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
r;   r<   r=   )r\   r]   r^   rB   T)r5   r6   r7   r8   queryrD   )pagerG   model)	rI   _get_api_listr   r   r   r   r   r   RoleListParams	r)   r>   r\   r]   r^   r5   r6   r7   r8   s	            r*   list
Roles.list   s    D XYcXfghh!!8ZP#D)(+'%%!&!&!&
 %33 /5 % " 
 	
r-   r5   r6   r7   r8   c                   U(       d  [        SU< 35      eU(       d  [        SU< 35      eU R                  [        SX!S9[        UUUUSS0S9[        S9$ )	!  
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
r;   rR   rS   rT   rB   TrC   rG   rH   rI   _deleter   r   r    r)   rU   r>   r5   r6   r7   r8   s          r*   deleteRoles.delete   sv    0 XYcXfghhUV]U`abb||Bzk(+'%.5 '  

 
	
r-    )returnr'   )rs   r0   r>   strr@   zSequenceNotStr[str]rA   ru   r4   Optional[str] | Omitr5   Headers | Noner6   Query | Noner7   Body | Noner8   'float | httpx.Timeout | None | NotGivenrs   r   rU   ru   r>   ru   r4   rv   r@   z$Optional[SequenceNotStr[str]] | OmitrA   rv   r5   rw   r6   rx   r7   ry   r8   rz   rs   r   )r>   ru   r\   
str | Omitr]   
int | Omitr^   Literal['asc', 'desc'] | Omitr5   rw   r6   rx   r7   ry   r8   rz   rs   zSyncNextCursorPage[Role]rU   ru   r>   ru   r5   rw   r6   rx   r7   ry   r8   rz   rs   r    __name__
__module____qualname____firstlineno__r   r+   r1   r   r   rM   rY   rg   rp   __static_attributes__rr   r-   r*   r!   r!      s   * * 0 0 -1 )-$("&;D4
4
 )	4

 4
 *4
 &4
 "4
  4
 94
 
4
v -1<@*. )-$("&;D7
7
 	7

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

 7
 -7
 &7
 "7
  7
 97
 
"7
@ )-$("&;D&
&
 	&
 &&
 "&
  &
 9&
 
&
 &
r-   c                  .   \ rS rSr\SS j5       r\SS j5       r\SSS\S.                 SS jjr	\\\SSS\S.                   SS jjr
\\\SSS\S	.                 SS
 jjrSSS\S.             SS jjrSrg)r"      c                    [        U 5      $ r&   )AsyncRolesWithRawResponser(   s    r*   r+   AsyncRoles.with_raw_response   s     )..r-   c                    [        U 5      $ r/   )AsyncRolesWithStreamingResponser(   s    r*   r1   "AsyncRoles.with_streaming_response	  s     /t44r-   Nr3   c                  #    U(       d  [        SU< 35      eU R                  [        SUS9[        UUUS.[        R
                  5      I Sh  vN [        UUUUSS0S9[        S	9I Sh  vN $  N! N7f)
r:   r;   r<   r=   r?   NrB   TrC   rE   )rI   rJ   r   r   r   rK   r   r   rL   s	            r*   rM   AsyncRoles.create  s     @ XYcXfghhZZ8ZP,#.!*#.
 #33  )+'%.5 #   
 
 	

s$   AA4A0
A4+A2,A42A4rO   c                 #    U(       d  [        SU< 35      eU(       d  [        SU< 35      eU R                  [        SX!S9[        UUUS.[        R
                  5      I Sh  vN [        UUUU	SS0S	9[        S
9I Sh  vN $  N! N7f)rQ   r;   rR   rS   rT   rV   NrB   TrC   rE   )rI   rJ   r   r   r   rW   r   r   rX   s
             r*   rY   AsyncRoles.updateH  s     B XYcXfghhUV]U`abbZZBzk,#.#.!*
 #33  )+'%.5 #   
 
 	

s$   A"B
$B
%B
BB
B
r[   c                   U(       d  [        SU< 35      eU R                  [        SUS9[        [           [        UUUU[        UUUS.[        R                  5      SS0S9[        S9$ r`   )	rI   rd   r   r   r   r   r   r   re   rf   s	            r*   rg   AsyncRoles.list  s    D XYcXfghh!!8ZP$T*(+'%%!&!&!&
 %33 /5 % " 
 	
r-   ri   c                  #    U(       d  [        SU< 35      eU(       d  [        SU< 35      eU R                  [        SX!S9[        UUUUSS0S9[        S9I S	h  vN $  N7f)
rk   r;   rR   rS   rT   rB   TrC   rl   Nrm   ro   s          r*   rp   AsyncRoles.delete  s     0 XYcXfghhUV]U`abb\\Bzk(+'%.5 ' " 

 

 
	
 

s   AA#A!A#rr   )rs   r   )rs   r   rt   r{   )r>   ru   r\   r|   r]   r}   r^   r~   r5   rw   r6   rx   r7   ry   r8   rz   rs   z/AsyncPaginator[Role, AsyncNextCursorPage[Role]]r   r   rr   r-   r*   r"   r"      s   / / 5 5 -1 )-$("&;D4
4
 )	4

 4
 *4
 &4
 "4
  4
 94
 
4
v -1<@*. )-$("&;D7
7
 	7

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

 7
 -7
 &7
 "7
  7
 97
 
97
@ )-$("&;D&
&
 	&
 &&
 "&
  &
 9&
 
&
 &
r-   c                      \ rS rSrSS jrSrg)r'   i  c                8   Xl         [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR
                  5      U l        [        R                  " UR                  5      U l        g N)_rolesr   to_raw_response_wrapperrM   rY   rg   rp   r)   roless     r*   __init__RolesWithRawResponse.__init__  sq    &>>LL
 '>>LL
 %<<JJ
	 '>>LL
r-   r   rM   rp   rg   rY   Nr   r!   rs   Noner   r   r   r   r   r   rr   r-   r*   r'   r'         
r-   r'   c                      \ rS rSrSS jrSrg)r   i  c                8   Xl         [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR
                  5      U l        [        R                  " UR                  5      U l        g r   )r   r   async_to_raw_response_wrapperrM   rY   rg   rp   r   s     r*   r   "AsyncRolesWithRawResponse.__init__  sq    &DDLL
 'DDLL
 %BBJJ
	 'DDLL
r-   r   Nr   r"   rs   r   r   rr   r-   r*   r   r     r   r-   r   c                      \ rS rSrSS jrSrg)r0   i  c                    Xl         [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l        [        UR
                  5      U l        g r   )r   r   rM   rY   rg   rp   r   s     r*   r   #RolesWithStreamingResponse.__init__  sY    2LL
 3LL
 1JJ
	 3LL
r-   r   Nr   r   rr   r-   r*   r0   r0     r   r-   r0   c                      \ rS rSrSS jrSrg)r   i  c                    Xl         [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l        [        UR
                  5      U l        g r   )r   r   rM   rY   rg   rp   r   s     r*   r   (AsyncRolesWithStreamingResponse.__init__  sY    8LL
 9LL
 7JJ
	 9LL
r-   r   Nr   r   rr   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.organization.roler   !types.admin.organization.projectsr   r   r   6types.admin.organization.projects.role_delete_responser    __all__r!   r"   r'   r   r0   r   rr   r-   r*   <module>r      s    #  %  " ] ] ] M M ( < [ C B 3 k k ZL
!b
O b
Jb
! b
J
 
$
 
$
 
$
 
r-   