- release_tracks: [ALPHA, BETA]
  help_text:
    brief: update a product.
    description: update a product.
    examples: |
      To change the display name to 'new-display--name', and description to 'new-description' of
      product 'my-product' in location 'us-east1', run:

        $ {command} my-product --location=us-east1 --display-name='new-display-name' --description='new-description'

      To add labels 'color=blue' to and remove 'weight=10lbs' from product 'my-product' in location 'us-east1',
      run:

        $ {command} my-product --location=us-east1 --add-product-labels='color=blue' --remove-product-labels='weight=10lbs'

      To clear all labels from product 'my-product' in location 'us-east1', run:

        $ {command} my-product --location=us-east1 --clear-product-labels

  request:
    collection: vision.projects.locations.products
    modify_request_hooks:
    - googlecloudsdk.command_lib.ml.vision.product_search.utils:UpdateLabelsAndUpdateMaskForProductUpdateRequest

  arguments:
    resource:
      help_text: The product to update.
      spec: !REF googlecloudsdk.command_lib.ml.vision.resources:product

    params:
    - api_field: product.displayName
      arg_name: display-name
      help_text: |-
        The display name of this product. It must not be empty and can be up to 4096 characters
        long.
    - api_field: product.description
      arg_name: description
      help_text: |-
        An optional description of this product. It can be up to 4096 characters long.
    additional_arguments_hook: googlecloudsdk.command_lib.ml.vision.product_search.utils:ProductLabelsArgumentsForUpdate
