File: //lib/python3/dist-packages/boto/s3/__pycache__/lifecycle.cpython-312.pyc
�
ckF[�* � �~ � d dl mZ G d� de� Z G d� de� Z G d� de� Z G d� d e� Z G d
� de� Zy)
� )�sixc �4 � e Zd ZdZ 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 |t j
� rt
|�� | _ n|| _ t |t � r+t � | _
| j j |� y |r|| _
y t � | _
y )N� )�days)�id�prefix�status�
isinstancer �
integer_types�
Expiration�
expiration�
Transition�Transitions�
transition�append)�selfr r
r r r s �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| j z S )Nz
<Rule: %s>)r �r s r �__repr__z
Rule.__repr__C s � ��d�g�g�%�%r c �f � |dk( r| j S |dk( rt � | _ | j S y )Nr r )r r r �r �name�attrs�
connections r �startElementzRule.startElementF s2 � ��<���?�?�"�
�\�
!�(�l�D�O��?�?�"�r c �l � |dk( r|| _ y |dk( r|| _ y |dk( r|| _ y t | ||� y )N�ID�Prefix�Status)r r
r �setattr�r r �valuer s r �
endElementzRule.endElementN s: � ��4�<��D�G�
�X�
��D�K�
�X�
��D�K��D�$��&r c �< � d}| j �|d| j z z
}|d| j z z
}|d| j z z
}| j �|| j j � 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
r r �to_xmlr �r �ss r r* zRule.to_xmlX s� � ����7�7��
�����(�(�A� �
"�T�[�[�
0�0�� �
"�T�[�[�
0�0���?�?�&�
����'�'�)�)�A��?�?�&�
����'�'�)�)�A� �Y����r )NNNNN) �__name__�
__module__�__qualname__�__doc__r r r r( r* � r r r r s* � ��* FJ� �,�*&��'�r r c �0 � e Zd ZdZdd�Zd� Zd� Zd� Zd� Zy) r z�
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)r r r6 s r r zExpiration.__init__n s � ��� ��� r c � � y r4 r1 r s r r zExpiration.startElementr � � �r c �J � |dk( rt |� | _ y |dk( r|| _ y y )N�Days�Date)�intr r6 r&