
                             d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZ  e	j                  e	j                  j                         G d	 d
e	j                               Zy)zCommand to create a new Lien.    )absolute_import)division)unicode_literals)error)liens)base)
propertiesc                   D    e Zd ZdZed        Zej                  d        Zy)CreatezGCreate a new lien.

  Creates a new lien to be applied to a project.
  c                     t        j                  ddd      j                  |        t        j                  ddd      j                  |        t        j                  ddd	      j                  |        y )
Nz--restrictionsTz3Comma separated list of IAM permissions to curtail.)requiredhelpz--reasonz=Human-readable description of why this lien is being applied.z--originFz/Origin of this lien. Defaults to user identity.)r   ArgumentAddToParser)parsers    ,lib/surface/resource_manager/liens/create.pyArgszCreate.Args"   sl    MMBD EPKEMML k&MM> k&    c                    dt         j                  j                  j                  j	                  d      z   }|j
                  }|s4t         j                  j                  j                  j	                  d      }t        j                         }t        j                         j                  |j                  ||j                  j                  d      ||j                              S )Nz	projects/T)r   ,)parentrestrictionsoriginreason)r	   VALUEScoreprojectGetr   accountr   LiensMessagesLiensServicer   Lienr   splitr   )selfargsr   r   messagess        r   Runz
Create.Run4   s    :,,1199==t=LLF [[F  %%--1141@f""$H&&**005;;	 	 	 ! !r   N)	__name__
__module____qualname____doc__staticmethodr   r   EmitErrorDetailsr'    r   r   r   r      s5    
  " 	! !r   r   N)r+   
__future__r   r   r   'googlecloudsdk.api_lib.resource_managerr   r   googlecloudsdk.callioper   googlecloudsdk.corer	   ReleaseTracksReleaseTrackALPHACreateCommandr   r.   r   r   <module>r7      sY    $ &  ' 9 9 ( * D%%++,(!T (! -(!r   