Ë
    £ªði|  ã                   ó0  — d dl Z d dlmZ d dlmZmZ d dlmZ d dlm	Z	 d dl
mZmZmZmZ d dlmZmZmZmZ  G d„ d	«      Z G d
„ d«      Z G d„ d«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Zy)é    N)ÚBytesIO©ÚreadableÚseekable)ÚFULL_OBJECT_CHECKSUM_ARGS)ÚIN_MEMORY_UPLOAD_TAG)ÚCompleteMultipartUploadTaskÚCreateMultipartUploadTaskÚSubmissionTaskÚTask)ÚChunksizeAdjusterÚDeferredOpenFileÚget_callbacksÚget_filtered_dictc                   ó&   — e Zd Zdd„Zd„ Zd„ Zd„ Zy)ÚAggregatedProgressCallbackc                 ó.   — || _         || _        d| _        y)aØ  Aggregates progress updates for every provided progress callback

        :type callbacks: A list of functions that accepts bytes_transferred
            as a single argument
        :param callbacks: The callbacks to invoke when threshold is reached

        :type threshold: int
        :param threshold: The progress threshold in which to take the
            aggregated progress and invoke the progress callback with that
            aggregated progress total
        r   N)Ú
_callbacksÚ
_thresholdÚ_bytes_seen)ÚselfÚ	callbacksÚ	thresholds      úh/var/www/acinvestment.org/public_html/aci/backend/venv/lib/python3.12/site-packages/s3transfer/upload.pyÚ__init__z#AggregatedProgressCallback.__init__"   s   € ð $ˆŒØ#ˆŒØˆÕó    c                 ó‚   — | xj                   |z  c_         | j                   | j                  k\  r| j                  «        y y ©N)r   r   Ú_trigger_callbacks)r   Úbytes_transferreds     r   Ú__call__z#AggregatedProgressCallback.__call__2   s7   € Ø×ÒÐ-Ñ-ÕØ×Ñ˜tŸ™Ò.Ø×#Ñ#Õ%ð /r   c                 óD   — | j                   dkD  r| j                  «        yy)z@Flushes out any progress that has not been sent to its callbacksr   N)r   r   ©r   s    r   Úflushz AggregatedProgressCallback.flush7   s!   € à×Ñ˜aÒØ×#Ñ#Õ%ð  r   c                 óZ   — | j                   D ]  } || j                  ¬«       Œ d| _        y )N)r    r   )r   r   )r   Úcallbacks     r   r   z-AggregatedProgressCallback._trigger_callbacks<   s+   € ØŸ™ò 	9ˆHÙ t×'7Ñ'7Ö8ð	9àˆÕr   N)i   )Ú__name__Ú
__module__Ú__qualname__r   r!   r$   r   © r   r   r   r   !   s   „ óò &ò
&ó
r   r   c                   ó>   — e Zd ZdZd„ Zd
d„Zdd„Zd„ Zd„ Zd„ Z	d	„ Z
y)ÚInterruptReaderaÏ  Wrapper that can interrupt reading using an error

    It uses a transfer coordinator to propagate an error if it notices
    that a read is being made while the file is being read from.

    :type fileobj: file-like obj
    :param fileobj: The file-like object to read from

    :type transfer_coordinator: s3transfer.futures.TransferCoordinator
    :param transfer_coordinator: The transfer coordinator to use if the
        reader needs to be interrupted.
    c                 ó    — || _         || _        y r   )Ú_fileobjÚ_transfer_coordinator)r   ÚfileobjÚtransfer_coordinators      r   r   zInterruptReader.__init__P   s   € ØˆŒØ%9ˆÕ"r   Nc                 ó�   — | j                   j                  r| j                   j                  ‚| j                  j                  |«      S r   )r/   Ú	exceptionr.   Úread)r   Úamounts     r   r4   zInterruptReader.readT   s:   € ð ×%Ñ%×/Ò/Ø×,Ñ,×6Ñ6Ð6Ø�}‰}×!Ñ! &Ó)Ð)r   c                 ó<   — | j                   j                  ||«       y r   )r.   Úseek)r   ÚwhereÚwhences      r   r7   zInterruptReader.seek^   s   € Ø�‰×Ñ˜5 &Õ)r   c                 ó6   — | j                   j                  «       S r   )r.   Útellr#   s    r   r;   zInterruptReader.tella   s   € Ø�}‰}×!Ñ!Ó#Ð#r   c                 ó8   — | j                   j                  «        y r   )r.   Úcloser#   s    r   r=   zInterruptReader.closed   s   € Ø�‰×ÑÕr   c                 ó   — | S r   r*   r#   s    r   Ú	__enter__zInterruptReader.__enter__g   s   € Øˆr   c                 ó$   — | j                  «        y r   )r=   )r   ÚargsÚkwargss      r   Ú__exit__zInterruptReader.__exit__j   s   € Ø�
