
                         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	j.                   G d de	j0                                      Zy)zJCommand for describing a Cloud Security Command Center NotificationConfig.    )absolute_import)division)print_function)unicode_literals)securitycenter_client)base)flags)util)notification_utilc                   2    e Zd ZdZddddZed        Zd Zy)	Describez7Describe a Security Command Center notification config.a        Describe a Security Command Center notification config.

      Notification configs that are created with Security Command Center API V2
      and later include a `location` attribute. If the `location` attribute is
      included in the resource name of a Notification configs, you must specify
      it when referencing the Notification config. For example, the following
      Notification configs name has `location=eu`:
      `organizations/123/locations/eu/notificationConfigs/test-config`.
      aU        Describe notification config 'test-config' from organization `123`

          $ {command} test-config               --organization=123

      Describe notification config 'test-config' from folder `456`

          $ {command} test-config               --folder=456

      Describe notification config 'test-config' from project `789`

          $ {command} test-config               --project=789

      Describe notification config 'test-config' from organization `123` and
      `location=global`

          $ {command} test-config               --organization=123 --location=global
      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                 @   | j                  ddd       | j                  dd      }|j                  dd	
       |j                  dd
       |j                  dd
       t        j                  j	                  |        t
        j                  j	                  |        y )NNOTIFICATIONCONFIGIDNOTIFICATION_CONFIG_IDz         The ID of the notification config. Formatted as
         "organizations/123/notificationConfigs/456" or just "456".
        )metavarhelpFT)requiredmutexz--organizationz            Organization where the notification config resides. Formatted as
            ``organizations/123'' or just ``123''.
            )r   z--folderz|            Folder where the notification config resides. Formatted as
            ``folders/456'' or just ``456''.
        z	--projectz            Project (ID or number) where the notification config resides.
            Formatted as ``projects/789'' or just ``789''.
        )add_argument	add_group	scc_flagsAPI_VERSION_FLAGAddToParsernotifications_flags*DESCRIBE_NOTIFICATION_CONFIG_LOCATION_FLAG)parserresource_groups     )lib/surface/scc/notifications/describe.pyArgszDescribe.ArgsL   s     (   %%uD%AN            **62BBNN    c                    t        j                  |      }t        j                  ||       t        j                  ||j
                  d      }t        j                  |      }t        j                  |      }|dk(  rE|j                         }t        j                  |      |_        |j                  j                  |      S |j                         }t        j                  |      |_        |j                   j                  |      S )NT)"version_specific_existing_resourcev1)scc_utilGetParentFromNamedArgumentsr    ValidateMutexOnConfigIdAndParentGetVersionFromArgumentsr   r   GetMessages	GetClient8SecuritycenterOrganizationsNotificationConfigsGetRequest&ValidateAndGetNotificationConfigV1Namename!organizations_notificationConfigsGetASecuritycenterOrganizationsLocationsNotificationConfigsGetRequest&ValidateAndGetNotificationConfigV2Name+organizations_locations_notificationConfigs)selfargsparentversionmessagesclientreqs          r    RunzDescribe.Runt   s    11$7F66tVD
 ..d''DG %009H",,W5F$MMOc"II$Och5599#>> 
T
T
V 
 #II$Och??CCCHHr"   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr!   r;    r"   r    r   r      s;    
 @	

,
C%-N % %NIr"   r   N)r?   
__future__r   r   r   r   googlecloudsdk.api_lib.sccr   googlecloudsdk.callioper   googlecloudsdk.command_lib.sccr	   r   r
   r&   ,googlecloudsdk.command_lib.scc.notificationsr   r   ReleaseTracksReleaseTrackGABETAALPHADefaultUniverseOnlyDescribeCommandr   rB   r"   r    <module>rO      s    Q &  % ' < ( = ; U J $++00$2C2C2I2I iIt## iI iIr"   