HEX
Server: Apache/2.4.68 (Debian)
System: Linux as-cs-widget-demo-us-central1 6.1.0-44-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.164-1 (2026-03-09) x86_64
User: root (0)
PHP: 8.2.32
Disabled: NONE
Upload Files
File: //lib/google-cloud-sdk/lib/surface/datastore/indexes/__pycache__/create.cpython-312.pyc
�

��,����dZddlmZddlmZddlmZddlmZddlmZddlm	Z	ddl
mZdd	l
mZdd
l
m
Z
ddlmZddlmZdd
lmZddlmZej,ej.ej0j2ej0j4�Gd�dej6���Zej,ej.ej0j:�Gd�de���Zy)z,The gcloud datastore indexes create command.�)�absolute_import)�division)�unicode_literals)�yaml_parsing)�	constants)�	index_api)�base)�
exceptions)�parser_arguments)�output_helpers)�flags)�
properties)�
console_ioc�j�eZdZdZdddd�Zedejddfd	��Zdd
�Z	de
de
d
eddfd�Zy)�CreatezCreate Cloud Datastore indexes.zECreate new datastore indexes based on your local index configuration.z�
Create new datastore indexes based on your local index configuration.
Any indexes in your index file that do not exist will be created.
      a)          To create new indexes based on your local configuration, run:

            $ {command} ~/myapp/index.yaml

          Detailed information about index configuration can be found at the
          [index.yaml reference](https://cloud.google.com/datastore/docs/tools/indexconfig).
          )�brief�DESCRIPTION�EXAMPLES�parser�returnNc�X�tj|�tj|�y)zGet arguments for this command.N)r
�AddIndexFileFlag�AddDatabaseIdFlag)rs �'lib/surface/datastore/indexes/create.py�ArgszCreate.Args9s ��
���6�"�	���F�#�c��|jr|jntj}|j|j|d��y)z9Create missing indexes as defined in the index.yaml file.F��
index_file�database�
enable_vectorN�r r�DEFAULT_NAMESPACE�
CreateIndexesr��self�args�database_ids   r�Runz
Create.Run?s>������
�
�I�,G�,G��	����?�?�[���rrr r!c���tjjjj	d��}t
jj|�}|r'|jt
jjk7rtjdd��tj||g��tjddd��t!j"|||j$|��y	)
a�Cleates missing indexes via the Firestore Admin API.

    Lists the database's existing indexes, and then compares them against the
    indexes that are defined in the given index.yaml file. Any discrepancies
    against the index.yaml file are created.

    Args:
      index_file: The users definition of their desired indexes.
      database: The database within the project we are operating on.
      enable_vector: Whether or not vector indexes are supported.
    T)�requiredrz5You must provide the path to a valid index.yaml file.)�project�configsF)�default�throw_if_unattended�cancel_on_no)�
project_idr(�index_definitionsr!N)r�VALUES�corer,�Getr�ConfigYamlInfo�FromFile�name�INDEXr
�InvalidArgumentExceptionr� DisplayProposedConfigDeploymentsr�PromptContinuer�#CreateMissingIndexesViaFirestoreApi�parsed)r&rr r!r,�infos      rr$zCreate.CreateIndexesIs������$�$�,�,�0�0�$�0�?�G��&�&�/�/�
�;�D��4�9�9�� ;� ;� A� A�A��/�/�
�O�
���3�3��$�������%�d���1�1����+�+�#�	r�rN)
�__name__�
__module__�__qualname__�__doc__�
detailed_help�staticmethodr�ArgumentInterceptorrr)�str�boolr$�rrrr!sp��(��
���-�&�$�#�7�7�$�D�$��$�
� �� �'*� �;?� �� rrc��eZdZdZdd�Zy)�CreateFirestoreAPIz2Create Cloud Datastore indexes with Firestore API.Nc��|jstjn|j}|j|j|d��S)NTrr"r%s   rr)zCreateFirestoreAPI.RunqsC��,0�=�=�	�#�#�d�m�m������?�?�[����rr@)rArBrCrDr)rJrrrLrLls��;�rrLN)rD�
__future__rrr�googlecloudsdk.api_lib.appr� googlecloudsdk.api_lib.datastorerr�googlecloudsdk.callioper	r
r�googlecloudsdk.command_lib.appr�$googlecloudsdk.command_lib.datastorer
�googlecloudsdk.corer�googlecloudsdk.core.consoler�DefaultUniverseOnly�
ReleaseTracks�ReleaseTrack�BETA�GA�Commandr�ALPHArLrJrr�<module>r]s���3�&��'�3�6�6�(�.�4�9�6�*�2��������D�%�%�*�*�D�,=�,=�,@�,@�A�F�T�\�\�F�B��F�R�������D�%�%�+�+�,�
��
�-��
r