File: //lib/google-cloud-sdk/lib/surface/storage/__pycache__/rm.cpython-312.pyc
�
��8) � �0 � d Z ddlmZ ddlmZ ddlmZ ddlZddlmZ ddlmZ ddl
mZ dd lm
Z
dd
lmZ ddlmZ ddlmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ej8 G d� dej: � � Zy)z4Implementation of rm command for deleting resources.� )�absolute_import)�division)�unicode_literalsN)� cloud_api)�errors)�base)�flags)�folder_util)�name_expansion)�plurality_checkable_iterator)�rm_command_util)�stdin_iterator)�user_request_args_factory)�
task_executor)�task_graph_executor)�task_status)�delete_task_iterator_factory)�logc �0 � e Zd ZdZddd�Zed� � Zd� Zy)�RmzDelete objects and buckets.z)
Delete objects and buckets.
a�
The following command deletes a Cloud Storage object named ``my-object''
from the bucket ``my-bucket'':
$ {command} gs://my-bucket/my-object
The following command deletes all objects directly within the directory
``my-dir'' but no objects within subdirectories:
$ {command} gs://my-bucket/my-dir/*
The following command deletes all objects and subdirectories within the
directory ``my-dir'':
$ {command} gs://my-bucket/my-dir/**
Note that for buckets that contain
[versioned objects](https://cloud.google.com/storage/docs/object-versioning),
the above command only affects live versions. Use the `--recursive` flag
instead to delete all versions.
The following command deletes all versions of all resources in
``my-bucket'' and then deletes the bucket.
$ {command} --recursive gs://my-bucket/
The following command deletes all text files in the top-level of
``my-bucket'', but not text files in subdirectories:
$ {command} -recursive gs://my-bucket/*.txt
The following command deletes one wildcard expression per line passed
in by stdin:
$ some_program | {command} -I
)�DESCRIPTION�EXAMPLESc �T � |j ddd�� |j ddddd �
� |j dddd
�
� |j dddd�� t j |� t j |� t j |� t j
|� y )N�urls�*z$The URLs of the resources to delete.)�nargs�helpz--recursivez-Rz-r�
store_truead Recursively delete the contents of buckets or directories that match the path expression. By default, this will delete managed folders as well. If the path is set to a bucket, like ``gs://bucket'', the bucket is also deleted. This option implies the `--all-versions` option. If you want to delete only live object versions, use the ``**'' wildcard instead.)�actionr z--all-versionsz-az\Delete all [versions](https://cloud.google.com/storage/docs/object-versioning) of an object.z--exclude-managed-foldersFa Excludes managed folders from command operations. By default gcloud storage includes managed folders in recursive removals. Please note that this flag would not be applicable for hierarchical namespace buckets as we always list managed folders for these buckets.)r �defaultr )�add_argumentr �add_additional_headers_flag�add_continue_on_error_flag�add_precondition_flags�add_read_paths_from_stdin_flag)�cls�parsers �lib/surface/storage/rm.py�ArgszRm.ArgsY s� � �
�����
3� � 5� �������
F�
� � ������� � � ���#���
"� � �
�%�%�f�-� �$�$�V�,� � � ��(� �(�(��0� c �� � |j rOt j j }t j
j }t j j }nIt j j }t j |� }t j j }|j xr
|j }t j � }t j t! j"