
    p                         d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z	 ej                   ej                  ej                  j                         G d dej                                      Zy	)
z=Implementation of delete command for Insights dataset config.    )insights_api)base)log_util)resource_args)
console_ioc                   0    e Zd ZdZdddZed        Zd Zy)Deletez#Delete dataset config for Insights.z0
      Delete an Insights dataset config.
      a|  

      To delete a dataset config with config name "my_config" in location
      "us-central1":

          $ {command} my_config --location=us-central1

      To delete the same dataset config with fully specified name:

          ${command} projects/foo/locations/us-central1/datasetConfigs/my_config

      To delete the same dataset config and unlink it from the BigQuery
      instance:

          $ {command} my_config --location=us-central1 --auto-delete-link

      To delete the same dataset config without taking user consent:

          $ {command} my_config --location=us-central1 --auto-delete-link
          --force
      )DESCRIPTIONEXAMPLESc                     t        j                  | d       | j                  ddd       | j                  ddd       y )Nz	to deletez--auto-delete-link
store_truezMDelete the BigQuery instance links before the config gets deleted explicitly.)actionhelpz--forcez0Force delete the config by skipping the consent.)r   add_dataset_config_resource_argadd_argument)parsers    6lib/surface/storage/insights/dataset_configs/delete.pyArgszDelete.Args9   sN    11&+F
	   ?      c                    t        j                         }|j                  j                  j	                         j                         }|j                  s)dj                  |      }t        j                  |dd       |j                  r2|j                  |      }t        j                  d||j                         |j                  |      }t        j                  d||j                         y )Nz*You are about to delete dataset config: {}T)messagethrow_if_unattendedcancel_on_nozDelete linkr	   )r   InsightsApiCONCEPTSdataset_configParseRelativeNameforceformatr   PromptContinueauto_delete_linkdelete_dataset_config_linkr   /dataset_config_operation_started_and_status_lognamedelete_dataset_config)selfargsclientdataset_config_relative_namer   $delete_dataset_config_link_operationdelete_dataset_config_operations          r   Runz
Delete.RunJ   s    %%'F$$**,99; ! ::<CC
&g t$ -3-N-N
&.* >>

&
.
3
3 '-&B&B$'# <<$',,r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r-    r   r   r	   r	      s1     ,

	-6   r   r	   N)r1   googlecloudsdk.api_lib.storager   googlecloudsdk.callioper   ;googlecloudsdk.command_lib.storage.insights.dataset_configsr   r   googlecloudsdk.core.consoler   DefaultUniverseOnlyReleaseTracksReleaseTrackALPHACommandr	   r4   r   r   <module>r>      sc     D 7 ( P U 2 D%%++,NT\\ N - Nr   