
                             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dl
mZ 	 	 	 dd	Z	 	 	 dd
Z	 	 	 ddZd Zd Zd Zd Zd Zd ZddZd Zy)z6Shared resource flags for Dataproc Metastore commands.    )absolute_import)division)unicode_literals)concepts)deps)concept_parsers)
propertiesc                     d|rdndz   }t        ||      }t        j                  j                  |t	               dj                  ||      ||      j                  |        y)a  Add a resource argument for a Dataproc Metastore Service.

  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, for example, 'to update'.
    positional: boolean, if True, means that the resource is a positional rather
      than a flag.
    required: boolean, if True, the arg is required
    plural: boolean, if True, expects a list of resources
  services 
The {} {}.requiredpluralN)_BuildArgNamer   ConceptParserForResourceGetServiceResourceSpecformatAddToParserparserverb
positionalr   r   nounnames          9lib/googlecloudsdk/command_lib/metastore/resource_args.pyAddServiceResourceArgr      sb    " 
Vc	,$	tZ	($++
$% , 
 ![(    c                     d|rdndz   }t        ||      }t        j                  j                  |t	               dj                  ||      ||      j                  |        y)a  Add a resource argument for a Dataproc Metastore long-running operation.

  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, for example, 'to update'.
    positional: boolean, if True, means that the resource is a positional rather
      than a flag.
    required: boolean, if True, the arg is required
    plural: boolean, if True, expects a list of resources
  	operationr   r   r   r   N)r   r   r   r   GetOperationResourceSpecr   r   r   s          r   AddOperationResourceArgr$   6   sb    " 
v2	.$	tZ	($++
 $% , 
 ![(r    c                     d|rdndz   }t        ||      }t        j                  j                  |t	               dj                  ||      ||      j                  |        y)a  Add a resource argument for a Dataproc Metastore Federation.

  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, for example, 'to update'.
    positional: boolean, if True, means that the resource is a positional rather
      than a flag.
    required: boolean, if True, the arg is required
    plural: boolean, if True, expects a list of resources
  
federationr   r   r   r   N)r   r   r   r   GetFederationResourceSpecr   r   r   s          r   AddFederationResourceArgr(   Q   sb    " 
B	/$	tZ	($++
!$% , 
 ![(r    c                  r    t        j                  ddt         j                  t               t	                     S )Nz%metastore.projects.locations.servicesr   )resource_name
projectsIdlocationsId
servicesId)r   ResourceSpec DEFAULT_PROJECT_ATTRIBUTE_CONFIGLocationAttributeConfigServiceAttributeConfig r    r   r   r   l   s0    			-::)+')
+ +r    c                  r    t        j                  ddt         j                  t               t	                     S )Nz'metastore.projects.locations.operationsr"   )r*   r+   r,   operationsId)r   r.   r/   r0   OperationAttributeConfigr2   r    r   r#   r#   u   s0    			/::)++-
/ /r    c                  r    t        j                  ddt         j                  t               t	                     S )Nz(metastore.projects.locations.federationsr&   )r*   r+   r,   federationsId)r   r.   r/   r0   FederationAttributeConfigr2   r    r   r'   r'   ~   s0    			0 ::)+-/
1 1r    c                  0    t        j                  dd      S )Nr   z.Dataproc Metastore service for the {resource}.r   	help_textr    ResourceParameterAttributeConfigr2   r    r   r1   r1      s    		2	2@
B Br    c                  0    t        j                  dd      S )Nr&   z1Dataproc Metastore federation for the {resource}.r:   r<   r2   r    r   r8   r8      s    		2	2C
E Er    c                  0    t        j                  dd      S )Nr"   z0Dataproc Metastore operation for the {resource}.r:   r<   r2   r    r   r5   r5      s    		2	2B
D Dr    c                     t        j                  dd| r=t        j                  t        j
                  j                  j                        g      S g       S )Nlocationz)Location to which the {resource} belongs.)r   r;   fallthroughs)r   r=   r   PropertyFallthroughr	   VALUES	metastorerA   )fallthroughs_enableds    r   r0   r0      sV    		2	2;   
"
":#4#4#>#>#G#G
H
* *
 &(
* *r    c                 8    dj                  |rd|       S d|       S )Nz{}{}r   z--)r   )r   r   s     r   r   r      s    	Zr4	88T4	88r    N)TTF)T)__doc__
__future__r   r   r    googlecloudsdk.calliope.conceptsr   r   (googlecloudsdk.command_lib.util.conceptsr   googlecloudsdk.corer	   r   r$   r(   r   r#   r'   r1   r8   r5   r0   r   r2   r    r   <module>rM      sz    = &  ' 5 1 D *
 &*#'!&	): (,%)#(	): )-&*$)	)6+/1BED*9r    