o
    ùT·jvZ  ã                   @  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 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/m0Z0m1Z1m2Z2 ddl3m4Z4 ddl5m6Z6 ddl7m8Z8 ddgZ9G dd„ de$ƒZ:G dd„ de%ƒZ;G dd„ dƒZ<G dd„ dƒZ=G dd„ dƒZ>G dd„ dƒZ?dS ) é    )Úannotations)ÚLiteralNé   )Ú_legacy_responseé   )ÚRolesÚ
AsyncRolesÚRolesWithRawResponseÚAsyncRolesWithRawResponseÚRolesWithStreamingResponseÚAsyncRolesWithStreamingResponse)ÚUsersÚ
AsyncUsersÚUsersWithRawResponseÚAsyncUsersWithRawResponseÚUsersWithStreamingResponseÚAsyncUsersWithStreamingResponse)Ú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)Úgroup_list_paramsÚgroup_create_paramsÚgroup_update_params)ÚGroup)ÚGroupDeleteResponse)ÚGroupUpdateResponseÚGroupsÚAsyncGroupsc                   @  ó¸   e Zd Zed0dd„ƒZed1dd„ƒZed2d	d
„ƒZed3dd„ƒZdddedœd4dd„Z	dddedœd5dd„Z
dddedœd6d!d"„Zeeeddded#œd7d+d,„Zdddedœd8d.d/„ZdS )9r,   Úreturnr   c                 C  ó
   t | jƒS ©N)r   Ú_client©Úself© r5   út/home/dinkstrade/pdmp-scanner/venv/lib/python3.10/site-packages/openai/resources/admin/organization/groups/groups.pyÚusers*   ó   
zGroups.usersr   c                 C  r0   r1   )r   r2   r3   r5   r5   r6   Úroles.   r8   zGroups.rolesÚGroupsWithRawResponsec                 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:   r3   r5   r5   r6   Úwith_raw_response2   ó   zGroups.with_raw_responseÚGroupsWithStreamingResponsec                 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?   r3   r5   r5   r6   Úwith_streaming_response<   ó   zGroups.with_streaming_responseN©Úextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚnameÚstrrD   úHeaders | NonerE   úQuery | NonerF   úBody | NonerG   ú(float | httpx2.Timeout | None | NotGivenr)   c             
   C  s0   | j dtd|itjƒt||||ddid�td�S )á�  
        Creates a new group in the organization.

        Args:
          name: Human readable name for the group.

          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/groupsrH   Úadmin_api_key_authT©rD   rE   rF   rG   Úsecurity©ÚbodyÚoptionsÚcast_to)Ú_postr   r'   ÚGroupCreateParamsr%   r)   ©r4   rH   rD   rE   rF   rG   r5   r5   r6   ÚcreateE   s   ûözGroups.createÚgroup_idc             	   C  ó<   |s	t d|›�ƒ‚| jtd|d�t||||ddid�td�S )áF  
        Retrieves a group.

        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
        ú7Expected a non-empty value for `group_id` but received ú/organization/groups/{group_id}©r[   rP   TrQ   ©rU   rV   ©Ú
ValueErrorÚ_getr   r%   r)   ©r4   r[   rD   rE   rF   rG   r5   r5   r6   Úretrievek   ó   
û÷zGroups.retriever+   c             
   C  sJ   |s	t d|›�ƒ‚| jtd|d�td|itjƒt||||ddid�td�S )	áƒ  
        Updates a group's information.

        Args:
          name: New display name for the group.

          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`   rH   rP   TrQ   rS   )rc   rW   r   r   r(   ÚGroupUpdateParamsr%   r+   ©r4   r[   rH   rD   rE   rF   rG   r5   r5   r6   Úupdate�   s   
ûözGroups.update©ÚafterÚlimitÚorderrD   rE   rF   rG   rm   ú
str | Omitrn   ú
int | Omitro   úLiteral['asc', 'desc'] | OmitúSyncNextCursorPage[Group]c                C  ó:   | j dtt t||||t|||dœtjƒddid�td�S ©ax  
        Lists all groups in the organization.

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

          limit: A limit on the number of groups to be returned. Limit can range between 0 and
              1000, and the default is 100.

          order: Specifies the sort order of the returned groups.

          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
        rO   )rm   rn   ro   rP   T)rD   rE   rF   rG   ÚqueryrR   )ÚpagerU   Úmodel)Ú_get_api_listr"   r)   r%   r   r&   ÚGroupListParams©r4   rm   rn   ro   rD   rE   rF   rG   r5   r5   r6   Úlist¹   ó&   #ýúóîzGroups.listr*   c             	   C  r\   )áZ  
        Deletes a group 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
        r^   r_   r`   rP   TrQ   ra   ©rc   Ú_deleter   r%   r*   re   r5   r5   r6   Údeleteñ   rg   zGroups.delete)r/   r   )r/   r   )r/   r:   )r/   r?   ©rH   rI   rD   rJ   rE   rK   rF   rL   rG   rM   r/   r)   ©r[   rI   rD   rJ   rE   rK   rF   rL   rG   rM   r/   r)   ©r[   rI   rH   rI   rD   rJ   rE   rK   rF   rL   rG   rM   r/   r+   )rm   rp   rn   rq   ro   rr   rD   rJ   rE   rK   rF   rL   rG   rM   r/   rs   ©r[   rI   rD   rJ   rE   rK   rF   rL   rG   rM   r/   r*   ©Ú__name__Ú
__module__Ú__qualname__r   r7   r9   r=   rA   r   rZ   rf   rk   r   r|   r�   r5   r5   r5   r6   r,   )   óJ    	÷,÷,ö,õ>÷c                   @  r.   )9r-   r/   r   c                 C  r0   r1   )r   r2   r3   r5   r5   r6   r7     r8   zAsyncGroups.usersr   c                 C  r0   r1   )r   r2   r3   r5   r5   r6   r9     r8   zAsyncGroups.rolesÚAsyncGroupsWithRawResponsec                 C  r;   r<   )r‹   r3   r5   r5   r6   r=      r>   zAsyncGroups.with_raw_responseÚ AsyncGroupsWithStreamingResponsec                 C  r;   r@   )rŒ   r3   r5   r5   r6   rA   *  rB   z#AsyncGroups.with_streaming_responseNrC   rH   rI   rD   rJ   rE   rK   rF   rL   rG   rM   r)   c             
   Ã  s>   �| j dtd|itjƒI dH t||||ddid�td�I dH S )rN   rO   rH   NrP   TrQ   rS   )rW   r   r'   rX   r%   r)   rY   r5   r5   r6   rZ   3  s   €ûözAsyncGroups.creater[   c             	   Ã  óD   �|s
