HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //proc/1233/cwd/usr/lib/python3/dist-packages/docker/models/__pycache__/resource.cpython-310.pyc
o

�2.a3
�@s Gdd�d�ZGdd�d�ZdS)c@sVeZdZdZdZddd�Zdd�Zdd	�Zd
d�Ze	dd
��Z
e	dd��Zdd�ZdS)�ModelzF
    A base class for representing a single object on the server.
    �IdNcCs*||_||_||_|jduri|_dSdS�N)�client�
collection�attrs)�selfrrr�r�8/usr/lib/python3/dist-packages/docker/models/resource.py�__init__s

�zModel.__init__cCsd|jj�d|j�d�S)N�<z: �>)�	__class__�__name__�short_id�rrrr	�__repr__�zModel.__repr__cCst||j�o|j|jkSr)�
isinstancer
�id)r�otherrrr	�__eq__rzModel.__eq__cCst|jj�d|j���S)N�:)�hashr
rrrrrr	�__hash__rzModel.__hash__cCs|j�|j�S)z'
        The ID of the object.
        )r�get�id_attributerrrr	r�zModel.idcCs|jdd�S)zC
        The ID of the object, truncated to 10 characters.
        N�
)rrrrr	r#rzModel.short_idcCs|j�|j�}|j|_dS)zh
        Load this object from the server again and update ``attrs`` with the
        new data.
        N)rrrr)r�	new_modelrrr	�reload*szModel.reload)NNN)
r�
__module__�__qualname__�__doc__rr
rrr�propertyrrrrrrr	rs


rc@sHeZdZdZdZddd�Zdd�Zdd�Zd	d
�Zddd�Z	d
d�Z
dS)�
Collectionz[
    A base class for representing all objects of a particular type on the
    server.
    NcCs
||_dSr)r)rrrrr	r
<s
zCollection.__init__cOstd�|jj���)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�kwargsrrr	�__call__As
�zCollection.__call__cC�t�r��NotImplementedErrorrrrr	�listG�zCollection.listcCr*rr+)r�keyrrr	rJr.zCollection.getcCr*rr+�rrrrr	�createMr.zCollection.createcCsLt|t�r|j|_||_|St|t�r|j||j|d�Std|jj|f��)z:
        Create a model from a set of attributes.
        )rrrzCan't create %s from %s)rrrr�dict�model�	Exceptionrr0rrr	�
prepare_modelPs


�zCollection.prepare_modelr)rr r!r"r3r
r)r-rr1r5rrrr	r$3s

r$N)rr$rrrr	�<module>s2