
    "                         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	lmZ d
Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zy)z3Shared resource arguments for Cloud Batch commands.    )absolute_import)division)unicode_literals)concepts)deps)concept_parsers)presentation_specs)
propertiesz!@#$%^c                      t        j                  t        j                  j                  j
                        g} t        j                  dd|       S )Nlocationz)Google Cloud location for the {resource}.name	help_textfallthroughs)r   PropertyFallthroughr
   VALUESbatchr   r    ResourceParameterAttributeConfig)ftss    5lib/googlecloudsdk/command_lib/batch/resource_args.pyLocationAttributeConfigr      sC    		!	!*"3"3"9"9"B"B	CD#		2	2;
     c                  0    t        j                  dd      S )NjobThe job ID for the {resource}.r   r   r   r    r   r   JobAttributeConfigr   '   s    		2	20
2 2r   c                  0    t        j                  dd      S )N
task_groupz%The task_group ID for the {resource}.r   r   r   r   r   TaskGroupAttributeConfigr"   -   s    		2	27
9 9r   c                  0    t        j                  dd      S )NtaskzThe task ID for the {resource}.r   r   r   r   r   TaskAttributeConfigr%   3   s    		2	21
3 3r   c                  `    t        j                  ddt               t         j                        S )Nzbatch.projects.locationsr   )resource_namelocationsId
projectsId)r   ResourceSpecr    DEFAULT_PROJECT_ATTRIBUTE_CONFIGr   r   r   GetLocationResourceSpecr,   9   s*    			 )+::	
< <r   c                  r    t        j                  ddt               t               t         j                        S )Nbatch.projects.locations.jobsr   r'   jobsIdr(   r)   )r   r*   r   r   r+   r   r   r   GetJobResourceSpecr1   A   s0    			%!)+::
< <r   c                      t        j                  ddt        j                  ddt        j                  t
        d      g      t               t         j                        S )Nr.   r   r   z9job ID is optional and will be generated if not specifiedhintr   r/   )r   r*   r   r   ValueFallthrough	INVALIDIDr   r+   r   r   r   GetSubmitJobResourceSpecr7   J   s]    			%664
 ###  *+::)
 r   c            	          t        j                  ddt               t               t	               t               t         j                        S )Nz.batch.projects.locations.jobs.taskGroups.tasksr$   )r'   tasksIdtaskGroupsIdr0   r(   r)   )r   r*   r%   r"   r   r   r+   r   r   r   GetTaskResourceSpecr;   c   s<    			6!#+-!)+::
< <r   c                     t        j                  dt               dd      g}t        j                  |      j                  |        y)zWAdd the location resource argument.

  Args:
    parser: the parser for the command.
  z
--locationzThe Batch location resource. If you omit this flag, the defaultlocation is used if you set the batch/location property.Otherwise, omitting this flag lists jobs across all locations.FrequiredN)r	   ResourcePresentationSpecr,   r   ConceptParserAddToParserparser	arg_specss     r   AddLocationResourceArgsrE   n   sH     11

!
#L 	) 	*66v>r   c                     t        j                  dt               dd      g}t        j                  |      j                  |        y)zZAdd the job resource argument as flag.

  Args:
    parser: the parser for the command.
  z--jobzLThe Batch job resource. If not specified,the current batch/location is used.Tr=   Nr	   r?   r1   r   r@   rA   rB   s     r   AddJobFlagResourceArgsrH      sE     11


1) 	*66v>r   c                     t        j                  dt               dd      g}t        j                  |      j                  |        yz`Add the job resource argument as positional.

  Args:
    parser: the parser for the command.
  JOBzWThe Batch job resource. If --location not specified,the current batch/location is used.Tr=   NrG   rB   s     r   AddJobResourceArgsrL      sE     11


1) 	*66v>r   c                     t        j                  dt               dd      g}t        j                  |      j                  |        yrJ   )r	   r?   r7   r   r@   rA   rB   s     r   AddSubmitJobResourceArgsrN      sE     11

"
$1) 	*66v>r   c                     t        j                  dt               dd      g}t        j                  |      j                  |        y)zSAdd the task resource argument.

  Args:
    parser: the parser for the command.
  TASKzMThe Batch task resource. If not specified,the current batch/location is used.Tr=   N)r	   r?   r;   r   r@   rA   rB   s     r   AddTaskResourceArgsrQ      sE     11


1) 	*66v>r   c                     t        j                  dt               dd      g}t        j                  |      j                  |        yzoAdd the resource allowance resource argument as positional.

  Args:
    parser: the parser for the command.
  RESOURCE_ALLOWANCEzfThe Batch resource allowance resource. If --location not specified,the current batch/location is used.Tr=   N)r	   r?    GetResourceAllowanceResourceSpecr   r@   rA   rB   s     r    AddResourceAllowanceResourceArgsrV      sG     11

*
,? 
) 	*66v>r   c                  0    t        j                  dd      S )Nresource_allowance-The resource allowance ID for the {resource}.r   r   r   r   r    ResourceAllowanceAttributeConfigrZ      s    		2	2?
 r   c            	      t    t        j                  dddt         j                  t               t	                     S )N+batch.projects.locations.resourceAllowancesv1alpharesourceAllowance)api_versionr'   r)   r(   resourceAllowancesId)r   r*   r+   r   rZ   r   r   r   rU   rU      s3    			3'::)+;=
 r   c                     t        j                  dt               dd      g}t        j                  |      j                  |        yrS   )r	   r?   &GetCreateResourceAllowanceResourceSpecr   r@   rA   rB   s     r   &AddCreateResourceAllowanceResourceArgsrc      sG     11

0
2? 
) 	*66v>r   c                      t        j                  dddt         j                  t               t        j                  ddt        j                  t        d      g      	      S )
Nr\   r^   r]   rX   rY   zHresource allowance ID is optional and will be generated if not specifiedr3   r   )r'   r_   r)   r(   r`   )r   r*   r+   r   r   r   r5   r6   r   r   r   rb   rb   
  s^    			3'::)+#DD#C ##*
 r   N) __doc__
__future__r   r   r    googlecloudsdk.calliope.conceptsr   r   (googlecloudsdk.command_lib.util.conceptsr   r	   googlecloudsdk.corer
   r6   r   r   r"   r%   r,   r1   r7   r;   rE   rH   rL   rN   rQ   rV   rZ   rU   rc   rb   r   r   r   <module>rj      s     : &  ' 5 1 D G *	293<<2<?(?&?&?&?&?*?*r   