
    2.a3
                     ,     G d  d      Z  G d d      Zy)c                   T    e Zd ZdZdZddZd Zd Zd Ze	d        Z
e	d	        Zd
 Zy)ModelzF
    A base class for representing a single object on the server.
    IdNc                 V    || _         || _        || _        | j                  i | _        y y N)client
collectionattrs)selfr	   r   r   s       8/usr/lib/python3/dist-packages/docker/models/resource.py__init__zModel.__init__   s1     % 
::DJ     c                 P    d| j                   j                   d| j                   dS )N<z: >)	__class____name__short_idr
   s    r   __repr__zModel.__repr__   s&    4>>**+2dmm_A>>r   c                 d    t        || j                        xr | j                  |j                  k(  S r   )
isinstancer   id)r
   others     r   __eq__zModel.__eq__   s%    %0HTWW5HHr   c                 ^    t        | j                  j                   d| j                         S )N:)hashr   r   r   r   s    r   __hash__zModel.__hash__   s'    t~~../q	:;;r   c                 L    | j                   j                  | j                        S )z'
        The ID of the object.
        )r	   getid_attributer   s    r   r   zModel.id   s    
 zz~~d//00r   c                      | j                   dd S )zC
        The ID of the object, truncated to 10 characters.
        N
   )r   r   s    r   r   zModel.short_id#   s    
 wws|r   c                 p    | j                   j                  | j                        }|j                  | _        y)zh
        Load this object from the server again and update ``attrs`` with the
        new data.
        N)r   r    r   r	   )r
   	new_models     r   reloadzModel.reload*   s'    
 OO''0	__
r   )NNN)r   
__module____qualname____doc__r!   r   r   r   r   propertyr   r   r&    r   r   r   r      sP     L
?I< 1 1  %r   r   c                   <    e Zd ZdZdZd	dZd Zd Zd Zd	dZ	d Z
y)

Collectionz[
    A base class for representing all objects of a particular type on the
    server.
    Nc                     || _         y r   )r   )r
   r   s     r   r   zCollection.__init__<   s     r   c                 ^    t        dj                  | j                  j                              )Nzk'{}' object is not callable. You might be trying to use the old (pre-2.0) API - use docker.APIClient if so.)	TypeErrorformatr   r   )r
   argskwargss      r   __call__zCollection.__call__A   s(    :VDNN++,. 	.r   c                     t         r   NotImplementedErrorr   s    r   listzCollection.listG       !!r   c                     t         r   r6   )r
   keys     r   r    zCollection.getJ   r9   r   c                     t         r   r6   r
   r	   s     r   createzCollection.createM   r9   r   c                     t        |t              r| j                  |_        | |_        |S t        |t              r| j                  || j                  |       S t        d| j
                  j                  d|      )z:
        Create a model from a set of attributes.
        )r	   r   r   zCan't create z from )r   r   r   r   dictmodel	Exceptionr   r=   s     r   prepare_modelzCollection.prepare_modelP   sj     eU#;;EL#ELt$::E$++$:OO!ZZ00%9 : :r   r   )r   r'   r(   r)   rA   r   r4   r8   r    r>   rC   r+   r   r   r-   r-   3   s,     E
.""":r   r-   N)r   r-   r+   r   r   <module>rD      s   /% /%d): ):r   