
                         2   S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r  SSKJr  SS	KJr  SS
KJr  SSKJr  SSKJr  \R,                  " \R.                  R0                  \R.                  R2                  5       " S S\R4                  5      5       rg)z)`gcloud dataplex content create` command.    )absolute_import)division)unicode_literals)content)util)
exceptions)base)resource_args)	arg_utils)labels_util)logc                   `    \ rS rSrSrSS0r\S 5       r\R                  " S5      S 5       r
Srg	)
Create   zCreating a content.EXAMPLESa  
          To create a Dataplex content `test-content` of type notebook  within lake `test-lake` in location `us-central1`.

           $ {command} --project=test-project --location=us-central1 --lake=test-lake --kernel-type=PYTHON3 --data-text='' --path='test-content'

          c                    [         R                  " U SSS9  U R                  SSS9  U R                  SSS	S
9  U R                  SSS	S
9  U R                  S	S	SS9nUR                  SSS9nUR                  SSS0[        R
                  SS	S9  UR                  SSS9nUR                  SSS0[        R
                  SS	S9  U R                  SSSSS9  [        R                  " U 5        g) zjRegister flags for this command.

Args:
  parser: argparse.Parser: Parser object for command line inputs.
zto create a Content to.F)
positionalz--descriptionzDescription of the Content)helpz--data-textzContent data in string formatT)r   requiredz--pathzAThe path for the Content file, represented as directory structurez.Sql script or notebook related configurations.)r   mutexr   z Notebook related configurations.)r   r   z--kernel-typePYTHON3python3zKernel Type of the notebook.)choicestyper   r   z"Sql script related configurations.z--query-engineSPARKsparkz*Query Engine to be used for the Sql Query.z--validate-only
store_truez:Validate the create action, but don't actually perform it.)actiondefaultr   N)r
   AddLakeResourceArgadd_argument	add_groupr   ChoiceToEnumNamer   AddCreateLabelsFlags)parsersqlscript_or_notebooknotebook
sql_scripts       &lib/surface/dataplex/content/create.pyArgsCreate.Args.   sS    $$)e=
.JK
;d  L
P  
 #,,= - ?
 %..? / AH I&''+   '00A 1 CJ '"''9   J	  L
 $$V,    z-Status code: {status_code}. {status_message}.c           	      L   UR                   R                  R                  5       n[        R                  " 5       nUR
                  R                  [        R                  " 5       R                  UR                  5       UR                  [        R                  " U5      S95      n[        USS5      nU(       a   [        R                  R!                  S5        g[        R"                  " UR$                  SR'                  UR(                  UR*                  UR,                  5      S9  g)zConstructs and sends request.

Args:
  args: argparse.Namespace, An object that contains the values for the
    arguments specified in the .Args() method.
)parentvalidateOnlygoogleCloudDataplexV1Contentvalidate_onlyFzValidation complete.NzBContent created in lake [{0}] in project [{1}] with location [{2}])details)CONCEPTSlakeParsedataplex_utilGetClientInstance%projects_locations_lakes_contentitemsr   GetMessageModule7DataplexProjectsLocationsLakesContentitemsCreateRequestRelativeNamer1   r   GenerateContentForCreateRequestgetattrr   statusPrintCreatedResourcenameformatlakesId
projectsIdlocationsId)selfargslake_refdataplex_clientcontent_responser1   s         r)   Run
Create.Runa   s     }}!!'')H#557O&LLSS&& 	

A
A((*++)0,,*--1*3 B 45 D/59M	jj-.T	  ("5"5x7K7K	LNr,    N)__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr*   gcloud_exception CatchHTTPErrorRaiseHTTPExceptionrK   __static_attributes__rM   r,   r)   r   r      sO     	- 0- 0-d 4457N7Nr,   r   N)rR   
__future__r   r   r   googlecloudsdk.api_lib.dataplexr   r   r6   googlecloudsdk.api_lib.utilr   rU   googlecloudsdk.callioper	   #googlecloudsdk.command_lib.dataplexr
   $googlecloudsdk.command_lib.util.apisr   $googlecloudsdk.command_lib.util.argsr   googlecloudsdk.corer   ReleaseTracksReleaseTrackALPHAGACommandr   rM   r,   r)   <module>re      sv    0 &  ' 3 A F ( = : < # D%%++T->->-A-AB_NT\\ _N C_Nr,   