
    hA                    l   S SK Jr  S SKJr  S SKJr  S SKrSSKJr  SSK	J
r
JrJrJrJr  SSKJrJr  SS	KJr  SS
KJrJr  SSKJrJr  SSKJrJr  SSKJrJr  SSK J!r!J"r"  SSK#J$r$  SSK%J&r&  SSK'J(r(  SS/r) " S S\5      r* " S S\5      r+ " S S5      r, " S S5      r- " S S5      r. " S S5      r/g)    )annotations)List)LiteralN   )_legacy_response)	NOT_GIVENBodyQueryHeadersNotGiven)maybe_transformasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)SyncPage	AsyncPage)AsyncPaginatormake_request_options)permission_create_paramspermission_retrieve_params)PermissionCreateResponse)PermissionDeleteResponse)PermissionRetrieveResponsePermissionsAsyncPermissionsc            	          \ rS rSr\SS j5       r\SS j5       rSSS\S.             SS jjr\\\\SSS\S.                   SS jjr	SSS\S.           SS	 jjr
S
rg)r      c                    [        U 5      $ z
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    f/var/www/html/env/lib/python3.13/site-packages/openai/resources/fine_tuning/checkpoints/permissions.pywith_raw_responsePermissions.with_raw_response   s     *$//    c                    [        U 5      $ 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_response#Permissions.with_streaming_response(   s     055r)   Nextra_headersextra_query
extra_bodytimeoutc                   U(       d  [        SU< 35      eU R                  SU S3[        [           [	        SU0[
        R                  5      [        X4XVS9[        SS9$ 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_checkpointr9   r0   r1   r2   r3   s          r&   createPermissions.create1   s}    : +\]x\{|  !!'(C'DLQ23 -!=?W?n?no(+Q[ + " 	
 		
r)   afterlimitorder
project_idr0   r1   r2   r3   c                   U(       d  [        SU< 35      eU R                  SU S3[        UUUU	[        UUUUS.[        R
                  5      S9[        S9$ )  
**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
r6   r7   r8   rH   rI   rJ   rK   r0   r1   r2   r3   queryr=   cast_to)r@   _getr   r   r   PermissionRetrieveParamsr   
r%   rD   rH   rI   rJ   rK   r0   r1   r2   r3   s
             r&   retrievePermissions.retrieve]   s    L +\]x\{|  yy'(C'DLQ(+'%%!&!&!&&0	 /GG /#  
 	
r)   c          
     p    U(       d  [        SU< 35      eU R                  SU S3[        X#XES9[        S9$ )  
**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
r6   r7   r8   r/   rQ   r@   _deleter   r   r%   rD   r0   r1   r2   r3   s         r&   deletePermissions.delete   sY    4 +\]x\{|  ||'(C'DLQ(+Q[ -  
 	
r)    )returnr#   )r`   r,   )rD   strr9   	List[str]r0   Headers | Noner1   Query | Noner2   Body | Noner3   'float | httpx.Timeout | None | NotGivenr`   z"SyncPage[PermissionCreateResponse]rD   ra   rH   str | NotGivenrI   zint | NotGivenrJ   z-Literal['ascending', 'descending'] | NotGivenrK   rh   r0   rc   r1   rd   r2   re   r3   rf   r`   r   rD   ra   r0   rc   r1   rd   r2   re   r3   rf   r`   r   __name__
__module____qualname____firstlineno__r   r'   r-   r   rE   rV   r]   __static_attributes__r_   r)   r&   r   r      sV   0 0 6 6 )-$("&;D*
%(*
 	*
 &*
 "*
  *
 9*
 
,*
` !* )?H%. )-$("&;D<
%(<
 	<

 <
 =<
 #<
 &<
 "<
  <
 9<
 
$<
H )-$("&;D$
%($
 &$
 "$
  $
 9$
 
"$
 $
r)   c            	          \ rS rSr\SS j5       r\SS j5       rSSS\S.             SS jjr\\\\SSS\S.                   SS jjr	SSS\S.           SS	 jjr
S
rg)r      c                    [        U 5      $ r"   )AsyncPermissionsWithRawResponser$   s    r&   r'   "AsyncPermissions.with_raw_response   s     /t44r)   c                    [        U 5      $ r+   )%AsyncPermissionsWithStreamingResponser$   s    r&   r-   (AsyncPermissions.with_streaming_response   s     5T::r)   Nr/   c                   U(       d  [        SU< 35      eU R                  SU S3[        [           [	        SU0[
        R                  5      [        X4XVS9[        SS9$ r5   )r@   rA   r   r   r   r   rB   r   rC   s          r&   rE   AsyncPermissions.create   s}    : +\]x\{|  !!'(C'DLQ34 -!=?W?n?no(+Q[ + " 	
 		
r)   rG   c                  #    U(       d  [        SU< 35      eU R                  SU S3[        UUUU	[        UUUUS.[        R
                  5      I Sh  vN S9[        S9I Sh  vN $  N N7f)rM   r6   r7   r8   rN   NrO   rQ   )r@   rS   r   r   r   rT   r   rU   s
             r&   rV   AsyncPermissions.retrieve  s     L +\]x\{|  YY'(C'DLQ(+'%1!&!&!&&0	 /GG  /#  
 
 	

s$   AA.A*A.%A,&A.,A.c          
        #    U(       d  [        SU< 35      eU R                  SU S3[        X#XES9[        S9I Sh  vN $  N7f)rY   r6   r7   r8   r/   rQ   NrZ   r\   s         r&   r]   AsyncPermissions.delete@  sf     4 +\]x\{|  \\'(C'DLQ(+Q[ - " 
 
 	
 
s   ;AAAr_   )r`   rs   )r`   rv   )rD   ra   r9   rb   r0   rc   r1   rd   r2   re   r3   rf   r`   zMAsyncPaginator[PermissionCreateResponse, AsyncPage[PermissionCreateResponse]]rg   ri   rj   r_   r)   r&   r   r      sW   5 5 ; ; )-$("&;D*
%(*
 	*
 &*
 "*
  *
 9*
 
W*
` !* )?H%. )-$("&;D<
%(<
 	<

 <
 =<
 #<
 &<
 "<
  <
 9<
 
$<
H )-$("&;D$
%($
 &$
 "$
  $
 9$
 
"$
 $
r)   c                      \ rS rSrSS jrSrg)r#   ig  c                    Xl         [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR
                  5      U l        g N)_permissionsr   to_raw_response_wrapperrE   rV   r]   r%   permissionss     r&   __init__#PermissionsWithRawResponse.__init__h  s]    '&>>
 )@@  
 '>>
r)   r   rE   r]   rV   Nr   r   r`   Nonerk   rl   rm   rn   r   ro   r_   r)   r&   r#   r#   g      
r)   r#   c                      \ rS rSrSS jrSrg)rs   iv  c                    Xl         [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR
                  5      U l        g r   )r   r   async_to_raw_response_wrapperrE   rV   r]   r   s     r&   r   (AsyncPermissionsWithRawResponse.__init__w  s]    '&DD
 )FF  
 'DD
r)   r   Nr   r   r`   r   r   r_   r)   r&   rs   rs   v  r   r)   rs   c                      \ rS rSrSS jrSrg)r,   i  c                    Xl         [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l        g r   )r   r   rE   rV   r]   r   s     r&   r   )PermissionsWithStreamingResponse.__init__  sK    '2
 5  
 3
r)   r   Nr   r   r_   r)   r&   r,   r,     r   r)   r,   c                      \ rS rSrSS jrSrg)rv   i  c                    Xl         [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l        g r   )r   r   rE   rV   r]   r   s     r&   r   .AsyncPermissionsWithStreamingResponse.__init__  sK    '8
 ;  
 9
r)   r   Nr   r   r_   r)   r&   rv   rv     r   r)   rv   )0
__future__r   typingr   typing_extensionsr   httpx r   _typesr   r	   r
   r   r   _utilsr   r   _compatr   	_resourcer   r   	_responser   r   
paginationr   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#   rs   r,   rv   r_   r)   r&   <module>r      s    #  %  ! @ @ ( ; Z . A b a a e,
-b
/ b
Jb
' b
J
 

 

 

 
r)   