
    
                         S r SSK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      \R                   " S S\R                  5      5       5       rg)	z5The create command for BigLake Iceberg REST catalogs.    N)util)base)flags)logc                   V    \ rS rSrSrS\R                  " S5      0r\S 5       r	S r
Srg)	CreateCatalog   z&Create a BigLake Iceberg REST catalog.EXAMPLESah            To add a catalog using a GCS bucket `my-catalog-bucket`, run:

            $ {command} my-catalog-bucket --catalog-type=gcs-bucket

          To create a catalog using a GCS bucket `my-catalog-bucket` with vended credentials, run:

            $ {command} my-catalog-bucket --catalog-type=gcs-bucket   --credential-mode=vended-credentials

          c                 N   [         R                  " U S5        [        R                  " [        R
                  R                  5      R                  R                  U 5        [        R                  " [        R
                  R                  5      R                  R                  U 5        g )Nz	to create)
r   AddCatalogResourceArgr   GetCredentialModeEnumMapperr   ReleaseTrackALPHA
choice_argAddToParserGetCatalogTypeEnumMapper)parsers    .lib/surface/biglake/iceberg/catalogs/create.pyArgsCreateCatalog.Args,   sh    	4$$jV$!!jV$    c                    [         R                  " U R                  5       5      nUR                  n[         R                  " UR
                  5      nS nUR                  S5      (       a=  [         R                  " U R                  5       5      R                  UR                  5      nUR                  U[         R                  " U R                  5       5      R                  UR                  5      US9nUR                  UR
                  U[         R                  " 5       S9n[        R                   " US5        UR"                  R%                  U5      $ )Ncredential_mode)namecatalog_typer   )iceberg_catalog_idicebergCatalogparentcatalog)r   GetClientInstancer   MESSAGES_MODULEGetCatalogNamer   IsSpecifiedr   GetEnumForChoicer   IcebergCatalogr   r   BBiglakeIcebergV1RestcatalogExtensionsProjectsCatalogsCreateRequestGetParentNamer   CreatedResource3iceberg_v1_restcatalog_extensions_projects_catalogsCreate)selfargsclientmessagescatalog_namer   r   requests           r   RunCreateCatalog.Run6   s(   ##D$5$5$78F%%H&&t||4LO)**88



--.  %%22


4,,
-' & G 	SS#||"%%' 	T 	
  i0EELL r    N)__name__
__module____qualname____firstlineno____doc__textwrapdedentdetailed_helpstaticmethodr   r1   __static_attributes__r3   r   r   r   r      s=     / 
// 	 	- % %r   r   )r8   r9   googlecloudsdk.api_lib.biglaker   googlecloudsdk.callioper   "googlecloudsdk.command_lib.biglaker   googlecloudsdk.corer   ReleaseTracksr   r   DefaultUniverseOnlyCreateCommandr   r3   r   r   <module>rE      s_    <  / ( 4 # D%%++,9D&& 9  -9r   