ó
č?F[c           @   sI   d  d l  m Z d   Z d e f d     YZ d e f d     YZ d S(   i’’’’(   t   OriginAccessIdentityc         C   s!   t  |  t  r |  j   S|  Sd  S(   N(   t
   isinstanceR    t   uri(   t   origin_access_identity(    (    s5   lib/python2.7/site-packages/boto/cloudfront/origin.pyt   get_oai_value   s    
t   S3Originc           B   sA   e  Z d  Z d d d  Z d   Z d   Z d   Z d   Z RS(   s   
    Origin information to associate with the distribution.
    If your distribution will use an Amazon S3 origin,
    then you use the S3Origin element.
    c         C   s   | |  _  | |  _ d S(   s  
        :param dns_name: The DNS name of your Amazon S3 bucket to
                         associate with the distribution.
                         For example: mybucket.s3.amazonaws.com.
        :type dns_name: str
        
        :param origin_access_identity: The CloudFront origin access
                                       identity to associate with the
                                       distribution. If you want the
                                       distribution to serve private content,
                                       include this element; if you want the
                                       distribution to serve public content,
                                       remove this element.
        :type origin_access_identity: str
        
        N(   t   dns_nameR   (   t   selfR   R   (    (    s5   lib/python2.7/site-packages/boto/cloudfront/origin.pyt   __init__&   s    	c         C   s   d |  j  S(   Ns   <S3Origin: %s>(   R   (   R   (    (    s5   lib/python2.7/site-packages/boto/cloudfront/origin.pyt   __repr__:   s    c         C   s   d  S(   N(   t   None(   R   t   namet   attrst
   connection(    (    s5   lib/python2.7/site-packages/boto/cloudfront/origin.pyt   startElement=   s    c         C   sD   | d k r | |  _  n( | d k r0 | |  _ n t |  | |  d  S(   Nt   DNSNameR    (   R   R   t   setattr(   R   R   t   valueR   (    (    s5   lib/python2.7/site-packages/boto/cloudfront/origin.pyt
   endElement@   s
    c         C   sN   d } | d |  j  7} |  j r@ t |  j  } | d | 7} n  | d 7} | S(   Ns     <S3Origin>
s       <DNSName>%s</DNSName>
s4       <OriginAccessIdentity>%s</OriginAccessIdentity>
s     </S3Origin>
(   R   R   R   (   R   t   st   val(    (    s5   lib/python2.7/site-packages/boto/cloudfront/origin.pyt   to_xmlH   s    	
N(	   t   __name__t
   __module__t   __doc__R
   R   R	   R   R   R   (    (    (    s5   lib/python2.7/site-packages/boto/cloudfront/origin.pyR      s   			t   CustomOriginc           B   sG   e  Z d  Z d d d d d  Z d   Z d   Z d   Z d   Z RS(	   s„   
    Origin information to associate with the distribution.
    If your distribution will use a non-Amazon S3 origin,
    then you use the CustomOrigin element.
    iP   i»  c         C   s(   | |  _  | |  _ | |  _ | |  _ d S(   s8  
        :param dns_name: The DNS name of your Amazon S3 bucket to
                         associate with the distribution.
                         For example: mybucket.s3.amazonaws.com.
        :type dns_name: str
        
        :param http_port: The HTTP port the custom origin listens on.
        :type http_port: int
        
        :param https_port: The HTTPS port the custom origin listens on.
        :type http_port: int
        
        :param origin_protocol_policy: The origin protocol policy to
                                       apply to your origin. If you
                                       specify http-only, CloudFront
                                       will use HTTP only to access the origin.
                                       If you specify match-viewer, CloudFront
                                       will fetch from your origin using HTTP
                                       or HTTPS, based on the protocol of the
                                       viewer request.
        :type origin_protocol_policy: str
        
        N(   R   t	   http_portt
   https_portt   origin_protocol_policy(   R   R   R   R   R   (    (    s5   lib/python2.7/site-packages/boto/cloudfront/origin.pyR   X   s    			c         C   s   d |  j  S(   Ns   <CustomOrigin: %s>(   R   (   R   (    (    s5   lib/python2.7/site-packages/boto/cloudfront/origin.pyR	   v   s    c         C   s   d  S(   N(   R
   (   R   R   R   R   (    (    s5   lib/python2.7/site-packages/boto/cloudfront/origin.pyR   y   s    c         C   sĀ   | d k r | |  _  n¦ | d k rW y t |  |  _ Wq¾ t k
 rS | |  _ q¾ Xng | d k r y t |  |  _ Wq¾ t k
 r | |  _ q¾ Xn( | d k r® | |  _ n t |  | |  d  S(   NR   t   HTTPPortt	   HTTPSPortt   OriginProtocolPolicy(   R   t   intR   t
   ValueErrorR   R   R   (   R   R   R   R   (    (    s5   lib/python2.7/site-packages/boto/cloudfront/origin.pyR   |   s    c         C   sX   d } | d |  j  7} | d |  j 7} | d |  j 7} | d |  j 7} | d 7} | S(   Ns     <CustomOrigin>
s       <DNSName>%s</DNSName>
s       <HTTPPort>%d</HTTPPort>
s       <HTTPSPort>%d</HTTPSPort>
s4       <OriginProtocolPolicy>%s</OriginProtocolPolicy>
s     </CustomOrigin>
(   R   R   R   R   (   R   R   (    (    s5   lib/python2.7/site-packages/boto/cloudfront/origin.pyR      s    
N(	   R   R   R   R
   R   R	   R   R   R   (    (    (    s5   lib/python2.7/site-packages/boto/cloudfront/origin.pyR   Q   s   				N(   t   boto.cloudfront.identityR    R   t   objectR   R   (    (    (    s5   lib/python2.7/site-packages/boto/cloudfront/origin.pyt   <module>   s   	2