
                         D   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  ej(                  ej*                  j,                  ej*                  j.                        ej0                   G d dej2                                      Zy)z.`gcloud dataplex entry-groups create` 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)CreateziCreate a Dataplex Entry Group.

     Entry Group acts as a logical container used to organize Entries.
  EXAMPLESai  
          To create Entry Group `test-entry-group` in project `test-dataplex` at location `us-central1`,
          with description `test description` and displayName `test display name`, run:

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

          c                 8   t        j                  | 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 create.z--descriptionFzDescription of the Entry Group.)requiredhelpz--display-namez Display name of the Entry Group.T)mutexr   z--validate-only
store_truez:Validate the create 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/create.pyArgszCreate.Args2   s    2263?A
.  0 /  1 "" # K J	  L
 	OO,$$V,    z-Status code: {status_code}. {status_message}.c           
      *   |j                   j                  j                         }t        j                         }|j
                  j                  t        j                         j                  |j                         |j                         j                         |j                  t        j                  |                  }t        |dd      }|r t        j                   j#                  d       y t        |dd      }|s\t        j$                  |      }t        j&                  |j(                  dj+                  |j,                  |j.                               |S t        j                   j#                  dj+                  ||j(                               |S )	N)entryGroupIdparentvalidateOnlygoogleCloudDataplexV1EntryGroupvalidate_onlyFzValidation complete.async_z8Entry Group created in project [{0}] with location [{1}])detailsz0Creating Entry Group [{0}] with operation [{1}].)CONCEPTSr   Parsedataplex_utilGetClientInstanceprojects_locations_entryGroupsr   GetMessageModule1DataplexProjectsLocationsEntryGroupsCreateRequestNameParentRelativeNamer'   "GenerateEntryGroupForCreateRequestgetattrr   statusPrintWaitForOperationCreatedResourcenameformat
projectsIdlocationsId)selfargsentry_group_refdataplex_clientcreate_req_opr'   r(   responses           r   Runz
Create.RunI   sO    mm//557O#557O#BBII&& 	

;
;(--/"))+88:++,7//-6	 < 78M D/59M	jj-.T8U+F--m<h	
--L6/,,!--/0
 oJJ:AA]//	12 r!   N)
__name__
__module____qualname____doc__detailed_helpstaticmethodr    gcloud_exception CatchHTTPErrorRaiseHTTPExceptionrD    r!   r   r   r      sQ     
- - -, 544577r!   r   N)rH   
__future__r   r   r   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>r[      s    5 &  ' 7 A F ( = < # D%%++T->->-A-ABJT\\ J  CJr!   