
                         `    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 r	 " S S	\
5      rg
)zCFacility for displaying information about a Job message to a user.
    )absolute_import)division)unicode_literals)apis)timesc                     [         R                  " U 5      n[         R                  " U5      (       d  g[         R                  " US5      $ )z=Returns a yyyy-mm-dd hh:mm:ss formatted date/time for string.Nz%Y-%m-%d %H:%M:%S)r   ParseDateTimeGetTimeStampFromDateTimeFormatDateTime)stringdts     2lib/googlecloudsdk/api_lib/dataflow/job_display.pyr   r      s:    6""		'	'	+	+			b"5	66    c                   >    \ rS rSrSrS r\S 5       r\S 5       rSr	g)DisplayInfo#   aA  Information about a job displayed in command output.

Fields:
  id: the job ID
  name: the job name
  type: one of 'batch', 'streaming'
  state: string representing the current job status
  creationTime: in the form yyyy-mm-dd hh:mm:ss
  stateTime: in the form yyyy-mm-dd hh:mm:ss
  location: the job's regional endpoint
c                 b   UR                   U l         UR                  U l        [        R                  UR                  5      U l        [        R                  UR                  5      U l        UR                  U l        [        UR                  5      U l        [        UR                  5      U l        g )N)idnamer   _JobTypeForJobtype_StatusForJobcurrentStatestatelocationr   currentStateTime	stateTime
createTimecreationTime)selfjobs     r   __init__DisplayInfo.__init__0   sv    ffDGDI**3884DI**3+;+;<DJLLDM $C$8$89DN&s~~6Dr   c                     [         R                  " 5       R                  R                  nUR                  SUR
                  S0nUR                  U S5      $ )zxReturn a string describing the job type.

Args:
  job_type: The job type enum
Returns:
  string describing the job type
Batch	StreamingUnknown)r   GetMessagesModuleJobTypeValueValuesEnumJOB_TYPE_BATCHJOB_TYPE_STREAMINGget)job_typetype_value_enum	value_maps      r   r   DisplayInfo._JobTypeForJobD   sN     ,,.22FFO&&**KI ==9--r   c                    [         R                  " 5       R                  R                  nUR                  SUR
                  SUR                  SUR                  SUR                  SUR                  SUR                  SUR                  SUR                  S	UR                  S
UR                  S0nUR                  U S5      $ )z|Return a string describing the job state.

Args:
  job_state: The job state enum
Returns:
  string describing the job state
	Cancelled
CancellingDoneDrainedDrainingFailedPendingQueuedRunningStoppedUpdatedr'   )r   r(   r)   CurrentStateValueValuesEnumJOB_STATE_CANCELLEDJOB_STATE_CANCELLINGJOB_STATE_DONEJOB_STATE_DRAINEDJOB_STATE_DRAININGJOB_STATE_FAILEDJOB_STATE_PENDINGJOB_STATE_QUEUEDJOB_STATE_RUNNINGJOB_STATE_STOPPEDJOB_STATE_UPDATEDr-   )	job_statestate_value_enumr0   s      r   r   DisplayInfo._StatusForJobT   s     --/33OO,,k--|''**I++Z))8**I))8**I**I**II ==I..r   )r   r   r   r   r   r   r   N)
__name__
__module____qualname____firstlineno____doc__r"   staticmethodr   r   __static_attributes__ r   r   r   r   #   s4    
7( . . / /r   r   N)rQ   
__future__r   r   r   googlecloudsdk.api_lib.dataflowr   googlecloudsdk.core.utilr   r   objectr   rT   r   r   <module>rY      s.     '  ' 0 *7H/& H/r   