
    j@                     V   d dl Z d dl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 ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl m!Z! ddl"m#Z# ddl$m%Z% ddl&m'Z'  ejP                  ejR                  d      Z* G d d      Z+ G d d      Z,y)    N)JSONDecodeError   )ApiError)AsyncClientWrapperSyncClientWrapper)AsyncHttpResponseHttpResponse)parse_obj_as)RequestOptions)'convert_and_respect_annotation_metadata)ForbiddenError)UnauthorizedError)AttachmentPage)(CompleteMultipartUploadRequestEntityType)ErrorMessage)MultipartUploadPart)StartMultipartUploadResponse   )AttachmentListRequestEntityType)#DownloadAttachmentRequestEntityType)%StartMultipartUploadRequestEntityType)!UploadAttachmentRequestEntityType.c                   F   e Zd ZdefdZdddddedededed	ej                  e	   d
ej                  e	   dej                  e
   dee   fdZeeedddededede	dedej                   e   dej                  e   dej                  e   dej                  e   dej                  e
   ded   fdZeeedddededede	dedej                   e   dej                  e   dej                  e   dej                  e   dej                  e
   ded   fdZej*                  ddddedededededej                  e   dej                  e
   dej.                  eej.                  e         fd       Zeedddede	dedededej                  e   dej                  e   dej                  e
   dee   fdZdddddedededej<                  eej                  ej>                     f   dej                  e   dej                  e   dej                  e
   ded   fd Z y)!RawAttachmentsClientclient_wrapperc                    || _         y N_client_wrapperselfr   s     }/Users/manta/Documents/Projects/TheRoad-I1/backend/.venv/lib/python3.12/site-packages/opik/rest_api/attachments/raw_client.py__init__zRawAttachmentsClient.__init__   
    -    Npagesizerequest_options
project_identity_type	entity_idpathr'   r(   r)   returnc                   | j                   j                  j                  dd||||||d|      }	 d|j                  cxk  rdk  rGn nDt	        j
                  t        t        t        |j                                     }	t        ||	      S |j                  d	k(  rt        t        |j                        t	        j
                  t        j                  t        j                     t        t        j                  t        j                     |j                                     
      |j                  dk(  rUt        t        |j                        t	        j
                  t         t        t         |j                                     
      |j                         }
t%        |j                  t        |j                        |
      # t"        $ r6 t%        |j                  t        |j                        |j&                        w xY w)a  
        Attachments list for entity

        Parameters
        ----------
        project_id : str

        entity_type : AttachmentListRequestEntityType

        entity_id : str

        path : str

        page : typing.Optional[int]

        size : typing.Optional[int]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        HttpResponse[AttachmentPage]
            Attachment Resource
        v1/private/attachment/listGETr'   r(   r*   r+   r,   r-   methodparamsr)      ,  type_object_responsedata  headersbody  status_coder@   rA   )r   httpx_clientrequestrD   typingcastr   r
   jsonr	   r   dictr@   OptionalAnyr   r   r   r   textr!   r*   r+   r,   r-   r'   r(   r)   	_response_data_response_jsons              r"   attachment_listz$RawAttachmentsClient.attachment_list!   s   H ((55==((*& , > 
	"	ti++1c1" , ) 0 $YUCC$$+' !2!23

3$"(//&**"=$-NN$4	 	 $$+$ !2!23$$".$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   AG DG ?Hproject_namecontainer_id	mime_typer)   	file_name	file_size	upload_iduploaded_file_partsrT   rU   rV   c       
            | j                   j                  j                  dd|||||||	|t        |t        j
                  t           d      d	ddi|
