
                             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 ddl	m
Z
 ddl	mZ dd	l	mZ ej                   G d
 dej                               Zy)z#Command to list storage operations.    )absolute_import)division)unicode_literals)api_factory)base)errors_util)operations_util)storage_urlc                   0    e Zd ZdZdddZed        Zd Zy)ListzList storage operations.z%      List storage operations.
      aN        To list all storage operations that belong to the bucket "my-bucket", run:

        $ {command} projects/_/buckets/my-bucket

      To list operations in JSON format, run:

        $ {command} projects/_/buckets/my-bucket --format=json

      An alternative bucket format is available:

        $ {command} gs://my-bucket
      )DESCRIPTIONEXAMPLESc                     | j                  dd       | j                  dd       t        j                  j                  |        t        j                  j                  |        y )Nparent_resource_namezNThe operation parent resource in the format "projects/```_```/buckets/BUCKET".)helpz--server-filtera   Server-side filter string used to determine what operations to return. Example: '(done = true AND complete_time >= "2023-01-01T00:00:00Z") OR requested_cancellation = true' Note that the entire filter string must be in quotes and date strings within the filter must be in embedded quotes.)add_argumentr   PAGE_SIZE_FLAGRemoveFromParserURI_FLAG)parsers    &lib/surface/storage/operations/list.pyArgsz	List.Args3   sc    
2   J  	 	((0MM""6*    c                    t        j                  |j                        }t        |t         j                        r-t        j                  |j                  |       |j                  }nt        j                  |j                        }t         j                  j                  }t        j                  |      j                  ||j                         S )N)bucket_nameserver_side_filter)r
   storage_url_from_stringr   
isinstanceCloudUrlr   raise_error_if_not_gcs_bucketcommand_pathr   r	   get_operation_bucket_from_nameProviderPrefixGCSr   get_apilist_operationsserver_filter)selfargs
url_objectbucketschemes        r   RunzList.RunK   s    44T5N5NOJ*k223//0A0A:N%%f==

#
#f ''++Fv&66-- 7  r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r-    r   r   r   r      s/     

	-& + +.r   r   N)r1   
__future__r   r   r   googlecloudsdk.api_lib.storager   googlecloudsdk.callioper   "googlecloudsdk.command_lib.storager   r	   r
   UniverseCompatibleListCommandr   r4   r   r   <module>r;      sI    * &  ' 6 ( : > : ;4 ; ;r   