
                            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\R0                  5      5       rg)z9`gcloud dataplex data-attribute-bindings update` command.    )absolute_import)division)unicode_literals)data_taxonomy)util)
exceptions)arg_parsers)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 Data Attribute Binding.EXAMPLESa?  
          To Update Data Attribute Binding `test-attribute-binding` in project
          `test-dataplex` at location `us-central1` with resource attributes
          a1 and a2. Test column 'testColumn1' attached to attribute 'a1' and 'testColumn2' attached to attribute 'a2' , run:

            $ {command} test-attribute-binding --project=test-dataplex --location=us-central1
            --resource-attributes='a1,a2'
            --paths=name=testColumn1,attributes=a1
            --paths=name=testColumn2,attributes=a2
            --etag=Etag_Received_From_Get

          c                    [         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[        R                  " 5       SS9  U R                  S	SS9nUR                  SSSS[        R                  " [        [        R                  " 5       S.SS/S9SS9  UR                  SSS9  U R                  S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 Data Attribute Binding.)requiredhelpz--display-namez+Display Name of the Data Attribute Binding.z--etagTz2etag value of the Data Attribute Binding resource.z--resource-attributes
ATTRIBUTESz:List of Data Attributes to be associated with the resource)metavardefaultr   typer   zCreation options.)mutexr   z--pathsPATHappend)name
attributesr   r   )specrequired_keysaO  The list of paths for items within the associated resource (eg. columns within a table) along with attribute bindings. The args can be passed as key value pair. Supported Keys are --path=name=value1,attributes=value2 ,See https://cloud.google.com/sdk/gcloud/reference/topic/escaping for details on using a delimiter other than a comma.)r   actionr   r   r   z--path-file-namez=The name of the JSON or YAML file to define Path config from.)r   z--path-file-formatjsonyamlzThe format of the file to create the path. Specify either yaml or json. Defaults to yaml if not specified. Will be ignored if --file-name is not specified.)choicesr   )r   r   z--validate-only
store_truez:Validate the update action, but don't actually perform it.)r    r   r   )r   "AddDataAttributeBindingResourceArgadd_argumentr	   ArgList	add_groupArgDictstrr
   
ASYNC_FLAGAddToParserr   AddCreateLabelsFlags)parsergroupasync_groups      6lib/surface/dataplex/data_attribute_bindings/update.pyArgsUpdate.Args5   s   44V5AC
9  ; :  < A  C   "I  K 4.ABE	  )113 "<0
0  1& 
  
  ?	  A "" # K J	  L
 	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UR                  R                  [        R                  " 5       R                  UR                  5       SR                  U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S	S
9  U$ [&        R(                  R+                  SR1                  X5R2                  5      5        U$ )N   zIUpdate commands must specify at least one additional parameter to change.,)r   
updateMaskvalidateOnly)googleCloudDataplexV1DataAttributeBindingvalidate_onlyFzValidation complete.async_zOperation was successful.)detailsz;Updating Data Attribute Binding [{0}] with operation [{1}].)r   "GenerateAttributeBindingUpdateMasklenr   HttpExceptionCONCEPTSdata_attribute_bindingParsedataplex_utilGetClientInstance(projects_locations_dataAttributeBindingsPatchGetMessageModule:DataplexProjectsLocationsDataAttributeBindingsPatchRequestRelativeNamejoinr;   ,GenerateDataAttributeBindingForUpdateRequestgetattrr   statusPrintWaitForOperationUpdatedResourceformatr   )	selfargsupdate_maskattribute_binding_refdataplex_clientupdate_req_opr;   r<   responses	            r1   Run
Update.Runz   sc     BB4HK
;!$$
U  !MM@@FFH#557O#LLRR&& 	

D
D&335yy-++6C997::>7@	 E ABM D/59M	jj-.T8U+F//>h	/"=?oJJELL!#5#5	78 r4    N)__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr2   gcloud_exception CatchHTTPErrorRaiseHTTPExceptionrZ   __static_attributes__r\   r4   r1   r   r       sO    1 -" B- B-H 4457!7!r4   r   N)ra   
__future__r   r   r   googlecloudsdk.api_lib.dataplexr   r   rD   googlecloudsdk.api_lib.utilr   rd   googlecloudsdk.callioper	   r
   #googlecloudsdk.command_lib.dataplexr   $googlecloudsdk.command_lib.util.argsr   googlecloudsdk.corer   ReleaseTracksReleaseTrackALPHACommandr   r\   r4   r1   <module>rr      sh    @ &  ' 9 A F / ( . = < # D%%++,|T\\ | -|r4   