
                             S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJ	r	  SSKJr
  SSKJr  SS	KJr  SS
KrS rS r\	R$                  S 5       rS rS rS rS rS rS rSS jrS rS rS rS rSS jrg
)z.Flags for commands that deal with the CRM API.    )absolute_import)division)unicode_literals)
exceptions)arg_parsers)base)concepts)concept_parsersNc                 L    [         R                  " SSSR                  U 5      S9$ )Nid	FOLDER_IDID for the folder {0}metavarhelpr   Argumentformatuse_descriptions    8lib/googlecloudsdk/command_lib/resource_manager/flags.pyFolderIdArgr      s'    	
"))/:
     c                 L    [         R                  " SSSR                  U 5      S9$ )Nr   CAPABILITY_IDzID for the capability {0}r   r   r   s    r   CapabilityIdArgr   &   s'    	
&--o>
 r   c                 N    [         R                  " SSS SR                  U 5      S9$ )N--folderr   r   )r   defaultr   r   r   s    r   FolderIdFlagr    .   s*    	"))/:	
 r   c                 L    [         R                  " SSSR                  U 5      S9$ )N--organizationORGANIZATION_IDzID for the organization {0}r   r   r   s    r   OrganizationIdFlagr$   8   s'    	(//@
 r   c                 L    [         R                  " SSSR                  U 5      S9$ )Nr   OPERATION_IDzID for the operation {0}r   r   r   s    r   OperationIdArgr'   @   s'    	
%,,_=
 r   c                  "    [         R                  $ )N)r   
ASYNC_FLAG r   r   OperationAsyncFlagr+   H   s    	r   c                 L    [         R                  " SSSR                  U 5      S9$ )Nr   LIEN_IDzID for the lien {0}r   r   r   s    r   	LienIdArgr.   L   s'    	
 ''8
 r   c                 l    [        S5      R                  U 5        [        S5      R                  U 5        g )Nzto use as a parent)r    AddToParserr$   )parsers    r   AddParentFlagsToParserr2   T   s*    #$008)*66v>r   c                     [        U SS 5      (       a  SR                  U R                  5      $ U R                  (       a  SR                  U R                  5      $ g )Nfolderzfolders/{0}zorganizations/{0})getattrr   r4   organization)argss    r   GetParentFromFlagsr8   Y   sI    T8T"",,%%d&7&788r   c                 `   [        U SS5      (       a(  U R                  (       a  [        R                  " SS5      eU(       am  SU ;   a8  U R                  (       d'  U R                  (       d  [
        R                  " S5      eSU ;  a(  U R                  (       d  [
        R                  " S5      eggg)a^  Assert that there are no conflicts with parent flags.

Ensure that both the organization flag and folder flag are not set at the
same time. This is a little tricky since the folder flag doesn't exist for
all commands which accept a parent specification.

Args:
  args: The argument object
  parent_required: True to assert that a parent flag was set
r4   Nr   r"   zBNeither --folder nor --organization provided, exactly one requiredz--organization is required)r5   r6   calliope_exceptionsConflictingArgumentsExceptionr4   r   ArgumentError)r7   parent_requireds     r   CheckParentFlagsr>   b   s     T8T""t'8'8

;
;$  4D4E4E$$
N  
	d&7&7$$%ABB '8	 r   c                  ,    [         R                  " SSS9$ )Nr4   zThe folder id)name	help_text)r	    ResourceParameterAttributeConfigr*   r   r   FolderAttributeConfigrC   z   s    		2	2
 r   c                  @    [         R                  " SSS[        5       S9$ )Nzcloudresourcemanager.foldersr4   v2)resource_nameapi_version	foldersId)r	   ResourceSpecrC   r*   r   r   GetFolderResourceSpecrJ      s$    			$%'	
 r   c                 p    [         R                  R                  S[        5       SR	                  U 5      SS9$ )N	folder_idz ID for the folder you want to {}T)required)r
   ConceptParserForResourcerJ   r   )verbs    r   GetFolderResourceArgrQ      s:    		&	&	2	2(//5	 
3 
 r   c            	          / SQn [         R                  " SS[        R                  " 5       [        R                  SR                  U 5      S9$ )z(Makes the base.Argument for --tags flag.)z%List of tags KEY=VALUE pairs to bind.zEach item must be expressed asz4`<tag-key-namespaced-name>=<tag-value-short-name>`.
z?Example: `123/environment=production,123/costCenter=marketing`
z)Note: Currently this field is in Preview.z--tagsz	KEY=VALUE
)r   typeactionr   )r   r   r   ArgDictUpdateActionjoin)
help_partss    r   TagsFlagrZ      sC    * 
 %%99Z 
 r   c                     [        X5      nU(       d  gU" [        [        R                  " U5      5       VVs/ s H  u  pEUR	                  XES9PM     snnS9$ s  snnf )zMakes the tags message object.N)keyvalue)additionalProperties)r5   sortedsix	iteritemsAdditionalProperty)r7   tags_messagetags_arg_nametagsr\   r]   s         r   GetTagsFromFlagsrf      s_    		%$		 #3==#677jc 
)
)c
)
?7
 s   A
)T)re   ) __doc__
__future__r   r   r   'googlecloudsdk.api_lib.resource_managerr   googlecloudsdk.callioper   r   r:    googlecloudsdk.calliope.conceptsr	   (googlecloudsdk.command_lib.util.conceptsr
   r`   r   r   Hiddenr    r$   r'   r+   r.   r2   r8   r>   rC   rJ   rQ   rZ   rf   r*   r   r   <module>rn      s    5 &  ' > / ( E 5 D 
  ?
C0$r   