‰
�r   r   )r   )r'   r(   r)   Ú__doc__r   r4   r7   r;   r=   r?   rC   r*   r   r   r,   r,   B   s*   „ ñò:ó*ó*ò$òòór   r,   c                   óX   — e Zd ZdZdd„Zed„ «       Zd„ Zd„ Zd„ Z	d„ Z
d	„ Zd
„ Zd„ Zd„ Zy)ÚUploadInputManageraJ  Base manager class for handling various types of files for uploads

    This class is typically used for the UploadSubmissionTask class to help
    determine the following:

        * How to determine the size of the file
        * How to determine if a multipart upload is required
        * How to retrieve the body for a PutObject
        * How to retrieve the bodies for a set of UploadParts

    The answers/implementations differ for the various types of file inputs
    that may be accepted. All implementations must subclass and override
    public methods from this class.
    Nc                 ó.   — || _         || _        || _        y r   )Ú_osutilr/   Ú_bandwidth_limiter)r   Úosutilr1   Úbandwidth_limiters       r   r   zUploadInputManager.__init__~   s   € ØˆŒØ%9ˆÔ"Ø"3ˆÕr   c                 ó   — t        d«      ‚)a  Determines if the source for the upload is compatible with manager

        :param upload_source: The source for which the upload will pull data
            from.

        :returns: True if the manager can handle the type of source specified
            otherwise returns False.
        zmust implement _is_compatible()©ÚNotImplementedError©ÚclsÚupload_sources     r   Úis_compatiblez UploadInputManager.is_compatibleƒ   s   € ô "Ð"CÓDÐDr   c                 ó   — t        d«      ‚)aÛ  Whether the body it provides are stored in-memory

        :type operation_name: str
        :param operation_name: The name of the client operation that the body
            is being used for. Valid operation_names are ``put_object`` and
            ``upload_part``.

        :rtype: boolean
        :returns: True if the body returned by the manager will be stored in
            memory. False if the manager will not directly store the body in
            memory.
        z%must implement store_body_in_memory()rM   ©r   Úoperation_names     r   Ústores_body_in_memoryz(UploadInputManager.stores_body_in_memory�   s   € ô "Ð"IÓJÐJr   c                 ó   — t        d«      ‚)z¼Provides the transfer size of an upload

        :type transfer_future: s3transfer.futures.TransferFuture
        :param transfer_future: The future associated with upload request
        z&must implement provide_transfer_size()rM   ©r   Útransfer_futures     r   Úprovide_transfer_sizez(UploadInputManager.provide_transfer_sizež   s   € ô "Ð"JÓKÐKr   c                 ó   — t        d«      ‚)aÔ  Determines where a multipart upload is required

        :type transfer_future: s3transfer.futures.TransferFuture
        :param transfer_future: The future associated with upload request

        :type config: s3transfer.manager.TransferConfig
        :param config: The config associated to the transfer manager

        :rtype: boolean
        :returns: True, if the upload should be multipart based on
            configuration and size. False, otherwise.
        z*must implement requires_multipart_upload()rM   ©r   rY   Úconfigs      r   Úrequires_multipart_uploadz,UploadInputManager.requires_multipart_upload¦   s   € ô "Ð"NÓOÐOr   c                 ó   — t        d«      ‚)aÜ  Returns the body to use for PutObject

        :type transfer_future: s3transfer.futures.TransferFuture
        :param transfer_future: The future associated with upload request

        :type config: s3transfer.manager.TransferConfig
        :param config: The config associated to the transfer manager

        :rtype: s3transfer.utils.ReadFileChunk
        :returns: A ReadFileChunk including all progress callbacks
            associated with the transfer future.
        z$must implement get_put_object_body()rM   rX   s     r   Úget_put_object_bodyz&UploadInputManager.get_put_object_bodyµ   s   € ô "Ð"HÓIÐIr   c                 ó   — t        d«      ‚)a  Yields the part number and body to use for each UploadPart

        :type transfer_future: s3transfer.futures.TransferFuture
        :param transfer_future: The future associated with upload request

        :type chunksize: int
        :param chunksize: The chunksize to use for this upload.

        :rtype: int, s3transfer.utils.ReadFileChunk
        :returns: Yields the part number and the ReadFileChunk including all
            progress callbacks associated with the transfer future for that
            specific yielded part.
        z)must implement yield_upload_part_bodies()rM   )r   rY   Ú	chunksizes      r   Úyield_upload_part_bodiesz+UploadInputManager.yield_upload_part_bodiesÄ   s   € ô "Ð"MÓNÐNr   c                 óš   — t        || j                  «      }| j                  r(| j                  j                  || j                  d¬«      }|S )NF)Úenabled)r,   r/   rI   Úget_bandwith_limited_stream)r   r0   s     r   Ú_wrap_fileobjz UploadInputManager._wrap_fileobjÔ   sM   € Ü! '¨4×+EÑ+EÓFˆØ×"Ò"Ø×-Ñ-×IÑIØ˜×3Ñ3¸Uð Jó ˆGð ˆr   c                 ó:   — t        |d«      }|rt        |«      gS g S )NÚprogress)r   r   )r   rY   r   s      r   Ú_get_progress_callbacksz*UploadInputManager._get_progress_callbacksÜ   s&   € Ü! /°:Ó>ˆ	ñ Ü.¨yÓ9Ð:Ð:Øˆ	r   c                 ó@   — |D �cg c]  }|j                   ‘Œ c}S c c}w r   )r$   )r   Úaggregated_progress_callbacksr&   s      r   Ú_get_close_callbacksz'UploadInputManager._get_close_callbackså   s   € Ø/LÖM 8�—“ÒMÐMùÒMs   …r   )r'   r(   r)   rD   r   ÚclassmethodrR   rV   rZ   r^   r`   rc   rg   rj   rm   r*   r   r   rF   rF   n   sP   „ ñó4ð
 ñ	Eó ð	EòKòLòPòJòOò òóNr   rF   c                   óV   — e Zd ZdZed„ «       Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d„ Zd	„ Zd
