
                             S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
  SSKJr  SS	KJr  SS
KJr  SSKJr  \
R"                  " \
R$                  R&                  5       " S S\
R(                  5      5       rg)z'Create Bitbucket Server config command.    )absolute_import)division)unicode_literals)cloudbuild_util)waiter)base)bitbucketserver_flags)log)
properties)	resourcesc                   .    \ rS rSrSr\S 5       rS rSrg)CreateAlpha   z8Create a Bitbucket Server config for use by Cloud Build.c                 f    [         R                  " U 5      n U R                  R                  S5        g)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.
z
          table(
            name,
            createTime.date('%Y-%m-%dT%H:%M:%S%Oz', undefined='-'),
            host_uri
          )
        N)r	   "AddBitbucketServerConfigCreateArgsdisplay_info	AddFormat)parsers    >lib/surface/builds/enterprise_config/bitbucketserver/create.pyArgsCreateAlpha.Args"   s-     #EEfMF
!! #     c           	         [         R                  " 5       n[         R                  " 5       n[         R                  " US5      n[        R
                  R                  R                  R                  SS9n[        R
                  R                  R                  R                  5       nUR                  =(       d    U=(       d    [         R                  n[        R                  R                  SUUS9nUR                  R                  UR!                  UR#                  5       UUR$                  S95      n	[        R                  R'                  U	R$                  SS9n
[(        R*                  " [(        R,                  " UR                  UR.                  5      U
S	5      n[        R                  R1                  S
SSUUUR$                  S.S9n[2        R4                  " U5        U$ )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:
  Some value that we want to have printed later.
FT)requiredzcloudbuild.projects.locations)
collection
projectsIdlocationsId)parentbitbucketServerConfigbitbucketServerConfigIdz(cloudbuild.projects.locations.operations)r   z Creating Bitbucket Server configNz4cloudbuild.projects.locations.bitbucketServerConfigsv1)r   r   bitbucketServerConfigsId)r   api_versionparams)r   GetClientInstanceGetMessagesModuleBitbucketServerConfigFromArgsr   VALUEScoreprojectGetbuildsregionDEFAULT_REGIONr   REGISTRYCreate)projects_locations_bitbucketServerConfigs>CloudbuildProjectsLocationsBitbucketServerConfigsCreateRequestRelativeNamenameParseRelativeNamer   WaitForCloudOperationPollerprojects_locations_operationsParser
   CreatedResource)selfargsclientmessagesbbsr   
regionprop
bbs_regionparent_resource
created_opop_resourcecreated_configbbs_resources                r   RunCreateAlpha.Run3   s    ..0F002H

7
7e
DC##++///>F""))00446JL
Lo.L.LJ((//2 0  O
 AAHHOO"//1"%$(II 	P 	/0J
 $$66$N 7 PK^^##<<00	23>*	,N
 %%++I %(6(;(;
	 , L %r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   rG   __static_attributes__rI   r   r   r   r      s    @  /r   r   N)rN   
__future__r   r   r   !googlecloudsdk.api_lib.cloudbuildr   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper   %googlecloudsdk.command_lib.cloudbuildr	   googlecloudsdk.corer
   r   r   ReleaseTracksReleaseTrackALPHACreateCommandr   rI   r   r   <module>r[      sc    . &  ' = . ( G # * ) D%%++,C$$$ C -Cr   