
                             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 Z
d	 Zd
 Zd Zd Zd ZddZddZddZy)z1Shared resource flags for Cloud Domains commands.    )absolute_import)division)unicode_literals)concepts)deps)concept_parsersc                  0    t        j                  dd      S )Nregistrationz+The domain registration for the {resource}.name	help_textr    ResourceParameterAttributeConfig     7lib/googlecloudsdk/command_lib/domains/resource_args.pyRegistrationAttributeConfigr          		2	2=
? ?r   c                  ^    t        j                  ddt        j                  d d      g      S )Nlocationz&The Cloud location for the {resource}.c                       y)Nglobalr   r   r   r   <lambda>z)LocationAttributeConfig.<locals>.<lambda>%   s    8r   zlocation is always global)r   r   fallthroughs)r   r   r   Fallthroughr   r   r   LocationAttributeConfigr       s2    		2	28


+-H
I
	 	r   c                  0    t        j                  dd      S )Nr
   z+Cloud Domains operation for the {resource}.r   r   r   r   r   OperationAttributeConfigr   )   r   r   c                  t    t        j                  ddt               t               t         j                  d      S )Nz(domains.projects.locations.registrationsr
   F)resource_nameregistrationsIdlocationsId
projectsIddisable_auto_completers)r   ResourceSpecr   r    DEFAULT_PROJECT_ATTRIBUTE_CONFIGr   r   r   GetRegistrationResourceSpecr'   /   s3    			0"13)+::#
% %r   c                  `    t        j                  ddt               t         j                        S )Nzdomains.projects.locationsr   )r    r"   r#   )r   r%   r   r&   r   r   r   GetLocationResourceSpecr)   9   s*    			")+::	
< <r   c                  t    t        j                  ddt               t               t         j                  d      S )Nz%domains.projects.locations.operations	operationF)r    operationsIdr"   r#   r$   )r   r%   r   r   r&   r   r   r   GetOperationResourceSpecr-   A   s3    			-+-)+::#
% %r   Nc                     |xs d}t         j                  j                  |rdndt               dj	                  ||      dddi      j                  |        y	)
a  Add a resource argument for a Cloud Domains registration.

  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 domain registration'.
    positional: bool, if True, means that the registration ID is a positional
      arg rather than a flag.
  zThe domain registrationr
   z--registrationz{} {}.Tr    requiredflag_name_overridesN)r   ConceptParserForResourcer'   formatAddToParser)parserverbnoun
positionals       r   AddRegistrationResourceArgr;   K   s]     
	**$++"n(8!#oodD!
b , 	 
V	r   c                     t         j                  j                  dt               dj	                  |      dddi      j                  |        y)zAdd 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'.
  z
--locationzThe Cloud location {}.Tr   r/   r0   N)r   r3   r4   r)   r5   r6   )r7   r8   s     r   AddLocationResourceArgr=   b   sM     ++%%d+
b , 	 
V	r   c                     t         j                  j                  |rdndt               dj	                  |      dddi      j                  |        y)	ai  Add a resource argument for a Cloud Domains registration.

  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'.
    positional: bool, if True, means that the registration ID is a positional
      arg rather than a flag.
  r+   z--operationzThe operation {}.Tr   r/   r0   N)r   r3   r4   r-   r5   r6   )r7   r8   r:   s      r   AddOperationResourceArgr?   u   sQ     ++k]   &
b , 	 
V	r   )NT)r/   )T)__doc__
__future__r   r   r    googlecloudsdk.calliope.conceptsr   r   (googlecloudsdk.command_lib.util.conceptsr   r   r   r   r'   r)   r-   r;   r=   r?   r   r   r   <module>rD      sI    8 &  ' 5 1 D?	?%<%.&r   