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/cloudfront/__pycache__/__init__.cpython-310.pyc
o

ckF[H;�@s�ddlZddlZddlZddlmZddlmZddlmZm	Z	m
Z
ddlmZmZm
Z
ddlmZddlmZddlmZdd	lmZmZmZdd
lmZddlmZGdd
�d
e�ZdS)�N)�AWSAuthConnection)�handler)�Distribution�DistributionSummary�DistributionConfig)�StreamingDistribution�StreamingDistributionSummary�StreamingDistributionConfig)�OriginAccessIdentity)�OriginAccessIdentitySummary)�OriginAccessIdentityConfig)�InvalidationBatch�InvalidationSummary�InvalidationListResultSet)�	ResultSet)�CloudFrontServerErrorcsHeZdZdZdZdddddedddddf�fdd�	Zdd	�Zd
d�Z		dCdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Z	 	dDd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Z	 	 	dDd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�ZdEd9d:�Zd;d<�Z	dFd=d>�Z 	dFd?d@�Z!		dCdAdB�Z"�Z#S)G�CloudFrontConnectionzcloudfront.amazonaws.comz
2010-11-01NrTcs,tt|�j|||d||||||	||
d�dS)NT)�debug�security_token�validate_certs�https_connection_factory�profile_name)�superr�__init__)�self�aws_access_key_id�aws_secret_access_key�port�proxy�
proxy_port�hostrrrrr��	__class__��:/usr/lib/python3/dist-packages/boto/cloudfront/__init__.pyr+s

�zCloudFrontConnection.__init__cCs0|j}|��D]}|��dkr||SqdS)N�etag)�msg�keys�lower)r�response�response_headers�keyr#r#r$�get_etag7s�zCloudFrontConnection.get_etagcCsdgS)N�
cloudfrontr#)rr#r#r$�_required_auth_capability>sz.CloudFrontConnection._required_auth_capabilitycCs�|sdtfg}|�dd|j|f�}|��}tj�|�|jdkr)t|j|j	|��|p,t
}|p1t�}||fi|��}	t�
|	|�}
tj�||
�|	S)Nr�GET�/%s/%s�,)r�make_request�Version�read�boto�logr�statusr�reasonr�dictr�
XmlHandler�xml�sax�parseString)r�resource�tags�result_set_class�result_set_kwargsr)�body�rs_class�	rs_kwargs�rs�hr#r#r$�_get_all_objectsCs
�

z%CloudFrontConnection._get_all_objectscCs�d|j||f}|�d|�}|��}tj�|�|jdkr%t|j|j|��||d�}|j	}|�
�D]
}	|	��dkr>||	|_q1t
�||�}
tj�||
�|S)N�	/%s/%s/%sr/r1��
connectionr%)r3r2r4r5r6rr7rr8r&r'r(r%rr:r;r<r=)r�idr>�
dist_class�urir)rB�dr*r+rFr#r#r$�	_get_infoTs


�zCloudFrontConnection._get_infoc	Cs~d|j||f}|�d|�}|��}tj�|�|jdkr%t|j|j|��||d�}|�	|�|_
t�||�}t
j�||�|S)N�/%s/%s/%s/configr/r1rI)r3r2r4r5r6rr7rr8r,r%rr:r;r<r=)	rrKr>�config_classrMr)rBrNrFr#r#r$�_get_configds

z CloudFrontConnection._get_configc	Cszt|t�rd}nd}d|j||f}|dd�}|�d|||���}|��}tj�|�|j	dkr8t
|j	|j|��|�|�S)N�streaming-distribution�distributionrP�text/xml)�If-Match�Content-Type�PUT��)
�
isinstancer	r3r2�to_xmlr4r5r6rr7rr8r,)	r�distribution_idr%�configr>rM�headersr)rBr#r#r$�_set_configqs



z CloudFrontConnection._set_configcCs�|jdd|j|fddi|��d�}|��}tj�|�|jdkr;||d�}t�	||�}t
j�||�|�
|�|_|St|j|j|��)N�POSTr0rWrU��data��rI)r2r3r[r4r5r6rr7rr:r;r<r=r,r%rr8)rr]r>rLr)rBrNrFr#r#r$�_create_objects��

