
    )                        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  SSKJr  \	R*                  " \	R,                  R.                  \	R,                  R0                  \	R,                  R2                  5      \	R4                   " S S\	R6                  5      5       5       rg)zHCommand for updating a Cloud Security Command Center NotificationConfig.    )absolute_import)division)print_function)unicode_literals)securitycenter_client)base)flags)util)notification_util)log)
propertiesc                   :    \ rS rSrSrSSSS.r\S 5       rS rS	r	g
)Update    z5Update a Security Command Center notification config.a        Update 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`.
      aX        Update all mutable fields under an organization parent `test-config`
      (description + pubsub topic + filter):

        $ {command} scc notifications update test-config --organization=123             --description="New description"             --pubsub-topic="projects/22222/topics/newtopic"

      Update all mutable fields under a folder parent `test-config`
      (description + pubsub topic + filter):

        $ {command} scc notifications update test-config --folder=456             --description="New description"             --pubsub-topic="projects/22222/topics/newtopic"

      Update all mutable fields under a project parent `test-config`
      (description + pubsub topic + filter):

        $ {command} scc notifications update test-config --project=789             --description="New description"             --pubsub-topic="projects/22222/topics/newtopic"

      Update test-config's description

        $ {command} test-config --organization=123 --description="New description"

      Update test-config's pubsub-topic

        $ {command} test-config --organization=123
        --pubsub-topic="projects/22222/topics/newtopic"

      Update test-config's filter

        $ {command} test-config --organization=123 --filter='state = \"ACTIVE\"'

      Update all mutable fields for `test-config` with `location=global` under an
      organization parent (description + pubsub topic + filter):

        $ {command} scc notifications update test-config --organization=123             --description="New description"             --pubsub-topic="projects/22222/topics/newtopic" --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                 (   [         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        U R                  R                  [        R                  R                  R                  R!                  5       5        g )N)notifications_flagsDESCRIPTION_FLAGAddToParserFILTER_FLAG_LONG_DESCRIPTIONPUBSUB_TOPIC_OPTIONAL_FLAG'AddNotificationConfigPositionalArgumentAddParentGroup	scc_flagsAPI_VERSION_FLAG(UPDATE_NOTIFICATION_CONFIG_LOCATION_FLAGdisplay_info	AddFormatr   VALUEScoredefault_formatGet)parsers    'lib/surface/scc/notifications/update.pyArgsUpdate.Argsb   s     ((44V<44@@H22>>vF??G&&v.**62@@LL !!*"3"3"8"8"G"G"K"K"MN    c                 ^   [         R                  " XR                  SS9n[        R                  " U5      n[        R
                  " U5      n[         R                  " U5      n[        R                  " X5        US:X  a8  UR                  5       n[        R                  " U5      Ul        UR                  nO7UR                  5       n[        R                  " U5      Ul        UR                  n/ nUR!                  5       Ul        UR%                  S5      (       a,  UR'                  S5        UR(                  UR"                  l        UR%                  S5      (       a,  UR'                  S5        UR*                  UR"                  l        UR%                  S5      (       aB  UR'                  S5        UR/                  5       n	UR0                  U	l        XR"                  l        S	R5                  U5      Ul        S Ul        UR9                  U5      n
[:        R<                  R?                  S
5        U
$ )NT)"version_specific_existing_resourcev1descriptionpubsub_topicpubsubTopicfilterzstreamingConfig.filter,zUpdated.) scc_utilGetVersionFromArgumentsNOTIFICATIONCONFIGIDr   GetMessages	GetClientGetParentFromNamedArgumentsr    ValidateMutexOnConfigIdAndParent:SecuritycenterOrganizationsNotificationConfigsPatchRequest&ValidateAndGetNotificationConfigV1Namename!organizations_notificationConfigsCSecuritycenterOrganizationsLocationsNotificationConfigsPatchRequest&ValidateAndGetNotificationConfigV2Name+organizations_locations_notificationConfigsNotificationConfignotificationConfigIsKnownAndSpecifiedappendr,   r-   r.   StreamingConfigr/   streamingConfigjoin
updateMaskPatchr   statusPrint)selfargsversionmessagesclientparentreqendpointcomputed_update_maskstreaming_configresults              r%   Run
Update.Runs   s    ..''DG %009H",,W5F11$7F66tD$

M
M
O 
 #II$Och99h 
V
V
X 
 #II$OchCCh%88:C..!!-0+/+;+;c(//!!-0+/+<+<c())!!":;!113 $/?, XX23CN DK^^C FJJZ Mr(    N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr&   rU   __static_attributes__rW   r(   r%   r   r       s;    
 >	
)
T
k9-v O O 1r(   r   N)r\   
__future__r   r   r   r   googlecloudsdk.api_lib.sccr   googlecloudsdk.callioper   googlecloudsdk.command_lib.sccr	   r   r
   r1   ,googlecloudsdk.command_lib.scc.notificationsr   r   googlecloudsdk.corer   r   ReleaseTracksReleaseTrackGABETAALPHADefaultUniverseOnlyUpdateCommandr   rW   r(   r%   <module>rm      s    O &  % ' < ( = ; U J # * $++00$2C2C2I2I @T @ @r(   