Repository: planetlabs/planet-client-python

Issue:
Add path_prefix parameter to cloud delivery option
I would like a parameter in the [delivery options ](https://github.com/planetlabs/planet-client-python/blob/4873a4856ef3247ba6e5e5fd7949e90bddad7e11/planet/subscription_request.py#L371)that allows me to add a prefix.

I know the API allows it: [https://developers.planet.com/docs/subscriptions/delivery/...](https://developers.planet.com/docs/subscriptions/delivery/#:~:text=%22delivery%22%3A%20%7B%0A%20%20%20%20%22type%22%3A%20%22google_cloud_storage%22%2C%0A%20%20%20%20%22parameters%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22bucket%22%3A%20%22your%2Dgcs%2Dbucket%22%2C%0A%20%20%20%20%20%20%20%20%22credentials%22%3A%20%22c29tZWNyZWRzZm9yeW91cmdjc2J1Y2...%22%2C%0A%20%20%20%20%20%20%20%20%22path_prefix%22%3A%22optionalsubfolder1/optionalsubfolder2%22%0A%20%20%20%20%7D%0A%7D)



**Describe the solution you'd like**


**Describe alternatives you've considered**


**Additional context**



Comments:

Patch:
diff --git a/planet/subscription_request.py b/planet/subscription_request.py
index 574a4ed..fd1273c 100644
--- a/planet/subscription_request.py
+++ b/planet/subscription_request.py
@@ -371,7 +371,8 @@ def _delivery(type: str, parameters: dict) -> dict:
 def amazon_s3(aws_access_key_id: str,
               aws_secret_access_key: str,
               bucket: str,
-              aws_region: str) -> dict:
+              aws_region: str,
+              path_prefix: Optional[str] = None) -> dict:
     """Delivery to Amazon S3.
 
     Parameters:
@@ -379,6 +380,7 @@ def amazon_s3(aws_access_key_id: str,
         aws_secret_access_key: S3 account secret key.
         bucket: The name of the bucket that will receive the order output.
         aws_region: The region where the bucket lives in AWS.
+        path_prefix: Path prefix for deliveries.
     """
     parameters = {
         'aws_access_key_id': aws_access_key_id,
@@ -387,13 +389,17 @@ def amazon_s3(aws_access_key_id: str,
         'aws_region': aws_region,
     }
 
+    if path_prefix:
+        parameters['path_prefix'] = path_prefix
+
     return _delivery('amazon_s3', parameters)
 
 
 def azure_blob_storage(account: str,
                        container: str,
                        sas_token: str,
-                       storage_endpoint_suffix: Optional[str] = None) -> dict:
+                       storage_endpoint_suffix: Optional[str] = None,
+                       path_prefix: Optional[str] = None) -> dict:
     """Delivery to Azure Blob Storage.
 
     Parameters:
@@ -403,6 +409,7 @@ def azure_blob_storage(account: str,
             without a leading '?'.
         storage_endpoint_suffix: Deliver order to a sovereign cloud. The
             default is "core.windows.net".
+        path_prefix: Path prefix for deliveries.
     """
     parameters = {
         'account': account,
@@ -413,21 +420,30 @@ def azure_blob_storage(account: str,
     if storage_endpoint_suffix:
         parameters['storage_endpoint_suffix'] = storage_endpoint_suffix
 
+    if path_prefix:
+        parameters['path_prefix'] = path_prefix
+
     return _delivery('azure_blob_storage', parameters)
 
 
-def google_cloud_storage(credentials: str, bucket: str) -> dict:
+def google_cloud_storage(credentials: str,
+                         bucket: str,
+                         path_prefix: Optional[str] = None) -> dict:
     """Delivery to Google Cloud Storage.
 
     Parameters:
         credentials: JSON-string of service account for bucket.
         bucket: GCS bucket name.
+        path_prefix: Path prefix for deliveries.
     """
     parameters = {
         'bucket': bucket,
         'credentials': credentials,
     }
 
+    if path_prefix:
+        parameters['path_prefix'] = path_prefix
+
     return _delivery('google_cloud_storage', parameters)
 
 
@@ -435,7 +451,8 @@ def oracle_cloud_storage(customer_access_key_id: str,
                          customer_secret_key: str,
                          bucket: str,
                          region: str,
-                         namespace: str) -> dict:
+                         namespace: str,
+                         path_prefix: Optional[str] = None) -> dict:
     """Delivery to Oracle Cloud Storage.
 
     Parameters:
@@ -444,6 +461,7 @@ def oracle_cloud_storage(customer_access_key_id: str,
         bucket: The name of the bucket that will receive the order output.
         region: The region where the bucket lives in Oracle.
         namespace: Object Storage namespace name.
+        path_prefix: Path prefix for deliveries.
     """
     parameters = {
         'customer_access_key_id': customer_access_key_id,
@@ -453,6 +471,9 @@ def oracle_cloud_storage(customer_access_key_id: str,
         'namespace': namespace
     }
 
+    if path_prefix:
+        parameters['path_prefix'] = path_prefix
+
     return _delivery('oracle_cloud_storage', parameters)
 
 


Test patch:
diff --git a/tests/unit/test_subscription_request.py b/tests/unit/test_subscription_request.py
index 01ff195..ef4e434 100644
--- a/tests/unit/test_subscription_request.py
+++ b/tests/unit/test_subscription_request.py
@@ -197,6 +197,25 @@ def test_amazon_s3_success():
     }
 
 
+def test_amazon_s3_path_prefix_success():
+    res = subscription_request.amazon_s3(aws_access_key_id='keyid',
+                                         aws_secret_access_key='accesskey',
+                                         bucket='bucket',
+                                         aws_region='region',
+                                         path_prefix="prefix")
+
+    assert res == {
+        "type": "amazon_s3",
+        "parameters": {
+            "aws_access_key_id": "keyid",
+            "aws_secret_access_key": "accesskey",
+            "bucket": "bucket",
+            "aws_region": "region",
+            "path_prefix": "prefix"
+        }
+    }
+
+
 def test_azure_blob_storage_success():
     res = subscription_request.azure_blob_storage(
         account='act',
@@ -215,6 +234,26 @@ def test_azure_blob_storage_success():
     }
 
 
+def test_azure_blob_storage_path_prefix_success():
+    res = subscription_request.azure_blob_storage(
+        account='act',
+        container='container',
+        sas_token='sastoken',
+        storage_endpoint_suffix='suffix',
+        path_prefix="prefix")
+
+    assert res == {
+        "type": "azure_blob_storage",
+        "parameters": {
+            "account": "act",
+            "container": "container",
+            "sas_token": "sastoken",
+            "storage_endpoint_suffix": "suffix",
+            "path_prefix": "prefix"
+        }
+    }
+
+
 def test_google_cloud_storage_success():
     res = subscription_request.google_cloud_storage(credentials='cred',
                                                     bucket='bucket')
@@ -227,6 +266,19 @@ def test_google_cloud_storage_success():
     }
 
 
+def test_google_cloud_storage_path_prefix_success():
+    res = subscription_request.google_cloud_storage(credentials='cred',
+                                                    bucket='bucket',
+                                                    path_prefix="prefix")
+
+    assert res == {
+        "type": "google_cloud_storage",
+        "parameters": {
+            "bucket": "bucket", "credentials": "cred", "path_prefix": "prefix"
+        }
+    }
+
+
 def test_oracle_cloud_storage_success():
     res = subscription_request.oracle_cloud_storage(
         customer_access_key_id='keyid',
@@ -247,6 +299,28 @@ def test_oracle_cloud_storage_success():
     }
 
 
+def test_oracle_cloud_storage_path_prefix_success():
+    res = subscription_request.oracle_cloud_storage(
+        customer_access_key_id='keyid',
+        customer_secret_key='secretkey',
+        bucket='bucket',
+        region='region',
+        namespace='namespace',
+        path_prefix="prefix")
+
+    assert res == {
+        "type": "oracle_cloud_storage",
+        "parameters": {
+            "customer_access_key_id": "keyid",
+            "customer_secret_key": "secretkey",
+            "bucket": "bucket",
+            "region": "region",
+            "namespace": "namespace",
+            "path_prefix": "prefix"
+        }
+    }
+
+
 def test_notifications_success():
     topics = ['delivery.success']
     notifications_config = subscription_request.notifications(url='url',