o
    ùT·jýN  ã                   @  s`  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 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+ ddl,m-Z- ddl.m/Z/ ddgZ0G dd„ deƒZ1G dd„ deƒZ2G dd„ dƒZ3G dd„ dƒZ4G dd„ dƒZ5G dd„ dƒZ6dS )é    )Úannotations)ÚOptionalNé   )Ú_legacy_responseé   )ÚRolesÚ
AsyncRolesÚRolesWithRawResponseÚAsyncRolesWithRawResponseÚRolesWithStreamingResponseÚAsyncRolesWithStreamingResponse)Ú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)ÚSyncConversationCursorPageÚAsyncConversationCursorPage)ÚAsyncPaginatorÚmake_request_options)Úuser_list_paramsÚuser_update_params)ÚOrganizationUser)ÚUserDeleteResponseÚUsersÚ
AsyncUsersc                	   @  óœ   e Zd Zed/dd„ƒZed0dd„ƒZed1d	d
„ƒZdddedœd2dd„Ze	e	e	e	dddedœd3d d!„Z
e	e	e	ddded"œd4d*d+„Zdddedœd5d-d.„ZdS )6r%   Úreturnr   c                 C  ó
   t | jƒS ©N)r   Ú_client©Úself© r.   úr/home/dinkstrade/pdmp-scanner/venv/lib/python3.10/site-packages/openai/resources/admin/organization/users/users.pyÚroles!   ó   
zUsers.rolesÚUsersWithRawResponsec                 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
        )r2   r,   r.   r.   r/   Úwith_raw_response%   ó   zUsers.with_raw_responseÚUsersWithStreamingResponsec                 C  r3   ©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
        )r7   r,   r.   r.   r/   Úwith_streaming_response/   ó   zUsers.with_streaming_responseN©Úextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚuser_idÚstrr<   úHeaders | Noner=   úQuery | Noner>   úBody | Noner?   ú(float | httpx2.Timeout | None | NotGivenr#   c             	   C  ó<   |s	t d|›�ƒ‚| jtd|d�t||||ddid�td�S )áY  
        Retrieves a user by their identifier.

        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 `user_id` but received ú/organization/users/{user_id}©r@   Úadmin_api_key_authT©r<   r=   r>   r?   Úsecurity©ÚoptionsÚcast_to©Ú
ValueErrorÚ_getr   r    r#   ©r-   r@   r<   r=   r>   r?   r.   r.   r/   Úretrieve8   ó   
û÷zUsers.retrieve©Údeveloper_personaÚroleÚrole_idÚtechnical_levelr<   r=   r>   r?   rX   úOptional[str] | OmitrY   rZ   r[   c          
   
   C  sP   |s	t d|›�ƒ‚| jtd|d�t||||dœtjƒt||||	ddid�td�S )	á'  
        Modifies a user's role in the organization.

        Args:
          developer_persona: Developer persona metadata.

          role: `owner` or `reader`

          role_id: Role ID to assign to the user.

          technical_level: Technical level metadata.

          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
        rH   rI   rJ   ©rX   rY   rZ   r[   rK   TrL   ©ÚbodyrO   rP   )rR   Ú_postr   r   r"   ÚUserUpdateParamsr    r#   ©
r-   r@   rX   rY   rZ   r[   r<   r=   r>   r?   r.   r.   r/   Úupdate]   s*   #
üù	ûîzUsers.update©ÚafterÚemailsÚlimitr<   r=   r>   r?   rf   ú
str | Omitrg   úSequenceNotStr[str] | Omitrh   ú
int | Omitú,SyncConversationCursorPage[OrganizationUser]c                C  ó:   | j dtt t||||t|||dœtjƒddid�td�S ©ao  
        Lists all of the users in the organization.

        Args:
          after: A cursor for use in pagination. `after` is an object ID that defines your place
              in the list. For instance, if you make a list request and receive 100 objects,
              ending with obj_foo, your subsequent call can include after=obj_foo in order to
              fetch the next page of the list.

          emails: Filter by the email address of users.

          limit: A limit on the number of objects to be returned. Limit can range between 1 and
              100, and the default is 20.

          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
        z/organization/users)rf   rg   rh   rK   T)r<   r=   r>   r?   ÚqueryrM   )ÚpagerO   Úmodel)Ú_get_api_listr   r#   r    r   r!   ÚUserListParams©r-   rf   rg   rh   r<   r=   r>   r?   r.   r.   r/   Úlist—   ó&   #ýúóîz
Users.listr$   c             	   C  rF   )áY  
        Deletes a user 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
        rH   rI   rJ   rK   TrL   rN   ©rR   Ú_deleter   r    r$   rT   r.   r.   r/   ÚdeleteÏ   rV   zUsers.delete)r(   r   )r(   r2   )r(   r7   ©r@   rA   r<   rB   r=   rC   r>   rD   r?   rE   r(   r#   ©r@   rA   rX   r\   rY   r\   rZ   r\   r[   r\   r<   rB   r=   rC   r>   rD   r?   rE   r(   r#   )rf   ri   rg   rj   rh   rk   r<   rB   r=   rC   r>   rD   r?   rE   r(   rl   ©r@   rA   r<   rB   r=   rC   r>   rD   r?   rE   r(   r$   ©Ú__name__Ú
__module__Ú__qualname__r   r0   r5   r9   r   rU   r   rd   ru   rz   r.   r.   r.   r/   r%       óD    	÷)ó=õ>÷c                	   @  r'   )6r&   r(   r   c                 C  r)   r*   )r   r+   r,   r.   r.   r/   r0   ö   r1   zAsyncUsers.rolesÚAsyncUsersWithRawResponsec                 C  r3   r4   )rƒ   r,   r.   r.   r/   r5   ú   r6   zAsyncUsers.with_raw_responseÚAsyncUsersWithStreamingResponsec                 C  r3   r8   )r„   r,   r.   r.   r/   r9     r:   z"AsyncUsers.with_streaming_responseNr;   r@   rA   r<   rB   r=   rC   r>   rD   r?   rE   r#   c             	   Ã  óD   �|s
t d|›�ƒ‚| jtd|d�t||||ddid�td�I dH S )	rG   rH   rI   rJ   rK   TrL   rN   NrQ   rT   r.   r.   r/   rU     ó   €
û÷zAsyncUsers.retrieverW   rX   r\   rY   rZ   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 )
r]   rH   rI   rJ   r^   NrK   TrL   r_   )rR   ra   r   r   r"   rb   r    r#   rc   r.   r.   r/   rd   2  s,   €#
üù	ûîzAsyncUsers.updatere   rf   ri   rg   rj   rh   rk   úOAsyncPaginator[OrganizationUser, AsyncConversationCursorPage[OrganizationUser]]c                C  rm   rn   )rr   r   r#   r    r   r!   rs   rt   r.   r.   r/   ru   l  rv   zAsyncUsers.listr$   c             	   Ã  r…   )	rw   rH   rI   rJ   rK   TrL   rN   Nrx   rT   r.   r.   r/   rz   ¤  r†   zAsyncUsers.delete)r(   r   )r(   rƒ   )r(   r„   r{   r|   )rf   ri   rg   rj   rh   rk   r<   rB   r=   rC   r>   rD   r?   rE   r(   r‡   r}   r~   r.   r.   r.   r/   r&   õ   r‚   c                   @  ó$   e Zd Zddd„Zeddd	„ƒZd
S )r2   Úusersr%   r(   ÚNonec                 C  óB   || _ t |j¡| _t |j¡| _t |j¡| _t |j¡| _d S r*   )Ú_usersr   Úto_raw_response_wrapperrU   rd   ru   rz   ©r-   r‰   r.   r.   r/   Ú__init__Ë  ó   ÿÿÿ
ÿzUsersWithRawResponse.__init__r	   c                 C  ó   t | jjƒS r*   )r	   rŒ   r0   r,   r.   r.   r/   r0   Û  ó   zUsersWithRawResponse.rolesN©r‰   r%   r(   rŠ   )r(   r	   ©r   r€   r�   r�   r   r0   r.   r.   r.   r/   r2   Ê  ó    
r2   c                   @  rˆ   )rƒ   r‰   r&   r(   rŠ   c                 C  r‹   r*   )rŒ   r   Úasync_to_raw_response_wrapperrU   rd   ru   rz   rŽ   r.   r.   r/   r�   á  r�   z"AsyncUsersWithRawResponse.__init__r
   c                 C  r‘   r*   )r
   rŒ   r0   r,   r.   r.   r/   r0   ñ  r’   zAsyncUsersWithRawResponse.rolesN©r‰   r&   r(   rŠ   )r(   r
   r”   r.   r.   r.   r/   rƒ   à  r•   rƒ   c                   @  rˆ   )r7   r‰   r%   r(   rŠ   c                 C  ó:   || _ t|jƒ| _t|jƒ| _t|jƒ| _t|jƒ| _d S r*   )rŒ   r   rU   rd   ru   rz   rŽ   r.   r.   r/   r�   ÷  ó   ÿÿÿ
ÿz#UsersWithStreamingResponse.__init__r   c                 C  r‘   r*   )r   rŒ   r0   r,   r.   r.   r/   r0     r’   z UsersWithStreamingResponse.rolesNr“   )r(   r   r”   r.   r.   r.   r/   r7   ö  r•   r7   c                   @  rˆ   )r„   r‰   r&   r(   rŠ   c                 C  r˜   r*   )rŒ   r   rU   rd   ru   rz   rŽ   r.   r.   r/   r�     r™   z(AsyncUsersWithStreamingResponse.__init__r   c                 C  r‘   r*   )r   rŒ   r0   r,   r.   r.   r/   r0     r’   z%AsyncUsersWithStreamingResponse.rolesNr—   )r(   r   r”   r.   r.   r.   r/   r„     r•   r„   )7Ú
__future__r   Útypingr   Úhttpx2Ú r   r0   r   r   r	   r
   r   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"   Ú*types.admin.organization.organization_userr#   Ú-types.admin.organization.user_delete_responser$   Ú__all__r%   r&   r2   rƒ   r7   r„   r.   r.   r.   r/   Ú<module>   s0    ( V V