- release_tracks: [ALPHA, BETA]
  command_type: GENERIC
  help_text:
    brief: Import a list of reference images to specified product sets.
    description: Import a list of reference images to specified product sets based on a list of image information.
    examples: |
      To import reference images from 'gs://my-bucket/my-object.csv' into location 'us-east1', run:

        $ {command} --location=us-east1 gs://my-bucket/my-object.csv

  request:
    collection: vision.projects.locations.productSets
    disable_resource_check: true
    method: import

  arguments:
    resource:
      help_text: Location to import to.
      spec: !REF googlecloudsdk.command_lib.ml.vision.resources:location
      is_positional: false
      override_resource_collection: true
      is_parent_resource: true
    params:
    - api_field: importProductSetsRequest.inputConfig.gcsSource.csvFileUri
      arg_name: source
      is_positional: true
      required: true
      help_text: |-
        Google Cloud Storage URI of the input csv file which must start with `gs://`.
        The format of the input csv file should be one image per line.
        In each line, there are 8 columns - `image-uri`, `image-id`, `product-set-id`, `product-id`,
        `product-category`, `product-display-name`, `labels`, and `bounding-poly`.
        The `image-uri`, `product-set-id`, `product-id`, and `product-category` columns are required.
        See https://cloud.google.com/vision/product-search/docs/csv-format for more information on the
        csv format and the meaning of each column.
  async:
    collection: vision.projects.locations.operations
    extract_resource_result: false
