
    &                         S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
  SSK	Jr  \" S	5      rS
 r\R                   " S S\R                   5      5       rg)zBCommand to list notification configurations belonging to a bucket.    )absolute_import)division)unicode_literals)base)#notification_configuration_iterator)resource_printer)resource_projectorz//pubsub.googleapis.com/c                 R   UR                   (       aI  SnUR                   R                   H,  nUSR                  UR                  UR                  5      -  nM.     OSnUR
                  (       d  UR                  (       ap  SnUR
                  (       a-  USR                  SR                  UR
                  5      5      -  nUR                  (       a  USR                  UR                  5      -  nOSnSR                  U R                  UR                  UR                  [        S	 UUS
9$ )z#Returns pretty notification string.z
	Custom attributes:z	
		{}: {} z

	Filters:z
		Event Types: {}z, z
		Object name prefix: '{}'zzprojects/_/buckets/{bucket}/notificationConfigs/{notification}
	Cloud Pub/Sub topic: {topic}{custom_attributes}{filters}

N)bucketnotificationtopiccustom_attributesfilters)r   additionalPropertiesformatkeyvalueevent_typesobject_name_prefixjoinbucket_nameidr   _PUBSUB_DOMAIN_PREFIX_LENGTH)urlconfigcustom_attributes_string	attributefilters_strings        1lib/surface/storage/buckets/notifications/list.py _get_human_readable_notificationr!      s   7--BB	."7"7
--#  C
  "644#N/66
))F&&
' n   8??

#
# n N))/yy9:;4  *0 *
    c                   >    \ rS rSrSrSSS.r\S 5       rS rS r	S	r
g
)ListE   zAList the notification configurations belonging to a given bucket.z
      *{command}* provides a list of notification configurations belonging to a
      given bucket. The listed name of each configuration can be used
      with the delete sub-command to delete that specific notification config.
      aR  
      Fetch the list of notification configs for the bucket `example-bucket`:

        $ {command} gs://example-bucket

      Fetch the notification configs in all buckets matching a wildcard:

        $ {command} gs://example-*

      Fetch all of the notification configs for buckets in the default project:

        $ {command}
      )DESCRIPTIONEXAMPLESc                 J    U R                  SSSS9  U R                  SSSSS	9  g )
Nurls*zfGoogle Cloud Storage bucket paths. The path must begin with gs:// and may contain wildcard characters.)nargshelpz--human-readable
store_trueTzKPrints notification information in a more descriptive, unstructured format.)actionhiddenr,   )add_argument)parsers    r    Args	List.Args`   sC    
:  ;
 $  	r"   c                     UR                   (       a  [        R                  " US5        g [        R                  " X!R                  =(       d    S5        g )Nobjectyaml)human_readabler   Printr   )selfargs	resourcess      r    DisplayList.Displayr   s2    Y1Y(=v>r"   c              #     #    UR                   (       d  S/nOUR                   n[        R                  " USS9 HL  nUu  pEUR                  (       a  [	        XE5      v   M'  UR
                  [        R                  " U5      S.v   MN     g 7f)Nzgs://F)&accept_notification_configuration_urls)z
Bucket URLzNotification Configuration)r)   r   'get_notification_configuration_iteratorr7   r!   
url_stringr	   MakeSerializable)r9   r:   r)   *notification_configuration_iterator_resultr   r   s         r    RunList.Runx   s     99YdYYd 	,	0	0	1	@ 	3
 ?kc			.s;; ..*<*M*M+
 	
	@s   BB
 N)__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr2   r<   rD   __static_attributes__rF   r"   r    r$   r$   E   s4    I

-.  "?
r"   r$   N)rK   
__future__r   r   r   googlecloudsdk.callioper   "googlecloudsdk.command_lib.storager   googlecloudsdk.core.resourcer   r	   lenr   r!   UniverseCompatibleListCommandr$   rF   r"   r    <module>rV      s^     I &  ' ( R 9 ;  ##=> #L H
4 H
 H
r"   