o
    ùT·jÔ^  ã                   @  sP  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„ deƒZ-G dd„ deƒZ.G dd„ dƒZ/G dd„ dƒZ0G dd„ dƒZ1G dd„ dƒZ2dS )é    )Ú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d1dd„ƒZed2dd„ƒZeddded	œd3dd„Zdddedœd4dd„Z	eeeddded œd5d"d#„Z
eeeddded$œd6d,d-„Zdddedœd7d/d0„ZdS )8r    ÚreturnÚRolesWithRawResponsec                 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
        )r$   ©Úself© r)   úu/home/dinkstrade/pdmp-scanner/venv/lib/python3.10/site-packages/openai/resources/admin/organization/projects/roles.pyÚwith_raw_response   ó   zRoles.with_raw_responseÚRolesWithStreamingResponsec                 C  r%   ©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
        )r-   r'   r)   r)   r*   Úwith_streaming_response$   ó   zRoles.with_streaming_responseN©ÚdescriptionÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚ
project_idÚstrÚpermissionsúSequenceNotStr[str]Ú	role_namer2   úOptional[str] | Omitr3   úHeaders | Noner4   úQuery | Noner5   úBody | Noner6   ú(float | httpx2.Timeout | None | NotGivenr   c          	   
   C  sN   |s	t d|›�ƒ‚| jtd|d�t|||dœtjƒt||||ddid�td�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©r7   ©r9   r;   r2   Úadmin_api_key_authT©r3   r4   r5   r6   Úsecurity©ÚbodyÚoptionsÚcast_to)Ú
ValueErrorÚ_postr   r   r   ÚRoleCreateParamsr   r   ©	r(   r7   r9   r;   r2   r3   r4   r5   r6   r)   r)   r*   Úcreate-   s(    
ýúûïzRoles.create©r3   r4   r5   r6   Úrole_idc             	   C  óP   |s	t d|›�ƒ‚|st d|›�ƒ‚| jtd||d�t||||ddid�td�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
        rB   ú6Expected a non-empty value for `role_id` but received ú&/projects/{project_id}/roles/{role_id}©r7   rS   rF   TrG   ©rK   rL   ©rM   Ú_getr   r   r   ©r(   rS   r7   r3   r4   r5   r6   r)   r)   r*   Úretrievec   ó   û÷zRoles.retrieve©r2   r9   r;   r3   r4   r5   r6   ú$Optional[SequenceNotStr[str]] | Omitc          
   
   C  sb   |s	t d|›�ƒ‚|st d|›�ƒ‚| jtd||d�t|||dœtjƒt||||	ddid�td	�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
        rB   rV   rW   rX   ©r2   r9   r;   rF   TrG   rI   )rM   rN   r   r   r   ÚRoleUpdateParamsr   r   ©
r(   rS   r7   r2   r9   r;   r3   r4   r5   r6   r)   r)   r*   Úupdate‹   s,   !ýúûïzRoles.update©ÚafterÚlimitÚorderr3   r4   r5   r6   rg   ú
str | Omitrh   ú
int | Omitri   úLiteral['asc', 'desc'] | OmitúSyncNextCursorPage[Role]c          	      C  óT   |s	t d|›�ƒ‚| jtd|d�tt t||||t|||dœtjƒddid�td�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
        rB   rC   rD   )rg   rh   ri   rF   T)r3   r4   r5   r6   ÚqueryrH   )ÚpagerK   Úmodel)	rM   Ú_get_api_listr   r   r   r   r   r   ÚRoleListParams©	r(   r7   rg   rh   ri   r3   r4   r5   r6   r)   r)   r*   ÚlistÄ   ó*   "
ýúóîz
Roles.listr   c             	   C  rT   )	á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
        rB   rV   rW   rX   rF   TrG   rY   ©rM   Ú_deleter   r   r   r\   r)   r)   r*   Údeleteý   r^   zRoles.delete)r#   r$   )r#   r-   ©r7   r8   r9   r:   r;   r8   r2   r<   r3   r=   r4   r>   r5   r?   r6   r@   r#   r   ©rS   r8   r7   r8   r3   r=   r4   r>   r5   r?   r6   r@   r#   r   ©rS   r8   r7   r8   r2   r<   r9   r`   r;   r<   r3   r=   r4   r>   r5   r?   r6   r@   r#   r   )r7   r8   rg   rj   rh   rk   ri   rl   r3   r=   r4   r>   r5   r?   r6   r@   r#   rm   ©rS   r8   r7   r8   r3   r=   r4   r>   r5   r?   r6   r@   r#   r   ©Ú__name__Ú
