
    	                     j    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
Z
d	 Zd
 Zd Zy)zIContains hooks to be executed along with Cloud Workflows gcloud commands.    )absolute_import)division)unicode_literals)cache)log)
propertiesNc                 f   dj                  |j                  dd       }t        j                  | j                        j                  d      }|d   }|d   }t        j                  j                  d       t        j                  j                  dj                  |||j                  |             | S )a  Prints describe execution command for just created execution of a workflow.

  Function to be used as a response hook
  (go/gcloud-declarative-commands#response)

  Args:
    response: API response
    args: gcloud command arguments

  Returns:
    response: API response
   N/   z<
To view the workflow status, you can use following command:z5{} executions describe {} --workflow {} --location {})joincommand_pathsix	text_typenamesplitr   statusPrintformatworkflow)responseargscmd_baseresource_nameexecution_idlocations         1lib/googlecloudsdk/command_lib/workflows/hooks.pyprint_describe_instructionr      s     XXd'',-(--.44S9-r",1(**EG**=DD
L$--;< 
/    c                 D    t        j                  | j                         | S )zExtracts the execution resource name to be saved into cache.

  Args:
    response: API response

  Returns:
    response: API response
  )r   cache_execution_idr   )r   _s     r   cache_execution_namer$   5   s     8==)	/r    c                     t         j                  j                  j                  j	                         s&|j                  d      st        j                  d       |S )zPrints a warning when the default location is used.

  Args:
    args: gcloud command arguments
    request: API request

  Returns:
    request: API request
  r   zUThe default location(us-central1) was used since the location flag was not specified.)r   VALUES	workflowsr   IsExplicitlySetIsSpecifiedr   warning)r#   r   requests      r   print_default_location_warningr,   B   sF     


%
%
.
.
>
>
@


:
&KK * +	.r    )__doc__
__future__r   r   r    googlecloudsdk.api_lib.workflowsr   googlecloudsdk.corer   r   r   r   r$   r,    r    r   <module>r2      s/    P &  ' 2 # * 
2
r    