
    	                     V   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 e
j                    e
j"                  e
j$                  j&                  e
j$                  j(                        e
j*                   G d de
j,                                             Zy)Delete a Workflow.    )absolute_import)division)unicode_literals)client_util)waiter)base)	run_flags)log)	resourcesc                   &    e Zd ZdZed        Zd Zy)Deleter   c                 T    | j                  dd       t        j                  |        y)zRegister flags for this command.

    Args:
      parser: An argparse.ArgumentParser-like object. It is mocked out in order
        to capture some information, but behaves like an ArgumentParser.
    WORKFLOW_IDzThe ID of the Workflow.)helpN)add_argumentr
   AddsRegionResourceArg)parsers    &lib/surface/builds/workflows/delete.pyArgszDelete.Args#   s&     ,EF##F+    c                    t        j                         }t        j                         }|j                  j                  j                         }|j                         }|d|j                  }|j                  j                  |j                  |            }t        j                  j                  |j                  d      }t        j                   t        j"                  |j$                        |d       t'        j(                  |       y)z9This is what gets called when the user runs this command.z/workflows/)namez(cloudbuild.projects.locations.operations)
collectionzDeleting WorkflowN)r   GetClientInstanceGetMessagesModuleCONCEPTSregionParseRelativeNamer   projects_locations_workflowsr   1CloudbuildProjectsLocationsWorkflowsDeleteRequestr   REGISTRYParseRelativeNamer   r   WaitForCloudOperationPollerNoResourcesprojects_locations_operationsr   DeletedResource)	selfargsclientmessages
region_refparentresource_namedelete_operationdelete_operation_refs	            r   Runz
Delete.Run.   s    **,F,,.H%%++-J$$&F)/1A1ABM ::AABB 	C 	 ! %--??= @ ? NN..00	23G
 &r   N)__name__
__module____qualname____doc__staticmethodr   r2    r   r   r   r      s     , ,'r   r   N)r6   
__future__r   r   r   $googlecloudsdk.api_lib.cloudbuild.v2r   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper	   %googlecloudsdk.command_lib.cloudbuildr
   googlecloudsdk.corer   r   HiddenReleaseTracksReleaseTrackALPHABETAUniverseCompatibleDeleteCommandr   r8   r   r   <module>rF      s     &  ' < . ( ; # ) D%%++T->->-C-CD%'T %'  E %'r   