
    AThC                    p   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 ddl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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gZ* G d de      Z+ G d de      Z, G d d      Z- G d d      Z. G d d      Z/ G d d      Z0y)    )annotations)List)LiteralN   )_legacy_response)	NOT_GIVENBodyQueryHeadersNotGiven)maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)SyncPage	AsyncPageSyncCursorPageAsyncCursorPage)AsyncPaginatormake_request_options)permission_create_paramspermission_retrieve_params)PermissionCreateResponse)PermissionDeleteResponse)PermissionRetrieveResponsePermissionsAsyncPermissionsc            	          e Zd Zed	d       Zed
d       Zddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	y)r   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
        )PermissionsWithRawResponseselfs    /var/www/catia.catastroantioquia-mas.com/valormas/lib/python3.12/site-packages/openai/resources/fine_tuning/checkpoints/permissions.pywith_raw_responsezPermissions.with_raw_response   s     *$//    c                    t        |       S 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
        ) PermissionsWithStreamingResponser$   s    r&   with_streaming_responsez#Permissions.with_streaming_response%   s     055r(   Nextra_headersextra_query
extra_bodytimeoutc                   |st        d|      | j                  d| dt        t           t	        d|it
        j                        t        ||||      t        d      S a?  
        **NOTE:** Calling this endpoint requires an [admin API key](../admin-api-keys).

        This enables organization owners to share fine-tuned models with other projects
        in their organization.

        Args:
          project_ids: The project identifiers to grant access to.

          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
        JExpected a non-empty value for `fine_tuned_model_checkpoint` but received /fine_tuning/checkpoints//permissionsproject_idsr-   post)pagebodyoptionsmodelmethod)
ValueError_get_api_listr   r   r   r   PermissionCreateParamsr   r%   fine_tuned_model_checkpointr7   r.   r/   r0   r1   s          r&   createzPermissions.create.   s    : +\]x\{|  !!'(C'DLQ23 -!=?W?n?no(+Q[el + " 	
 		
r(   afterlimitorder
project_idr.   r/   r0   r1   c                   |st        d|      | j                  d| dt        t           t	        ||||	t        ||||dt        j                              t              S a  
        **NOTE:** This endpoint requires an [admin API key](../admin-api-keys).

        Organization owners can use this endpoint to view all permissions for a
        fine-tuned model checkpoint.

        Args:
          after: Identifier for the last permission ID from the previous pagination request.

          limit: Number of permissions to retrieve.

          order: The order in which to retrieve permissions.

          project_id: The ID of the project to get permissions for.

          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
        r4   r5   r6   )rE   rF   rG   rH   )r.   r/   r0   r1   query)r9   r;   r<   )r>   r?   r   r   r   r   r   PermissionRetrieveParams
