
    2.a5                     L    d dl mZ ddlmZmZ  G d de      Z G d de      Zy)	   )	APIClient   )Model
Collectionc                   0    e Zd ZdZdZd Zed        Zd Zy)Secretz	A secret.IDc                 P    d| j                   j                   d| j                   dS )N<z: 'z'>)	__class____name__nameselfs    7/usr/lib/python3/dist-packages/docker/models/secrets.py__repr__zSecret.__repr__	   s&    4>>**+3tyyk<<    c                 &    | j                   d   d   S )NSpecName)attrsr   s    r   r   zSecret.name   s    zz&!&))r   c                 `    | j                   j                  j                  | j                        S )z
        Remove this secret.

        Raises:
            :py:class:`docker.errors.APIError`
                If secret failed to remove.
        )clientapiremove_secretidr   s    r   removezSecret.remove   s!     {{,,TWW55r   N)	r   
__module____qualname____doc__id_attributer   propertyr   r    r   r   r   r      s(    L= * *6r   r   c                   \    e Zd ZdZeZd Zej                  j                  e_        d Z	d Z
y)SecretCollectionzSecrets on the Docker server.c                      | j                   j                  j                  di |}|j                  d      |j	                  di       d<   | j                  |      S )Nr   r   r   r#   )r   r   create_secretget
setdefaultprepare_model)r   kwargsobjs      r   createzSecretCollection.create   sN    +dkkoo++5f5-3ZZ-?vr"6*!!#&&r   c                 j    | j                  | j                  j                  j                  |            S )ac  
        Get a secret.

        Args:
            secret_id (str): Secret ID.

        Returns:
            (:py:class:`Secret`): The secret.

        Raises:
            :py:class:`docker.errors.NotFound`
                If the secret does not exist.
            :py:class:`docker.errors.APIError`
                If the server returns an error.
        )r*   r   r   inspect_secret)r   	secret_ids     r   r(   zSecretCollection.get%   s(      !!$++//"@"@"KLLr   c                      | j                   j                  j                  di |}|D cg c]  }| j                  |       c}S c c}w )aT  
        List secrets. Similar to the ``docker secret ls`` command.

        Args:
            filters (dict): Server-side list filtering options.

        Returns:
            (list of :py:class:`Secret`): The secrets.

        Raises:
            :py:class:`docker.errors.APIError`
                If the server returns an error.
        r#   )r   r   secretsr*   )r   r+   respr,   s       r   listzSecretCollection.list7   s@     't{{&&00378C""3'888s   AN)r   r   r   r    r   modelr-   r   r'   r(   r4   r#   r   r   r%   r%      s/    'E' ,,44FNM$9r   r%   N)r   r   resourcer   r   r   r%   r#   r   r   <module>r7      s#     '6U 6,+9z +9r   