HEX
Server: Apache
System: Linux pdx1-shared-a1-29 6.18.39-grsec-noble+ #4 SMP Thu Jul 23 07:53:29 UTC 2026 x86_64
User: dh_bj99yp (22285841)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/boto/s3/__pycache__/lifecycle.cpython-312.pyc
�

ckF[�*��~�ddlmZGd�de�ZGd�de�ZGd�de�ZGd�d	e�ZGd
�de�Zy)
�)�sixc�4�eZdZdZ		dd�Zd�Zd�Zd�Zd�Zy)	�RuleaH
    A Lifecycle rule for an S3 bucket.

    :ivar id: Unique identifier for the rule. The value cannot be longer
        than 255 characters. This value is optional. The server will
        generate a unique value for the rule if no value is provided.

    :ivar prefix: Prefix identifying one or more objects to which the
        rule applies. If prefix is not provided, Boto generates a default
        prefix which will match all objects.

    :ivar status: If 'Enabled', the rule is currently being applied.
        If 'Disabled', the rule is not currently being applied.

    :ivar expiration: An instance of `Expiration`. This indicates
        the lifetime of the objects that are subject to the rule.

    :ivar transition: An instance of `Transition`.  This indicates
        when to transition to a different storage class.

    Nc�D�||_|�dn||_||_t|tj
�rt
|��|_n||_t|t�r+t�|_
|jj|�y|r||_
yt�|_
y)N�)�days)�id�prefix�status�
isinstancer�
integer_types�
Expiration�
expiration�
Transition�Transitions�
transition�append)�selfr	r
rrrs      �3/usr/lib/python3/dist-packages/boto/s3/lifecycle.py�__init__z
Rule.__init__.s|�����"�N�b��������j�#�"3�"3�4�(�j�9�D�O�)�D�O��j�*�-�)�m�D�O��O�O�"�"�:�.�
�(�D�O�)�m�D�O�c� �d|jzS)Nz
<Rule: %s>)r	�rs r�__repr__z
Rule.__repr__Cs���d�g�g�%�%rc�f�|dk(r|jS|dk(rt�|_|jSy)Nrr)rrr�r�name�attrs�
connections    r�startElementzRule.startElementFs2���<���?�?�"�
�\�
!�(�l�D�O��?�?�"�rc�l�|dk(r||_y|dk(r||_y|dk(r||_yt|||�y)N�ID�Prefix�Status)r	r
r�setattr�rr�valuers    r�
endElementzRule.endElementNs:���4�<��D�G�
�X�
��D�K�
�X�
��D�K��D�$��&rc�<�d}|j�|d|jzz
}|d|jzz
}|d|jzz
}|j�||jj	�z
}|j
�||j
j	�z
}|dz
}|S)Nz<Rule>z<ID>%s</ID>z<Prefix>%s</Prefix>z<Status>%s</Status>z</Rule>)r	r
rr�to_xmlr�r�ss  rr*zRule.to_xmlXs������7�7��
�����(�(�A�	�
"�T�[�[�
0�0��	�
"�T�[�[�
0�0���?�?�&�
����'�'�)�)�A��?�?�&�
����'�'�)�)�A�	�Y����r)NNNNN)	�__name__�
__module__�__qualname__�__doc__rrr r(r*�rrrrs*���*FJ� �,�*&��'�rrc�0�eZdZdZdd�Zd�Zd�Zd�Zd�Zy)	rz�
    When an object will expire.

    :ivar days: The number of days until the object expires

    :ivar date: The date when the object will expire. Must be
        in ISO 8601 format.
    Nc� �||_||_y�N�r�date)rrr6s   rrzExpiration.__init__ns����	���	rc��yr4r1rs    rr zExpiration.startElementr���rc�J�|dk(rt|�|_y|dk(r||_yy)N�Days�Date)�intrr6r&s    rr(zExpiration.endElementus'���6�>��E�
�D�I�
�V�^��D�I�rc�j�|j�d|jz}d|zSd|jz}d|zS)N�on: %s�in: %s daysz<Expiration: %s>r5�r�how_longs  rrzExpiration.__repr__{sB���9�9���$�)�)�+�H�"�H�,�,�%�t�y�y�0�H�!�H�,�,rc��d}|j�|d|jzz
}n|j�|d|jzz
}|dz
}|S)Nz<Expiration>�<Days>%s</Days>�<Date>%s</Date>z
</Expiration>r5r+s  rr*zExpiration.to_xml�sR�����9�9� �
�"�T�Y�Y�.�.�A�
�Y�Y�
"�
�"�T�Y�Y�.�.�A�	�_����r)NN)	r-r.r/r0rr r(rr*r1rrrres ������-�rrc�$�eZdZdZdd�Zd�Zd�Zy)raJ
    A transition to a different storage class.

    :ivar days: The number of days until the object should be moved.

    :ivar date: The date when the object should be moved.  Should be
        in ISO 8601 format.

    :ivar storage_class: The storage class to transition to.  Valid
        values are GLACIER, STANDARD_IA.
    Nc�.�||_||_||_yr4�rr6�
