- release_tracks: [ALPHA, BETA, GA]

  help_text:
    brief:  Export a Cloud Healthcare API DICOM store to Google Cloud Storage.
    description: Export a Cloud Healthcare API DICOM store to Google Cloud Storage.
    examples: |
      To export the dicom-store 'test-dicom-store' to the existing bucket 'testGcsBucket' in the folder 'someFolder', with the mime-type 'application/dicom', run:

        $ {command} test-dicom-store --gcs-uri-prefix=gs://testGcsBucket/someFolder --mime-type=application/dicom --dataset=test-dataset

  request:
    collection: healthcare.projects.locations.datasets.dicomStores
    method: export
    ALPHA:
      api_version: v1alpha2
    BETA:
      api_version: v1beta1
    GA:
      api_version: v1

  arguments:
    resource:
      help_text: Cloud Healthcare API DICOM store to export.
      spec: !REF googlecloudsdk.command_lib.healthcare.resources:dicom_store

    params:
    - arg_name: gcs-uri-prefix
      api_field: exportDicomDataRequest.gcsDestination.uriPrefix
      required: true
      help_text: |
        URI for a Google Cloud Storage directory to which result
        files should be written (for example, `gs://bucket-id/path/to/destination/dir`).
        If there is no trailing slash, the service will append one when composing
        the object path. The user is responsible for creating the Google Cloud
        Storage bucket referenced in `uri_prefix`.
    - arg_name: mime-type
      api_field: exportDicomDataRequest.gcsDestination.mimeType
      help_text: |
        'MIME types supported by DICOM spec. Each file will be
        written in the following format:
        `.../{study_id}/{series_id}/{instance_id}[/{frame_number}].{extension}`
        The frame_number component will exist only for multi-frame instances.
        Refer to the DICOM conformance statement for permissible MIME types:
        https://cloud.google.com/healthcare/docs/dicom#wado-rs  The following
        extensions will be used for output files:
        * application/dicom -> .dcm
        * image/jpeg -> .jpg
        * image/png -> .png

        If unspecified, the instances
        will be exported in their original DICOM format.'
    - arg_name: filter-config-gcs-uri
      release_tracks: [ALPHA, BETA]
      api_field: exportDicomDataRequest.filterConfig.resourcePathsGcsUri
      help_text: |
        Cloud Storage location of the filter configuration file. The FILTER_CONFIG_GCS_URI must be
        in the format gs://bucket/path/to/object. The filter configuration file must contain a list
        of resource paths separated by newline characters (\n or \r\n). Each resource path must be in
        the format "/studies/{studyUID}[/series/{seriesUID}[/instances/{instanceUID}]]"

        Cloud Healthcare API service account must have the roles/storage.objectViewer Cloud IAM
        role for this Cloud Storage location.
  async:
    collection: healthcare.projects.locations.datasets.operations
