
                             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 GitHub Enterprise config command.    )absolute_import)division)unicode_literals)cloudbuild_util)waiter)base)githubenterprise_flags)log)
properties)	resourcesc                   .    \ rS rSrSr\S 5       rS rSrg)CreateAlpha   z<Create a GitHub Enterprise 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_url,
            app_id
          )
        N)r	   #AddGitHubEnterpriseConfigCreateArgsdisplay_info	AddFormat)parsers    5lib/surface/builds/enterprise_config/github/create.pyArgsCreateAlpha.Args#   s-     $GGOF
!! #     c           	         [         R                  " 5       n[         R                  " 5       n[         R                  " US5      n[        R
                  R                  R                  R                  5       nUR                  =(       d    U=(       d    [         R                  n[        R
                  R                  R                  R                  SS9n[        R                  R                  SUUS9nUR                  R                  UR!                  UR#                  5       UR$                  UUS95      n	[        R                  R'                  U	R$                  SS9n
[(        R*                  " [(        R,                  " UR.                  UR0                  5      U
S	5      n[        R                  R3                  S
SSUUR$                  US.S9n[4        R6                  " 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gheConfigIdgitHubEnterpriseConfig	projectIdz(cloudbuild.projects.locations.operations)r   z!Creating github enterprise configNz5cloudbuild.projects.locations.githubEnterpriseConfigsv1)r   githubEnterpriseConfigsIdr   )r   api_versionparams)r   GetClientInstanceGetMessagesModuleGitHubEnterpriseConfigFromArgsr   VALUESbuildsregionGetDEFAULT_REGIONcoreprojectr   REGISTRYCreate*projects_locations_githubEnterpriseConfigs?CloudbuildProjectsLocationsGithubEnterpriseConfigsCreateRequestRelativeNamenameParseRelativeNamer   WaitForCloudOperationPoller projects_githubEnterpriseConfigsprojects_locations_operationsParser
   CreatedResource)selfargsclientmessagesghe
regionproplocationr   parent_resource
created_opop_resourcecreated_configghe_resources                r   RunCreateAlpha.Run5   s    ..0F002H

8
8u
EC""))00446J{{JjJO,J,JH##++///>F((//2 0 O
 BBIIPP"//1		#&	 	Q 	J $$66$N 7 PK^^##F$K$K$*$H$H	J8:N %%++J )7)<)<#
	 , L %r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   rI   __static_attributes__rK   r   r   r   r      s       "0r   r   N)rP   
__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   rK   r   r   <module>r]      sc    / &  ' = . ( H # * ) D%%++,F$$$ F -Fr   