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/sql/databases/__pycache__/delete.cpython-312.pyc
�

�����P�dZddlmZddlmZddlmZddlmZddlmZddlm	Z	ddl
mZdd	lm
Z
dd
lmZddlmZe	j"e	j$j&e	j$j(e	j$j*�Gd�d
e	j,��Zy)z'Deletes a database in a given instance.�)�absolute_import)�division)�unicode_literals)�api_util)�
operations)�base)�flags)�log)�
properties)�
console_ioc�&�eZdZdZed��Zd�Zy)�Deletez`Deletes a Cloud SQL database.

  For MySQL, also deletes all files in the database directory.
  c��tj|�tj|�|jj	tj
�y)z�Args is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use it to add arguments that go
          on the command line after this command. Positional arguments are
          allowed.
    N)r	�AddInstance�AddDatabaseName�display_info�AddCacheUpdater�DatabaseCompleter)�parsers �#lib/surface/sql/databases/delete.py�ArgszDelete.Args&s:��
���f��	���&�!�
���'�'��(?�(?�@�c�&�tjtj�}|j}|j}t
jjjjd��}|jj|jdt
jjjjid��}tjddd��|j j#|j%||j|j&���}|jj)d	|j*|j�
�}t,j.j1||d�t3j4|j&d�y
)z�Deletes a Cloud SQL database.

    For MySQL, also deletes all files in the database directory.

    Args:
      args: argparse.Namespace, The arguments that this command was invoked
          with.

    Returns:
      SQL database resource iterator.
    T)�required�projectz
sql.instances)�params�
collectionzmThe database will be deleted. Any data stored in the database will be destroyed. You cannot undo this action.)�message�default�cancel_on_no)r�instance�databasezsql.operations)�	operationrzDeleting Cloud SQL databaser"N)r�	SqlClient�API_VERSION_DEFAULT�
sql_client�sql_messagesr�VALUES�corer�Get�resource_parser�Parser!�	GetOrFailr�PromptContinue�	databasesr�SqlDatabasesDeleteRequestr"�Create�namer�OperationsV1Beta4�WaitForOperationr
�DeletedResource)	�self�args�clientr&r'�
project_id�instance_ref�result_operation�
operation_refs	         r�Runz
Delete.Run3sV���
�
�� <� <�
=�F��"�"�J��&�&�L��"�"�'�'�/�/�3�3�T�3�B�J��)�)�/�/��
�
��:�,�,�1�1�9�9�C�C�D�"�0�$�L�
���:���	�"�+�+�2�2��.�.��������	/�	P�Q���*�*�1�1��"�'�'��$�$�2�&�M�
� � �1�1�*�m�2O�Q�����
�
�z�2rN)�__name__�
__module__�__qualname__�__doc__�staticmethodrr=�rrrrs"���
�
A��
A�(3rrN)rA�
__future__rrr�googlecloudsdk.api_lib.sqlrr�googlecloudsdk.callioper�googlecloudsdk.command_lib.sqlr	�googlecloudsdk.corer
r�googlecloudsdk.core.consoler�
ReleaseTracks�ReleaseTrack�GA�BETA�ALPHA�
DeleteCommandrrCrr�<module>rPs���.�&��'�/�1�(�0�#�*�2�����D�%�%�(�(�$�*;�*;�*@�*@��%�%�+�+�-�;3�T�
�
�;3�-�;3r