U
    dE                     @   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-vyj7p4na/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   