__module__Ú__qualname__r   r+   r/   r   r   rQ   r]   re   rv   r{   r)   r)   r)   r*   r       óJ    	ô=ö-ó=ô@öc                   @  r"   )8r!   r#   ÚAsyncRolesWithRawResponsec                 C  r%   r&   )r…   r'   r)   r)   r*   r+   '  r,   zAsyncRoles.with_raw_responseÚAsyncRolesWithStreamingResponsec                 C  r%   r.   )r†   r'   r)   r)   r*   r/   1  r0   z"AsyncRoles.with_streaming_responseNr1   r7   r8   r9   r:   r;   r2   r<   r3   r=   r4   r>   r5   r?   r6   r@   r   c          	   
   Ã  s\   �|s
t d|›�ƒ‚| jtd|d�t|||dœtjƒI dH t||||ddid�td	�I dH S )
rA   rB   rC   rD   rE   NrF   TrG   rI   )rM   rN   r   r   r   rO   r   r   rP   r)   r)   r*   rQ   :  s*   € 
ýúûïzAsyncRoles.createrR   rS   c             	   Ã  óX   �|s
t d|›�ƒ‚|st d|›�ƒ‚| jtd||d�t||||ddid�td�I d	H S )
rU   rB   rV   rW   rX   rF   TrG   rY   NrZ   r\   r)   r)   r*   r]   p  ó    €û÷zAsyncRoles.retriever_   r`   c          
   
   Ã  sp   �|s
t d|›�ƒ‚|st d|›�ƒ‚| jtd||d�t|||dœtjƒI dH t||||	ddid	�td
�I dH S )ra   rB   rV   rW   rX   rb   NrF   TrG   rI   )rM   rN   r   r   r   rc   r   r   rd   r)   r)   r*   re   ˜  s.   €!ýúûïzAsyncRoles.updaterf   rg   rj   rh   rk   ri   rl   ú/AsyncPaginator[Role, AsyncNextCursorPage[Role]]c          	      C  rn   ro   )	rM   rs   r   r   r   r   r   r   rt   ru   r)   r)   r*   rv   Ñ  rw   zAsyncRoles.listr   c             	   Ã  r‡   )
rx   rB   rV   rW   rX   rF   TrG   rY   Nry   r\   r)   r)   r*   r{   
  rˆ   zAsyncRoles.delete)r#   r…   )r#   r†   r|   r}   r~   )r7   r8   rg   rj   rh   rk   ri   rl   r3   r=   r4   r>   r5   r?   r6   r@   r#   r‰   r   r€   r)   r)   r)   r*   r!   &  r„   c                   @  ó   e Zd Zddd„ZdS )	r$   Úrolesr    r#   ÚNonec                 C  óP   || _ t |j¡| _t |j¡| _t |j¡| _t |j¡| _t |j¡| _d S ©N)Ú_rolesr   Úto_raw_response_wrapperrQ   r]   re   rv   r{   ©r(   r‹   r)   r)   r*   Ú__init__4  ó    ÿÿÿÿ
ÿzRolesWithRawResponse.__init__N©r‹   r    r#   rŒ   ©r�   r‚   rƒ   r’   r)   r)   r)   r*   r$   3  ó    r$   c                   @  rŠ   )	r…   r‹   r!   r#   rŒ   c                 C  r�   rŽ   )r�   r   Úasync_to_raw_response_wrapperrQ   r]   re   rv   r{   r‘   r)   r)   r*   r’   I  r“   z"AsyncRolesWithRawResponse.__init__N©r‹   r!   r#   rŒ   r•   r)   r)   r)   r*   r…   H  r–   r…   c                   @  rŠ   )	r-   r‹   r    r#   rŒ   c                 C  óF   || _ t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _d S rŽ   )r�   r   rQ   r]   re   rv   r{   r‘   r)   r)   r*   r’   ^  ó    ÿÿÿÿ
ÿz#RolesWithStreamingResponse.__init__Nr”   r•   r)   r)   r)   r*   r-   ]  r–   r-   c                   @  rŠ   )	r†   r‹   r!   r#   rŒ   c                 C  r™   rŽ   )r�   r   rQ   r]   re   rv   r{   r‘   r)   r)   r*   r’   s  rš   z(AsyncRolesWithStreamingResponse.__init__Nr˜   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)   r*   Ú<module>   s4   (    