„ Zd„ Zy)ÚUploadFilenameInputManagerzUpload utility for filenamesc                 ó"   — t        |t        «      S r   )Ú
isinstanceÚstrrO   s     r   rR   z(UploadFilenameInputManager.is_compatibleì   s   € ä˜-¬Ó-Ð-r   c                  ó   — y)NFr*   rT   s     r   rV   z0UploadFilenameInputManager.stores_body_in_memoryð   s   € Ør   c                 ó¨   — |j                   j                  | j                  j                  |j                   j                  j
                  «      «       y r   )ÚmetarZ   rH   Úget_file_sizeÚ	call_argsr0   rX   s     r   rZ   z0UploadFilenameInputManager.provide_transfer_sizeó   s:   € Ø×Ñ×2Ñ2Ø�L‰L×&Ñ& ×';Ñ';×'EÑ'E×'MÑ'MÓNõ	
r   c                 óH   — |j                   j                  |j                  k\  S r   )rv   ÚsizeÚmultipart_thresholdr\   s      r   r^   z4UploadFilenameInputManager.requires_multipart_uploadø   s   € Ø×#Ñ#×(Ñ(¨F×,FÑ,FÑFÐFr   c                 óü   — | j                  |«      \  }}| j                  |«      }| j                  |«      }| j                  |«      }|j                  j
                  }| j                  j                  |||||¬«      S )N©r0   Ú
chunk_sizeÚfull_file_sizer   Úclose_callbacks)Ú&_get_put_object_fileobj_with_full_sizerg   rj   rm   rv   rz   rH   Ú#open_file_chunk_reader_from_fileobj)r   rY   r0   Ú	full_sizer   r€   rz   s          r   r`   z.UploadFilenameInputManager.get_put_object_bodyû   s‹   € à!×HÑHØó
Ñˆ�ð ×$Ñ$ WÓ-ˆà×0Ñ0°ÓAˆ	Ø×3Ñ3°IÓ>ˆØ×#Ñ#×(Ñ(ˆð �|‰|×?Ñ?ØØØ$ØØ+ð @ó 
ð 	
r   c              #   ó²  K  — |j                   j                  }| j                  ||«      }t        d|dz   «      D ]™  }| j	                  |«      }| j                  |«      }||dz
  z  }| j                  |j                   j                  j                  |||¬«      \  }	}
