
    ;                     n   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 dd
lmZ dd	lmZ  ej&                  ej(                  j*                  ej(                  j,                  ej(                  j.                        ej0                   G d dej2                                      Zy)zGCommand for listing Cloud Security Command Center Notification Configs.    )absolute_import)division)print_function)unicode_literals)
list_pager)securitycenter_client)base)flags)utilc                   2    e Zd ZdZddddZed        Zd Zy)	Listz2List Security Command Center notification configs.a*  List Security Command Center notification configs.

      Notification Configs that are created with Security Command Center API V2
      and later include a `location` attribute. Include the `--location` flag to
      list Notification Configs with `location` attribute other than `global`.
      a        List notification configs from organization `123`

        $ {command} 123
        $ {command} organizations/123

      List notification configs from folder `456`

        $ {command} folders/456

      List notification configs from project `789`

        $ {command} projects/789

      List notification configs from organization `123` and `location=eu`

        $ {command} 123 --location=eu
        $ {command} organizations/123 --location=locations/eu
      z      This command uses the Security Command Center API. For more information,
      see [Security Command Center API.](https://cloud.google.com/security-command-center/docs/reference/rest)
      )DESCRIPTIONEXAMPLESzAPI REFERENCEc                 4   t         j                  j                  |        t        j                         d   j                  |        t        j                  |        t        j                  j                  |        t        j                  j                  |        y )Nr   )
r	   URI_FLAGRemoveFromParser	scc_flagsAppendParentArgAddToParsernotifications_flagsAddParentGroupAPI_VERSION_FLAG&LIST_NOTIFICATION_CONFIG_LOCATION_FLAG)parsers    %lib/surface/scc/notifications/list.pyArgsz	List.ArgsE   sm     	MM""6* "..v6&&v.**62>>JJ    c                    t        j                  |d      }t        j                  |      }t        j                  |      }|dk(  r7|j                         }t        j                  |      |_        |j                  }nQ|j                         }t        j                  |d      }t        j                  |       d| |_        |j                  }|j                  |_        t        j                  ||d|j                  d      S )	NT)"version_specific_existing_resourcev1v2z/locations/pageSizenotificationConfigs)batch_size_attribute
batch_sizefield)scc_utilGetVersionFromArgumentsr   GetMessages	GetClient9SecuritycenterOrganizationsNotificationConfigsListRequest GetParentFromPositionalArgumentsparent!organizations_notificationConfigsBSecuritycenterOrganizationsLocationsNotificationConfigsListRequestValidateAndGetLocation+organizations_locations_notificationConfigs	page_sizer"   r   YieldFromList)selfargsversionmessagesclientrequestendpointlocations           r   RunzList.RunR   s    ..G %009H",,W5F$

L
L
N   @@Fgn99h 
U
U
W  00t<h"CCDIJ+V^U_`gnCCh~~G ##'>># r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r<    r   r   r   r      s7    
 ;

&
5-@ 
 
r   r   N)r@   
__future__r   r   r   r   apitools.base.pyr   googlecloudsdk.api_lib.sccr   googlecloudsdk.callioper	   googlecloudsdk.command_lib.sccr
   r   r   r'   ,googlecloudsdk.command_lib.scc.notificationsr   ReleaseTracksReleaseTrackGABETAALPHADefaultUniverseOnlyListCommandr   rC   r   r   <module>rQ      s    N &  % ' ' < ( = ; U $++00$2C2C2I2I O4 O Or   