o
    ùT·jYW  ã                   @  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%m&Z&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)Ú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d0dd„ƒZed1dd„ƒZeddded	œd2dd„Zdddedœd3dd„Z	eeedddedœd4d!d"„Z
eeeddded#œd5d+d,„Zdddedœd6d.d/„ZdS )7r    Ú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)   úl/home/dinkstrade/pdmp-scanner/venv/lib/python3.10/site-packages/openai/resources/admin/organization/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ÚpermissionsúSequenceNotStr[str]Ú	role_nameÚstrr2   úOptional[str] | Omitr3   úHeaders | Noner4   úQuery | Noner5   úBody | Noner6   ú(float | httpx2.Timeout | None | NotGivenr   c             
   C  s4   | j dt|||dœtjƒt||||ddid�td�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©r7   r9   r2   Úadmin_api_key_authT©r3   r4   r5   r6   Úsecurity©ÚbodyÚoptionsÚcast_to)Ú_postr   r   ÚRoleCreateParamsr   r   ©r(   r7   r9   r2   r3   r4   r5   r6   r)   r)   r*   Úcreate-   s$   ýúûïzRoles.create©r3   r4   r5   r6   Úrole_idc             	   C  ó<   |s	t d|›�ƒ‚| jtd|d�t||||ddid�td�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}©rO   rC   TrD   ©rH   rI   ©Ú
ValueErrorÚ_getr   r   r   ©r(   rO   r3   r4   r5   r6   r)   r)   r*   Úretrieve`   ó   
û÷zRoles.retrieve©r2   r7   r9   r3   r4   r5   r6   ú$Optional[SequenceNotStr[str]] | Omitc          	   
   C  sN   |s	t d|›�ƒ‚| jtd|d�t|||dœtjƒt||||ddid�td�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
        rR   rS   rT   ©r2   r7   r9   rC   TrD   rF   )rW   rJ   r   r   r   ÚRoleUpdateParamsr   r   ©	r(   rO   r2   r7   r9   r3   r4   r5   r6   r)   r)   r*   Úupdate…   s(    
ýúûïzRoles.update©ÚafterÚlimitÚorderr3   r4   r5   r6   rd   ú
str | Omitre   ú
int | Omitrf   úLiteral['asc', 'desc'] | OmitúSyncNextCursorPage[Role]c                C  ó:   | j dtt t||||t|||dœtjƒddid�td�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
        rA   )rd   re   rf   rC   T)r3   r4   r5   r6   ÚqueryrE   )ÚpagerH   Úmodel)Ú_get_api_listr   r   r   r   r   ÚRoleListParams©r(   rd   re   rf   r3   r4   r5   r6   r)   r)   r*   Úlist»   ó&    ýúóîz
Roles.listr   c             	   C  rP   )á`  
        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
        rR   rS   rT   rC   TrD   rU   ©rW   Ú_deleter   r   r   rY   r)   r)   r*   Údeleteð   r[   zRoles.delete)r#   r$   )r#   r-   ©r7   r8   r9   r:   r2   r;   r3   r<   r4   r=   r5   r>   r6   r?   r#   r   ©rO   r:   r3   r<   r4   r=   r5   r>   r6   r?   r#   r   ©rO   r:   r2   r;   r7   r]   r9   r;   r3   r<   r4   r=   r5   r>   r6   r?   r#   r   )rd   rg   re   rh   rf   ri   r3   r<   r4   r=   r5   r>   r6   r?   r#   rj   ©rO   r:   r3   r<   r4   r=   r5   r>   r6   r?   r#   r   ©Ú__name__Ú
__module__Ú__qualname__r   r+   r/   r   r   rM   rZ   rb   rs   rx   r)   r)   r)   r*   r       óJ    	õ9÷)ô9õ;÷c                   @  r"   )7r!   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/   !  r0   z"AsyncRoles.with_streaming_responseNr1   r7   r8   r9   r:   r2   r;   r3   r<   r4   r=   r5   r>   r6   r?   r   c             
   Ã  sB   �| j dt|||dœtjƒI dH t||||ddid�td�I dH S )r@   rA   rB   NrC   TrD   rF   )rJ   r   r   rK   r   r   rL   r)   r)   r*   rM   *  s&   €ýúûïzAsyncRoles.createrN   rO   c             	   Ã  óD   �|s
t d|›�ƒ‚| jtd|d�t||||ddid�td�I dH S )	rQ   rR   rS   rT   rC   TrD   rU   NrV   rY   r)   r)   r*   rZ   ]  ó   €
û÷zAsyncRoles.retriever\   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^   rR   rS   rT   r_   NrC   TrD   rF   )rW   rJ   r   r   r   r`   r   r   ra   r)   r)   r*   rb   ‚  s*   € 
ýúûïzAsyncRoles.updaterc   rd   rg   re   rh   rf   ri   ú/AsyncPaginator[Role, AsyncNextCursorPage[Role]]c                C  rk   rl   )rp   r   r   r   r   r   rq   rr   r)   r)   r*   rs   ¸  rt   zAsyncRoles.listr   c             	   Ã  r„   )	ru   rR   rS   rT   rC   TrD   rU   Nrv   rY   r)   r)   r*   rx   í  r…   zAsyncRoles.delete)r#   r‚   )r#   rƒ   ry   rz   r{   )rd   rg   re   rh   rf   ri   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_wrapperrM   rZ   rb   rs   rx   ©r(   rˆ   r)   r)   r*   Ú__init__  ó    ÿÿÿÿ
ÿzRolesWithRawResponse.__init__N©rˆ   r    r#   r‰   ©r~   r   r€   r�   r)   r)   r)   r*   r$     ó    r$   c                   @  r‡   )	r‚   rˆ   r!   r#   r‰   c                 C  rŠ   r‹   )rŒ   r   Úasync_to_raw_response_wrapperrM   rZ   rb   rs   rx   rŽ   r)   r)   r*   r�   )  r�   z"AsyncRolesWithRawResponse.__init__N©rˆ   r!   r#   r‰   r’   r)   r)   r)   r*   r‚   (  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   rM   rZ   rb   rs   rx   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   rM   rZ   rb   rs   rx   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.organizationr   r   r   Útypes.admin.organization.roler   Ú-types.admin.organization.role_delete_responser   Ú__all__r    r!   r$   r‚   r-   rƒ   r)   r)   r)   r*   Ú<module>   s0   ( ~ ~