z#CloudFrontConnection._create_objectcCsTd|j||f}|�d|d|i�}|��}tj�|�|jdkr(t|j|j|��dS)NrH�DELETErV��)	r3r2r4r5r6rr7rr8)rrKr%r>rMr)rBr#r#r$�_delete_object�s
�z#CloudFrontConnection._delete_objectcC�dtfg}|�d|�S)NrrT)rrG�rr?r#r#r$�get_all_distributions��
z*CloudFrontConnection.get_all_distributionscC�|�|dt�S�NrT)rOr�rr\r#r#r$�get_distribution_info��z*CloudFrontConnection.get_distribution_infocCrlrm)rRrrnr#r#r$�get_distribution_config���z,CloudFrontConnection.get_distribution_configcC�|�|||�S�N�r_�rr\r%r]r#r#r$�set_distribution_config�rpz,CloudFrontConnection.set_distribution_config�cC�"t||||||d�}|�|dt�S)N��origin�enabled�caller_reference�cnames�comment�trusted_signersrT)rrdr�rr{r|r}r~rr�r]r#r#r$�create_distribution�s�z(CloudFrontConnection.create_distributioncC�|�||d�Srm�rg�rr\r%r#r#r$�delete_distribution�rpz(CloudFrontConnection.delete_distributioncCrh)NrrS)rrGrir#r#r$�get_all_streaming_distributions�rkz4CloudFrontConnection.get_all_streaming_distributionscCrl�NrS)rOrrnr#r#r$�get_streaming_distribution_info�rrz4CloudFrontConnection.get_streaming_distribution_infocCrlr�)rRr	rnr#r#r$�!get_streaming_distribution_config�rrz6CloudFrontConnection.get_streaming_distribution_configcCrsrtrurvr#r#r$�!set_streaming_distribution_config�rpz6CloudFrontConnection.set_streaming_distribution_configcCry)NrzrS)r	rdrr�r#r#r$�create_streaming_distribution�s��z2CloudFrontConnection.create_streaming_distributioncCr�r�r�r�r#r#r$�delete_streaming_distribution�rrz2CloudFrontConnection.delete_streaming_distributioncCrh)N�%CloudFrontOriginAccessIdentitySummary�!origin-access-identity/cloudfront)rrGrir#r#r$�get_all_origin_access_identity�s�z3CloudFrontConnection.get_all_origin_access_identitycCrl�Nr�)rOr
�r�	access_idr#r#r$�get_origin_access_identity_info�rrz4CloudFrontConnection.get_origin_access_identity_infocCrlr�)rRrr�r#r#r$�!get_origin_access_identity_config�s�z6CloudFrontConnection.get_origin_access_identity_configcCrsrtru)rr�r%r]r#r#r$�!set_origin_access_identity_config�sz6CloudFrontConnection.set_origin_access_identity_configcCst||d�}|�|dt�S)N)r}rr�)rrdr
)rr}rr]r#r#r$�create_origin_access_identity�s��z2CloudFrontConnection.create_origin_access_identitycCr�r�r�)rr�r%r#r#r$�delete_origin_access_identity�rrz2CloudFrontConnection.delete_origin_access_identitycCs�t|t�s	t|�}||_d|j|f}|jd|ddi|��d�}|��}|jdkr8t�	||�}t
j�||�|St
|j|j|��)zQCreates a new invalidation request
            :see: http://goo.gl/8vECq
        z /%s/distribution/%s/invalidationr`rWrUrarc)rZr
rJr3r2r[r4r7rr:r;r<r=rr8)rr\�pathsr}rMr)rBrFr#r#r$�create_invalidation_request�s 
��
z0CloudFrontConnection.create_invalidation_requestc	Csjd|j||f}|�d|ddi�}|��}|jdkr-tg�}t�||�}tj�	||�|St
|j|j|��)Nz#/%s/distribution/%s/invalidation/%sr/rWrUrY)r3r2r4r7r
rr:r;r<r=rr8)	rr\�
request_idr}rMr)rBr�rFr#r#r$�invalidation_request_status	s�
z0CloudFrontConnection.invalidation_request_statuscCs�d|}t�}|r
||d<|r||d<|r.|d|��7}|��D]\}}|d||f7}q!dtfg}t}	t||||d�}
|j|||	|
d�S)	a
        Get all invalidation requests for a given CloudFront distribution.
        This returns an instance of an InvalidationListResultSet that
        automatically handles all of the result paging, etc. from CF - you just
        need to keep iterating until there are no more results.

        :type distribution_id: string
        :param distribution_id: The id of the CloudFront distribution

        :type marker: string
        :param marker: Use this only when paginating results and only in
                       follow-up request after you've received a response where
                       the results are truncated. Set this to the value of the
                       Marker element in the response you just received.

        :type max_items: int
        :param max_items: Use this only when paginating results and only in a
                          follow-up request to indicate the maximum number of
                          invalidation requests you want in the response. You
                          will need to pass the next_marker property from the
                          previous InvalidationListResultSet response in the
                          follow-up request in order to get the next 'page' of
                          results.

        :rtype: :class:`boto.cloudfront.invalidation.InvalidationListResultSet`
        :returns: An InvalidationListResultSet iterator that lists invalidation
                  requests for a given CloudFront distribution. Automatically
                  handles paging the results.
        zdistribution/%s/invalidation�Marker�MaxItemsz?%s=%sz&%s=%sr)rJr\�	max_items�marker)r@rA)r9�popitem�itemsrrrG)rr\r�r�rM�params�k�vr?rCrDr#r#r$�get_invalidation_requestss$
�
�z.CloudFrontConnection.get_invalidation_requests)NN)rxNrxN)rxrxrt)$�__name__�
__module__�__qualname__�DefaultHostr3rr,r.rGrOrRr_rdrgrjrorqrwr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��
__classcell__r#r#r!r$r&s`�
�


�
�

�
��r)�xml.saxr;�timer5�boto.connectionrr�boto.cloudfront.distributionrrrrrr	�boto.cloudfront.identityr
rr�boto.cloudfront.invalidationr
rr�boto.resultsetr�boto.cloudfront.exceptionrrr#r#r#r$�<module>s