o
    µ£‰Tï  ã                   @   s‚   d Z eZdgZzddlmZ W n ey   ddlmZ Y nw ddlm	Z	m
Z
 G dd„ de	ƒZG dd„ de	ƒZG d	d„ de
ƒZd
S )z5Test client for the lazr.restful example web service.ÚCookbookWebServiceClienté    )Úquote)ÚCollectionWithKeyBasedLookupÚServiceRootc                   @   ó   e Zd ZdZdd„ ZdZdS )ÚCookbookSetz>A custom subclass capable of cookbook lookup by cookbook name.c                 C   s    t | jj ¡ ƒd tt |ƒƒ S )z>Transform a cookbook name into the URL to a cookbook resource.z
cookbooks/)ÚstrÚ_rootÚ	_root_uriÚensureSlashr   ©ÚselfÚid© r   úB/usr/lib/python3/dist-packages/lazr/restfulclient/tests/example.pyÚ_get_url_from_id%   s
   ÿ
ÿzCookbookSet._get_url_from_idÚcookbookN©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úcollection_ofr   r   r   r   r   "   s    r   c                   @   r   )Ú	RecipeSetz8A custom subclass capable of recipe lookup by recipe ID.c                 C   s   t | jj ¡ ƒd t |ƒ S )z8Transform a recipe ID into the URL to a recipe resource.zrecipes/)r   r	   r
   r   r   r   r   r   r   0   s   zRecipeSet._get_url_from_idÚrecipeNr   r   r   r   r   r   -   s    r   c                       sF   e Zd ZeejƒZeed< eed< dZdZ	ee	df‡ fdd„	Z
‡  ZS )r   ÚrecipesÚ	cookbookszhttp://cookbooks.dev/z1.0Nc                    s   t t| ƒjd |||d� d S )N)ÚcacheÚversion)Úsuperr   Ú__init__)r   Úservice_rootr   r   ©Ú	__class__r   r   r    @   s   

ÿz!CookbookWebServiceClient.__init__)r   r   r   Údictr   ÚRESOURCE_TYPE_CLASSESr   r   ÚDEFAULT_SERVICE_ROOTÚDEFAULT_VERSIONr    Ú__classcell__r   r   r"   r   r   7   s    
ÿN)r   ÚtypeÚ__metaclass__Ú__all__Úurllib.parser   ÚImportErrorÚurllibÚlazr.restfulclient.resourcer   r   r   r   r   r   r   r   r   Ú<module>   s   ÿÿ
