U
    W+dA                     @   sL   d dl mZ d dlmZmZ d dlmZ G dd deZdd Zdd	 Zd
S )    )Route53Connection)
RegionInfoget_regions)connectc                   @   s   e Zd Zdd ZdS )Route53RegionInfoc                 K   s    | j r| j f d| ji|S dS )a  
        Connect to this Region's endpoint. Returns an connection
        object pointing to the endpoint associated with this region.
        You may pass any of the arguments accepted by the connection
        class's constructor as keyword arguments and they will be
        passed along to the connection object.

        :rtype: Connection object
        :return: The connection to this regions endpoint
        hostN)connection_clsendpoint)self	kw_params r   9/tmp/pip-unpacked-wheel-dlxw5sjy/boto/route53/__init__.pyr   !   s    zRoute53RegionInfo.connectN)__name__
__module____qualname__r   r   r   r   r   r      s   r   c                  C   s&   t dttd} | tddtd | S )z
    Get all available regions for the Route53 service.

    :rtype: list
    :return: A list of :class:`boto.regioninfo.RegionInfo` instances
    route53Z
region_clsr   	universalroute53.amazonaws.comnamer	   r   )r   r   r   append)regionsr   r   r   r   0   s    r   c                 K   s:   | dkr"t ddtd}|jf |S td| ft td|S )af  
    Given a valid region name, return a
    :class:`boto.route53.connection.Route53Connection`.

    :type: str
    :param region_name: The name of the region to connect to.

    :rtype: :class:`boto.route53.connection.Route53Connection` or ``None``
    :return: A connection to the given region, or None if an invalid region
             name is given
    r   r   r   r   r   )r   r   r   )Zregion_namer   Zregionr   r   r   connect_to_regionI   s    
r   N)	Zboto.route53.connectionr   Zboto.regioninfor   r   r   r   r   r   r   r   r   r   <module>   s
   