Skip to content

orders + subscriptions: support user_id query param #1188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Aug 14, 2025

Conversation

adamweiner
Copy link
Contributor

Proposed Changes:

For inclusion in changelog (if applicable):

  1. Add support for Orders API & Subscriptions API user_id query parameter

PR Checklist:

  • This PR is as small and focused as possible
  • If this PR includes proposed changes for inclusion in the changelog, the title of this PR summarizes those changes and is ready for inclusion in the Changelog.
  • I have updated docstrings for function changes and docs in the 'docs' folder for user interface / behavior changes
  • This PR does not break any examples or I have updated them

@asonnenschein asonnenschein requested a review from Copilot August 13, 2025 15:16
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for the user_id query parameter to both the Orders API and Subscriptions API, allowing organization administrators to filter results by user ID. The parameter accepts either "all" to see all users' data or a specific user ID.

  • Added user_id parameter to client methods for both Orders and Subscriptions APIs
  • Updated CLI commands to support the new --user-id option
  • Added comprehensive test coverage for the new functionality

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
planet/clients/orders.py Added user_id parameter to list_orders method with proper type conversion
planet/clients/subscriptions.py Added user_id parameter to list_subscriptions method and cleaned up TODO comment
planet/sync/orders.py Added user_id parameter to sync wrapper for list_orders
planet/sync/subscriptions.py Added user_id parameter to sync wrapper for list_subscriptions
planet/cli/orders.py Added --user-id CLI option for orders list command
planet/cli/subscriptions.py Added --user-id CLI option for subscriptions list command
tests/integration/test_orders_api.py Added comprehensive tests for user_id filtering in both async and sync clients
tests/integration/test_orders_cli.py Added CLI test for user_id parameter
tests/integration/test_subscriptions_api.py Added test for user_id filtering in subscriptions API
tests/integration/test_subscriptions_cli.py Added CLI test parameters for user_id
docs/cli/cli-orders.md Added documentation for --user-id option with examples
docs/cli/cli-subscriptions.md Added documentation for --user-id option with examples

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@asonnenschein asonnenschein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I think the issue that co-pilot flagged should be addressed (the orders client casts user_id to string, and the subscriptions client does not).

@adamweiner adamweiner merged commit b8be6a6 into main Aug 14, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants