
                             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 dd	lmZ dd
lmZ  G d dej$                        Zy)z(Command to delete a specified Batch job.    )absolute_import)division)unicode_literals)
exceptions)jobs)util)base)resource_args)logc                   &    e Zd ZdZed        Zd Zy)DeleteaT  Delete a job.

  This command can fail for the following reasons:
  * The job specified does not exist.
  * The active account does not have permission to delete the given job.

  ## EXAMPLES

  To delete the job with name
  `projects/foo/locations/us-central1/jobs/bar`, run:

    $ {command} projects/foo/locations/us-central1/jobs/bar
  c                 .    t        j                  |        y )N)r
   AddJobResourceArgs)parsers     lib/surface/batch/jobs/delete.pyArgszDelete.Args.   s    $$V,    c                    | j                         }t        j                  |      }|j                  j                  j                         }	 |j                  |      }t        j                  j                  dj!                  |j#                                      |S # t        j                  $ r)}t        j                  |t        j                        d }~ww xY w)Nz%Job {jobName} deletion is in progress)jobName)ReleaseTrackr   
JobsClientCONCEPTSjobParser   apitools_exceptions	HttpErrorr   HttpExceptionr   HTTP_ERROR_FORMATr   statusPrintformatRelativeName)selfargsrelease_trackclientjob_ref	operationes          r   Runz
Delete.Run2   s    %%'M__]+Fmm%%'G@--(i JJ<CC$$& D ( )	 (( @$$Q(>(>??@s   B C.$CCN)__name__
__module____qualname____doc__staticmethodr   r*    r   r   r   r      s      - -r   r   N)r.   
__future__r   r   r   apitools.base.pyr   r   googlecloudsdk.api_lib.batchr   r   googlecloudsdk.api_lib.utilgooglecloudsdk.callioper	    googlecloudsdk.command_lib.batchr
   googlecloudsdk.corer   DeleteCommandr   r0   r   r   <module>r9      s:     / &  ' > - - 2 ( : #T r   