t              }	 d	|j                  cxk  rd
k  rn nt        |d      S |j                  dk(  rt        t        |j                        t	        j                  t        j                  t        j                     t!        t        j                  t        j                     |j#                                           |j                  dk(  rUt%        t        |j                        t	        j                  t&        t!        t&        |j#                                           |j#                         }t+        |j                  t        |j                        |      # t(        $ r6 t+        |j                  t        |j                        |j,                        w xY w)a  
        Complete multipart attachment upload

        Parameters
        ----------
        file_name : str

        entity_type : CompleteMultipartUploadRequestEntityType

        entity_id : str

        file_size : int

        upload_id : str

        uploaded_file_parts : typing.Sequence[MultipartUploadPart]

        project_name : typing.Optional[str]
            If null, the default project is used

        container_id : typing.Optional[str]

        mime_type : typing.Optional[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        HttpResponse[None]
        %v1/private/attachment/upload-completePOSTwriter:   
annotation	direction	rW   rT   r+   r,   rU   rX   rV   rY   rZ   content-typeapplication/jsonr4   rI   r@   r)   omitr6   r7   Nr;   r>   r8   r?   rB   rC   r   rE   rF   r   rG   Sequencer   OMITrD   r	   r   rJ   r@   rH   rK   rL   r
   rI   r   r   r   r   rM   r!   rW   r+   r,   rX   rY   rZ   rT   rU   rV   r)   rO   rQ   s                r"   complete_multi_part_uploadz/RawAttachmentsClient.complete_multi_part_uploadw   s   Z ((55==3& ,*& ,&&&'N/FOOL_<`ls(  2 ,) > 
	,	ti++1c1#YTBB$$+' !2!23

3$"(//&**"=$-NN$4	 	 $$+$ !2!23$$".$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	t   $F< DF< <?G;c       
            | j                   j                  j                  dd|||||||	|t        |t        j
                  t           d      d	ddi|
t              }	 d	|j                  cxk  rd
k  rn nt        |d      S |j                  dk(  rt        t        |j                        t	        j                  t        j                  t        j                     t!        t        j                  t        j                     |j#                                           |j                  dk(  rUt%        t        |j                        t	        j                  t&        t!        t&        |j#                                           |j#                         }t+        |j                  t        |j                        |      # t(        $ r6 t+        |j                  t        |j                        |j,                        w xY w)a  
        Delete attachments

        Parameters
        ----------
        file_name : str

        entity_type : CompleteMultipartUploadRequestEntityType

        entity_id : str

        file_size : int

        upload_id : str

        uploaded_file_parts : typing.Sequence[MultipartUploadPart]

        project_name : typing.Optional[str]
            If null, the default project is used

        container_id : typing.Optional[str]

        mime_type : typing.Optional[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        HttpResponse[None]
        v1/private/attachment/deleter]   r^   r_   rb   rc   rd   re   r6   r7   Nr;   r>   r8   r?   rB   rC   rg   rj   s                r"   delete_attachmentsz'RawAttachmentsClient.delete_attachments   s   Z ((55==*& ,*& ,&&&'N/FOOL_<`ls(  2 ,) > 
	,	ti++1c1#YTBB$$+' !2!23

3$"(//&**"=$-NN$4	 	 $$+$ !2!23$$".$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	trl   workspace_namer)   rq   c             #      	K   | j                   j                  j                  dd||||||d      5 	dt        t        j
                  t              f	fd} |        ddd       y# 1 sw Y   yxY ww)aq  
        Download attachment from MinIO

        Parameters
        ----------
        container_id : str

        entity_type : DownloadAttachmentRequestEntityType

        entity_id : str

        file_name : str

        mime_type : str

        workspace_name : typing.Optional[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.

        Returns
        -------
        typing.Iterator[HttpResponse[typing.Iterator[bytes]]]
            Attachment Resource
        v1/private/attachment/downloadr1   rq   rU   r+   r,   rW   rV   r3   r.   c                     	 dj                   cxk  rdk  r=n n:j                  dd       nd } t        d j                  |       D              S j	                          j                   dk(  rt        t        j                        t        j                  t        j                  t        j                     t        t        j                  t        j                     j                                     	      j                   d
k(  rUt        t        j                        t        j                  t        t        t        j                                     	      j                         }t#        j                   t        j                        |      # t         $ r6 t#        j                   t        j                        j$                        w xY w)Nr6   r7   
chunk_sizec              3       K   | ]  }|  y wr    .0_chunks     r"   	<genexpr>zKRawAttachmentsClient.download_attachment.<locals>.stream.<locals>.<genexpr>q  s     5xKwfKws   rv   r;   r>   r8   r?   rB   rC   )rD   getr	   
iter_bytesreadr   rJ   r@   rG   rH   rK   rL   r
   rI   r   r   r   r   rM   _chunk_sizerQ   rO   r)   s     r"   streamz8RawAttachmentsClient.download_attachment.<locals>.streaml  s   !i339c9Q`Qlo&9&9,&Mrv+%.5x9K_K_kvK_Kw5x   NN$ ,,3/$():):$;!' &

 ; ,*0//&***E,5NN,<!""	 	 !,,3,$():):$;!' , ,*6,5NN,<!""	 	 &/^^%5N
 9+@+@$yO`O`Jahvww	 ' "$-$9$94	HYHYCZajaoao s   AF DF ?GN)r   rE   r   r	   rG   Iteratorbytes
