
                             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  e	j                   e	j"                  j$                  e	j"                  j&                        e	j(                   G d	 d
e	j*                                      Zy)z,`gcloud dataplex glossaries create` 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)CreateziCreate a Dataplex Glossary resource.

     A Glossary represents a collection of Categories and Terms.
  EXAMPLESab  
          To create a Glossary `test-glossary` in project `test-dataplex` at
          location `us-central1`, with description `test description` and
          displayName `displayName` , run:

            $ {command} test-glossary --location=us-central1 --project=test-dataplex --description='test description' --display-name='displayName'

          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--display-nameFzDisplay Name of the Glossary.)requiredhelpz--descriptionzDescription of the Glossary.T)mutexr   z--validate-only
store_truez:Validate the create 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/create.pyArgszCreate.Args.   s    ((>
5/N   %.L   "" # 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)
glossaryIdparentvalidateOnlygoogleCloudDataplexV1Glossaryvalidate_onlyFzValidation complete.async_z5Glossary created in project [{0}] with location [{1}])detailsz-Creating Glossary [{0}] with operation [{1}].)CONCEPTSr   Parsedataplex_utilGetClientInstanceprojects_locations_glossariesr   GetMessageModule0DataplexProjectsLocationsGlossariesCreateRequestNameParentRelativeNamer$    GenerateGlossaryForCreateRequestgetattrr	   statusPrintWaitForOperationCreatedResourcenameformat
projectsIdlocationsId)selfargsglossary_refdataplex_clientcreate_req_opr$   r%   responses           r   Runz
Create.RunB   sO    ==))//1L#557O#AAHH&& 	

:
:#((*&&(557++*2--d+4	 ; 56M D/59M	jj-.T8U+F**=9h	
--I6,))**,-
 oJJ7>>-,,	./ r   N)
__name__
__module____qualname____doc__detailed_helpstaticmethodr   gcloud_exception CatchHTTPErrorRaiseHTTPExceptionrA    r   r   r   r      sQ     - - -& 544577r   r   N)rE   googlecloudsdk.api_lib.dataplexr   r   r)   googlecloudsdk.api_lib.utilr   rH   googlecloudsdk.callioper   #googlecloudsdk.command_lib.dataplexr   $googlecloudsdk.command_lib.util.argsr   googlecloudsdk.corer	   ReleaseTracksReleaseTrackALPHAGADefaultUniverseOnlyCommandr   rJ   r   r   <module>rW      sw    3 4 A F ( = < # D%%++T->->-A-ABGT\\ G  CGr   