o
    ùT·jK  ã                   @  sT  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„ 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)Ú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d„ƒZed)dd„ƒZddded	œd*dd„Zddded	œd+dd„Ze	e	e	dddedœd,d#d$„Z
ddded	œd-d&d'„ZdS ).r   Ú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(   úr/home/dinkstrade/pdmp-scanner/venv/lib/python3.10/site-packages/openai/resources/admin/organization/users/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©Úextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚuser_idÚstrÚrole_idr1   úHeaders | Noner2   úQuery | Noner3   úBody | Noner4   ú(float | httpx2.Timeout | None | NotGivenr   c             
   C  sJ   |s	t d|›�ƒ‚| jtd|d�td|itjƒt||||ddid�td�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©r5   r7   Úadmin_api_key_authT©r1   r2   r3   r4   Úsecurity©ÚbodyÚoptionsÚcast_to)Ú
ValueErrorÚ_postr   r   r   ÚRoleCreateParamsr   r   ©r'   r5   r7   r1   r2   r3   r4   r(   r(   r)   Úcreate.   s   
ûözRoles.creater   c             	   C  óP   |s	t d|›�ƒ‚|st d|›�ƒ‚| jtd||d�t||||ddid�td�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
        r=   ú6Expected a non-empty value for `role_id` but received ú-/organization/users/{user_id}/roles/{role_id}©r5   r7   r@   TrA   ©rE   rF   ©rG   Ú_getr   r   r   ©r'   r7   r5   r1   r2   r3   r4   r(   r(   r)   ÚretrieveW   ó   û÷zRoles.retrieve©ÚafterÚlimitÚorderr1   r2   r3   r4   rX   ú
str | OmitrY   ú
int | OmitrZ   úLiteral['asc', 'desc'] | Omitú$SyncNextCursorPage[RoleListResponse]c          	      C  óT   |s	t d|›�ƒ‚| jtd|d�tt t||||t|||dœtjƒddid�td�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
        r=   r>   r?   )rX   rY   rZ   r@   T)r1   r2   r3   r4   ÚqueryrB   )ÚpagerE   Úmodel)	rG   Ú_get_api_listr   r   r   r   r   r   ÚRoleListParams©	r'   r5   rX   rY   rZ   r1   r2   r3   r4   r(   r(   r)   Úlist   ó*   !
ýúóîz
Roles.listr   c             	   C  rL   )	á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
        r=   rN   rO   rP   r@   TrA   rQ   ©rG   Ú_deleter   r   r   rT   r(   r(   r)   Údelete·   rV   zRoles.delete)r"   r#   )r"   r,   ©r5   r6   r7   r6   r1   r8   r2   r9   r3   r:   r4   r;   r"   r   ©r7   r6   r5   r6   r1   r8   r2   r9   r3   r:   r4   r;   r"   r   )r5   r6   rX   r[   rY   r\   rZ   r]   r1   r8   r2   r9   r3   r:   r4   r;   r"   r^   ©r7   r6   r5   r6   r1   r8   r2   r9   r3   r:   r4   r;   r"   r   ©Ú__name__Ú
__module__Ú__qualname__r   r*   r.   r   rK   rU   r   rg   rl   r(   r(   r(   r)   r      ó8    	ö0ö,ô?öc                   @  r!   ).r    r"   ÚAsyncRolesWithRawResponsec                 C  r$   r%   )ru   r&   r(   r(   r)   r*   á   r+   zAsyncRoles.with_raw_responseÚAsyncRolesWithStreamingResponsec                 C  r$   r-   )rv   r&   r(   r(   r)   r.   ë   r/   z"AsyncRoles.with_streaming_responseNr0   r5   r6   r7   r1   r8   r2   r9   r3   r:   r4   r;   r   c             
   Ã  sX   �|s
t d|›�ƒ‚| jtd|d�td|itjƒI dH t||||ddid�td	�I dH S )
r<   r=   r>   r?   r7   Nr@   TrA   rC   )rG   rH   r   r   r   rI   r   r   rJ   r(   r(   r)   rK   ô   s   €
ûözAsyncRoles.creater   c             	   Ã  óX   �|s
t d|›�ƒ‚|st d|›�ƒ‚| jtd||d�t||||ddid�td�I d	H S )
rM   r=   rN   rO   rP   r@   TrA   rQ   NrR   rT   r(   r(   r)   rU     ó    €û÷zAsyncRoles.retrieverW   rX   r[   rY   r\   rZ   r]   úGAsyncPaginator[RoleListResponse, AsyncNextCursorPage[RoleListResponse]]c          	      C  r_   r`   )	rG   rd   r   r   r   r   r   r   re   rf   r(   r(   r)   rg   E  rh   zAsyncRoles.listr   c             	   Ã  rw   )
ri   r=   rN   rO   rP   r@   TrA   rQ   Nrj   rT   r(   r(   r)   rl   }  rx   zAsyncRoles.delete)r"   ru   )r"   rv   rm   rn   )r5   r6   rX   r[   rY   r\   rZ   r]   r1   r8   r2   r9   r3   r:   r4   r;   r"   ry   ro   rp   r(   r(   r(   r)   r    à   rt   c                   @  ó   e Zd Zddd„ZdS )	r#   Úrolesr   r"   ÚNonec                 C  óB   || _ t |j¡| _t |j¡| _t |j¡| _t |j¡| _d S ©N)Ú_rolesr   Úto_raw_response_wrapperrK   rU   rg   rl   ©r'   r{   r(   r(   r)   Ú__init__§  ó   ÿÿÿ
ÿzRolesWithRawResponse.__init__N©r{   r   r"   r|   ©rq   rr   rs   r‚   r(   r(   r(   r)   r#   ¦  ó    r#   c                   @  rz   )	ru   r{   r    r"   r|   c                 C  r}   r~   )r   r   Úasync_to_raw_response_wrapperrK   rU   rg   rl   r�   r(   r(   r)   r‚   ¹  rƒ   z"AsyncRolesWithRawResponse.__init__N©r{   r    r"   r|   r…   r(   r(   r(   r)   ru   ¸  r†   ru   c                   @  rz   )	r,   r{   r   r"   r|   c                 C  ó:   || _ t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _d S r~   )r   r   rK   rU   rg   rl   r�   r(   r(   r)   r‚   Ë  ó   ÿÿÿ
ÿz#RolesWithStreamingResponse.__init__Nr„   r…   r(   r(   r(   r)   r,   Ê  r†   r,   c                   @  rz   )	rv   r{   r    r"   r|   c                 C  r‰   r~   )r   r   rK   rU   rg   rl   r�   r(   r(   r)   r‚   Ý  rŠ   z(AsyncRolesWithStreamingResponse.__init__Nrˆ   r…   r(   r(   r(   r)   rv   Ü  r†   rv   )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#   ru   r,   rv   r(   r(   r(   r)   Ú<module>   s2   $ G G