
    	                     B    d Z ddlmZ ddlmZ ddlmZ  G d de      Zy)z Encapsulation of a docker image.    )absolute_import)division)unicode_literalsc                   l    e Zd ZdZ	 	 d	dZed        Zed        Zed        Zed        Z	ed        Z
y)
ImagezEDocker image that requires building and should be removed afterwards.Nc                 X    || _         || _        || _        || _        || _        d| _        y)aZ  Initializer for Image.

    Args:
      dockerfile_dir: str, Path to the directory with the Dockerfile.
      repo: str, Repository name to be applied to the image in case of
          successful build.
      tag: str, Repository tag to be applied to the image in case of successful
          build.
      nocache: boolean, True if cache should not be used when building the
          image.
      rm: boolean, True if intermediate images should be removed after a
          successful build. Default value is set to True because this is the
          default value used by "docker build" command.
    N)_dockerfile_dir_repo_tag_nocache_rm_id)selfdockerfile_dirrepotagnocacherms         .lib/googlecloudsdk/api_lib/app/docker_image.py__init__zImage.__init__   s/      *DDJDIDMDHDH    c                     | j                   S )z4Returns the directory the image is to be built from.)r	   r   s    r   r   zImage.dockerfile_dir2   s     r   c                     | j                   S )z:Returns 64 hexadecimal digit string identifying the image.)r   r   s    r   idzImage.id7   s     88Or   c                     | j                   S )zReturns image repo string.)r
   r   s    r   r   z
Image.repo=   s     ::r   c                     | j                   S )zReturns image tag string.)r   r   s    r   r   z	Image.tagB   s     99r   c                 ~    | j                   r&dj                  | j                  | j                         S | j                  S )z1Returns image repo string with tag, if it exists.z{0}:{1})r   formatr   r   s    r   tagged_repozImage.tagged_repoG   s.     59HH9DIItxx0K$))Kr   )NNNFT)__name__
__module____qualname____doc__r   propertyr   r   r   r   r     r   r   r   r      sv    MGL0      
     L Lr   r   N)r$   
__future__r   r   r   objectr   r&   r   r   <module>r)      s!     ' &  '3LF 3Lr   