File: //usr/lib/python3/dist-packages/boto/gs/__pycache__/lifecycle.cpython-310.pyc
o
ckF[^# � @ sx d dl mZ dZdZdZdZdZdZdZd Z d
Z
dZdZeegZ
ee e
eegZegZG d
d� de�ZG dd� de�ZdS )� )�InvalidLifecycleConfigError�LifecycleConfiguration�Rule�Action�Delete�SetStorageClass� Condition�Age�
CreatedBefore�NumberOfNewerVersions�IsLive�MatchesStorageClassc @ sJ e Zd ZdZddd�Zdd� Zdd� Zd d
� Zdd� Zd
d� Z dd� Z
dS )r ax
A lifecycle rule for a bucket.
:ivar action: Action to be taken.
:ivar action_text: The text value for the specified action, if any.
:ivar conditions: A dictionary of conditions that specify when the action
should be taken. Each item in the dictionary represents the name and
value (or a list of multiple values, if applicable) of a condition.
Nc C s || _ || _|p i | _t| _d S )N)�action�action_text�
conditions�RULE�current_tag)�selfr r r � r �3/usr/lib/python3/dist-packages/boto/gs/lifecycle.py�__init__: s
z
Rule.__init__c C s | j |krtd|| j f ��dS )zVerify parent of the start tag.z"Invalid tag %s found inside %s tagN�r r )r �tag�parentr r r �validateStartTagB s
��zRule.validateStartTagc C s || j krtd| j |f ��dS )z%Verify end tag against the start tag.z%Mismatched start and end tags (%s/%s)Nr )r r r r r �validateEndTagH s
���zRule.validateEndTagc C s� |t kr| �|t� nB|tv r"| �|t � | jd urtd��|| _n+|tkr-| �|t� n |tv rG| �|t� || jv rF|t vrFtd| ��ntd| ��|| _
d S )Nz+Only one action tag is allowed in each rulez,Found duplicate non-repeatable conditions %s�Unsupported tag )�ACTIONr r �
LEGAL_ACTIONSr r � CONDITION�LEGAL_CONDITIONSr �LEGAL_REPEATABLE_CONDITIONSr )r �name�attrs�
connectionr r r �startElementO s*
�
��
zRule.startElementc C s� | � |� |tkr| �� d S |tkrt| _d S |tv r.|tkr)|d ur)|�� | _t| _d S |t kr7t| _d S |t
v rat | _|tv rX|| jvrLg | j|<