| j                  |	«      }	| j                  j                  |	||
||¬«      }||f–— Œ› y ­w)Né   )Ú
start_byteÚ	part_sizer   r}   )rv   rz   Ú_get_num_partsÚrangerj   rm   Ú'_get_upload_part_fileobj_with_full_sizerx   r0   rg   rH   r‚   )r   rY   rb   r   Ú	num_partsÚpart_numberr   r€   r†   r0   rƒ   Úread_file_chunks               r   rc   z3UploadFilenameInputManager.yield_upload_part_bodies  sö   è ø€ Ø(×-Ñ-×2Ñ2ˆØ×'Ñ'¨¸ÓCˆ	Ü   I°¡MÓ2ò 	/ˆKØ×4Ñ4°_ÓEˆIØ"×7Ñ7¸	ÓBˆOØ" k°A¡oÑ6ˆJð "&×!MÑ!MØ×$Ñ$×.Ñ.×6Ñ6Ø%Ø#Ø-ð	 "Nó "ÑˆG�Yð ×(Ñ(¨Ó1ˆGð #Ÿl™l×NÑNØØ$Ø(Ø#Ø /ð Oó ˆOð ˜Ð.Ó.ñ5	/ùs   ‚CCc                 óJ   — t        ||| j                  j                  ¬«      }|S )N)Úopen_function)r   rH   Úopen)r   r0   r†   s      r   Ú_get_deferred_open_filez2UploadFilenameInputManager._get_deferred_open_file2  s$   € Ü"Ø�Z¨t¯|©|×/@Ñ/@ô
ˆð ˆr   c                 ó–   — |j                   j                  j                  }|j                   j                  }| j	                  |d«      |fS )Nr   )rv   rx   r0   rz   r‘   ©r   rY   r0   rz   s       r   r�   zAUploadFilenameInputManager._get_put_object_fileobj_with_full_size8  sB   € Ø!×&Ñ&×0Ñ0×8Ñ8ˆØ×#Ñ#×(Ñ(ˆØ×+Ñ+¨G°QÓ7¸Ð=Ð=r   c                 ó>   — |d   }|d   }| j                  ||«      |fS )Nr†   r   )r‘   )r   r0   rB   r†   rƒ   s        r   rŠ   zBUploadFilenameInputManager._get_upload_part_fileobj_with_full_size=  s/   € Ø˜LÑ)ˆ
ØÐ+Ñ,ˆ	Ø×+Ñ+¨G°ZÓ@À)ÐKÐKr   c                 ó~   — t        t        j                  |j                  j                  t        |«      z  «      «      S r   )ÚintÚmathÚceilrv   rz   Úfloat)r   rY   r‡   s      r   rˆ   z)UploadFilenameInputManager._get_num_partsB  s,   € Ü”4—9‘9˜_×1Ñ1×6Ñ6¼¸yÓ9IÑIÓJÓKÐKr   N)r'   r(   r)   rD   rn   rR   rV   rZ   r^   r`   rc   r‘   r�   rŠ   rˆ   r*   r   r   rp   rp   é   sG   „ Ù&àñ.ó ð.òò
ò
Gò
ò0/ò>ò>ò
Ló
Lr   rp   c                   ó8   — e Zd ZdZed„ «       Zd„ Zd„ Zd„ Zd„ Z	y)ÚUploadSeekableInputManagerz&Upload utility for an open file objectc                 ó2   — t        |«      xr t        |«      S r   r   rO   s     r   rR   z(UploadSeekableInputManager.is_compatibleI  s   € ä˜Ó&ÒB¬8°MÓ+BÐBr   c                 ó   — |dk(  ryy)NÚ
put_objectFTr*   rT   s     r   rV   z0UploadSeekableInputManager.stores_body_in_memoryM  s   € Ø˜\Ò)Øàr   c                 ó  — |j                   j                  j                  }|j                  «       }|j	                  dd«       |j                  «       }|j	                  |«       |j                   j                  ||z
  «       y )Nr   é   )rv   rx   r0   r;   r7   rZ   )r   rY   r0   Ústart_positionÚend_positions        r   rZ   z0UploadSeekableInputManager.provide_transfer_sizeS  sg   € Ø!×&Ñ&×0Ñ0×8Ñ8ˆð !Ÿ™›ˆØ�‰�Q˜ÔØ—|‘|“~ˆØ�‰�^Ô$Ø×Ñ×2Ñ2Ø˜>Ñ)õ	
