
    /                        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 r	S r
S	 rS
 rS rS rS rS rS rS rS rS r    SS jr   SS jr     SS jr SS jrS S jr    S!S jr       S"S jrS#S jrg)$z7Shared resource flags for Certificate Manager commands.    )base)concepts)deps)concept_parsers)presentation_specsc                  ,    [         R                  " SSS9$ )Nmapz'The certificate map for the {resource}.name	help_textr    ResourceParameterAttributeConfig     Clib/googlecloudsdk/command_lib/certificate_manager/resource_args.pyCertificateMapAttributeConfigr      s    		2	2E
G Gr   c                  ,    [         R                  " SSS9$ )Nentryz-The certificate map entry for the {resource}.r
   r   r   r   r   "CertificateMapEntryAttributeConfigr      s    		2	2M
O Or   c                  ,    [         R                  " SSS9$ )Ncertificatez#The certificate for the {resource}.r
   r   r   r   r   CertificateAttributeConfigr   #   s    		2	2$I
K Kr   c                  \    [         R                  " SS[        R                  " S S5      /S9$ )Nlocation&The Cloud location for the {resource}.c                      g)Nglobalr   r   r   r   <lambda>)LocationAttributeConfig.<locals>.<lambda>-   s    8r   z%default value of location is [global]r   r   fallthroughsr   r   r   Fallthroughr   r   r   LocationAttributeConfigr$   (   s5    		2	28


+BD
	 	r   c                  \    [         R                  " SS[        R                  " S S5      /S9$ )Nr   r   c                      g)N-r   r   r   r   r   3AllDefaultLocationAttributeConfig.<locals>.<lambda>8   s    cr   z>if left empty, will use the wildcard '-' to list all locationsr    r"   r   r   r   !AllDefaultLocationAttributeConfigr)   2   s5    		2	28


NP
	 	r   c                  ,    [         R                  " SSS9$ )N	operationz1Certificate Manager operation for the {resource}.r
   r   r   r   r   OperationAttributeConfigr,   =   s    		2	2C
E Er   c            	      p    [         R                  " SS[        5       [        5       [         R                  SS9$ )Nz5certificatemanager.projects.locations.certificateMapszcertificate mapF)resource_namecertificateMapsIdlocationsId
projectsIddisable_auto_completers)r   ResourceSpecr   r$    DEFAULT_PROJECT_ATTRIBUTE_CONFIGr   r   r   GetCertificateMapResourceSpecr5   C   s3    			=%57)+::#
% %r   c            
          [         R                  " SS[        5       [        5       [	        5       [         R
                  SS9$ )NzKcertificatemanager.projects.locations.certificateMaps.certificateMapEntrieszcertificate map entryF)r.   certificateMapEntriesIdr/   r0   r1   r2   )r   r3   r   r   r$   r4   r   r   r   "GetCertificateMapEntryResourceSpecr8   M   s9    			S+@B57)+::#
