
                         N    S r SSKJr  SSKJr  S rS rS rS rS rS	 r	SS
 jr
g)z.Shared flags for Certificate Manager commands.    )arg_parsers)basec                 B    [         R                  R                  U 5        g)zHAdds async flag. It's not marked as go/gcloud-style#commonly-used-flags.N)r   
ASYNC_FLAGAddToParserparsers    ;lib/googlecloudsdk/command_lib/certificate_manager/flags.pyAddAsyncFlagToParserr      s    //f%    c                     [         R                  " SSR                  U5      [         R                  S9R	                  U 5        g)zAdds description flag.z--descriptionzText description of a {}.)helpcategoryN)r   ArgumentformatCOMMONLY_USED_FLAGSr   )r	   resource_names     r
   AddDescriptionFlagToParserr      s4    --&--m<'') *5V)<r   c                 
   [         R                  " SSSS9n[         R                  " SSS9n[         R                  " SS	S	[         R                  S
9nUR	                  U5        UR	                  U5        UR                  U 5        g)z2Adds flags defining certificate map entry matcher.z--set-primaryzcThe certificate will be used as the default cert if no other certificate in the map matches on SNI.
store_true)r   actionz
--hostnamezA domain name (FQDN), which controls when list of certificates specified in the resource will be taken under consideration for certificate selection.)r   z=Arguments to configure matcher for the certificate map entry.T)r   requiredmutexr   N)r   r   ArgumentGroupr   AddArgumentr   )r	   is_primary_flaghostname_flaggroups       r
   AddMapEntryMatcherFlagsToParserr   #   s    MMp/ -- c- 

J''	)%
 O$M"Fr   c                 l   [         R                  " SS[        R                  " 5       SS9n[         R                  " SS[        R                  " 5       SS9n[         R                  " SUU(       d  [         R
                  OSS	9nUR                  U5        UR                  U5        UR                  U 5        g)
z1Adds certificate file and private key file flags.z--certificate-filez)The certificate data in PEM-encoded form.T)r   typer   z--private-key-filez)The private key data in PEM-encoded form.z5Arguments to configure self-managed certificate data.N)r   r   r   )r   r   r   FileContentsr   r   r   r   )r	   is_required	cert_flagkey_flagr   s        r
   *AddSelfManagedCertificateDataFlagsToParserr&   7   s    
 mm6##%	)
 ]]6##%	( 

B/:t''F% IHFr   c           	          / SQn[         R                  " SS[        R                  " 5       [        R                  SR                  U5      SS9R                  U 5        g)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--tagsz	KEY=VALUE
T)metavarr!   r   r   hiddenN)r   r   r   ArgDictUpdateActionjoinr   )r	   
help_partss     r
   GetTagsr/   P   sM    * -- %%99Z  Kr   c                     [        U 5        g)zpAdds create command tags flags to an argparse parser.

Args:
  parser: The argparse parser to add the flags to.
N)r/   r   s    r
   AddTagsFlagsr1   b   s     
&/r   c                     [        X5      nU(       d  gU" [        UR                  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)getattrsorteditemsAdditionalProperty)argstags_messagetags_arg_nametagsr3   r4   s         r
   GetTagsFromArgsr>   k   sZ    		%$		tzz|,,.,*# %%#%;,,. 
/ / ,.s   A
N)r=   )__doc__googlecloudsdk.callioper   r   r   r   r   r&   r/   r1   r>    r   r
   <module>rB      s5    5 0 (&
=(2$/r   