r!   rU   r+   r,   rW   rV   rq   r)   r   rO   s
          ` @r"   download_attachmentz(RawAttachmentsClient.download_attachment9  s     J !!..55,"0 ,*&&& , 6 
 #xL)?@ #xJ (Ng
 
 
s   1A9/A-$	A9-A62A9rV   rT   r)   num_of_file_partsc                $   | j                   j                  j                  dd|||||||dddi|t              }		 d|	j                  cxk  rdk  rGn nDt        j                  t        t        t        |	j                         	            }
t        |	|

      S |	j                  dk(  rt        t        |	j                        t        j                  t
        j                  t
        j                     t        t
        j                  t
        j                     |	j                         	                  |	j                  dk(  rUt!        t        |	j                        t        j                  t"        t        t"        |	j                         	                  |	j                         }t'        |	j                  t        |	j                        |      # t$        $ r6 t'        |	j                  t        |	j                        |	j(                        w xY w)ad  
        Start multipart attachment upload

        Parameters
        ----------
        file_name : str

        num_of_file_parts : int

        entity_type : StartMultipartUploadRequestEntityType

        entity_id : str

        path : str

        mime_type : typing.Optional[str]

        project_name : typing.Optional[str]
            If null, the default project is used

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        HttpResponse[StartMultipartUploadResponse]
            MultipartUploadResponse
        "v1/private/attachment/upload-startr]   rW   r   rV   rT   r+   r,   r-   rc   rd   re   r6   r7   r8   r;   r>   r?   rB   rC   )r   rE   rF   ri   rD   rG   rH   r   r
   rI   r	   r   rJ   r@   rK   rL   r   r   r   r   rM   r!   rW   r   r+   r,   r-   rV   rT   r)   rO   rP   rQ   s               r"   start_multi_part_uploadz,RawAttachmentsClient.start_multi_part_upload  s   P ((55==0&%6& ,*&  2 ,! > 
	$"	ti++1c10 : ) 0 $YUCC$$+' !2!23

3$"(//&**"=$-NN$4	 	 $$+$ !2!23$$".$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   AG DG ?HrT   rV   r)   rF   c                   | j                   j                  j                  dd|||||d||t              }	 d|j                  cxk  rdk  rn nt        |d      S |j                  d	k(  rt        t        |j                        t        j                  t        j                  t        j                     t        t        j                  t        j                     |j                         
                  |j                  dk(  rUt        t        |j                        t        j                  t         t        t         |j                         
                  |j                         }	t%        |j                  t        |j                        |	      # t"        $ r6 t%        |j                  t        |j                        |j&                        w xY w)a  
        Upload attachment to MinIO

        Parameters
        ----------
        file_name : str

        entity_type : UploadAttachmentRequestEntityType

        entity_id : str

        request : typing.Dict[str, typing.Optional[typing.Any]]

        project_name : typing.Optional[str]

        mime_type : typing.Optional[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        HttpResponse[None]
        v1/private/attachment/uploadPUTrW   rT   rV   r+   r,   r4   r5   rI   r)   rf   r6   r7   Nr;   r>   r8   r?   rB   rC   )r   rE   rF   ri   rD   r	   r   rJ   r@   rG   rH   rK   rL   r
   rI   r   r   r   r   rM   
r!   rW   r+   r,   rF   rT   rV   r)   rO   rQ   s
             r"   upload_attachmentz&RawAttachmentsClient.upload_attachment  s   F ((55==*& ,&*& + > 
		ti++1c1#YTBB$$+' !2!23

3$"(//&**"=$-NN$4	 	 $$+$ !2!23$$".$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   $F DF ?G)!__name__
__module____qualname__r   r#   strr   rG   rK   intr   r	   r   rR   ri   r   rh   r   rk   ro   
contextlibcontextmanagerr   r   r   r   r   r   r   r   DictrL   r   rx   r%   r"   r   r      s/   .*; . &*%);?Tp Tp 5	Tp
 Tp Tp ooc"Tp ooc"Tp  8Tp 
n	%Tp~ .2-1*.;?_p _p >	_p
 _p _p _p $__-@A_p ooc*_p ooc*_p ??3'_p  8_p 
d	_pT .2-1*.;?_p _p >	_p
 _p _p _p $__-@A_p ooc*_p ooc*_p ??3'_p  8_p 
d	_pB  04;?W W 9	W
 W W W ,W  8W 
fooe&<=	>W WB +/-1;?]p ]p 	]p
 ;]p ]p ]p ??3']p ooc*]p  8]p 
2	3]pL .2*.;?Mp Mp 7	Mp
 Mp S&//&**"==>Mp ooc*Mp ??3'Mp  8Mp 
d	Mpr%   r   c                   F   e Zd ZdefdZdddddedededed	ej                  e	   d
ej                  e	   dej                  e
   dee   fdZeeedddededede	dedej                   e   dej                  e   dej                  e   dej                  e   dej                  e
   ded   fdZeeedddededede	dedej                   e   dej                  e   dej                  e   dej                  e   dej                  e
   ded   fdZej*                  ddddedededededej                  e   dej                  e
   dej.                  eej.                  e         fd       Zeedddede	dedededej                  e   dej                  e   dej                  e
   dee   fdZdddddedededej<                  eej                  ej>                     f   dej                  e   dej                  e   dej                  e
   ded   fd Z y)!AsyncRawAttachmentsClientr   c                    || _         y r   r   r    s     r"   r#   z"AsyncRawAttachmentsClient.__init__C  r$   r%   Nr&   r*   r+   r,   r-   r'   r(   r)   r.   c                0  K   | j                   j                  j                  dd||||||d|       d{   }	 d|j                  cxk  rdk  rGn nDt	        j
                  t        t        t        |j                                     }	t        ||		      S |j                  d
k(  rt        t        |j                        t	        j
                  t        j                  t        j                     t        t        j                  t        j                     |j                                           |j                  dk(  rUt        t        |j                        t	        j
                  t         t        t         |j                                           |j                         }
t%        |j                  t        |j                        |
      7 # t"        $ r6 t%        |j                  t        |j                        |j&                        w xY ww)a  
        Attachments list for entity

        Parameters
        ----------
        project_id : str

        entity_type : AttachmentListRequestEntityType

        entity_id : str

        path : str

        page : typing.Optional[int]

        size : typing.Optional[int]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        AsyncHttpResponse[AttachmentPage]
            Attachment Resource
        r0   r1   r2   r3   Nr6   r7   r8   r;   r>   r?   rB   rC   )r   rE   rF   rD   rG   rH   r   r
   rI   r   r   rJ   r@   rK   rL   r   r   r   r   rM   rN   s              r"   rR   z)AsyncRawAttachmentsClient.attachment_listF  s    H ..;;CC((*& , D 
 
	"	ti++1c1" , ) 0 ))%HH$$+' !2!23

3$"(//&**"=$-NN$4	 	 $$+$ !2!23$$".$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`nooa
\  	ty'<'<d9K\K\F]dmdrdrss	ts4   4HGHAG HDG &,H?HHrS   rW   rX   rY   rZ   rT   rU   rV   c       
           K   | j                   j                  j                  dd|||||||	|t        |t        j
                  t           d      d	ddi|
