- release_tracks: [ALPHA, BETA, GA]

  help_text:
    brief: Update a Cloud Security Command Center notification config.
    description: Update a Cloud Security Command Center notification config.
    examples: |
        Update all mutable fields under an organization parent my-config (description + pubsub topic + filter):

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

        $ {command} scc notifications update \
            organizations/123/notificationConfigs/my-config \
            --description="New description" \
            --pubsub-topic="projects/22222/topics/newtopic"

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

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

        $ {command} scc notifications update \
            folders/456/notificationConfigs/my-config \
            --description="New description" \
            --pubsub-topic="projects/22222/topics/newtopic"

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

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

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

        Update my-config's description

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

        $ {command} organizations/123/notificationConfigs/my-config --description="New description"

        Update my-config's pubsub-topic

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

        $ {command} organizations/123/notificationConfigs/my-config --pubsub-topic="projects/22222/topics/newtopic"

        Update my-config's filter

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

        $ {command} organizations/123/notificationConfigs/my-config --filter='state = \"ACTIVE\"'
  request:
    collection: securitycenter.organizations.notificationConfigs
    disable_resource_check: true
    api_version: v1
    method: patch
    modify_request_hooks:
    - googlecloudsdk.command_lib.scc.notifications.request_hooks:UpdateNotificationReqHook

  arguments:
    params:
    - arg_name: notificationConfigId
      api_field: name
      is_positional: true
      required: true
      help_text: |
        The ID of the notification config. Formatted as "organizations/123/notificationConfigs/456" or just "456".

    - group:
        mutex: true
        required: false
        params:
        - arg_name: organization
          required: false
          help_text: |
            Organization where the notification config resides. Formatted as ``organizations/123'' or just ``123''.

        - arg_name: folder
          required: false
          help_text: |
            Folder where the notification config resides. Formatted as ``folders/456'' or just ``456''.

        - arg_name: project
          required: false
          help_text: |
            Project (ID or number) where the notification config resides. Formatted as ``projects/789'' or just ``789''.

    - !REF googlecloudsdk.command_lib.scc.notifications.flags:description
    - !REF googlecloudsdk.command_lib.scc.notifications.flags:pubsub_topic
    - !REF googlecloudsdk.command_lib.scc.notifications.flags:filter
