Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion planet/cli/subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ def subscriptions(ctx, base_url):
)
@click.option('--user-id',
help="Filter by user ID. Accepts 'all' or a specific user ID.")
@click.option(
'--geom-ref',
help="Filter subscriptions created with the provided feature reference.")
@limit
@click.option('--page-size',
type=click.INT,
Expand All @@ -132,6 +135,7 @@ async def list_subscriptions_cmd(ctx,
limit,
destination_ref,
user_id,
geom_ref,
page_size,
pretty):
"""Prints a sequence of JSON-encoded Subscription descriptions."""
Expand All @@ -149,7 +153,8 @@ async def list_subscriptions_cmd(ctx,
'updated': updated,
'limit': limit,
'destination_ref': destination_ref,
'user_id': user_id
'user_id': user_id,
'geom_ref': geom_ref
}
if page_size is not None:
list_subscriptions_kwargs['page_size'] = page_size
Expand Down
4 changes: 4 additions & 0 deletions planet/clients/subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ async def list_subscriptions(self,
updated: Optional[str] = None,
destination_ref: Optional[str] = None,
user_id: Optional[Union[str, int]] = None,
geom_ref: Optional[str] = None,
page_size: int = 500) -> AsyncIterator[dict]:
"""Iterate over list of account subscriptions with optional filtering.

Expand Down Expand Up @@ -111,6 +112,7 @@ async def list_subscriptions(self,
provided destination reference.
user_id (str or int): filter by user ID. Only available to organization admins.
Accepts "all" or a specific user ID.
geom_ref (str): A feature reference to filter by.
page_size (int): number of subscriptions to return per page.

Datetime args (created, end_time, start_time, updated) can either be a
Expand Down Expand Up @@ -159,6 +161,8 @@ class _SubscriptionsPager(Paged):
params['destination_ref'] = destination_ref
if user_id is not None:
params['user_id'] = user_id
if geom_ref is not None:
params['geom_ref'] = geom_ref

params['page_size'] = page_size

Expand Down
3 changes: 3 additions & 0 deletions planet/sync/subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def list_subscriptions(self,
updated: Optional[str] = None,
destination_ref: Optional[str] = None,
user_id: Optional[Union[str, int]] = None,
geom_ref: Optional[str] = None,
page_size: int = 500) -> Iterator[dict]:
"""Iterate over list of account subscriptions with optional filtering.

Expand Down Expand Up @@ -85,6 +86,7 @@ def list_subscriptions(self,
provided destination reference.
user_id (str or int): filter by user ID. Only available to organization admins.
Accepts "all" or a specific user ID.
geom_ref (str): A feature reference to filter by.
limit (int): limit the number of subscriptions in the
results. When set to 0, no maximum is applied.
page_size (int): number of subscriptions to return per page.
Expand Down Expand Up @@ -120,6 +122,7 @@ def list_subscriptions(self,
updated,
destination_ref,
user_id,
geom_ref,
page_size))

def create_subscription(self, request: Dict) -> Dict:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "planet"
authors = [{ name = "Planet", email = "python-sdk-contributors@planet.com" }]
description = "Planet SDK for Python"
dependencies = [
"click (>=8.0,!=8.2.1)",
"click (>=8.0,!=8.2.1,<8.4.0)",
"geojson",
"httpx>=0.28.0",
"jsonschema",
Expand Down
Loading