
                             S r SSKJr  SSKJr  SrS\R                  4S jrS\R                  4S jr	S\\R                     4S	 jr
S
 rg)z+Util functions for Cloud Run v2 conditions.    )Sequence	conditionReadyr   c                 d    U R                   [        R                  R                  R                  :H  $ N)statecondition_objects	ConditionStateCONDITION_SUCCEEDEDr   s    3lib/googlecloudsdk/command_lib/run/v2/conditions.pyIsConditionReadyr      s&    oo*44::NNN    c                 d    U R                   [        R                  R                  R                  :H  $ r   )r	   r
   r   r   CONDITION_FAILEDr   s    r   IsConditionFailedr      s$    	-77==NN	NNr   
conditionsc                 F    U  H  nUR                   [        :X  d  M  Us  $    g r   )type_ready_condition_type)r   r   s     r   _GetReadyConditionr   #   s$    i~~..  
r   c                 f    [        U S5      (       a  U R                  $ [        U R                  5      $ )a  Returns the terminal condition of a resource.

Args:
  resource: A Cloud Run v2 resource to get the terminal condition of.

Returns:
  A condition object representing the terminal condition of the resource, or
  None if the resource does not have a terminal condition.
terminal_condition)hasattrr   r   r   )resources    r   GetTerminalConditionr   *   s7     
/	0	0 !! h112r   N)__doc__typingr   ;googlecloudsdk.generated_clients.gapic_clients.run_v2.typesr   r
   r   r   r   r   r   r    r   r   <module>r"      s]    2  f    1 ; ; O!2!<!< O8,=,G,G#H r   