- release_tracks: [ALPHA]
  help_text:
    brief: Update a Data Catalog crawler.
    description: Update a Data Catalog crawler.
    examples: |
      Update the display name of a crawler:

        $ {command} crawler1 --display-name="my-crawler"

      Add buckets to a BUCKET-scoped crawler:

        $ {command} crawler1 --add-buckets=bucket1,bucket2

      Remove buckets from a BUCKET-scoped crawler:

        $ {command} crawler1 --remove-buckets=bucket1,bucket2

      Overwrite buckets in a BUCKET-scoped crawler with bucket1, bucket2:

        $ {command} crawler1 --clear-buckets --add-buckets=bucker1,bucket2

      Change the schedule of a manual crawler to run daily:

        $ {command} crawler1 --run-option=SCHEDULED --run-schedule=DAILY

  request:
    collection: datacatalog.projects.crawlers
    api_version: v1alpha3
    modify_request_hooks:
    - googlecloudsdk.command_lib.data_catalog.crawlers.util:ValidateAndParseFlagsForUpdate
    - googlecloudsdk.command_lib.data_catalog.crawlers.util:SetUpdateMask

  arguments:
    resource:
      help_text: The crawler to update.
      spec: !REF googlecloudsdk.command_lib.data_catalog.resources:crawler

    params:
    - !REF googlecloudsdk.command_lib.data_catalog.crawlers.flags:crawler.description
    - !REF googlecloudsdk.command_lib.data_catalog.crawlers.flags:crawler.display_name
    - group:
        help_text: |-
          Update bundling specifications. Bundling specifications direct the crawler to bundle files
          into filesets based on the patterns provided:
        params:
        - !REF googlecloudsdk.command_lib.data_catalog.crawlers.flags:crawler.add_bundle_specs
        - group:
            mutex: true
            params:
            - !REF googlecloudsdk.command_lib.data_catalog.crawlers.flags:crawler.remove_bundle_specs
            - !REF googlecloudsdk.command_lib.data_catalog.crawlers.flags:crawler.clear_bundle_specs

    additional_arguments_hook: |-
      googlecloudsdk.command_lib.data_catalog.crawlers.flags:AddCrawlerScopeAndSchedulingFlagsForUpdate

  update:
    disable_auto_field_mask: true