t               d	{   }	 d
|j                  cxk  rdk  rn nt        |d	      S |j                  dk(  rt        t        |j                        t	        j                  t        j                  t        j                     t!        t        j                  t        j                     |j#                                           |j                  dk(  rUt%        t        |j                        t	        j                  t&        t!        t&        |j#                                           |j#                         }t+        |j                  t        |j                        |      7 d# t(        $ r6 t+        |j                  t        |j                        |j,                        w xY ww)a  
        Complete multipart attachment upload

        Parameters
        ----------
        file_name : str

        entity_type : CompleteMultipartUploadRequestEntityType

        entity_id : str

        file_size : int

        upload_id : str

        uploaded_file_parts : typing.Sequence[MultipartUploadPart]

        project_name : typing.Optional[str]
            If null, the default project is used

        container_id : typing.Optional[str]

        mime_type : typing.Optional[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        AsyncHttpResponse[None]
        r\   r]   r^   r_   rb   rc   rd   re   Nr6   r7   r;   r>   r8   r?   rB   rC   r   rE   rF   r   rG   rh   r   ri   rD   r   r   rJ   r@   rH   rK   rL   r
   rI   r   r   r   r   rM   rj   s                r"   rk   z4AsyncRawAttachmentsClient.complete_multi_part_upload  s    Z ..;;CC3& ,*& ,&&&'N/FOOL_<`ls(  2 ,) D 
 
	,	ti++1c1()$GG$$+' !2!23

3$"(//&**"=$-NN$4	 	 $$+$ !2!23$$".$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`nooe
`  	ty'<'<d9K\K\F]dmdrdrss	t7   A H"G#H($G	 HDG	 ,H	?HHc       
           K   | j                   j                  j                  dd|||||||	|t        |t        j
                  t           d      d	ddi|
t               d	{   }	 d
|j                  cxk  rdk  rn nt        |d	      S |j                  dk(  rt        t        |j                        t	        j                  t        j                  t        j                     t!        t        j                  t        j                     |j#                                           |j                  dk(  rUt%        t        |j                        t	        j                  t&        t!        t&        |j#                                           |j#                         }t+        |j                  t        |j                        |      7 d# t(        $ r6 t+        |j                  t        |j                        |j,                        w xY ww)a  
        Delete attachments

        Parameters
        ----------
        file_name : str

        entity_type : CompleteMultipartUploadRequestEntityType

        entity_id : str

        file_size : int

        upload_id : str

        uploaded_file_parts : typing.Sequence[MultipartUploadPart]

        project_name : typing.Optional[str]
            If null, the default project is used

        container_id : typing.Optional[str]

        mime_type : typing.Optional[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        AsyncHttpResponse[None]
        rn   r]   r^   r_   rb   rc   rd   re   Nr6   r7   r;   r>   r8   r?   rB   rC   r   rj   s                r"   ro   z,AsyncRawAttachmentsClient.delete_attachments  s    Z ..;;CC*& ,*& ,&&&'N/FOOL_<`ls(  2 ,) D 
 
	,	ti++1c1()$GG$$+' !2!23

3$"(//&**"=$-NN$4	 	 $$+$ !2!23$$".$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`nooe
`  	ty'<'<d9K\K\F]dmdrdrss	tr   rp   rq   c               F  	K   | j                   j                  j                  dd||||||d      4 d{   	dt        t        j
                  t              f	fd} |        d{    ddd      d{    y7 L7 7 	# 1 d{  7  sw Y   yxY ww)a  
        Download attachment from MinIO

        Parameters
        ----------
        container_id : str

        entity_type : DownloadAttachmentRequestEntityType

        entity_id : str

        file_name : str

        mime_type : str

        workspace_name : typing.Optional[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.

        Returns
        -------
        typing.AsyncIterator[AsyncHttpResponse[typing.AsyncIterator[bytes]]]
            Attachment Resource
        rs   r1   rt   r3   Nr.   c                    K   	 dj                   cxk  rdk  r=n n:j                  dd       nd } t        d j                  |       2              S j	                          d {    j                   dk(  rt        t        j                        t        j                  t        j                  t        j                     t        t        j                  t        j                     j                                     	      j                   d
k(  rUt        t        j                        t        j                  t        t        t        j                                     	      j                         }t#        j                   t        j                        |      7 ># t         $ r6 t#        j                   t        j                        j$                        w xY ww)Nr6   r7   rv   c                2   K   | 3 d {   }| 7 
6 y wr   rx   ry   s     r"   r|   zPAsyncRawAttachmentsClient.download_attachment.<locals>.stream.<locals>.<genexpr>  s     !k!k6&!k!ks   r}   r;   r>   r8   r?   rB   rC   )rD   r~   r   aiter_bytesareadr   rJ   r@   rG   rH   rK   rL   r
   rI   r   r   r   r   rM   r   s     r"   r   z=AsyncRawAttachmentsClient.download_attachment.<locals>.stream  s    "i339c9Q`Qlo&9&9,&Mrv0%.!kY=R=R^i=R=j!k   $//+++ ,,3/$():):$;!' &

 ; ,*0//&***E,5NN,<!""	 	 !,,3,$():):$;!' , ,*6,5NN,<!""	 	 &/^^%5N
 9+@+@$yO`O`Jahvww9 ,0 ' "$-$9$94	HYHYCZajaoao s<   G-AF+ G-F+ *F(+DF+ =+G-(F+ +?G**G-)r   rE   r   r   rG   AsyncIteratorr   r   s
          ` @r"   r   z-AsyncRawAttachmentsClient.download_attachment^  s     J ''44;;,"0 ,*&&& , < 
 
 $x"3F4H4H4O"P $xL . i
 
 
h !i
 
 
 
sV   5B!BB!0B-B.B5B! B
B!B
B!BBBB!r   r   c                B  K   | j                   j                  j                  dd|||||||dddi|t               d{   }		 d|	j                  cxk  rd	k  rGn nDt        j                  t        t        t        |	j                         
            }
t        |	|
      S |	j                  dk(  rt        t        |	j                        t        j                  t
        j                  t
        j                     t        t
        j                  t
        j                     |	j                         
                  |	j                  dk(  rUt!        t        |	j                        t        j                  t"        t        t"        |	j                         
                  |	j                         }t'        |	j                  t        |	j                        |      7 # t$        $ r6 t'        |	j                  t        |	j                        |	j(                        w xY ww)ai  
        Start multipart attachment upload

        Parameters
        ----------
        file_name : str

        num_of_file_parts : int

        entity_type : StartMultipartUploadRequestEntityType

        entity_id : str

        path : str

        mime_type : typing.Optional[str]

        project_name : typing.Optional[str]
            If null, the default project is used

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        AsyncHttpResponse[StartMultipartUploadResponse]
            MultipartUploadResponse
        r   r]   r   rc   rd   re   Nr6   r7   r8   r;   r>   r?   rB   rC   )r   rE   rF   ri   rD   rG   rH   r   r
   rI   r   r   rJ   r@   rK   rL   r   r   r   r   rM   r   s               r"   r   z1AsyncRawAttachmentsClient.start_multi_part_upload  s    P ..;;CC0&%6& ,*&  2 ,! D 
 
	$"	ti++1c10 : ) 0 ))%HH$$+' !2!23

3$"(//&**"=$-NN$4	 	 $$+$ !2!23$$".$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`nook
f  	ty'<'<d9K\K\F]dmdrdrss	ts6   =HG HAG  H!DG /,H?HHr   rF   c                  K   | j                   j                  j                  dd|||||d||t               d{   }	 d|j                  cxk  rdk  rn nt        |d      S |j                  d	k(  rt        t        |j                        t        j                  t        j                  t        j                     t        t        j                  t        j                     |j                         
                  |j                  dk(  rUt        t        |j                        t        j                  t         t        t         |j                         
                  |j                         }	t%        |j                  t        |j                        |	      7 d# t"        $ r6 t%        |j                  t        |j                        |j&                        w xY ww)a  
        Upload attachment to MinIO

        Parameters
        ----------
        file_name : str

        entity_type : UploadAttachmentRequestEntityType

        entity_id : str

        request : typing.Dict[str, typing.Optional[typing.Any]]

        project_name : typing.Optional[str]

        mime_type : typing.Optional[str]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        AsyncHttpResponse[None]
        r   r   r   r   Nr6   r7   r;   r>   r8   r?   rB   rC   )r   rE   rF   ri   rD   r   r   rJ   r@   rG   rH   rK   rL   r
   rI   r   r   r   r   rM   r   s
             r"   r   z+AsyncRawAttachmentsClient.upload_attachment  s    F ..;;CC*& ,&*& + D 
 
		ti++1c1()$GG$$+' !2!23

