
    i                     P    S r SSKJr  SSKJr  SSKJr  SSKrSSKJr  S rS	S jr	g)
z#Validation for Cloud Workflows API.    )absolute_import)division)unicode_literalsN)
exceptionsc                    S[        U 5      s=::  a  S::  d  O  [        R                  " SS5      e[        R                  " SU 5      (       d  [        R                  " SS5      e[        R                  " SU 5      (       d  [        R                  " SS5      e[        R                  " S	U 5      (       d  [        R                  " SS
5      eg)zHConfirm workflow name is of acceptable length and uses valid characters.   @   workflowz'ID must be between 1-64 characters longz^[a-zA-Z].*zID must start with a letterz.*[a-zA-Z0-9]$z#ID must end with a letter or numberz^[-_a-zA-Z0-9]*$z>ID must only contain letters, numbers, underscores and hyphensN)lenr   InvalidArgumentExceptionresearch)names    0lib/googlecloudsdk/api_lib/workflows/validate.pyWorkflowNameConformsr      s    	
c$i	2	

-
-=? ? 
=$	'	'

-
-13 3	#T	*	*

-
-9; ;	%t	,	,

-
-HJ J 
-    c                 d    U(       a)  U R                   (       d  [        R                  " SS5      eg g )Nz--sourcezrequired on first deployment)sourceContentsr   RequiredArgumentException)r
   first_deployments     r   ValidateWorkflowr   -   s/    h55

.
.z/MO O 6r   )F)
__doc__
__future__r   r   r   r   googlecloudsdk.callioper   r   r    r   r   <module>r      s%    * &  ' 	 .J&Or   