
    0                     0   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
 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.    )absolute_import)division)unicode_literals)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>0   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>;   s    cr   z>if left empty, will use the wildcard '-' to list all locationsr#   r%   r   r   r   !AllDefaultLocationAttributeConfigr,   5   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   GetCertificateMapResourceSpecr8   F   s3    			=%57)+::#
% %r   c            
          [         R                  " SS[        5       [        5       [	        5       [         R
                  SS9$ )NzKcertificatemanager.projects.locations.certificateMaps.certificateMapEntrieszcertificate map entryF)r1   certificateMapEntriesIdr2   r3   r4   r5   )r   r6   r   r   r'   r7   r   r   r   "GetCertificateMapEntryResourceSpecr;   P   s9    			S+@B57)+::#
% %r   c            	      p    [         R                  " SS[        5       [        5       [         R                  SS9$ )Nz2certificatemanager.projects.locations.certificatesr   F)r1   certificatesIdr3   r4   r5   )r   r6   r   r'   r7   r   r   r   GetCertificateResourceSpecr>   [   s3    			:!/1)+::#
% %r   c                  \    [         R                  " SS[        5       [         R                  S9$ Nz%certificatemanager.projects.locationsr   )r1   r3   r4   )r   r6   r'   r7   r   r   r   GetLocationResourceSpecrA   e   s*    			-)+::	
< <r   c                  \    [         R                  " SS[        5       [         R                  S9$ r@   )r   r6   r,   r7   r   r   r   !GetAllDefaultLocationResourceSpecrC   m   s*    			-35::	
< <r   c            	      p    [         R                  " SS[        5       [        5       [         R                  SS9$ )Nz0certificatemanager.projects.locations.operationsr.   F)r1   operationsIdr3   r4   r5   )r   r6   r/   r'   r7   r   r   r   GetOperationResourceSpecrF   u   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verbrJ   rK   rL   with_locationrM   s           r   '_GetCertificateResourcePresentationSpecrT      sL    * 	&(
#		4	4
 "ood!-
/ /r   c           	      b    [         R                  " U [        5       SR                  X5      UUUS9$ )NrI   )rJ   rK   rL   )r
   rN   r;   rO   )rP   rQ   rR   rJ   rK   rL   s         r   /_GetCertificateMapEntryResourcePresentationSpecrV      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.
rH   r   zThe certificate map--rI   )rJ   rM   N)r	   ConceptParserForResourcer8   rO   AddToParser)parserrR   r   rQ   
positionalrJ   rS   rM   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defaultrJ   help)r   ArgumentrO   )resource_typerJ   s     r   .GetClearCertificateMapArgumentForOtherResourcerf      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	   rY   rV   r[   )r\   rR   rQ   r]   s       r   !AddCertificateMapEntryResourceArgri      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.
rh   zThe certificateszto be attached to the entryr   z--certificatesFT)rJ   rK   rL   rS   N)r	   rY   rV   rT   r[   )r\   
entry_verb
entry_noun	cert_verb	cert_noun
cert_groups         r   1AddCertificateMapEntryAndCertificatesResourceArgsrp      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   rX   N)r	   rY   rT   r[   )	r\   rR   rQ   r   r]   rJ   rK   rL   rS   s	            r   AddCertificateResourceArgrr     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)rJ   N)rC   rA   r	   rY   rZ   rO   r[   )r\   rR   all_default_locationresource_specs       r   AddLocationResourceArgrv   =  sS     57M+-M++%%d+	 ,  ![(r   )TFNT)TFN)r   NTTT)F)NT)NNNN)Nr   TTFNT)rH   F)!__doc__
__future__r   r   r   googlecloudsdk.callioper    googlecloudsdk.calliope.conceptsr   r   (googlecloudsdk.command_lib.util.conceptsr	   r
   r   r   r   r'   r,   r/   r8   r;   r>   rA   rC   rF   rT   rV   r^   rf   ri   rp   rr   rv   r   r   r   <module>r|      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   