storage_class)rrr6rHs    rrzTransition.__init__�s����	���	�*��rc�~�|j�d|jz}nd|jz}d|�d|j�d�S)Nr>r?z
<Transition: z, �>rGr@s  rrzTransition.__repr__�s:���9�9���$�)�)�+�H�$�t�y�y�0�H��)1�4�3E�3E�F�Frc��d}|d|jzz
}|j�|d|jzz
}n|j�|d|jzz
}|dz
}|S)Nz<Transition>z<StorageClass>%s</StorageClass>rCrDz
</Transition>)rHrr6r+s  rr*zTransition.to_xml�sh����	�
.��1C�1C�
C�C���9�9� �
�"�T�Y�Y�.�.�A�
�Y�Y�
"�
�"�T�Y�Y�.�.�A�	�_����r�NNN)r-r.r/r0rrr*r1rrrr�s��
�+�
G�rrc�f�eZdZdZd�Zd�Zd�Zd�Zdd�Zd�Z	e
d	��Ze
d
��Ze
d��Z
y)
rz[
    A container for the transitions associated with a Lifecycle's Rule configuration.
    c�J�d|_d|_d|_d|_d|_y)N��)�transition_properties�current_transition_property�	temp_days�	temp_date�temp_storage_classrs rrzTransitions.__init__�s(��%&��"�+,��(�������"&��rc��yr4r1rs    rr zTransitions.startElement�r8rc�l�|dk(rt|�|_n|dk(r||_n|dk(r||_|j|j
k(rW|j
t|j|j|j��dx|_x|_|_d|_y|xjdz
c_y)Nr:r;�StorageClassrP)r<rSrTrUrRrQrrr&s    rr(zTransitions.endElement�s����6�>� ��Z�D�N�
�V�^�"�D�N�
�^�
#�&+�D�#�
�+�+�t�/I�/I�I��K�K�
�4�>�>�4�>�>�4�CZ�CZ�[�\�HL�L�D�N�L�T�^�d�.E�/0�D�,��,�,��1�,rc�>�d}|D]}||j�z
}�|S)�v
        Returns a string containing the XML version of the Lifecycle
        configuration as defined by S3.
        r�r*)rr,rs   rr*zTransitions.to_xml�s0��

���	%�J�
��"�"�$�$�A�	%��rNc�@�t|||�}|j|�y)aB
        Add a transition to this Lifecycle configuration.  This only adds
        the rule to the local copy.  To install the new rule(s) on
        the bucket, you need to pass this Lifecycle config object
        to the configure_lifecycle method of the Bucket object.

        :ivar days: The number of days until the object should be moved.

        :ivar date: The date when the object should be moved.  Should be
            in ISO 8601 format.

        :ivar storage_class: The storage class to transition to.  Valid
            values are GLACIER, STANDARD_IA.
        N)rr)rrr6rHrs     r�add_transitionzTransitions.add_transition�s�� ��d�M�:�
����J�rc�,�|D]}t||�cSyr4)�getattr)r�proprs   r�__first_or_defaultzTransitions.__first_or_default�s!���	-�J��:�t�,�,�	-�rc�$�|jd�S)Nr��_Transitions__first_or_defaultrs rrzTransitions.days�����&�&�v�.�.rc�$�|jd�S)Nr6rcrs rr6zTransitions.date�rerc�$�|jd�S)NrHrcrs rrHzTransitions.storage_class�s���&�&��7�7rrL)r-r.r/r0rr r(r*r]rd�propertyrr6rHr1rrrr�sa���'��2�$� �$��/��/��/��/��8��8rrc�.�eZdZdZd�Zd�Zd�Z		dd�Zy)�	LifecyclezN
    A container for the rules associated with a Lifecycle configuration.
    c�H�|dk(rt�}|j|�|Sy)Nr�rr)rrrr�rules     rr zLifecycle.startElements$���6�>��6�D��K�K����K�rc��t|||�yr4)r%r&s    rr(zLifecycle.endElement	s����d�E�"rc�R�d}|dz
}|D]}||j�z
}�|dz
}|S)rZz&<?xml version="1.0" encoding="UTF-8"?>z<LifecycleConfiguration>z</LifecycleConfiguration>r[)rr,rms   rr*zLifecycle.to_xmlsC��

5��	�
'�'���	�D�
������A�	�	�
(�(���rNc�D�t|||||�}|j|�y)a�
        Add a rule to this Lifecycle configuration.  This only adds
        the rule to the local copy.  To install the new rule(s) on
        the bucket, you need to pass this Lifecycle config object
        to the configure_lifecycle method of the Bucket object.

        :type id: str
        :param id: Unique identifier for the rule. The value cannot be longer
            than 255 characters. This value is optional. The server will
            generate a unique value for the rule if no value is provided.

        :type prefix: str
        :iparam prefix: Prefix identifying one or more objects to which the
            rule applies.

        :type status: str
        :param status: If 'Enabled', the rule is currently being applied.
            If 'Disabled', the rule is not currently being applied.

        :type expiration: int
        :param expiration: Indicates the lifetime, in days, of the objects
            that are subject to the rule. The value must be a non-zero
            positive integer. A Expiration object instance is also perfect.

        :type transition: Transitions
        :param transition: Indicates when an object transitions to a
            different storage class. 
        Nrl)rr	r
rrrrms       r�add_rulezLifecycle.add_rules"��<�B���
�J�?�����D�r)Nr�EnabledNN)r-r.r/r0r r(r*rqr1rrrjrj�s#����#�
�3<�-1�rrjN)	�boto.compatr�objectrrr�listrrjr1rr�<module>rvsN��,�K�6�K�Z$��$�L �� �DM8�$�M8�`:��:r