ó
    €Ï«  ã            	       óŠ  • 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	\R                  S
\S\R"                  4S jrS	\R                  S\S\S\R"                  4S jrS	\R                  SS4S jrS\R                  S
\S\\R"                  SS4   4S jrS	\R                  S\S\R"                  4S jrg)z'Bigtable materialized-views API helper.é    )Ú	Generator)Ú
list_pager)Úutil)Ú
exceptions)Ú	arg_utils)Ú	resources)Úbigtableadmin_v2_messagesÚmaterialized_view_refÚviewÚreturnc                 óZ  • [         R                  " 5       n[         R                  " 5       nUR                  nUR                  n[
        R                  " SUSSSS.S9nUR                  U5      nUc  UR                  nU" U R                  5       US9nUR                  R                  U5      $ )a+  Describe a materialized view.

Args:
  materialized_view_ref: A resource reference to the materialized view to
    describe.
  view: Specifies what type of information to return about the view. Valid
    values are 'schema', 'replication', and 'full'.

Returns:
  materialized view resource object.
ú--viewÚschemaÚreplicationÚfull©ÚSCHEMA_VIEWÚREPLICATION_VIEWÚFULL©Úcustom_mappings)Únamer   )r   ÚGetAdminClientÚGetAdminMessagesÚ9BigtableadminProjectsInstancesMaterializedViewsGetRequestÚViewValueValuesEnumr   ÚChoiceEnumMapperÚGetEnumForChoicer   ÚRelativeNameÚ$projects_instances_materializedViewsÚGet)	r
   r   ÚclientÚmsgsÚget_materialized_view_requestÚview_enum_typeÚmapperÚ	view_enumÚmsgs	            Ú9lib/googlecloudsdk/api_lib/bigtable/materialized_views.pyÚDescriber*      sµ   € ô ×ÒÓ €&Ü	×	Ò	Ó	 €$ð ×DÑDð  ð 1×DÑD€.Ü×%Ò%ØØà!Ø+Øññ€&ð ×%Ñ% dÓ+€)ØÑØ×*Ñ*€Iá%Ø ×-Ñ-Ó/°iñ	€#ð 
×	4Ñ	4×	8Ñ	8¸Ó	=Ð=ó    ÚqueryÚdeletion_protectionc                 ó6  • [         R                  " 5       n[         R                  " 5       nU R                  5       nUR	                  US9nUb  X&l        UR                  UU R                  5       UR                  5       S9nUR                  R                  U5      $ )a2  Create a materialized view.

Args:
  materialized_view_ref: A resource reference to the materialized view to
    create.
  query: The query of the materialized view.
  deletion_protection: Whether the materialized view is protected from
    deletion.

Returns:
  Created materialized view resource object.
)r,   )ÚmaterializedViewÚmaterializedViewIdÚparent)r   r   r   ÚParentÚMaterializedViewÚdeletionProtectionÚ<BigtableadminProjectsInstancesMaterializedViewsCreateRequestÚNamer   r    ÚCreate)r
   r,   r-   r"   r#   Úinstance_refÚmaterialized_viewr(   s           r)   r7   r7   B   s˜   € ô$ ×ÒÓ €&Ü	×	Ò	Ó	 €$à&×-Ñ-Ó/€,à×+Ñ+°%Ð+Ð8ÐØÑ$Ø+>Ô(à×IÑIØ(Ø.×3Ñ3Ó5Ø×&Ñ&Ó(ð 	Jð 	€#ð
 
×	4Ñ	4×	;Ñ	;¸CÓ	@Ð@r+   Nc                 óÄ   • [         R                  " 5       n[         R                  " 5       R                  U R	                  5       S9nUR
                  R                  U5        g)zyDelete a materialized view.

Args:
  materialized_view_ref: A resource reference to the materialized view to
    delete.
)r   N)r   r   r   Ú<BigtableadminProjectsInstancesMaterializedViewsDeleteRequestr   r    ÚDelete)r
   r"   r(   s      r)   r<   r<   e   sS   € ô ×ÒÓ €&Ü×ÒÓ×\Ñ\Ø ×-Ñ-Ó/ð 	]ð 	€#ð 	×-Ñ-×4Ñ4°SÕ9r+   r8   c                 ó”  • [         R                  " 5       n[         R                  " 5       nUR                  nUR                  n[
        R                  " SUSSSS.S9nUR                  U5      nXuR                  :w  a  [        R                  " US5      eU" U R                  5       US9n[        R                  " UR                  US	S
S9$ )a3  List materialized views.

Args:
  instance_ref: A resource reference of the instance to list materialized
    views for.
  view: Specifies what type of information to return about the views. The only
    supported value at this time is 'schema'.

Returns:
  Generator of materialized view resource objects.
r   r   r   r   r   r   z<Only 'schema' view is supported for list materialized views.)r1   r   ÚmaterializedViewsN)ÚfieldÚbatch_size_attribute)r   r   r   Ú:BigtableadminProjectsInstancesMaterializedViewsListRequestr   r   r   r   r   r   ÚBadArgumentExceptionr   r   ÚYieldFromListr    )	r8   r   r"   r#   Úlist_materialized_view_requestr%   r&   r'   r(   s	            r)   ÚListrE   u   sÚ   € ô ×ÒÓ €&Ü	×	Ò	Ó	 €$ð ×EÑEð !ð 2×EÑE€.Ü×%Ò%ØØà!Ø+Øññ€&ð ×%Ñ% dÓ+€)à×,Ñ,Ó,Ü
×
)Ò
)ØØFóð ñ
 	'Ø×&Ñ&Ó(Øñ	€#ô 
×	!Ò	!Ø×1Ñ1Ø	ØØñ	
ð r+   c                 óä   • [         R                  " 5       n[         R                  " 5       nUR                  UR	                  US9U R                  5       SS9nUR                  R                  U5      $ )a  Update a materialized view.

Args:
  materialized_view_ref: A resource reference to the materialized view to
    update.
  deletion_protection: Whether the materialized view is protected from
    deletion.

Returns:
  Updated materialized view resource object.
)r4   r-   )r/   r   Ú
updateMask)r   r   r   Ú;BigtableadminProjectsInstancesMaterializedViewsPatchRequestr3   r   r    ÚPatch)r
   r-   r"   r#   r(   s        r)   ÚUpdaterJ   ¨   sv   € ô ×ÒÓ €&Ü	×	Ò	Ó	 €$à×HÑHØ×,Ñ,Ø0ð -ð ð !×-Ñ-Ó/Ø&ð 	Ið 	€#ð 
×	4Ñ	4×	:Ñ	:¸3Ó	?Ð?r+   )Ú__doc__Útypingr   Úapitools.base.pyr   Úgooglecloudsdk.api_lib.bigtabler   Úgooglecloudsdk.callioper   Ú$googlecloudsdk.command_lib.util.apisr   Úgooglecloudsdk.corer   Ú6googlecloudsdk.generated_clients.apis.bigtableadmin.v2r	   ÚResourceÚstrr3   r*   Úboolr7   r<   rE   rJ   © r+   r)   Ú<module>rW      s  ðñ .å Ý 'Ý 0Ý .Ý :Ý )Ý \ð%>Ø$×-Ñ-ð%>Ø58ð%>à×/Ñ/ô%>ðP AØ$×-Ñ-ð Aàð Að ð Að ×/Ñ/ô	 AðF:Ø$×-Ñ-ð:à	ô:ð 0Ø×$Ñ$ð0à
ð0ð Ð(×9Ñ9¸4ÀÐEÑFô0ðf@Ø$×-Ñ-ð@ØDHð@à×/Ñ/õ@r+   