r%   rB   rE   rF   rG   rH   r.   r/   r0   r1   s
             r&   retrievezPermissions.retrieveZ   s    L +\]x\{|  !!'(C'DLQ :;(+'%%!&!&!&&0	 /GG -% " 
 	
r(   c          	         |st        d|      |st        d|      | j                  d| d| t        ||||      t              S )  
        **NOTE:** This endpoint requires an [admin API key](../admin-api-keys).

        Organization owners can use this endpoint to delete a permission for a
        fine-tuned model checkpoint.

        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
        r4   <Expected a non-empty value for `permission_id` but received r5   /permissions/r-   r;   cast_tor>   _deleter   r   r%   permission_idrB   r.   r/   r0   r1   s          r&   deletezPermissions.delete   s|    6 +\]x\{|  [\i[lmnn||'(C'DMR_Q`a(+Q[el -  
 	
r(   )returnr#   )rZ   r+   )rB   strr7   	List[str]r.   Headers | Noner/   Query | Noner0   Body | Noner1   'float | httpx.Timeout | None | NotGivenrZ   z"SyncPage[PermissionCreateResponse])rB   r[   rE   str | NotGivenrF   int | NotGivenrG   -Literal['ascending', 'descending'] | NotGivenrH   ra   r.   r]   r/   r^   r0   r_   r1   r`   rZ   z*SyncCursorPage[PermissionRetrieveResponse]rX   r[   rB   r[   r.   r]   r/   r^   r0   r_   r1   r`   rZ   r   
__name__
__module____qualname__r   r'   r,   r   rC   rN   rY    r(   r&   r   r      s[   0 0 6 6 )-$("&;D*
%(*
 	*
 &*
 "*
  *
 9*
 
,*
` !* )?H%. )-$("&;D=
%(=
 	=

 =
 ==
 #=
 &=
 "=
  =
 9=
 
4=
L )-$("&;D'
'
 &)	'
 &'
 "'
  '
 9'
 
"'
r(   c            	          e Zd Zed	d       Zed
d       Zddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZeeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ	y)r   c                    t        |       S r"   )AsyncPermissionsWithRawResponser$   s    r&   r'   z"AsyncPermissions.with_raw_response   s     /t44r(   c                    t        |       S r*   )%AsyncPermissionsWithStreamingResponser$   s    r&   r,   z(AsyncPermissions.with_streaming_response   s     5T::r(   Nr-   c                   |st        d|      | j                  d| dt        t           t	        d|it
        j                        t        ||||      t        d      S r3   )r>   r?   r   r   r   r   r@   r   rA   s          r&   rC   zAsyncPermissions.create   s    : +\]x\{|  !!'(C'DLQ34 -!=?W?n?no(+Q[el + " 	
 		
r(   rD   c                   |st        d|      | j                  d| dt        t           t	        ||||	t        ||||dt        j                              t              S rJ   )r>   r?   r   r   r   r   r   rL   rM   s
             r&   rN   zAsyncPermissions.retrieve  s    L +\]x\{|  !!'(C'DLQ !;<(+'%%!&!&!&&0	 /GG -% " 
 	
r(   c          	        K   |st        d|      |st        d|      | j                  d| d| t        ||||      t               d{   S 7 w)rP   r4   rQ   r5   rR   r-   rS   NrU   rW   s          r&   rY   zAsyncPermissions.deleteB  s     6 +\]x\{|  [\i[lmnn\\'(C'DMR_Q`a(+Q[el - " 
 
 	
 
s   AAAA)rZ   rl   )rZ   rn   )rB   r[   r7   r\   r.   r]   r/   r^   r0   r_   r1   r`   rZ   zMAsyncPaginator[PermissionCreateResponse, AsyncPage[PermissionCreateResponse]])rB   r[   rE   ra   rF   rb   rG   rc   rH   ra   r.   r]   r/   r^   r0   r_   r1   r`   rZ   zWAsyncPaginator[PermissionRetrieveResponse, AsyncCursorPage[PermissionRetrieveResponse]]rd   re   ri   r(   r&   r   r      s]   5 5 ; ; )-$("&;D*
%(*
 	*
 &*
 "*
  *
 9*
 
W*
` !* )?H%. )-$("&;D=
%(=
 	=

 =
 ==
 #=
 &=
 "=
  =
 9=
 
a=
L )-$("&;D'
'
 &)	'
 &'
 "'
  '
 9'
 
"'
r(   c                      e Zd ZddZy)r#   c                    || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        y N)_permissionsr   to_raw_response_wrapperrC   rN   rY   r%   permissionss     r&   __init__z#PermissionsWithRawResponse.__init__m  s_    '&>>
 )@@  
 '>>
r(   Nrx   r   rZ   Nonerf   rg   rh   ry   ri   r(   r&   r#   r#   l      
r(   r#   c                      e Zd ZddZy)rl   c                    || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        y rt   )ru   r   async_to_raw_response_wrapperrC   rN   rY   rw   s     r&   ry   z(AsyncPermissionsWithRawResponse.__init__|  s_    '&DD
 )FF  
 'DD
r(   Nrx   r   rZ   r{   r|   ri   r(   r&   rl   rl   {  r}   r(   rl   c                      e Zd ZddZy)r+   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        y rt   )ru   r   rC   rN   rY   rw   s     r&   ry   z)PermissionsWithStreamingResponse.__init__  sM    '2
 5  
 3
r(   Nrz   r|   ri   r(   r&   r+   r+     r}   r(   r+   c                      e Zd ZddZy)rn   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        y rt   )ru   r   rC   rN   rY   rw   s     r&   ry   z.AsyncPermissionsWithStreamingResponse.__init__  sM    '8
 ;  
 9
r(   Nr   r|   ri   r(   r&   rn   rn     r}   r(   rn   )1
__future__r   typingr   typing_extensionsr   httpx r   _typesr   r	   r
   r   r   _utilsr   _compatr   	_resourcer   r   	_responser   r   
paginationr   r   r   r   _base_clientr   r   types.fine_tuning.checkpointsr   r   8types.fine_tuning.checkpoints.permission_create_responser   8types.fine_tuning.checkpoints.permission_delete_responser   :types.fine_tuning.checkpoints.permission_retrieve_responser   __all__r   r   r#   rl   r+   rn   ri   r(   r&   <module>r      s    #  %  ! @ @ & ' ; Z O O A b a a e,
-f
/ f
Rf
' f
R
 

 

 

 
r(   