Repository: planetlabs/planet-client-python

Issue:
sdk does not support data api skysatvideo item type
**Expected behavior**
`planet data search skysatvideo` should search for the [skysatvideo](https://developers.planet.com/docs/data/skysatvideo/) item type.

**Actual behavior (describe the problem)**
skysatvideo is not supported

```console
planet-client-python$> planet data search skysatvideo
Usage: planet data search [OPTIONS] ITEM_TYPES
Try 'planet data search --help' for help.

Error: Invalid value for 'ITEM_TYPES': item_type - 'skysatvideo' is not one of 'PSOrthoTile', 'PSScene', 'MYD09GQ', 'Sentinel2L1C', 'SkySatCollect', 'REOrthoTile', 'REScene', 'MOD09GA', 'Sentinel1', 'Landsat8L1G', 'MYD09GA', 'MOD09GQ', 'SkySatScene'.
```

**Context**
skysatvideo is a valid item type for the data api. the sdk pulls valid item types from the orders api bundle spec, which does not include skysatvideo. skysatvideo is not mentioned in the data api [openapi spec](https://api.planet.com/data/v1/spec). it is described in the [docs](https://developers.planet.com/docs/data/skysatvideo/) and also returned from a query of https://api.planet.com/data/v1/item-types.

Discussion:

Patch:
diff --git a/planet/cli/data.py b/planet/cli/data.py
index d138cb5..fdb4279 100644
--- a/planet/cli/data.py
+++ b/planet/cli/data.py
@@ -28,8 +28,8 @@ from planet.clients.data import (SEARCH_SORT,
                                  SEARCH_SORT_DEFAULT,
                                  STATS_INTERVAL)
 
-from planet.specs import (get_item_types,
-                          validate_item_type,
+from planet.specs import (get_data_item_types,
+                          validate_data_item_type,
                           SpecificationException)
 
 from . import types
@@ -38,8 +38,8 @@ from .io import echo_json
 from .options import limit, pretty
 from .session import CliSession
 
-ALL_ITEM_TYPES = get_item_types()
-valid_item_string = "Valid entries for ITEM_TYPES: " + "|".join(ALL_ITEM_TYPES)
+valid_item_string = "Valid entries for ITEM_TYPES: " + "|".join(
+    get_data_item_types())
 
 
 @asynccontextmanager
@@ -75,7 +75,7 @@ def check_item_types(ctx, param, item_types) -> Optional[List[dict]]:
     item types.'''
     try:
         for item_type in item_types:
-            validate_item_type(item_type)
+            validate_data_item_type(item_type)
         return item_types
     except SpecificationException as e:
         raise click.BadParameter(str(e))
@@ -85,7 +85,7 @@ def check_item_type(ctx, param, item_type) -> Optional[List[dict]]:
     '''Validates the item type provided by comparing it to all supported
     item types.'''
     try:
-        validate_item_type(item_type)
+        validate_data_item_type(item_type)
     except SpecificationException as e:
         raise click.BadParameter(str(e))
 
diff --git a/planet/clients/data.py b/planet/clients/data.py
index 6f8fe09..7b8133a 100644
--- a/planet/clients/data.py
+++ b/planet/clients/data.py
@@ -25,7 +25,7 @@ from .. import exceptions
 from ..constants import PLANET_BASE_URL
 from ..http import Session
 from ..models import Paged, StreamingBody
-from ..specs import validate_item_type
+from ..specs import validate_data_item_type
 
 BASE_URL = f'{PLANET_BASE_URL}/data/v1/'
 SEARCHES_PATH = '/searches'
@@ -147,7 +147,7 @@ class DataClient:
 
         search_filter = search_filter or empty_filter()
 
-        item_types = [validate_item_type(item) for item in item_types]
+        item_types = [validate_data_item_type(item) for item in item_types]
         request_json = {'filter': search_filter, 'item_types': item_types}
         if name:
             request_json['name'] = name
@@ -204,7 +204,7 @@ class DataClient:
         """
         url = self._searches_url()
 
-        item_types = [validate_item_type(item) for item in item_types]
+        item_types = [validate_data_item_type(item) for item in item_types]
         request = {
             'name': name,
             'filter': search_filter,
@@ -237,7 +237,7 @@ class DataClient:
         """
         url = f'{self._searches_url()}/{search_id}'
 
-        item_types = [validate_item_type(item) for item in item_types]
+        item_types = [validate_data_item_type(item) for item in item_types]
         request = {
             'name': name,
             'filter': search_filter,
@@ -396,7 +396,7 @@ class DataClient:
 
         url = f'{self._base_url}{STATS_PATH}'
 
-        item_types = [validate_item_type(item) for item in item_types]
+        item_types = [validate_data_item_type(item) for item in item_types]
         request = {
             'interval': interval,
             'filter': search_filter,
@@ -450,7 +450,7 @@ class DataClient:
             planet.exceptions.ClientError: If asset type identifier is not
             valid.
         """
-        item_type_id = validate_item_type(item_type_id)
+        item_type_id = validate_data_item_type(item_type_id)
         assets = await self.list_item_assets(item_type_id, item_id)
 
         try:
diff --git a/planet/specs.py b/planet/specs.py
index a30a871..5e6f592 100644
--- a/planet/specs.py
+++ b/planet/specs.py
@@ -70,6 +70,17 @@ def validate_item_type(item_type):
     return _validate_field(item_type, supported_item_types, 'item_type')
 
 
+def validate_data_item_type(item_type):
+    '''Validate and correct capitalization of data api item type.'''
+    return _validate_field(item_type, get_data_item_types(), 'item_type')
+
+
+def get_data_item_types():
+    '''Item types supported by the data api.'''
+    # This is a quick-fix for gh-956, to be superseded by gh-960
+    return get_item_types() | {'SkySatVideo'}
+
+
 def validate_order_type(order_type):
     return _validate_field(order_type, SUPPORTED_ORDER_TYPES, 'order_type')
 


Test patch:
diff --git a/tests/unit/test_specs.py b/tests/unit/test_specs.py
index 5b5241e..d3d4d13 100644
--- a/tests/unit/test_specs.py
+++ b/tests/unit/test_specs.py
@@ -103,6 +103,11 @@ def test_validate_item_type_notsupported_itemtype():
         specs.validate_item_type('notsupported')
 
 
+def test_validate_data_item_type():
+    '''ensure skysatvideo is included'''
+    specs.validate_data_item_type('skysatvideo')
+
+
 def test_validate_order_type_supported():
     assert 'full' == specs.validate_order_type('FULL')