
    &                        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S	K
Jr  SSKJr  SS
KJr  SSKJr  \	R(                  " \	R*                  R,                  \	R*                  R.                  \	R*                  R0                  5      \	R2                   " S S\	R4                  5      5       5       rS rg)zHCommand for creating a Cloud Security Command Center NotificationConfig.    )absolute_import)division)print_function)unicode_literals)securitycenter_client)base)flags)util)notification_util)logc                   :    \ rS rSrSrSSSS.r\S 5       rS rS	r	g
)Create    z5Create a Security Command Center notification config.a        Create a Security Command Center notification config.

      Notification configs that are created with Security Command Center API V2
      and later include a `location` attribute. If a location is not specified,
      the default `global` location is used. For example, the following
      Notification config name has `location=global` attribute:
      `organizations/123/locations/global/notificationConfigs/my-config`.a        Create a notification config test-config under organization 123 for
      findings for pubsub-topic projects/test-project/topics/notification-test
      with a filter on resource name:

        $ {command} test-config --organization=123
          --pubsub-topic=projects/test-project/topics/notification-test
          --filter="resource_name: \"a\""

      Create a notification config `test-config` under folder `456` for findings
      for pubsub-topic `projects/test-project/topics/notification-test` with a
      filter on resource name:

        $ {command} test-config --folder=456
          --pubsub-topic=projects/test-project/topics/notification-test
          --filter="resource_name: \"a\""

      Create a notification config `test-config` under project `789` for
      findings for pubsub-topic `projects/test-project/topics/notification-test`
      with a filter on resource name:

        $ {command} test-config --project=789
          --pubsub-topic=projects/test-project/topics/notification-test
          --filter="resource_name: \"a\""

      Create a notification config `test-config` under organization `123` for
      findings for `pubsub-topic projects/test-project/topics/notification-test`
      with a filter on resource name and `location=eu`

        $ {command} test-config --project=789
          --pubsub-topic=projects/test-project/topics/notification-test
          --filter="resource_name: \"a\"" --location=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                    [         R                  R                  U 5        [         R                  R                  U 5        [         R                  R                  U 5        [         R
                  " U 5        [         R                  " U 5        [        R                  R                  U 5        [         R                  R                  U 5        g )N)
notifications_flagsPUBSUB_TOPIC_REQUIRED_FLAGAddToParserDESCRIPTION_FLAGFILTER_FLAG'AddNotificationConfigPositionalArgumentAddParentGroup	scc_flagsAPI_VERSION_FLAG(CREATE_NOTIFICATION_CONFIG_LOCATION_FLAG)parsers    'lib/surface/scc/notifications/create.pyArgsCreate.ArgsW   s     22>>vF((44V<##//7??G&&v.**62@@LL    c                 d   [         R                  " U5      n[        R                  " X5        [         R                  " XR
                  SS9n[        R                  " U5      n[        R                  " U5      nUS:X  a'  UR                  5       n[        R                  " U5      nO&UR                  5       n[        R                  " U5      n[        R                  " U5      Ul        [        U5      Ul        UR#                  5       Ul        UR&                  UR$                  l        UR(                  UR$                  l        SUR
                  ;   a  XvR$                  l        OUR
                  UR$                  l        UR/                  5       nUR0                  c  SUl        OUR0                  Ul        XR$                  l        S Ul        US:X  a  UR4                  R7                  U5      n	OUR8                  R7                  U5      n	[:        R<                  R?                  S5        U	R,                  $ )NT)"version_specific_existing_resourcev1z/notificationConfigs/ zCreated.) scc_utilGetParentFromNamedArgumentsr    ValidateMutexOnConfigIdAndParentGetVersionFromArgumentsNOTIFICATIONCONFIGIDr   GetMessages	GetClient;SecuritycenterOrganizationsNotificationConfigsCreateRequest&ValidateAndGetNotificationConfigV1NameDSecuritycenterOrganizationsLocationsNotificationConfigsCreateRequest&ValidateAndGetNotificationConfigV2Name#GetParentFromNotificationConfigNameparent_GetNotificationConfigIdconfigIdNotificationConfignotificationConfigdescriptionpubsub_topicpubsubTopicnameStreamingConfigfilterstreamingConfig!organizations_notificationConfigsr   +organizations_locations_notificationConfigsr   statusPrint)
selfargsr2   versionmessagesclientreqconfig_namestreaming_configresults
             r   Run
Create.Runf   s   11$7F66tD ..''DG %009H",,W5F $

N
N
P 
 &LL
k
 
W
W
Y 
 &LL
k #FFCJ ,K8CL%88:C)-)9)9C&)-):):C& $";";;$/!$($=$=c!  //1{{ " $-=* DK$77>>sCfAAHHMfJJZ ;;r!    N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   rK   __static_attributes__rM   r!   r   r   r       s;    
 >M 
B
U.-`  @r!   r   c                 .    U R                  S5      nUS   $ )N/)split)resource_nameparams_as_lists     r   r3   r3      s     &&s+.		r!   N)rR   
__future__r   r   r   r   googlecloudsdk.api_lib.sccr   googlecloudsdk.callioper   googlecloudsdk.command_lib.sccr	   r   r
   r&   ,googlecloudsdk.command_lib.scc.notificationsr   r   googlecloudsdk.corer   ReleaseTracksReleaseTrackGABETAALPHADefaultUniverseOnlyCreateCommandr   r3   rM   r!   r   <module>ri      s     O &  % ' < ( = ; U J # $++00$2C2C2I2I BT B BJr!   