
                         2   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  \R(                  " \R*                  R,                  \R*                  R.                  5       " S S\R0                  5      5       rg)z+Command to update a Dataplex lake resource.    )absolute_import)division)unicode_literals)lake)util)
exceptions)base)resource_args)labels_util)logc                   `    \ rS rSrSrSS0r\S 5       r\R                  " S5      S 5       r
Srg	)
Update   z Update a Dataplex lake resource.EXAMPLESa            To update a Dataplex Lake `test-lake` in location `us-central1` to
          have the display name `first-dataplex-lake` and metastore service           `projects/test-lake/locations/us-central1/service/test-service`, run:

            $ {command} test-lake --location=us-central1 --display-name="first-dataplex-lake" --metastore-service="projects/test-lake/locations/us-central1/service/test-service"
          c                 >   [         R                  " U S5        U R                  SSSSS9  U R                  SSS	9  U R                  S
SS	9  U R                  SS	9nUR                  SSS	9  [        R
                  R                  U 5        [        R                  " U 5        g )Nz
to update.z--validate-only
store_trueFz:Validate the update action, but don't actually perform it.)actiondefaulthelpz--descriptionzDescription of the lake)r   z--display-namezDisplay NamezGSettings to manage metadata publishing to a Hive Metastore from a lake.z--metastore-serviceaN   A relative reference to the Dataproc Metastore
        (https://cloud.google.com/dataproc-metastore/docs) service instance into
        which metadata will be published. This is of the form:
        `projects/{project_number}/locations/{location_id}/services/{service_id}`
        where the location matches the location of the lake.)	r
   AddLakeResourceArgadd_argument	add_groupr	   
ASYNC_FLAGAddToParserr   AddCreateLabelsFlags)parser	metastores     $lib/surface/dataplex/lakes/update.pyArgsUpdate.Args.   s    $$V\:
J	  L
 .GH
(~>  V ! I @  A 	OO'$$V,    z-Status code: {status_code}. {status_message}.c                    [         R                  " U5      n[        U5      S:  a  [        R                  " S5      eUR
                  R                   R                  5       n[        R                  " 5       n[        R                  " 5       nUR                  R                  UR                  UR                  5       UR                  SR                  U5      UR!                  UR"                  UR$                  UR'                  UR(                  S9[        R*                  " UR                   U5      S9S95      n[-        USS5      nU(       a!  [.        R0                  R3                  S	5        U$ [-        US
S5      nU(       d,  [         R4                  " U5        [.        R6                  " USS9  g [.        R0                  R3                  SR9                  X6R:                  5      5        g )N   zIUpdate commands must specify at least one additional parameter to change.,)service)descriptiondisplayNamer   labels)namevalidateOnly
updateMaskgoogleCloudDataplexV1Lakevalidate_onlyFz Validation complete with errors:async_zOperation was sucessful.)detailsz$Updating [{0}] with operation [{1}].)r   GenerateUpdateMasklenr   HttpExceptionCONCEPTSParsedataplex_utilGetClientInstanceGetMessageModuleprojects_locations_lakesPatch*DataplexProjectsLocationsLakesPatchRequestRelativeNamer-   joinGoogleCloudDataplexV1Laker&   display_name"GoogleCloudDataplexV1LakeMetastoremetastore_serviceCreateLabelsgetattrr   statusPrintWaitForOperationUpdatedResourceformatr)   )	selfargsupdate_masklake_refdataplex_clientmessageupdate_req_opr-   r.   s	            r   Run
Update.RunE   s    ))$/K
;!$$
U  }}!!'')H#557O,,.G#<<BB::&&(++yy-&-&G&G ,, --!DD 22 E 4$1155t= 'H '>	 	; 
	?@M D/59M	jj9:T8U+F
M*	(,FGJJ;BB$$& 'r!    N)__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   gcloud_exception CatchHTTPErrorRaiseHTTPExceptionrO   __static_attributes__rQ   r!   r   r   r      sL    ( 	- - -, 4457"'7"'r!   r   N)rV   
__future__r   r   r   googlecloudsdk.api_lib.dataplexr   r   r5   googlecloudsdk.api_lib.utilr   rY   googlecloudsdk.callioper	   #googlecloudsdk.command_lib.dataplexr
   $googlecloudsdk.command_lib.util.argsr   googlecloudsdk.corer   ReleaseTracksReleaseTrackALPHAGACommandr   rQ   r!   r   <module>rh      ss    2 &  ' 0 A F ( . = < # D%%++T->->-A-ABI'T\\ I' CI'r!   