U
    O8ÚcE  ã                   @   s`   d dl Z d dlmZ edddddgƒZG dd„ deƒZd	d
„ Zdd„ Zdd„ ZG dd„ dƒZdS )é    N)Ú
namedtupleÚServiceContextÚservice_nameZservice_modelZservice_waiter_modelZresource_json_definitionsc                   @   s   e Zd ZdZdS )r   a   Provides important service-wide, read-only information about a service

    :type service_name: str
    :param service_name: The name of the service

    :type service_model: :py:class:`botocore.model.ServiceModel`
    :param service_model: The model of the service.

    :type service_waiter_model: :py:class:`botocore.waiter.WaiterModel` or
        a waiter model-like object such as
        :py:class:`boto3.utils.LazyLoadedWaiterModel`
    :param service_waiter_model: The waiter model of the service.

    :type resource_json_definitions: dict
    :param resource_json_definitions: The loaded json models of all resource
        shapes for a service. It is equivalient of loading a
        ``resource-1.json`` and retrieving the value at the key "resources".
    N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r	   r	   ú//tmp/pip-unpacked-wheel-hml_76kf/boto3/utils.pyr      s   c                 C   s   t | ƒ tj|  S )zIImport module given a name.

    Does not support relative imports.

    )Ú
__import__ÚsysÚmodules)Únamer	   r	   r
   Úimport_module2   s    r   c                    s   |‰‡ ‡fdd„}|S )Nc                     s2   ˆ   dd¡\}}t|ƒ}|  ˆ¡ t||ƒf | ŽS )NÚ.é   )Úrsplitr   ÚupdateÚgetattr)ÚkwargsÚmoduleZfunction_name©Ú	full_nameZparent_kwargsr	   r
   Ú_handler?   s    
zlazy_call.<locals>._handlerr	   )r   r   r   r	   r   r
   Ú	lazy_call<   s    r   c                 C   s&   || krt d|› dƒ‚n|| |< d S )NzCannot inject class attribute "z*", attribute already exists in class dict.)ÚRuntimeError)Zclass_attributesr   Úvaluer	   r	   r
   Úinject_attributeH   s
    
ÿr   c                   @   s    e Zd ZdZdd„ Zdd„ ZdS )ÚLazyLoadedWaiterModelat  A lazily loaded waiter model

    This does not load the service waiter model until an attempt is made
    to retrieve the waiter model for a specific waiter. This is helpful
    in docstring generation where we do not need to actually need to grab
    the waiter-2.json until it is accessed through a ``get_waiter`` call
    when the docstring is generated/accessed.
    c                 C   s   || _ || _|| _d S ©N)Ú_sessionÚ_service_nameÚ_api_version)ÚselfZ
bc_sessionr   Úapi_versionr	   r	   r
   Ú__init__\   s    zLazyLoadedWaiterModel.__init__c                 C   s   | j  | j| j¡ |¡S r   )r    Zget_waiter_modelr!   r"   Ú
get_waiter)r#   Zwaiter_namer	   r	   r
   r&   a   s     ÿþz LazyLoadedWaiterModel.get_waiterN)r   r   r   r   r%   r&   r	   r	   r	   r
   r   R   s   	r   )	r   Úcollectionsr   Z_ServiceContextr   r   r   r   r   r	   r	   r	   r
   Ú<module>   s   üþ

