File: //lib/python3/dist-packages/awscli/customizations/s3/__pycache__/fileinfo.cpython-38.pyc
U
Z�^� � @ s G d d� de �ZdS )c @ s2 e Zd ZdZddd�Zdd� Zdd � Zd
d� ZdS )
�FileInfoa� This class contains important details related to performing a task.
It can perform operations such as ``upload``, ``download``, ``copy``,
``delete``, ``move``. Similarly to ``TaskInfo`` objects attributes
like ``session`` need to be set in order to perform operations.
:param dest: the destination path
:type dest: string
:param compare_key: the name of the file relative to the specified
directory/prefix. This variable is used when performing synching
or if the destination file is adopting the source file's name.
:type compare_key: string
:param size: The size of the file in bytes.
:type size: integer
:param last_update: the local time of last modification.
:type last_update: datetime object
:param dest_type: if the destination is s3 or local.
:param dest_type: string
:param parameters: a dictionary of important values this is assigned in
the ``BasicTask`` object.
:param associated_response_data: The response data used by
the ``FileGenerator`` to create this task. It is either an dictionary
from the list of a ListObjects or the response from a HeadObject. It
will only be filled if the task was generated from an S3 bucket.
NFc C s` || _ || _|| _| | _|| _|| _|| _|| _|| _i | _ |
d k rJ|
| _ || _
|| _|
| _d S )N)
�src�src_type�operation_name�client�dest� dest_type�compare_key�size�last_update�
parameters�
source_client� is_stream�associated_response_data)�selfr r r r r
r r r r r r r
r � r �C/usr/lib/python3/dist-packages/awscli/customizations/s3/fileinfo.py�__init__) s zFileInfo.__init__c C s6 | � | j�r2| jdkrdS | jdkr2| jdkr2dS dS )a Determines if a file info object is glacier compatible
Operations will fail if the S3 object has a storage class of GLACIER
and it involves copying from S3 to S3, downloading from S3, or moving
where S3 is the source (the delete will actually succeed, but we do
not want fail to transfer the file and then successfully delete it).
:returns: True if the FileInfo's operation will not fail because the
operation is on a glacier object. False if it will fail.
)�copyZdownloadFZmoveZs3T)�_is_glacier_objectr r r )r r r r �is_glacier_compatible? s
zFileInfo.is_glacier_compatiblec C s, ddg}|r(|� d�|kr(| �|�s(dS dS )NZGLACIERZDEEP_ARCHIVEZStorageClassTF)�get�_is_restored)r �
response_dataZglacier_storage_classesr r r r R s �zFileInfo._is_glacier_objectc C s d|� dd�kS )Nzongoing-request="false"ZRestore� )r )r r r r r r Z s zFileInfo._is_restored)NNNNNNNNNNFN)�__name__�
__module__�__qualname__�__doc__r r r r r r r r r s �
r N)�objectr r r r r �<module> �