
    5                        S r SSKJr  SSKJr  SSKJr  SSKJr  S r S"S jr	S	 r
S
 rS rS rS rS rS r S"S jr S"S jrS rS rS r S"S jrS r S"S jr S"S jr S"S jrS rS rS rS r S"S jrS r S  r! S"S! jr"g)#z8Resource flags and helpers for the deploy command group.    )concepts)deps)concept_parsers)
propertiesc                      [         R                  " S[        R                  " [        R
                  " S5      5      /SS9$ )z1Creates the delivery pipeline resource attribute.zdelivery-pipelinezdeploy/delivery_pipelinezrThe delivery pipeline associated with the {resource}.  Alternatively, set the property [deploy/delivery-pipeline].)namefallthroughs	help_textr    ResourceParameterAttributeConfigr   PropertyFallthroughr   
FromString     6lib/googlecloudsdk/command_lib/deploy/resource_args.pyDeliveryPipelineAttributeConfigr      s@    		2	2

"
"##$>?I
 r   Nc                     U=(       d    Sn[         R                  R                  U(       a  SOS[        5       UUSS9R	                  U 5        g)zAdd --release resource argument to the parser.

Args:
  parser: argparse.ArgumentParser, the parser for the command.
  help_text: help text for this flag.
  positional: if it is a positional flag.
  required: if it is required.
zThe name of the Release.releasez	--releaseFrequiredpluralN)r   ConceptParserForResourceGetReleaseResourceSpecAddToParserparserr
   
positionalr   s       r   AddReleaseResourceArgr   (   J     55)++i; , 
  K'r   c            
          [         R                  " SS[        5       [        5       [         R                  [        5       SS9$ )HConstructs and returns the Resource specification for Delivery Pipeline.z9clouddeploy.projects.locations.deliveryPipelines.releasesr   F)resource_namedeliveryPipelinesId
releasesId
projectsIdlocationsIddisable_auto_completers)r   ResourceSpecr   ReleaseAttributeConfig DEFAULT_PROJECT_ATTRIBUTE_CONFIGLocationAttributeConfigr   r   r   r   r   =   s9    			A9;')::)+#
% %r   c                  ,    [         R                  " SSS9$ )z'Creates the release resource attribute.r   z+The release associated with the {resource}.r   r
   r   r   r   r   r   r*   r*   I       		2	2 M
O Or   c            	          [         R                  " SS[        R                  " [        R
                  " S5      5      /SS9$ )z(Creates the location resource attribute.regionr'   zdeploy/regionzVThe Cloud region for the {resource}.  Alternatively, set the property [deploy/region].)r   parameter_namer	   r
   r   r   r   r   r,   r,   O   s>    		2	2"

"
":#8#8#I
J>

 
r   c                 r    [         R                  R                  S[        5       SSS9R	                  U 5        g)zAdds a resource argument for a cloud deploy region.

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

Args:
  parser: argparse.ArgumentParser, the parser for the command.
z--regionzThe Cloud region of {resource}.T)r   N)r   r   r   GetLocationResourceSpecr   )r   s    r   AddLocationResourceArgr6   ^   s8     ++'	 ,  ![(r   c                  \    [         R                  " SS[        5       [         R                  S9$ )z?Constructs and returns the Resource specification for location.zclouddeploy.projects.locationslocation)r#   r'   r&   )r   r)   r,   r+   r   r   r   r5   r5   m   s*    			&)+::	
 r   c                  ,    [         R                  " SSS9$ )z&Creates the target resource attribute.targetz*The target associated with the {resource}.r.   r/   r   r   r   TargetAttributeConfigr;   w   s    		2	2K
M Mr   c            	      p    [         R                  " SS[        5       [         R                  [	        5       SS9$ )z;Constructs and returns the target specification for Target.z&clouddeploy.projects.locations.targetsr:   F)r#   	targetsIdr&   r'   r(   )r   r)   r;   r+   r,   r   r   r   GetTargetResourceSpecr>   }   s3    			.%'::)+#
% %r   c                     U=(       d    Sn[         R                  R                  U(       a  SOS[        5       UUSS9R	                  U 5        g)zAdd target resource argument to the parser.

Args:
  parser: argparse.ArgumentParser, the parser for the command.
  help_text: help text for this flag.
  positional: if it is a positional flag.
  required: if it is required.
zThe name of the Target.r:   z--targetFr   N)r   r   r   r>   r   r   s       r   AddTargetResourceArgr@      sJ     44)++h* , 
  K'r   c                     U=(       d    Sn[         R                  R                  U(       a  SOS[        5       UUSS9R	                  U 5        g)zAdds --delivery-pipeline resource argument to the parser.

Args:
  parser: argparse.ArgumentParser, the parser for the command.
  help_text: help text for this flag.
  positional: if it is a positional flag.
  required: if it is required.
z"The name of the Delivery Pipeline.delivery_pipelinez--delivery-pipelineFr   N)r   r   r   GetDeliveryPipelineResourceSpecr   r   s       r   AddDeliveryPipelineResourceArgrD      sL     ??)++'-B%' , 
  K'r   c            	      p    [         R                  " SS[        5       [         R                  [	        5       SS9$ )r"   z0clouddeploy.projects.locations.deliveryPipelinesrB   Fr#   r$   r&   r'   r(   r   r)   r   r+   r,   r   r   r   rC   rC      s3    			8'9;::)+#
% %r   c                  ,    [         R                  " SSS9$ )z'Creates the rollout resource attribute.rolloutz+The rollout associated with the {resource}.r.   r/   r   r   r   RolloutAttributeConfigrJ      r0   r   c                      [         R                  " SS[        5       [        5       [	        5       [         R
                  [        5       SS9$ )z>Constructs and returns the resource specification for Rollout.zBclouddeploy.projects.locations.deliveryPipelines.releases.rolloutsrI   Fr#   r$   r%   
rolloutsIdr&   r'   r(   r   r)   r   r*   rJ   r+   r,   r   r   r   GetRolloutResourceSpecrO      s?    			J9;')')::)+#
% %r   c                     U=(       d    Sn[         R                  R                  U(       a  SOS[        5       UUSS9R	                  U 5        g)zAdd --rollout resource argument to the parser.

Args:
  parser: argparse.ArgumentParser, the parser for the command.
  help_text: help text for this flag.
  positional: if it is a positional flag.
  required: if it is required.
zThe name of the Rollout.rI   z	--rolloutFr   N)r   r   r   rO   r   r   s       r   AddRolloutResourceArgrQ      r    r   c                      [         R                  " SS[        5       [        5       [	        5       [         R
                  [        5       SS9$ )z>Constructs and returns the Resource specification for Job Run.zJclouddeploy.projects.locations.deliveryPipelines.releases.rollouts.jobRunsjob_runFrL   rN   r   r   r   GetJobRunResourceSpecrT      s?    			R9;')')::)+#	
 	r   c                     U=(       d    Sn[         R                  R                  U(       a  SOS[        5       UUSS9R	                  U 5        g)zAdd --job-run resource argument to the parser.

Args:
  parser: argparse.ArgumentParser, the parser for the command.
  help_text: help text for this flag.
  positional: if it is a positional flag.
  required: if it is required.
zThe name of the Job Run.rS   z	--job-runFr   N)r   r   r   rT   r   r   s       r   AddJobRunResourceArgrV      sJ     55)++i; ,  Kr   c                     U=(       d    Sn[         R                  R                  U(       a  SOS[        5       UUSS9R	                  U 5        g)zAdd --automation-run resource argument to the parser.

Args:
  parser: argparse.ArgumentParser, the parser for the command.
  help_text: help text for this flag.
  positional: if it is a positional flag.
  required: if it is required.
zThe name of the AutomationRun.automation_runz--automation-runFr   N)r   r   r   GetAutomationRunResourceSpecr   r   s       r   AddAutomationRunResourceArgrZ   	  sL     ;;)++$*<"$ ,  Kr   c                     U=(       d    Sn[         R                  R                  U(       a  SOS[        5       UUSS9R	                  U 5        g)zAdd --automation resource argument to the parser.

Args:
  parser: argparse.ArgumentParser, the parser for the command.
  help_text: help text for this flag.
  positional: if it is a positional flag.
  required: if it is required.
zThe name of the Automation.
automationz--automationFr   N)r   r   r   GetAutomationResourceSpecr   r   s       r   AddAutomationResourceArgr^     sJ     88)++ ln! ,  Kr   c            	      p    [         R                  " SS[        5       [         R                  [	        5       SS9$ )zDConstructs and returns the Resource specification for AutomationRun.z?clouddeploy.projects.locations.deliveryPipelines.automationRunsrX   FrF   rG   r   r   r   rY   rY   5  s3    			G$9;::)+#
 r   c            	      p    [         R                  " SS[        5       [         R                  [	        5       SS9$ )zAConstructs and returns the Resource specification for Automation.z<clouddeploy.projects.locations.deliveryPipelines.automationsr\   FrF   rG   r   r   r   r]   r]   A  s3    			D 9;::)+#
 r   c                  ,    [         R                  " SSS9$ )z2Creates the Custom Target Type resource attribute.custom_target_typez6The Custom Target Type associated with the {resource}.r.   r/   r   r   r   CustomTargetTypeAttributeConfigrc   M  s    		2	2H
 r   c            	      p    [         R                  " SS[        5       [         R                  [	        5       SS9$ )zIConstructs and returns the Resource specification for Custom Target Type.z0clouddeploy.projects.locations.customTargetTypesrb   F)r#   customTargetTypesIdr&   r'   r(   )r   r)   rc   r+   r,   r   r   r   GetCustomTargetTypeResourceSpecrf   U  s3    			8(9;::)+#
 r   c                     U=(       d    Sn[         R                  R                  U(       a  SOS[        5       UUSS9R	                  U 5        g)zAdds --custom-target-type resource argument to the parser.

Args:
  parser: argparse.ArgumentPArser, the parser for the command.
  help_text: help text for this flag.
  positional: if it is a positional flag.
  required: if it is required.
z#The name of the Custom Target Type.rb   z--custom-target-typeFr   N)r   r   r   rf   r   r   s       r   AddCustomTargetTypeResourceArgrh   a  sL     @@)++(.D%' ,  Kr   c                  ,    [         R                  " SSS9$ )z-Creates the Deploy Policy resource attribute.deploy_policyz1The Deploy Policy associated with the {resource}.r.   r/   r   r   r   DeployPolicyAttributeConfigrk   w  s    		2	2C
 r   c            	      p    [         R                  " SS[        5       [         R                  [	        5       SS9$ )zDConstructs and returns the Resource specification for Deploy Policy.z-clouddeploy.projects.locations.deployPolicieszdeploy policyF)r#   deployPoliciesIdr&   r'   r(   )r   r)   rk   r+   r,   r   r   r   GetDeployPolicyResourceSpecrn     s3    			5#24::)+#
 r   c                     U=(       d    Sn[         R                  R                  U(       a  SOS[        5       UUSS9R	                  U 5        g)zAdds --deploy-policy resource argument to the parser.

Args:
  parser: argparse.ArgumentParser, the parser for the command.
  help_text: help text for this flag.
  positional: if it is a positional flag.
  required: if it is required.
zThe name of the Deploy Policy.rj   z--deploy_policyFr   N)r   r   r   rn   r   r   s       r   AddDeployPolicyResourceArgrp     sK     ;;)++#o):!# ,  Kr   )NFT)#__doc__ googlecloudsdk.calliope.conceptsr   r   (googlecloudsdk.command_lib.util.conceptsr   googlecloudsdk.corer   r   r   r   r*   r,   r6   r5   r;   r>   r@   rD   rC   rJ   rO   rQ   rT   rV   rZ   r^   rY   r]   rc   rf   rh   rk   rn   rp   r   r   r   <module>ru      s    ? 6 1 D *" 8<(*	%O)M% 8<(, 8<(*%O
% 8<(* 8<. 8<. 8<,			 8<,	 8<r   