Repository: planetlabs/planet-client-python

Issue:
Include basemaps orders in `planet order list` output
**Is your feature request related to a problem? Please describe.**

Planet now supports [basemaps in orders](https://developers.planet.com/apis/orders/basemaps/). This works great with all the core orders commands, except for `list`. You can `get` a basemaps order, `wait`, and `download` it. 
 
**Describe the solution you'd like**
To have `planet orders list` return basemaps and scene orders.

The core API team wanted to make everything backwards compatible, so they kept the GET at https://api.planet.com/compute/ops/orders/v2/ to just the scene orders. They introduced a parameter called `source_type`, that can take values like `all`, `basemaps`, `scenes`, `basemaps,scenes`. 

I propose we just return `all`, since the SDK and CLI just output the JSON directly, so returning an extra JSON attribute doesn't effect anything. Our `list` should aim to show all the options at the end point.

**Describe alternatives you've considered**

We could consider supporting the `source_type` parameter as an option, with a default to `all`. But that could also be ticketed as its own issue.

**Additional context**



Discussion:
jreiberkyle: Also closes #752 (looks like that got duped - is that how one shortens 'duplicated'?) 😆 
jreiberkyle: oh wait, this is a little different. This PR makes the default behavior be to list all orders. #752 adds a new argument to list which allows filtering. It makes sense to have listing all be the default and we'll keep #752 open for later on.
cholmes: > It makes sense to have listing all be the default and we'll keep https://github.com/planetlabs/planet-client-python/issues/752 open for later on.

Sounds great, and in line with what I was thinking - get this one in now, and then later make source_type an explicit parameter. It doesn't feel super pressing to make it a parameter since it's pretty easy to filter client side. Didn't realize you had a ticket for it, I'll schedule it on a milestone.

Patch:
diff --git a/planet/clients/orders.py b/planet/clients/orders.py
index e405046..733e96f 100644
--- a/planet/clients/orders.py
+++ b/planet/clients/orders.py
@@ -481,15 +481,14 @@ class OrdersClient:
             planet.exceptions.ClientError: If state is not valid.
         """
         url = self._orders_url()
+        params = {"source_type": "all"}
 
         if state:
             if state not in ORDER_STATE_SEQUENCE:
                 raise exceptions.ClientError(
                     f'Order state ({state}) is not a valid state. '
                     f'Valid states are {ORDER_STATE_SEQUENCE}')
-            params = {"state": state}
-        else:
-            params = None
+            params['state'] = state
 
         response = await self._session.request(method='GET',
                                                url=url,


Test patch:
diff --git a/tests/integration/test_orders_api.py b/tests/integration/test_orders_api.py
index d7ddab2..bb1a63e 100644
--- a/tests/integration/test_orders_api.py
+++ b/tests/integration/test_orders_api.py
@@ -123,7 +123,7 @@ async def test_list_orders_basic(order_descriptions, session):
 @respx.mock
 @pytest.mark.asyncio
 async def test_list_orders_state(order_descriptions, session):
-    list_url = TEST_ORDERS_URL + '?state=failed'
+    list_url = TEST_ORDERS_URL + '?source_type=all&state=failed'
 
     order1, order2, _ = order_descriptions
 
diff --git a/tests/integration/test_orders_cli.py b/tests/integration/test_orders_cli.py
index 59909c8..16c7a9f 100644
--- a/tests/integration/test_orders_cli.py
+++ b/tests/integration/test_orders_cli.py
@@ -85,7 +85,7 @@ def test_cli_orders_list_empty(invoke):
 
 @respx.mock
 def test_cli_orders_list_state(invoke, order_descriptions):
-    list_url = TEST_ORDERS_URL + '?state=failed'
+    list_url = TEST_ORDERS_URL + '?source_type=all&state=failed'
 
     order1, order2, _ = order_descriptions