HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/boto/gs/__pycache__/lifecycle.cpython-310.pyc
o

ckF[^#�@sxddlmZdZdZdZdZdZdZdZd	Z	d
Z
dZdZeegZ
ee	e
eegZegZGd
d�de�ZGdd�de�ZdS)�)�InvalidLifecycleConfigError�LifecycleConfiguration�Rule�Action�Delete�SetStorageClass�	Condition�Age�
CreatedBefore�NumberOfNewerVersions�IsLive�MatchesStorageClassc@sJeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)rax
    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.
    NcCs ||_||_|p	i|_t|_dS)N)�action�action_text�
conditions�RULE�current_tag)�selfrrr�r�3/usr/lib/python3/dist-packages/boto/gs/lifecycle.py�__init__:s

z
Rule.__init__cCs |j|krtd||jf��dS)zVerify parent of the start tag.z"Invalid tag %s found inside %s tagN�rr)r�tag�parentrrr�validateStartTagBs

��zRule.validateStartTagcCs ||jkrtd|j|f��dS)z%Verify end tag against the start tag.z%Mismatched start and end tags (%s/%s)Nr)rrrrr�validateEndTagHs
���zRule.validateEndTagcCs�|tkr|�|t�nB|tvr"|�|t�|jdurtd��||_n+|tkr-|�|t�n |tvrG|�|t�||jvrF|t	vrFtd|��ntd|��||_
dS)Nz+Only one action tag is allowed in each rulez,Found duplicate non-repeatable conditions %s�Unsupported tag )�ACTIONrr�
LEGAL_ACTIONSrr�	CONDITION�LEGAL_CONDITIONSr�LEGAL_REPEATABLE_CONDITIONSr)r�name�attrs�
connectionrrr�startElementOs*
�
��
zRule.startElementcCs�|�|�|tkr|��dS|tkrt|_dS|tvr.|tkr)|dur)|��|_t|_dS|t	kr7t|_dS|t
vrat	|_|tvrX||jvrLg|j|<|j|�
|���dS|��|j|<dStd|���NzUnsupported end tag )rr�validaterrr�SET_STORAGE_CLASS�striprrr r!r�appendr�rr"�valuer$rrr�
endElementfs&






zRule.endElementcCs&|jstd��|jstd|j��dS)zValidate the rule.z#No action was specified in the rulez(No condition was specified for action %sN)rrr�rrrrr'�s���z
Rule.validatecCsdtdg}|�dtd�|jr'|�d|jd|jd|jdg�n
|�d|jd�|�dtd�|�dtd�|jD],}|tvrMqF|t	vrW|j|}n|j|g}|D]}|�d|d|d|dg�q_qF|�dtd�|�dtd�d�
|�S)z0Convert the rule into XML string representation.�<�>�</z/>�)rr*rr�extendrrrr r!�join)r�s�condition_name�condition_values�condition_valuerrr�to_xml�s2�

��
zRule.to_xml)NNN)�__name__�
__module__�__qualname__�__doc__rrrr%r-r'r9rrrrr-s
	c@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�LifecycleConfigzI
    A container of rules associated with a lifecycle configuration.
    cCs
d|_dS)NF)�has_root_tagr.rrrr�s
zLifecycleConfig.__init__cCsZ|tkr|jrtd��d|_dS|tkr'|jstd|��t�}|�|�|Std|��)Nz'Only one root tag is allowed in the XMLTzInvalid root tag r)�LIFECYCLE_CONFIGr?rrrr*)rr"r#r$�rulerrrr%�s�

zLifecycleConfig.startElementcCs|tkrdStd|��r&)r@rr+rrrr-�szLifecycleConfig.endElementcCsLdg}|�dtd�|D]	}|�|���q|�dtd�d�|�S)z>Convert LifecycleConfig object into XML string representation.z&<?xml version="1.0" encoding="UTF-8"?>r/r0r1r2)r*r@r9r4)rr5rArrrr9�s
zLifecycleConfig.to_xmlcCst|||�}|�|�dS)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 action: str
        :param action: Action to be taken.

        :type action_text: str
        :param action_text: Value for the specified action.

        :type conditions: dict
        :param conditions: A dictionary of conditions that specify when the
        action should be taken. Each item in the dictionary represents the name
        and value of a condition.
        N)rr*)rrrrrArrr�add_rule�szLifecycleConfig.add_ruleN)	r:r;r<r=rr%r-r9rBrrrrr>�s	r>N)�boto.exceptionrr@rr�DELETEr(r�AGE�CREATED_BEFORE�NUM_NEWER_VERSIONS�IS_LIVE�MATCHES_STORAGE_CLASSrr r!�objectr�listr>rrrr�<module>s&�y