
                            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  SSKJr  SSKJr  \
R(                  " \
R*                  R,                  5       " S S\
R.                  5      5       rg)z(Update GitLab Enterprise config command.    )absolute_import)division)unicode_literals)cloudbuild_util)waiter)base)gitlab_flags)resource_args)concept_parsers)log)
properties)	resourcesc                   .    \ rS rSrSr\S 5       rS rSrg)CreateAlpha    z9Update a GitLab Enterprise config for use by Cloud Build.c                     [         R                  R                  S[        R                  " 5       SSS9R                  U 5        [        R                  " U 5      n 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.
CONFIGzGitLab Enterprise config.TrequiredN)r   ConceptParserForResourcer
   GetGitLabConfigResourceSpecAddToParserr	   AddGitLabConfigUpdateArgs)parsers    5lib/surface/builds/enterprise_config/gitlab/update.pyArgsCreateAlpha.Args$   sN     !!--113#	 .  #{6*33F;F    c           	         [         R                  " 5       n[         R                  " 5       nUR                  n[         R                  " U5      n[
        R                  R                  R                  R                  SS9n[        R                  R                  SSSUUR                  US.S9n[         R                  " U5      nUR                  UR!                  5       USR#                  U5      S	9n	UR$                  R'                  U	5      n
[        R                  R)                  U
R*                  S
S9n[,        R.                  " [,        R0                  " UR$                  UR2                  5      US5      n[4        R6                  " USS9  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.
Tr   Nz+cloudbuild.projects.locations.gitLabConfigsv1)
projectsIdlocationsIdgitLabConfigsId)
collectionapi_versionparams,)namegitLabConfig
updateMaskz(cloudbuild.projects.locations.operations)r%   z!Updating GitLab Enterprise configenterprise_config)kind)r   GetClientInstanceGetMessagesModuler   GitLabConfigFromArgsr   VALUEScoreprojectGetr   REGISTRYParseregionMessageToFieldPaths4CloudbuildProjectsLocationsGitLabConfigsPatchRequestRelativeNamejoin projects_locations_gitLabConfigsPatchParseRelativeNamer)   r   WaitForCloudOperationPollerprojects_locations_operationsr   UpdatedResource)selfargsclientmessages	config_idgitlabparentgitlab_resourceupdate_maskreq
updated_opop_resourceupdated_gitlabs                r   RunCreateAlpha.Run4   sf    ..0F002HI11$7F##++///>F  ((..@ ;;(
	 / O "55f=K

G
G))+88K( H *C
 88>>sCJ$$66$N 7 PK ^^##F$K$K$*$H$H	J8:N
 	(;<r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   rP   __static_attributes__rR   r   r   r   r       s    A< <-r   r   N)rW   
__future__r   r   r   !googlecloudsdk.api_lib.cloudbuildr   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper   %googlecloudsdk.command_lib.cloudbuildr	   r
   (googlecloudsdk.command_lib.util.conceptsr   googlecloudsdk.corer   r   r   ReleaseTracksReleaseTrackALPHACreateCommandr   rR   r   r   <module>re      si    / &  ' = . ( > ? D # * ) D%%++,@$$$ @ -@r   