r   c                 óV   — |j                  |d   «      }t        |«      t        |«      fS )Nr‡   )r4   r   Úlen)r   r0   rB   Údatas       r   rŠ   zBUploadSeekableInputManager._get_upload_part_fileobj_with_full_size`  s,   € ð �|‰|˜F ;Ñ/Ó0ˆô �t‹}œc $›iÐ'Ð'r   c                 ó˜   — |j                   j                  j                  }|j                  «       |j                   j                  z   }||fS r   )rv   rx   r0   r;   rz   r“   s       r   r�   zAUploadSeekableInputManager._get_put_object_fileobj_with_full_sizeo  sA   € Ø!×&Ñ&×0Ñ0×8Ñ8ˆð �|‰|‹~ × 4Ñ 4× 9Ñ 9Ñ9ˆØ˜ˆ}Ðr   N)
r'   r(   r)   rD   rn   rR   rV   rZ   rŠ   r�   r*   r   r   r›   r›   F  s-   „ Ù0àñCó ðCòò
ò(ór   r›   c                   ó`   ‡ — e Zd ZdZdˆ fd„	Zed„ «       Zd„ Zd„ Zd„ Z	d„ Z
d„ Zdd	„Zd
„ Zˆ xZS )ÚUploadNonSeekableInputManagerz7Upload utility for a file-like object that cannot seek.c                 ó6   •— t         ‰| �  |||«       d| _        y )Nr   )Úsuperr   Ú_initial_data)r   rJ   r1   rK   Ú	__class__s       €r   r   z&UploadNonSeekableInputManager.__init__z  s   ø€ Ü‰Ñ˜Ð!5Ð7HÔIØ ˆÕr   c                 ó   — t        |«      S r   )r   rO   s     r   rR   z+UploadNonSeekableInputManager.is_compatible~  s   € ä˜Ó&Ð&r   c                  ó   — y)NTr*   rT   s     r   rV   z3UploadNonSeekableInputManager.stores_body_in_memory‚  s   € Ør   c                  ó   — y r   r*   rX   s     r   rZ   z3UploadNonSeekableInputManager.provide_transfer_size…  s   € ð 	r   c                 ó0  — |j                   j                  �#|j                   j                  |j                  k\  S |j                   j                  j                  }|j                  }| j                  ||d«      | _        t        | j                  «      |k  ryy)NFT)rv   rz   r{   rx   r0   Ú_readr«   r¤   )r   rY   r]   r0   r   s        r   r^   z7UploadNonSeekableInputManager.requires_multipart_uploadŠ  sƒ   € à×Ñ×$Ñ$Ð0Ø"×'Ñ'×,Ñ,°×0JÑ0JÑJÐJð "×&Ñ&×0Ñ0×8Ñ8ˆØ×.Ñ.ˆ	Ø!ŸZ™Z¨°¸EÓBˆÔÜˆt×!Ñ!Ó" YÒ.Øàr   c                 óô   — | j                  |«      }| j                  |«      }|j                  j                  j                  }| j                  | j                  |j                  «       z   ||«      }d | _        |S r   )rj   rm   rv   rx   r0   Ú
_wrap_datar«   r4   )r   rY   r   r€   r0   Úbodys         r   r`   z1UploadNonSeekableInputManager.get_put_object_body›  sn   € Ø×0Ñ0°ÓAˆ	Ø×3Ñ3°IÓ>ˆØ!×&Ñ&×0Ñ0×8Ñ8ˆà�‰Ø×Ñ §¡£Ñ/°¸Oó
ˆð "ˆÔØˆr   c              #   ó   K  — |j                   j                  j                  }d}	 | j                  |«      }| j	                  |«      }|dz  }| j                  ||«      }|sy | j                  |||«      }d }||f–— ŒX­w)Nr   r…   )rv   rx   r0   rj   rm   r±   r³   )	r   rY   rb   Úfile_objectrŒ   r   r€   Úpart_contentÚpart_objects	            r   rc   z6UploadNonSeekableInputManager.yield_upload_part_bodies©  s“   è ø€ Ø%×*Ñ*×4Ñ4×<Ñ<ˆØˆð Ø×4Ñ4°_ÓEˆIØ"×7Ñ7¸	ÓBˆOØ˜1ÑˆKØŸ:™: k°9Ó=ˆLÙØØŸ/™/Ø˜i¨óˆKð
  ˆLØ˜{Ð*Ò*ð ùs   ‚A<A>c                 óT  — t        | j                  «      dk(  r|j                  |«      S |t        | j                  «      k  r'| j                  d| }|r| j                  |d | _        |S |t        | j                  «      z
  }| j                  |j                  |«      z   }|rd| _        |S )a=  
        Reads a specific amount of data from a stream and returns it. If there
        is any data in initial_data, that will be popped out first.

        :type fileobj: A file-like object that implements read
        :param fileobj: The stream to read from.

        :type amount: int
        :param amount: The number of bytes to read from the stream.

        :type truncate: bool
        :param truncate: Whether or not to truncate initial_data after
            reading from it.

        :return: Generator which generates part bodies from the initial data.
        r   Nr   )r¤   r«   r4   )r   r0   r5   Útruncater¥   Úamount_to_reads         r   r±   z#UploadNonSeekableInputManager._read½  s®   € ô$ ˆt×!Ñ!Ó" aÒ'Ø—<‘< Ó'Ð'ð ”S˜×+Ñ+Ó,Ò,Ø×%Ñ% g vÐ.ˆDñ Ø%)×%7Ñ%7¸¸Ð%@�Ô"ØˆKð
  ¤# d×&8Ñ&8Ó"9Ñ9ˆØ×!Ñ! G§L¡L°Ó$@Ñ@ˆñ Ø!$ˆDÔØˆr   c                 óš   — | j                  t        |«      «      }| j                  j                  |t	        |«      t	        |«      ||¬«      S )a¸  
        Wraps data with the interrupt reader and the file chunk reader.

        :type data: bytes
        :param data: The data to wrap.

        :type callbacks: list
        :param callbacks: The callbacks associated with the transfer future.

        :type close_callbacks: list
        :param close_callbacks: The callbacks to be called when closing the
            wrapper for the data.

        :return: Fully wrapped data.
        r}   )rg   r   rH   r‚   r¤   )r   r¥   r   r€   r0   s        r   r³   z(UploadNonSeekableInputManager._wrap_dataç  sL   € ð  ×$Ñ$¤W¨T£]Ó3ˆØ�|‰|×?Ñ?ØÜ˜4“yÜ˜t›9ØØ+ð @ó 
ð 	
r   r   )T)r'   r(   r)   rD   r   rn   rR   rV   rZ   r^   r`   rc   r±   r³   Ú__classcell__)r¬   s   @r   r¨   r¨   w  sC   ø„ ÙAõ!ð ñ'ó ð'òòò
ò"ò+ó((öT
r   r¨   c                   ót   — e Zd ZdZddgZedgz   Zg d¢Zg d¢ez   Zd„ Z		 dd„Z
d	„ Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zy)ÚUploadSubmissionTaskz.Task for submitting tasks to execute an uploadÚChecksumTypeÚMpuObjectSize)ÚChecksumAlgorithmÚSSECustomerKeyÚSSECustomerAlgorithmÚSSECustomerKeyMD5ÚRequestPayerÚExpectedBucketOwner)rÃ   rÄ   rÅ   rÆ   rÇ   rÀ   rÁ   c                 óÒ   — t         t        t        g}|j                  j                  j
                  }|D ]  }|j                  |«      sŒ|c S  t        d|› dt        |«      › d�«      ‚)ao  Retrieves a class for managing input for an upload based on file type

        :type transfer_future: s3transfer.futures.TransferFuture
        :param transfer_future: The transfer future for the request

        :rtype: class of UploadInputManager
        :returns: The appropriate class to use for managing a specific type of
            input for uploads.
        zInput z
 of type: z is not supported.)	rp   r›   r¨   rv   rx   r0   rR   ÚRuntimeErrorÚtype)r   rY   Úupload_manager_resolver_chainr0   Úupload_manager_clss        r   Ú_get_upload_input_manager_clsz2UploadSubmissionTask._get_upload_input_manager_cls  sx   € ô 'Ü&Ü)ð)
