
    k                     D   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,                  5      \R.                  \R0                   " S S\R2                  5      5       5       5       rg)z2`gcloud dataplex governance-rules update` command.    )absolute_import)division)unicode_literals)governance_rule)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    zaUpdate a Dataplex Governance Rule.

Governance Rule is a template for creating Governance Rules.
EXAMPLESa  
          To update Governance Rule `test-governance-rule` in project `test-dataplex` at location `us-central1`,
          with description `test description`, displayName `test display name` and ruleMetaDataFile `file.json`, run:

            $ {command} test-governance-rule --location=us-central1 --project=test-project --description='test description'
            --display-name='test display name'

          c                 h   [         R                  " U S5        U R                  SSSS9  U R                  SSSS9  U R                  SSS	S9  U R                  S
SSS9  U R                  SSS9nUR                  SSSSS9  [        R
                  R                  U5        [        R                  " U 5        g )Nz
to update.z--descriptionFz#Description of the Governance Rule.)requiredhelpz--display-namez$Display name of the Governance Rule.z--rule-metadata-filez:The name of the JSON or YAML file to define rule metadata.z--etagz*etag value for particular Governance Rule.T)mutexr   z--validate-only
store_truez:Validate the update action, but don't actually perform it.)actiondefaultr   )	r
   AddGovernanceRuleResourceArgadd_argument	add_groupr	   
ASYNC_FLAGAddToParserr   AddCreateLabelsFlags)parser
async_types     /lib/surface/dataplex/governance_rules/update.pyArgsUpdate.Args5   s    ..v|D
2  
 3  
 I  
 9   !!u!=J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UR                  R                  [        R                  " 5       R                  UR                  5       UR                  SR                  U5      [         R                   " U5      S95      n[#        USS5      nU(       a   [$        R&                  R)                  S5        g [#        USS5      (       d-  [         R*                  " U5      n[$        R,                  " US	S
9  U$ [$        R&                  R)                  SR/                  X5R0                  5      5        U$ )N   zIUpdate commands must specify at least one additional parameter to change.,)namevalidateOnly
updateMask#googleCloudDataplexV1GovernanceRulevalidate_onlyFzValidation complete.async_zOperation was successful.)detailsz4Updating Governance Rule [{0}] with operation [{1}].)r   GenerateUpdateMasklenr   HttpExceptionCONCEPTSParsedataplex_utilGetClientInstance"projects_locations_governanceRulesPatchGetMessageModule4DataplexProjectsLocationsGovernanceRulesPatchRequestRelativeNamer+   join&GenerateGovernanceRuleForUpdateRequestgetattrr   statusPrintWaitForOperationUpdatedResourceformatr'   )selfargsupdate_maskgovernance_rule_refdataplex_clientupdate_req_opr+   responses           r    Run
Update.RunW   s[    "44T:K
;!$$ 
 --77==?#557O#FFLL&&(]]$113++xx,0?0f0f1	 	^ 	
	M D/59M	jj-.45)) 11-@h	
'B oJJ>EE!3!3	

 r#    N)__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr!   gcloud_exception CatchHTTPErrorRaiseHTTPExceptionrI   __static_attributes__rK   r#   r    r   r       sO      
- - -B 445&&r#   r   N)rP   
__future__r   r   r   googlecloudsdk.api_lib.dataplexr   r   r3   googlecloudsdk.api_lib.utilr   rS   googlecloudsdk.callioper	   #googlecloudsdk.command_lib.dataplexr
   $googlecloudsdk.command_lib.util.argsr   googlecloudsdk.corer   ReleaseTracksReleaseTrackALPHADefaultUniverseOnlyHiddenCommandr   rK   r#   r    <module>rc      s    9 '  ' ; A F ( . = < # D%%++,]T\\ ]   -]r#   