
                         ,   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  \	R                   \	R"                  " \	R$                  R&                  \	R$                  R(                  5       " S	 S
\	R*                  5      5       5       rg)z>`gcloud dataplex datascans update data-documentation` command.    )datascan)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	)
DataDocumentation   z1Update a Dataplex data documentation scan job.
  EXAMPLESa5  
          To update a data documentation scan `data-documentation-datascan`
          in project `test-project` located in `us-central1` with a new description, run:

            $ {command} data-documentation-datascan --project=test-project --location=us-central1 --description="new description"

          c                    [         R                  " U S5        U R                  SSSS9  U R                  SSSS9  U R                  SS	9nUR                  S
SS9nUR                  S[        SS9  UR                  SSS	9  UR                  SS	9nUR                  SSSSS9  UR                  SSS	9  U R                  S
SSS9nUR                  SSSSS9  [
        R                  R                  U5        [        R                  " U 5        g )Nz(to update a data documentation scan for.z--descriptionFz+Description of the data documentation scan.)requiredhelpz--display-namez,Display name of the data documentation scan.z+Data documentation scan execution settings.)r   Tz)Data documentation scan trigger settings.)mutexr   z--on-demandzNIf set, the scan runs one-time shortly after data documentation scan creation.)typer   z
--schedulea  Cron schedule (https://en.wikipedia.org/wiki/Cron) for running scans periodically. To explicitly set a timezone to the cron tab, apply a prefix in the cron tab: "CRON_TZ=${IANA_TIME_ZONE}" or "TZ=${IANA_TIME_ZONE}". The ${IANA_TIME_ZONE} may only be a valid string from IANA time zone database. For example, `CRON_TZ=America/New_York 1 * * * *` or `TZ=America/New_York 1 * * * *`. This field is required for RECURRING scans.z2Data documentation scan one-time trigger settings.z
--one-time
store_truezkIf set, the data documentation scan runs once, and auto deleted once the ttl_after_scan_completion expires.)actiondefaultr   --ttl-after-scan-completiona  The time to live for one-time scans. Default value is 24 hours, minimum value is 0 seconds, and maximum value is 365 days. The time is calculated from the data scan job completion time. If value is set as 0 seconds, the scan will be immediately deleted upon job completion, regardless of whether the job succeeded or failed. The value should be a number followed by a unit suffix "s". Example: "100s" for 100 seconds. The argument is only valid when --one-time is set.z:At most one of --async | --validate-only can be specified.)r   r   r   z--validate-onlyz:Validate the update action, but don't actually perform it.)
r   AddDatascanResourceArgadd_argument	add_groupboolr   
ASYNC_FLAGAddToParserr   AddCreateLabelsFlags)parserexecution_spectriggerone_time_triggerasync_groups        ;lib/surface/dataplex/datascans/update/data_documentation.pyArgsDataDocumentation.Args-   s   ((: :  
 ;  
 %%: & N &&D ' G 	   C   ((A )  !!C "  !!%& "  ""I # K
 I	   	OO,$$V,    z-Status code: {status_code}. {status_message}.c           
      6   [         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SS5        UR                  R                  UR                  UR                  5       UR                  SR!                  U5      [         R"                  " U5      S95      nUR%                  S5      (       a-  UR%                  S5      (       d  [        R&                  " S	S
5      e[)        USS5      (       a   [*        R,                  R/                  S5        g [)        USS5      nU(       d[  [         R0                  " U5      n[*        R2                  " UR4                  SR7                  UR8                  UR:                  5      S9  U$ [*        R,                  R/                  SR7                  X6R4                  5      5        U$ )N   zIUpdate commands must specify at least one additional parameter to change.	scan_typeDOCUMENTATION,)namevalidateOnly
updateMaskgoogleCloudDataplexV1DataScanttl_after_scan_completionone_timer   z-can only be specified when --one-time is set.validate_onlyFz/Validation completed. Skipping resource update.async_zDData documentation scan updated in project [{0}] with location [{1}])detailszEUpdating data documentation scan with path [{0}] and operation [{1}].)r   GenerateUpdateMasklenr   HttpExceptionCONCEPTSParsedataplex_utilGetClientInstanceGetMessageModulesetattrprojects_locations_dataScansPatch.DataplexProjectsLocationsDataScansPatchRequestRelativeNamer2   join GenerateDatascanForUpdateRequestIsSpecifiedInvalidArgumentExceptiongetattrr	   statusPrintWaitForOperationUpdatedResourcer,   format
projectsIdlocationsId)	selfargsupdate_maskdatascan_refdataplex_clientmessageupdate_req_opr3   responses	            r#   RunDataDocumentation.Run}   s    --d3K
;!$$  ==))//1L#557O,,.GD+/#@@FF>>**,++xx,*2*S*S+	 	? 	
	M 	455  ,,//
'
9; ; t_e,,	jjHIT8U+F**=9h	
--vl55|7O7OP	 oJJO	00	1 r&    N)__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr$   gcloud_exception CatchHTTPErrorRaiseHTTPExceptionrV   __static_attributes__rX   r&   r#   r   r      sQ      	- M- M-^ 44500r&   r   N)r]   googlecloudsdk.api_lib.dataplexr   r   r:   googlecloudsdk.api_lib.utilr   r`   googlecloudsdk.callioper   #googlecloudsdk.command_lib.dataplexr   $googlecloudsdk.command_lib.util.argsr   googlecloudsdk.corer	   UniverseCompatibleReleaseTracksReleaseTrackALPHAGAUpdateCommandr   rX   r&   r#   <module>ro      s}    E 5 A F ( . = < # D%%++T->->-A-ABR** R C Rr&   