3$"(//&**"=$-NN$4	 	 $$+$ !2!23$$".$-NN$4	 	 '^^-N 9#8#8$yGXGXBY`nooU
P  	ty'<'<d9K\K\F]dmdrdrss	ts4   9G$FG$$F" %G$&DF" 4,G$"?G!!G$)!r   r   r   r   r#   r   r   rG   rK   r   r   r   r   rR   ri   r   rh   r   rk   ro   r   asynccontextmanagerr   r   r   r   r   r   r   r   r   rL   r   rx   r%   r"   r   r   B  s4   .*< . &*%);?Tp Tp 5	Tp
 Tp Tp ooc"Tp ooc"Tp  8Tp 
>	*Tp~ .2-1*.;?_p _p >	_p
 _p _p _p $__-@A_p ooc*_p ooc*_p ??3'_p  8_p 
4	 _pT .2-1*.;?_p _p >	_p
 _p _p _p $__-@A_p ooc*_p ooc*_p ??3'_p  8_p 
4	 _pB ## 04;?X! X! 9	X!
 X! X! X! ,X!  8X! 
		/0D0DU0KL	MX! $X!D +/-1;?]p ]p 	]p
 ;]p ]p ]p ??3']p ooc*]p  8]p 
7	8]pL .2*.;?Mp Mp 7	Mp
 Mp S&//&**"==>Mp ooc*Mp ??3'Mp  8Mp 
4	 Mpr%   r   )-r   rG   json.decoderr   core.api_errorr   core.client_wrapperr   r   core.http_responser   r	   core.pydantic_utilitiesr
   core.request_optionsr   core.serializationr   errors.forbidden_errorr   errors.unauthorized_errorr   types.attachment_pager   3types.complete_multipart_upload_request_entity_typer   types.error_messager   types.multipart_upload_partr   %types.start_multipart_upload_responser   )types.attachment_list_request_entity_typer   -types.download_attachment_request_entity_typer   0types.start_multipart_upload_request_entity_typer   +types.upload_attachment_request_entity_typer   rH   rL   ri   r   r   rx   r%   r"   <module>r      sx      ( % G @ 2 1 H 3 9 2 j . = P V ^ c Z v{{6::s#bp bpJcp cpr%   