Ð%ð "×&Ñ&×0Ñ0×8Ñ8ˆØ"?ò 	*ÐØ!×/Ñ/°Õ8Ø)Ò)ð	*ô Ø�W�I˜Z¬¨W« Ð6HÐIó
ð 	
r   Nc                 ó  —  | j                  |«      || j                  |«      }|j                  j                  €|j	                  |«       |j                  ||«      s| j                  ||||||«       y| j                  ||||||«       y)aÒ  
        :param client: The client associated with the transfer manager

        :type config: s3transfer.manager.TransferConfig
        :param config: The transfer config associated with the transfer
            manager

        :type osutil: s3transfer.utils.OSUtil
        :param osutil: The os utility associated to the transfer manager

        :type request_executor: s3transfer.futures.BoundedExecutor
        :param request_executor: The request executor associated with the
            transfer manager

        :type transfer_future: s3transfer.futures.TransferFuture
        :param transfer_future: The transfer future associated with the
            transfer request that tasks are being submitted for
        N)rÍ   r/   rv   rz   rZ   r^   Ú_submit_upload_requestÚ_submit_multipart_request)r   Úclientr]   rJ   Úrequest_executorrY   rK   Úupload_input_managers           r   Ú_submitzUploadSubmissionTask._submit3  s©   € ð6 
˜t×AÑAØó 
à
�$×,Ñ,Ð.?ó AÐð
 ×Ñ×$Ñ$Ð,Ø ×6Ñ6°ÔGð $×=Ñ=Ø˜Vô
ð ×'Ñ'ØØØØ ØØ$õð ×*Ñ*ØØØØ ØØ$õr   c                 óD  — |j                   j                  }| j                  |j                  «      }| j	                  |d«      }	| j
                  j                  |t        | j
                  ||j                  |«      |j                  |j                  |dœd¬«      |	¬«       y )Nrž   )rÑ   r0   ÚbucketÚkeyÚ
