
                             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(Update 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)UpdateAlpha   z7Update github enterprise config used 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	   #AddGitHubEnterpriseConfigUpdateArgsdisplay_info	AddFormat)parsers    5lib/surface/builds/enterprise_config/github/update.pyArgsUpdateAlpha.Args#   s-     $GGOF
!! #     c           	         [         R                  " 5       n[         R                  " 5       nUR                  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SSUUUS.S9n	[         R                   " U5      n
U
R#                  5         UR%                  U	R'                  5       USR)                  U
5      S	9nUR*                  R-                  U5      n[        R                  R/                  UR0                  S
S9n[2        R4                  " [2        R6                  " UR*                  UR8                  5      US5      n[:        R<                  " 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:
  The updated github enterprise resource.
T)requiredNz5cloudbuild.projects.locations.githubEnterpriseConfigsv1)
projectsIdgithubEnterpriseConfigsIdlocationsId)
collectionapi_versionparams,)namegitHubEnterpriseConfig
updateMaskz(cloudbuild.projects.locations.operations)r   z!Updating GitHub Enterprise Config)r   GetClientInstanceGetMessagesModuleCONFIGGitHubEnterpriseConfigFromArgsr   VALUESbuildsregionGetDEFAULT_REGIONcoreprojectr   REGISTRYParseMessageToFieldPathssort>CloudbuildProjectsLocationsGithubEnterpriseConfigsPatchRequestRelativeNamejoin*projects_locations_githubEnterpriseConfigsPatchParseRelativeNamer#   r   WaitForCloudOperationPollerprojects_locations_operationsr
   UpdatedResource)selfargsclientmessages	config_idghe
regionproplocationparentghe_resourceupdate_maskreq
updated_opop_resourceupdated_ghes                  r   RunUpdateAlpha.Run5   s    ..0F002HI

8
8t
DC""))00446J{{JjJO,J,JH##++///>F %%++J )2#
	 , 	L "55c:KOO**,#&xx, 	P 	
  BBHHMJ$$66$N 7 K ..##==00	
 	+K %r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   rN   __static_attributes__rP   r   r   r   r      s       "<r   r   N)rU   
__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UpdateCommandr   rP   r   r   <module>rb      sc    / &  ' = . ( H # * ) D%%++,R$$$ R -Rr   