
    M                         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 Bitbucket Server 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)DeleteAlphaz2Delete a Bitbucket Server config from Cloud Build.c                 T    t        j                  |        | 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 Bitbucket Server Config)helpN)build_flagsAddRegionFlagadd_argument)parsers    >lib/surface/builds/enterprise_config/bitbucketserver/delete.pyArgszDeleteAlpha.Args"   s&     f%
'NO    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)requiredNz4cloudbuild.projects.locations.bitbucketServerConfigsv1)
projectsIdlocationsIdbitbucketServerConfigsId)
collectionapi_versionparams)namez(cloudbuild.projects.locations.operations)r   z Deleting Bitbucket Server config)r   GetClientInstanceGetMessagesModuler   VALUEScoreprojectGetbuildsregionDEFAULT_REGIONr   r   REGISTRYParse)projects_locations_bitbucketServerConfigsDelete>CloudbuildProjectsLocationsBitbucketServerConfigsDeleteRequestRelativeNameParseRelativeNamer"   r   WaitForCloudOperationPollerNoResourcesprojects_locations_operationsr
   DeletedResource)selfargsclientmessagesparent
regionprop
bbs_region	config_idbbs_resource
deleted_opop_resources              r   RunzDeleteAlpha.Run-   sT    ..0F002H##++///>F""))00446JL
Lo.L.LJI %%++I %(1
	 , L AAHHOO**, 	P 	./J $$66$N 7 PK
NN..00	23>*, %r   N)__name__
__module____qualname____doc__staticmethodr   rB    r   r   r   r      s    :P P(&r   r   N)rF   
__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   rH   r   r   <module>rS      sb    . &  ' = . ( B # * ) D%%++,6&$$$ 6& -6&r   