
                             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  e
j$                  e
j&                  j(                         G d de
j*                               Zy)z(Delete github enterprise config command.    )absolute_import)division)unicode_literals)cloudbuild_util)waiter)base)flags)log)
properties)	resourcesc                   &    e Zd ZdZed        Zd Zy)DeleteAlphaz3Delete a github enterprise config from Cloud Build.c                 Z    | j                  dd       t        j                  | dd       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.
    CONFIGz&The id of the GitHub Enterprise Config)helpF)hiddenrequiredN)add_argumentbuild_flagsAddRegionFlag)parsers    5lib/surface/builds/enterprise_config/github/delete.pyArgszDeleteAlpha.Args"   s*     'OPfUUC    c           	      (   t        j                         }t        j                         }t        j                  j
                  j                  j                  d      }t        j                  j                  j                  j                         }|j                  xs |xs t         j                  }|j                  }t        j                  j                  ddd|||d      }|j                  j!                  |j#                  |j%                         ||            }	t        j                  j'                  |	j(                  d	
      }
t+        j,                  t+        j.                  |j0                        |
d       t3        j4                  |       y)zThis is what gets called when the user runs this command.

    Args:
      args: an argparse namespace. All the arguments that were provided to this
        command invocation.

    Returns:
      Nothing on success.
    T)r   Nz5cloudbuild.projects.locations.githubEnterpriseConfigsv1)
projectsIdgithubEnterpriseConfigsIdlocationsId)
collectionapi_versionparams)nameconfigId	projectIdz(cloudbuild.projects.locations.operations)r    z!Deleting GitHub Enterprise Config)r   GetClientInstanceGetMessagesModuler   VALUEScoreprojectGetbuildsregionDEFAULT_REGIONr   r   REGISTRYParse*projects_locations_githubEnterpriseConfigsDelete?CloudbuildProjectsLocationsGithubEnterpriseConfigsDeleteRequestRelativeNameParseRelativeNamer#   r   WaitForCloudOperationPollerNoResourcesprojects_locations_operationsr
   DeletedResource)selfargsclientmessagesparent
regionproplocation	config_idghe_resource
deleted_opop_resources              r   RunzDeleteAlpha.Run-   sZ    ..0F002H##++///>F""))00446J{{JjJO,J,JHI %%++J )2#
	 , L BBIIPP**, 	Q 	J
 $$66$N 7 PK
NN..00	23>+- %r   N)__name__
__module____qualname____doc__staticmethodr   rE    r   r   r   r      s    ;D D+&r   r   N)rI   
__future__r   r   r   !googlecloudsdk.api_lib.cloudbuildr   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper   !googlecloudsdk.command_lib.buildsr	   r   googlecloudsdk.corer
   r   r   ReleaseTracksReleaseTrackALPHADeleteCommandr   rK   r   r   <module>rV      sb    / &  ' = . ( B # * ) D%%++,9&$$$ 9& -9&r   