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   