% %r   c            	      p    [         R                  " SS[        5       [        5       [         R                  SS9$ )Nz2certificatemanager.projects.locations.certificatesr   F)r.   certificatesIdr0   r1   r2   )r   r3   r   r$   r4   r   r   r   GetCertificateResourceSpecr;   X   s3    			:!/1)+::#
% %r   c                  \    [         R                  " SS[        5       [         R                  S9$ Nz%certificatemanager.projects.locationsr   )r.   r0   r1   )r   r3   r$   r4   r   r   r   GetLocationResourceSpecr>   b   s*    			-)+::	
< <r   c                  \    [         R                  " SS[        5       [         R                  S9$ r=   )r   r3   r)   r4   r   r   r   !GetAllDefaultLocationResourceSpecr@   j   s*    			-35::	
< <r   c            	      p    [         R                  " SS[        5       [        5       [         R                  SS9$ )Nz0certificatemanager.projects.locations.operationsr+   F)r.   operationsIdr0   r1   r2   )r   r3   r,   r$   r4   r   r   r   GetOperationResourceSpecrC   r   s3    			8+-)+::#
% %r   Nc           
          0 nU(       d  SUS'   [         R                  " U [        5       SR                  X5      UUUUS9$ )a  Returns ResourcePresentationSpec for certificate resource.

Args:
  flag: str, the flag name.
  noun: str, the resource; default: 'The certificate map'.
  verb: str, the verb to describe the resource, such as 'to update'.
  required: bool, if False, means that map ID is optional.
  plural: bool.
  group: args group.
  with_location: bool, if False, means that location flag is hidden.

Returns:
  presentation_specs.ResourcePresentationSpec.
 r   {} {}.)requiredpluralgroupflag_name_overrides)r   ResourcePresentationSpecr;   format)flagnounverbrG   rH   rI   with_locationrJ   s           r   '_GetCertificateResourcePresentationSpecrQ   |   sL    * 	&(
#		4	4
 "ood!-
/ /r   c           	      b    [         R                  " U [        5       SR                  X5      UUUS9$ )NrF   )rG   rH   rI   )r   rK   r8   rL   )rM   rN   rO   rG   rH   rI   s         r   /_GetCertificateMapEntryResourcePresentationSpecrS      s5     
	4	4
(*ood!
 r   c                     0 nU(       d  SUS'   U=(       d    Sn[         R                  R                  U(       a  UOSU-   [        5       SR	                  X15      UUS9R                  U 5        g)aN  Add a resource argument for a Certificate Manager certificate map.

NOTE: Must be used only if it's the only resource arg in the command.

Args:
  parser: the parser for the command.
  verb: str, the verb to describe the resource, such as 'to update'.
  name: str, the name of the main arg for the resource.
  noun: str, the resource; default: 'The certificate map'.
  positional: bool, if True, means that the map ID is a positional arg rather
    than a flag.
  required: bool, if False, means that map ID is optional.
  with_location: bool, if False, means that location flag is hidden.
rE   r   zThe certificate map--rF   )rG   rJ   N)r   ConceptParserForResourcer5   rL   AddToParser)parserrO   r   rN   
positionalrG   rP   rJ   s           r   AddCertificateMapResourceArgr[      sk    * 	&(
#		&&$++ddTk#%ood!- , /
 0;{6/Br   c           	      P    [         R                  " SSSUSR                  U 5      S9$ )zDReturns the flag for clearing a Certificate Manager certificate map.z--clear-certificate-map
store_trueFz1Removes any attached certificate map from the {}.)actiondefaultrG   help)r   ArgumentrL   )resource_typerG   s     r   .GetClearCertificateMapArgumentForOtherResourcerc      s2     
>EE

 r   c                     U=(       d    Sn[         R                  " [        U(       a  SOSX!5      /5      R                  U 5        g)a  Add a resource argument for a Certificate Manager certificate map entry.

NOTE: Must be used only if it's the only resource arg in the command.

Args:
  parser: the parser for the command.
  verb: str, the verb to describe the resource, such as 'to update'.
  noun: str, the resource; default: 'The certificate map'.
  positional: bool, if True, means that the map ID is a positional arg rather
    than a flag.
The certificate map entryr   z--entryN)r   rV   rS   rX   )rY   rO   rN   rZ   s       r   !AddCertificateMapEntryResourceArgrf      s?     
	,,$5'Y<!  [r   c                     U=(       d    SnU=(       d    SnU=(       d    Sn[         R                  " [        SUU5      [        SUUSSUSS9/5      R	                  U 5        g	)
aH  Add a resource argument for a Certificate Manager certificate map entry and certificates.

NOTE: Must be used only if these are the only resource args in the command.

Args:
  parser: the parser for the command.
  entry_verb: str, the verb to describe the entry, such as 'to update'.
  entry_noun: str, the entry resource; default: 'The certificate map entry'.
  cert_verb: str, the verb to describe the cert, default: 'to be attached to
    the entry'.
  cert_noun: str, the certificate resources; default: 'The certificates'.
  cert_group: args group certificates should belong to.
re   zThe certificateszto be attached to the entryr   z--certificatesFT)rG   rH   rI   rP   N)r   rV   rS   rQ   rX   )rY   
entry_verb
entry_noun	cert_verb	cert_noun
cert_groups         r   1AddCertificateMapEntryAndCertificatesResourceArgsrm      sq    & 88*--)88)5gz6@B-


!  [r   c	                     U=(       d    Sn[         R                  " [        U(       a  SOSU-   UUUUUU5      /5      R                  U 5        g)ao  Add a resource argument for a Certificate Manager certificate.

NOTE: Must be used only if it's the only resource arg in the command.

Args:
  parser: the parser for the command.
  verb: str, the verb to describe the resource, such as 'to update'.
  noun: str, the resource; default: 'The certificate'.
  name: str, the name of the flag.
  positional: bool, if True, means that the certificate ID is a positional arg
    rather than a flag.
  required: bool, if True the flag is required.
  plural: bool, if True the flag is a list.
  group: args group.
  with_location: bool, if False, means that location flag is hidden.
zThe certificater   rU   N)r   rV   rQ   rX   )	rY   rO   rN   r   rZ   rG   rH   rI   rP   s	            r   AddCertificateResourceArgro     sS    6 
	""$-%-4$;






! 
 [r   c                     U(       a  [        5       nO
[        5       n[        R                  R	                  SUSR                  U5      SS9R                  U 5        g)aF  Add a resource argument for a cloud location.

NOTE: Must be used only if it's the only resource arg in the command.

Args:
  parser: the parser for the command.
  verb: str, the verb to describe the resource, such as 'to update'.
  all_default_location: bool, if True, the default for the location flag will
  be set to '-'.
z
--locationzThe Cloud location {}.T)rG   N)r@   r>   r   rV   rW   rL   rX   )rY   rO   all_default_locationresource_specs       r   AddLocationResourceArgrs   :  sS     57M+-M++%%d+	 ,  ![(r   )TFNT)TFN)r	   NTTT)F)NT)NNNN)Nr   TTFNT)rE   F)__doc__googlecloudsdk.callioper    googlecloudsdk.calliope.conceptsr   r   (googlecloudsdk.command_lib.util.conceptsr   r   r   r   r   r$   r)   r,   r5   r8   r;   r>   r@   rC   rQ   rS   r[   rc   rf   rm   ro   rs   r   r   r   <module>rx      s    > ) 5 1 D GG
O
K
		E%%%<<% 6:3826:>/J >B;@:>" ',&*,0*./3CD =B	* BF@D@DAE!N 
	
&R)r   