t d|›�ƒ‚| jtd|d�t||||ddid�td�I dH S )	r]   r^   r_   r`   rP   TrQ   ra   Nrb   re   r5   r5   r6   rf   Y  ó   €
û÷zAsyncGroups.retriever+   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 )
rh   r^   r_   r`   rH   NrP   TrQ   rS   )rc   rW   r   r   r(   ri   r%   r+   rj   r5   r5   r6   rk   ~  s   €
ûözAsyncGroups.updaterl   rm   rp   rn   rq   ro   rr   ú1AsyncPaginator[Group, AsyncNextCursorPage[Group]]c                C  rt   ru   )ry   r#   r)   r%   r   r&   rz   r{   r5   r5   r6   r|   §  r}   zAsyncGroups.listr*   c             	   Ã  r�   )	r~   r^   r_   r`   rP   TrQ   ra   Nr   re   r5   r5   r6   r�   ß  rŽ   zAsyncGroups.delete)r/   r   )r/   r   )r/   r‹   )r/   rŒ   r‚   rƒ   r„   )rm   rp   rn   rq   ro   rr   rD   rJ   rE   rK   rF   rL   rG   rM   r/   r�   r…   r†   r5   r5   r5   r6   r-     rŠ   c                   @  ó2   e Zd Zddd„Zeddd	„ƒZeddd„ƒZdS )r:   Úgroupsr,   r/   ÚNonec                 C  óP   || _ t |j¡| _t |j¡| _t |j¡| _t |j¡| _t |j¡| _d S r1   )Ú_groupsr   Úto_raw_response_wrapperrZ   rf   rk   r|   r�   ©r4   r‘   r5   r5   r6   Ú__init__  ó    ÿÿÿÿ
ÿzGroupsWithRawResponse.__init__r   c                 C  ó   t | jjƒS r1   )r   r”   r7   r3   r5   r5   r6   r7     ó   zGroupsWithRawResponse.usersr	   c                 C  r™   r1   )r	   r”   r9   r3   r5   r5   r6   r9     rš   zGroupsWithRawResponse.rolesN©r‘   r,   r/   r’   )r/   r   )r/   r	   ©r‡   rˆ   r‰   r—   r   r7   r9   r5   r5   r5   r6   r:     ó    
r:   c                   @  r�   )r‹   r‘   r-   r/   r’   c                 C  r“   r1   )r”   r   Úasync_to_raw_response_wrapperrZ   rf   rk   r|   r�   r–   r5   r5   r6   r—   #  r˜   z#AsyncGroupsWithRawResponse.__init__r   c                 C  r™   r1   )r   r”   r7   r3   r5   r5   r6   r7   6  rš   z AsyncGroupsWithRawResponse.usersr
   c                 C  r™   r1   )r
   r”   r9   r3   r5   r5   r6   r9   :  rš   z AsyncGroupsWithRawResponse.rolesN©r‘   r-   r/   r’   )r/   r   )r/   r
   rœ   r5   r5   r5   r6   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 r1   )r”   r    rZ   rf   rk   r|   r�   r–   r5   r5   r6   r—   @  ó    ÿÿÿÿ
ÿz$GroupsWithStreamingResponse.__init__r   c                 C  r™   r1   )r   r”   r7   r3   r5   r5   r6   r7   S  rš   z!GroupsWithStreamingResponse.usersr   c                 C  r™   r1   )r   r”   r9   r3   r5   r5   r6   r9   W  rš   z!GroupsWithStreamingResponse.rolesNr›   )r/   r   )r/   r   rœ   r5   r5   r5   r6   r?   ?  r�   r?   c                   @  r�   )rŒ   r‘   r-   r/   r’   c                 C  r    r1   )r”   r!   rZ   rf   rk   r|   r�   r–   r5   r5   r6   r—   ]  r¡   z)AsyncGroupsWithStreamingResponse.__init__r   c                 C  r™   r1   )r   r”   r7   r3   r5   r5   r6   r7   p  rš   z&AsyncGroupsWithStreamingResponse.usersr   c                 C  r™   r1   )r   r”   r9   r3   r5   r5   r6   r9   t  rš   z&AsyncGroupsWithStreamingResponse.rolesNrŸ   )r/   r   )r/   r   rœ   r5   r5   r5   r6   rŒ   \  r�   rŒ   )@Ú
__future__r   Útyping_extensionsr   Úhttpx2Ú r   r9   r   r   r	   r
   r   r   r7   r   r   r   r   r   r   Ú_typesr   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.groupr)   Ú.types.admin.organization.group_delete_responser*   Ú.types.admin.organization.group_update_responser+   Ú__all__r,   r-   r:   r‹   r?   rŒ   r5   r5   r5   r6   Ú<module>   s4     $ o o