
    
                     ,   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mZ dd	lmZ  ej                  ej                   j"                  ej                   j$                        ej&                   G d
 dej(                                      Zy)z7Implementation of gcloud dataflow jobs archive command.    )absolute_import)division)unicode_literals)apis)base)	job_utils)log)
console_ioc                   &    e Zd ZdZed        Zd Zy)Archivea1  Archives a job.

  Archives a single job. The job must be in a terminal state, otherwise the
  request will be rejected.

  This command will require confirmation to run.

  ## EXAMPLES

  To archive job `2025-03-15_14_23_56-1234567890123456`, run:

    $ {command} 2025-03-15_14_23_56-1234567890123456
  c                 .    t        j                  |        y )N)r   ArgsForJobRef)parsers    $lib/surface/dataflow/jobs/archive.pyArgszArchive.Args-   s    F#    c           
         t        j                  |      }|j                  }t        j                  dj                  |      d       t        j                         }|j                  |j                  |j                  j                  |j                  j                  j                  dd      g            	      }|j                  |j                  |j                  |j                  |d
      }t        j                  j!                         j#                  |      }t$        j&                  j)                  dj                  |             |S )zRuns the command.

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

    Returns:
      A Job message.
    zJob [{}] will be archived.T)messagecancel_on_noarchivedtrue)keyvalue)additionalProperties)userDisplayProperties)jobMetadataz-job_metadata.user_display_properties.archived)jobIdlocation	projectIdjob
updateMaskzArchived job [{}].)r   ExtractJobRefr   r
   PromptContinueformatr   GetMessagesModuleJobJobMetadataUserDisplayPropertiesValueAdditionalProperty*DataflowProjectsLocationsJobsUpdateRequestr   r   Jobs
GetServiceUpdater	   statusPrint)selfargsjob_refjob_idmessagesr    requestresults           r   RunzArchive.Run1   s.    %%d+G]]F,33F;$ %%'H
,,(("*"6"6"Q"Q((CCVV&f W & #R # ) 
  
C AAmm!!##B B G YY!!#**73FJJ)0089Mr   N)__name__
__module____qualname____doc__staticmethodr   r7    r   r   r   r      s      $ $'r   r   N)r;   
__future__r   r   r   googlecloudsdk.api_lib.dataflowr   googlecloudsdk.callioper   #googlecloudsdk.command_lib.dataflowr   googlecloudsdk.corer	   googlecloudsdk.core.consoler
   ReleaseTracksReleaseTrackGABETADefaultUniverseOnlyCommandr   r=   r   r   <module>rJ      sw    > &  ' 0 ( 9 # 2 D%%(($*;*;*@*@A:dll :  B:r   