- release_tracks: [ALPHA, BETA]
  help_text:
    brief: create a product.
    description: Create a product.
    examples: |
      To create a product 'my-product' in 'us-east1' with category of 'toys' and display name of
      'favorite product', run:

        $ {command} my-product --location=us-east1 --category=toys --display-name='favorite product'

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

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

    params:
    - api_field: product.displayName
      arg_name: display-name
      required: true
      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.
    - api_field: product.productCategory
      arg_name: category
      required: true
      choices:
      - arg_value: homegoods
        enum_value: homegoods
      - arg_value: apparel
        enum_value: apparel
      - arg_value: toys
        enum_value: toys
      help_text: |-
        The category for the product. After being set, it cannot be changed.
    additional_arguments_hook: googlecloudsdk.command_lib.ml.vision.product_search.utils:ProductLabelsArgumentsForCreate
