
                         P   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
 dd	lmZ dd
lmZ ddlmZ  ej(                  ej*                  j,                  ej*                  j.                        ej0                   G d dej2                                      Zy)z.`gcloud dataplex entry-groups update` command.    )absolute_import)division)unicode_literals)entry_group)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Update a Dataplex Entry Group.EXAMPLESa  
          To update Entry Group `test-entry-group` in project `test-project` at location `us-central1`,
          with description `updated description` and display name `updated display name`, run:

            $ {command} test-entry-group --location=us-central1 --project=test-project --description='updated description'
            --display-name='updated display name'

          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 Entry Group.)requiredhelpz--display-namez Display name of the Entry Group.z--etagz&etag value for particular Entry Group.T)mutexr   z--validate-only
store_truez:Validate the update action, but don't actually perform it.)actiondefaultr   )	r
    AddDataplexEntryGroupResourceArgadd_argument	add_groupr	   
ASYNC_FLAGAddToParserr   AddCreateLabelsFlags)parserasync_groups     +lib/surface/dataplex/entry_groups/update.pyArgszUpdate.Args1   s    226<H
%.O   /  
 5'O   """>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googleCloudDataplexV1EntryGroupvalidate_onlyFzValidation complete.async_zOperation was successful.)detailsz0Updating Entry Group [{0}] with operation [{1}].)r   GenerateEntryGroupUpdateMasklenr   HttpExceptionCONCEPTSParsedataplex_utilGetClientInstanceprojects_locations_entryGroupsPatchGetMessageModule0DataplexProjectsLocationsEntryGroupsPatchRequestRelativeNamer)   join"GenerateEntryGroupForUpdateRequestgetattrr   statusPrintWaitForOperationUpdatedResourceformatr%   )	selfargsupdate_maskentry_group_refdataplex_clientupdate_req_opr)   r*   responses	            r   Runz
Update.RunI   sY    ::4@K
;!$$ 
 mm//557O#557O#BBHH&& 	

:
: --/++yy-,7//-6	 ; 78M D/59M	jj-.T8U+F--m<h	/3NOoJJ:AA]//	12 r!   N)
__name__
__module____qualname____doc__detailed_helpstaticmethodr    gcloud_exception CatchHTTPErrorRaiseHTTPExceptionrG    r!   r   r   r      sQ     ' - - -. 5445!!r!   r   N)rK   
__future__r   r   r   googlecloudsdk.api_lib.dataplexr   r   r1   googlecloudsdk.api_lib.utilr   rN   googlecloudsdk.callioper	   #googlecloudsdk.command_lib.dataplexr
   $googlecloudsdk.command_lib.util.argsr   googlecloudsdk.corer   ReleaseTracksReleaseTrackALPHAGADefaultUniverseOnlyCommandr   rP   r!   r   <module>r^      s    5 &  ' 7 A F ( . = < # D%%++T->->-A-ABLT\\ L  CLr!   