
    
                        S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
  SS	KJr  \
R                  " \
R                  R                  \
R                  R                   5       " S
 S\
R"                  5      5       rg)z5Implementation of gcloud dataflow jobs show command.
    )absolute_import)division)unicode_literals)apis)job_display)	step_json)base)	job_utilsc                   4    \ rS rSrSr\S 5       rS rS rSr	g)Show   z.Shows a short description of the given job.
  c                 t    [         R                  " U 5        U R                  SSSS9  U R                  SSSS9  g)zfRegister flags for this command.

Args:
  parser: argparse.ArgumentParser to register arguments with.
z--environment
store_truez+If present, the environment will be listed.)actionhelpz--stepsz%If present, the steps will be listed.N)r
   ArgsForJobRefadd_argument)parsers    !lib/surface/dataflow/jobs/show.pyArgs	Show.Args#   sJ     F#
:  < ,4  6    c                    [         R                  " U5      n[        R                  R	                  UR
                  UR                  UR                  [        R                  R                  R                  R                  S9n[        R                  " U5      nUR                  (       a  UR                  Ul        UR                  (       a:  [        R                   " U5       Vs/ s H  oPR#                  U5      PM     snUl        U$ s  snf )zyRuns the command.

Args:
  args: The arguments that were provided to this command invocation.

Returns:
  A Job message.
)job_id
project_id	region_idview)r
   ExtractJobRefr   JobsGetjobId	projectIdlocationGET_REQUESTViewValueValuesEnumJOB_VIEW_ALLr   DisplayInfoenvironmentstepsr   ExtractSteps_PrettyStep)selfargsjob_refjob	shown_jobsteps         r   RunShow.Run3   s     %%d+G
))--}}$$""YY""66CC	  EC '',I!ooizz-6-C-CC-HJ-HT

4
 -HJio Js   "Dc                     US   US   S   S.$ )zPrettify a given step, by only extracting certain pieces of info.

Args:
  step: The step to prettify.
Returns:
  A dictionary describing the step.
name
properties	user_name)idr7    )r,   r1   s     r   r+   Show._PrettyStepO   s"     6l,'4 r   r9   N)
__name__
__module____qualname____firstlineno____doc__staticmethodr   r2   r+   __static_attributes__r9   r   r   r   r      s%     6 68r   r   N)r?   
__future__r   r   r   googlecloudsdk.api_lib.dataflowr   r   r   googlecloudsdk.callioper	   #googlecloudsdk.command_lib.dataflowr
   ReleaseTracksReleaseTrackBETAGACommandr   r9   r   r   <module>rK      si     '  ' 0 7 5 ( 9 D%%**D,=,=,@,@A;4<< ; B;r   