
    /                     ,   d Z ddlmZ ddlmZ ddlmZ ddlm	Z	 ddlmZ ddl
mZ ddlmZ ddlmZ  e	j                   e	j"                  j$                  e	j"                  j&                        e	j(                   G d	 d
e	j*                                      Zy)z,`gcloud dataplex glossaries update` command.    )glossary)util)
exceptions)base)resource_args)labels_util)logc                   X    e Zd ZdZddiZed        Z ej                  d      d        Z	y)UpdatezUpdates a Dataplex Glossary.EXAMPLESa5            To update Glossary `test-glossary` in project `test-dataplex` at location `us-central1`,
          with description `updated description` and displayName `displayName`
            $ {command} test-glossary --location=us-central1 --project test-dataplex --description='updated description'
          c                 `   t        j                  | d       | j                  ddd       | j                  ddd       | j                  ddd	       | j                  d
d      }|j                  dddd       t        j
                  j                  |       t        j                  |        y )Nz
to update.z--descriptionFzDescription of the Glossary.)requiredhelpz--display-namezDisplay Name of the Glossary.z--etagz#etag value for particular Glossary.T)mutexr   z--validate-only
store_truez:Validate the update action, but don't actually perform it.)actiondefaultr   )	r   AddGlossaryResourceArgadd_argument	add_groupr   
ASYNC_FLAGAddToParserr   AddCreateLabelsFlags)parserasync_groups     )lib/surface/dataplex/glossaries/update.pyArgszUpdate.Args&   s    ((>
+  
 ,  
 2  
 """>KI	   	OO,$$V,    z-Status code: {status_code}. {status_message}.c           
      $   t        j                  |      }t        |      dk  rt        j                  d      |j
                  j                   j                         }t        j                         }|j                  j                  t        j                         j                  |j                         |j                  dj                  |      t        j                   |                  }t#        |dd      }|r t$        j&                  j)                  d       y t#        |dd      }|s.t        j*                  |      }t%        j,                  |d	
       |S t$        j&                  j)                  dj/                  ||j0                               |S )N   zIUpdate commands must specify at least one additional parameter to change.,)namevalidateOnly
updateMaskgoogleCloudDataplexV1Glossaryvalidate_onlyFzValidation complete.async_zOperation was successful.)detailsz-Updating Glossary [{0}] with operation [{1}].)r   GenerateUpdateMasklenr   HttpExceptionCONCEPTSParsedataplex_utilGetClientInstanceprojects_locations_glossariesPatchGetMessageModule/DataplexProjectsLocationsGlossariesPatchRequestRelativeNamer&   join GenerateGlossaryForUpdateRequestgetattrr	   statusPrintWaitForOperationUpdatedResourceformatr"   )	selfargsupdate_maskglossary_refdataplex_clientupdate_req_opr&   r'   responses	            r   Runz
Update.RunB   sY    --d3K
;!$$  ==))//1L#557O#AAGG&&(XX**,++xx,*2*S*S+	 	Y 	
	M D/59M	jj-.T8U+F**=9h	,0KLoJJ7>>-,,	

 r   N)
__name__
__module____qualname____doc__detailed_helpstaticmethodr   gcloud_exception CatchHTTPErrorRaiseHTTPExceptionrD    r   r   r   r      sO     % - - -6 5445!!r   r   N)rH   googlecloudsdk.api_lib.dataplexr   r   r.   googlecloudsdk.api_lib.utilr   rK   googlecloudsdk.callioper   #googlecloudsdk.command_lib.dataplexr   $googlecloudsdk.command_lib.util.argsr   googlecloudsdk.corer	   ReleaseTracksReleaseTrackALPHAGADefaultUniverseOnlyCommandr   rM   r   r   <module>rZ      sz    3 4 A F ( . = < # D%%++T->->-A-ABJT\\ J  CJr   