Description
This is mostly focused on CLI, but perhaps also makes sense for the Python API.
Right now validation of 'bundles' appears to happen first, but it'd be much better if 'item-type' happened first.
Two examples of how this manifests:
% planet orders request --item-type PSScene --bundle analytic --id 20220919_183509_93_248f --name hood-stac
Usage: planet orders request [OPTIONS]
Try 'planet orders request --help' for help.
Error: Invalid value: item_type - 'PSScene' is not one of 'Sentinel2L1C', 'PSScene4Band', 'PSOrthoTile', 'SkySatScene', 'Landsat8L1G', 'Sentinel1', 'PSScene3Band', 'REOrthoTile', 'SkySatCollect'.
In this case I know I want PSScene, but I got the bundle wrong. But instead of telling me the proper bundles for PSScene it's telling me the item-types that are valid for the bundle I specified. Users will most always select a scene, and figure out the bundle to use based on that.
Related is when you just start trying out the command and following the prompts for what to enter:
planet orders request
Usage: planet orders request [OPTIONS]
Try 'planet orders request --help' for help.
Error: Missing option '--name'.
(planet-v2-cli) (base) cholmes@X9T37M3HGT Repos % planet orders request --name "My Order"
Usage: planet orders request [OPTIONS]
Try 'planet orders request --help' for help.
Error: Missing option '--bundle'. Choose from:
analytic,
analytic_udm2,
analytic_3b_udm2,
analytic_5b,
analytic_5b_udm2,
analytic_8b_udm2,
visual,
....
pansharpened_udm2,
basic_l1a_dn
(planet-v2-cli) (base) cholmes@X9T37M3HGT Repos % planet orders request --name "My Order" --bundle visual
% planet orders request --name "My Order" --bundle visual
Usage: planet orders request [OPTIONS]
Try 'planet orders request --help' for help.
Error: Missing option '--id'.
It'd be better to raise the item-type prompt before the bundle prompt, and then ideally the bundle options shown are the ones based on the item-type selected (which the bundle does now, but it'd be much better the other way).
Note that #680 and #677 seemed to be working in this space, and it looked like there was one commit that put item-types first, but it didn't end up in the final merge.