
                            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  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\R&                  \R(                  " \R*                  R,                  \R*                  R.                  \R*                  R0                  5       " S S\R2                  5      5       5       rg)z+Bigtable materialized views create command.    N)
exceptions)materialized_views)util)base)parser_arguments)parser_extensions)	arguments)log)	resources)bigtableadmin_v2_messagesc                       \ rS rSrSrS\R                  " S5      0r\S\	R                  SS4S j5       rS	\R                  S
\R                  S\R"                  4S jrS
\R                  S\R"                  4S jrSrg)CreateMaterializedView"   z(Create a new Bigtable materialized view.EXAMPLESz          To create a materialized view, run:
            $ {command} my-materialized-view-id --instance=my-instance-id --query="SELECT my-column-family FROM my-table --deletion-protection=false"
          parserreturnNc                     [         R                  " U S5        [         R                  " U 5      R                  SS9R	                  5       R                  5         g )Nz	to createT)required)r	   AddMaterializedViewResourceArgArgAdderAddViewQueryAddDeletionProtectionAddAsync)r   s    1lib/surface/bigtable/materialized_views/create.pyArgsCreateMaterializedView.Args0   sB    ,,V[Av++ , hhj    materialized_view_refargsc                 X    [         R                  " XR                  UR                  5      $ )a$  Creates a materialized view with the given arguments.

Args:
  materialized_view_ref: A resource reference of the new materialized view.
  args: an argparse namespace. All the arguments that were provided to this
    command invocation.

Returns:
  Created materialized view resource object.
)r   Createquerydeletion_protection)selfr   r   s      r   _CreateMaterializedView.CreateMaterializedView._CreateMaterializedView7   s&     $$zz4+C+C r   c                    UR                   R                  R                  5       nU R                  X!5      nUR                  (       dJ  [
        R                  " U5      n[
        R                  " USR                  UR                  5       5      5      $ [        R                  " UR                  5       SUR                  S9  g)zThis is what gets called when the user runs this command.

Args:
  args: an argparse namespace. All the arguments that were provided to this
    command invocation.

Returns:
  Created resource.
zCreating materialized view {0}zmaterialized view)kindis_asyncN)CONCEPTSmaterialized_viewParser%   async_r   GetOperationRefAwaitMaterializedViewformatNamer
   CreatedResource)r$   r   r   	operationoperation_refs        r   RunCreateMaterializedView.RunJ   s     !MM;;AAC,,-BII;;**95m''

*
1
12G2L2L2N
O  ""$ 
 r    )__name__
__module____qualname____firstlineno____doc__textwrapdedentdetailed_helpstaticmethodr   ArgumentInterceptorr   r   Resourcer   	Namespacer   MaterializedViewr%   r5   __static_attributes__r7   r   r   r   r   "   s    
 1 (// # - )#77 )D ) )&// '' !11	&#-- 11r   r   )r<   r=   apitools.base.pyr   googlecloudsdk.api_lib.bigtabler   r   googlecloudsdk.callioper   r   r   #googlecloudsdk.command_lib.bigtabler	   googlecloudsdk.corer
   r   6googlecloudsdk.generated_clients.apis.bigtableadmin.v2r   	HttpErrorUniverseCompatibleReleaseTracksReleaseTrackGABETAALPHACreateCommandr   r7   r   r   <module>rT      s    2  ' > 0 ( 4 5 9 # ) \   	 $++00$2C2C2I2I=T// = =r   