
                         8   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      \R.                  \R0                   " S S\R2                  5      5       5       5       rg)z2`gcloud dataplex governance-rules create` 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	)
Create   zaCreate a Dataplex Governance Rule.

Governance Rule is a template for creating Governance Rules.
EXAMPLESa  
          To create 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'
            --rule-metadata-file='file.json'

          c                 F   [         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9nUR                  SSSSS9  [        R
                  R                  U5        [        R                  " U 5        g )Nz
to create.z--descriptionFz#Description of the Governance Rule.)requiredhelpz--display-namez$Display name of the Governance Rule.z--rule-metadata-fileTz:The name of the JSON or YAML file to define rule metadata.)mutexr   z--validate-only
store_truez:Validate the create 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/create.pyArgsCreate.Args5   s    ..v|D
2  
 3  
 I   !!u!=JI	   	OO
+$$V,    z-Status code: {status_code}. {status_message}.c           
      :   UR                   R                  R                  5       n[        R                  " 5       nUR
                  R                  [        R                  " 5       R                  UR                  5       UR                  5       R                  5       UR                  [        R                  " U5      S95      n[        USS5      nU(       a   [        R                   R#                  S5        g [        USS5      nU(       d[  [        R$                  " U5      n[        R&                  " UR(                  SR+                  UR,                  UR.                  5      S9  U$ [        R                   R#                  SR+                  X$R(                  5      5        U$ )	N)governanceRuleIdparentvalidateOnly#googleCloudDataplexV1GovernanceRulevalidate_onlyFzValidation complete.async_z<Governance Rule created in project [{0}] with location [{1}])detailsz4Creating Governance Rule [{0}] with operation [{1}].)CONCEPTSr   Parsedataplex_utilGetClientInstance"projects_locations_governanceRulesr   GetMessageModule5DataplexProjectsLocationsGovernanceRulesCreateRequestNameParentRelativeNamer)   &GenerateGovernanceRuleForCreateRequestgetattrr   statusPrintWaitForOperationCreatedResourcenameformat
projectsIdlocationsId)selfargsgovernance_rule_refdataplex_clientcreate_req_opr)   r*   responses           r    Run
Create.RunR   sO    --77==?#557O#FFMM&&(^^0557&--/<<>++0?0f0f1	 	_ 	
	M D/59M	jj-.T8U+F 11-@h	
--Lv%00%11		 oJJ>EE!3!3	

 r#    N)__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr!   gcloud_exception CatchHTTPErrorRaiseHTTPExceptionrF   __static_attributes__rH   r#   r    r   r      sN      	- - -8 445''r#   r   N)rM   
__future__r   r   r   googlecloudsdk.api_lib.dataplexr   r   r.   googlecloudsdk.api_lib.utilr   rP   googlecloudsdk.callioper	   #googlecloudsdk.command_lib.dataplexr
   $googlecloudsdk.command_lib.util.argsr   googlecloudsdk.corer   ReleaseTracksReleaseTrackALPHADefaultUniverseOnlyHiddenCommandr   rH   r#   r    <module>r`      s}    9 '  ' ; A F ( = < # D%%++,ZT\\ Z   -Zr#   