extra_argsT)r1   Úmain_kwargsÚis_final©Útag)rv   rx   Ú_extra_put_object_argsrØ   Ú_get_upload_task_tagr/   ÚsubmitÚPutObjectTaskr`   rÖ   r×   )
r   rÑ   r]   rJ   rÒ   rY   rÓ   rx   Úput_object_extra_argsÚput_object_tags
             r   rÏ   z+UploadSubmissionTask._submit_upload_requestl  s­   € ð $×(Ñ(×2Ñ2ˆ	à $× ;Ñ ;Ø× Ñ ó!
Ðð
 ×2Ñ2Ø  ,ó
ˆð
 	×"Ñ"×)Ñ)ØÜØ%)×%?Ñ%?à$Ø3×GÑGØ'ó ð (×.Ñ.Ø$Ÿ=™=Ø"7ñð ôð ð 	*õ 	
r   c                 ó,  — |j                   j                  }t        D ]?  }||j                  v sŒd|j                  d<   |j	                  dd«      |j                  d<   ŒA | j                  |j                  «      }	| j                  j                  |t        | j                  ||j                  |j                  |	dœ¬«      «      }
g }| j                  |j                  «      }| j                  |d«      }|j                   j                  }t        «       }|j                  |j                   |«      }|j#                  ||«      }|D ]e  \  }}|j%                  | j                  j                  |t'        | j                  |||j                  |j                  ||d	œd
|
i¬«      |¬«      «       Œg | j)                  |j                  «      }| j                  j                  |t+        | j                  ||j                  |j                  |dœ|
|dœd¬«      «       y )NÚFULL_OBJECTrÀ   ÚChecksumÚ rÂ   )rÑ   rÖ   r×   rØ   )r1   rÙ   Úupload_part)rÑ   r0   rÖ   r×   rŒ   rØ   Ú	upload_id)r1   rÙ   Úpending_main_kwargsrÛ   )rè   ÚpartsT)r1   rÙ   ré   rÚ   )rv   rx   r   rØ   ÚreplaceÚ_extra_create_multipart_argsr/   rß   r
   rÖ   r×   Ú_extra_upload_part_argsrÞ   rz   r   Úadjust_chunksizeÚmultipart_chunksizerc   ÚappendÚUploadPartTaskÚ_extra_complete_multipart_argsr	   )r   rÑ   r]   rJ   rÒ   rY   rÓ   rx   ÚchecksumÚcreate_multipart_extra_argsÚcreate_multipart_futureÚpart_futuresÚextra_part_argsÚupload_part_tagrz   Úadjusterrb   Úpart_iteratorrŒ   r0   Úcomplete_multipart_extra_argss                        r   rÐ   z.UploadSubmissionTask._submit_multipart_request“  s<  € ð $×(Ñ(×2Ñ2ˆ	ô 2ò 	ˆHØ˜9×/Ñ/Ò/Ø7D�	×$Ñ$ ^Ñ4Ø<D×<LÑ<LØ ó=�	×$Ñ$Ð%8Ò9ð	ð '+×&GÑ&GØ× Ñ ó'
Ð#ð
 #'×"<Ñ"<×"CÑ"CØÜ%Ø%)×%?Ñ%?à$Ø'×.Ñ.Ø$Ÿ=™=Ø"=ñ	ôó#
Ðð ˆØ×6Ñ6°y×7KÑ7KÓLˆð ×3Ñ3Ø  -ó
ˆð ×#Ñ#×(Ñ(ˆÜ$Ó&ˆØ×-Ñ-¨f×.HÑ.HÈ$ÓOˆ	Ø,×EÑEØ˜Yó
ˆð %2ò 	Ñ ˆK˜Ø×ÑØ×*Ñ*×1Ñ1Ø$Ü"Ø-1×-GÑ-Gà&,Ø'.Ø&/×&6Ñ&6Ø#,§=¡=Ø+6Ø*9ñ%ð (Ð)@ð-ôð (ð! 2ó õð	ð, )-×(KÑ(KØ× Ñ ó)
Ð%ð 	×"Ñ"×)Ñ)ØÜ'Ø%)×%?Ñ%?à$Ø'×.Ñ.Ø$Ÿ=™=Ø"?ñ	ð "9Ø)ñ%ð ôõ	
r   c                 ó.   — t        || j                  «      S r   )r   ÚUPLOAD_PART_ARGS©r   rØ   s     r   rí   z,UploadSubmissionTask._extra_upload_part_argsö  s   € ô ! ¨T×-BÑ-BÓCÐCr   c                 ó.   — t        || j                  «      S r   )r   ÚCOMPLETE_MULTIPART_ARGSrþ   s     r   rò   z3UploadSubmissionTask._extra_complete_multipart_argsû  s   € Ü  ¨T×-IÑ-IÓJÐJr   c                 ó0   — t        || j                  ¬«      S ©N)Úblocklisted_keys)r   ÚCREATE_MULTIPART_BLOCKLISTrþ   s     r   rì   z1UploadSubmissionTask._extra_create_multipart_argsþ  s   € Ü Ø¨×)HÑ)Hô
ð 	
r   c                 ó0   — t        || j                  ¬«      S r  )r   ÚPUT_OBJECT_BLOCKLISTrþ   s     r   rÝ   z+UploadSubmissionTask._extra_put_object_args  s   € Ü Ø¨×)BÑ)Bô
ð 	
r   c                 ó8   — d }|j                  |«      rt        }|S r   )rV   r   )r   rÓ   rU   rÜ   s       r   rÞ   z)UploadSubmissionTask._get_upload_task_tag  s   € ØˆØ×5Ñ5°nÔEÜ&ˆCØˆ
r   r   )r'   r(   r)   rD   r  r   r  rý   r   rÍ   rÔ   rÏ   rÐ   rí   rò   rì   rÝ   rÞ   r*   r   r   r¿   r¿     sp   „ Ù8à*¨OÐ<Ðà!:¸oÐ=NÑ!NÐòÐòð 	"ñ"Ðò
ð> ó7òr%
òNa
òFDò
Kò
ò

ó
r   r¿   c                   ó   — e Zd ZdZd„ Zy)rà   z Task to do a nonmultipart uploadc                 ó^   — |5 } |j                   d|||dœ|¤Ž ddd«       y# 1 sw Y   yxY w)aP  
        :param client: The client to use when calling PutObject
        :param fileobj: The file to upload.
        :param bucket: The name of the bucket to upload to
        :param key: The name of the key to upload to
        :param extra_args: A dictionary of any extra arguments that may be
            used in the upload.
        )ÚBucketÚKeyÚBodyNr*   )rž   )r   rÑ   r0   rÖ   r×   rØ   r´   s          r   Ú_mainzPutObjectTask._main  s>   € ð ð 	O˜ØˆF×ÑÐN V°¸4ÑNÀ:ÒN÷	O÷ 	Oñ 	Oús   ƒ#£,N©r'   r(   r)   rD   r  r*   r   r   rà   rà     s   „ Ù*ó
Or   rà   c                   ó   — e Zd ZdZd„ Zy)rñ   z+Task to upload a part in a multipart uploadc           
      óÈ   — |5 } |j                   d|||||dœ|¤Ž}	ddd«       	d   }
|
|dœ}d|v r$|d   j                  «       }d|› �}||	v r|	|   ||<   |S # 1 sw Y   Œ=xY w)aÓ  
        :param client: The client to use when calling PutObject
        :param fileobj: The file to upload.
        :param bucket: The name of the bucket to upload to
        :param key: The name of the key to upload to
        :param upload_id: The id of the upload
        :param part_number: The number representing the part of the multipart
            upload
        :param extra_args: A dictionary of any extra arguments that may be
            used in the upload.

        :rtype: dict
        :returns: A dictionary representing a part::

            {'Etag': etag_value, 'PartNumber': part_number}

            This value can be appended to a list to be used to complete
            the multipart upload.
        )r
  r  ÚUploadIdÚ
PartNumberr  NÚETag)r  r  rÂ   rå   r*   )rç   Úupper)r   rÑ   r0   rÖ   r×   rè   rŒ   rØ   r´   ÚresponseÚetagÚpart_metadataÚalgorithm_nameÚchecksum_members                 r   r  zUploadPartTask._main"  sª   € ð, ð 	˜Ø)�v×)Ñ)ð ØØØ"Ø&Øñð ñˆH÷	ð ˜ÑˆØ!%°[ÑAˆØ *Ñ,Ø'Ð(;Ñ<×BÑBÓDˆNØ (¨Ð(8Ð9ˆOØ (Ñ*Ø19¸/Ñ1J�˜oÑ.ØÐ÷!	ð 	ús   ƒAÁA!Nr  r*   r   r   rñ   rñ     s
   „ Ù5ó&r   rñ   )r—   Úior   Ús3transfer.compatr   r   Ús3transfer.constantsr   Ús3transfer.futuresr   Ús3transfer.tasksr	   r
   r   r   Ús3transfer.utilsr   r   r   r   r   r,   rF   rp   r›   r¨   r¿   rà   rñ   r*   r   r   ú<module>r      s¨   ðó Ý ç 0Ý :Ý 3÷ó ÷ó ÷ñ ÷B)ñ )÷XxNñ xNôvZLÐ!3ô ZLôz.Ð!;ô .ôbG
Ð$6ô G
ôTK˜>ô Kô\O�Dô Oô )�Tõ )r   