Skip to content

feat: add plans and masking policy clients - #26

Merged
AminChirazi merged 1 commit into
mainfrom
feat/plans-and-masking
Jul 28, 2026
Merged

feat: add plans and masking policy clients#26
AminChirazi merged 1 commit into
mainfrom
feat/plans-and-masking

Conversation

@AminChirazi

Copy link
Copy Markdown
Collaborator

Two of the gaps between this SDK and the API. The package tracks the newest primitives well - sets and keymaps are both current - but had nothing for Plans or masking policies, which are the governed path the product now leads with.

client.plans.get_plans()
client.masking_policies.create_masking_policy(
    name="pii", fields=rules, reversible=True, key_map_name="pii-reversal"
)
Client Methods
client.plans get_plans get_plan update_plan delete_plan
client.masking_policies get_masking_policies get_masking_policy create_masking_policy update_masking_policy delete_masking_policy

Both mirror the shapes in the API's OpenAPI document (automators-com/datamaker#2879), and the method names match the resource clients already here.

Two behaviours documented rather than smoothed over

  • delete_plan answers {"success": true}, not the {"message": ...} every other resource returns. Returned as-is. Normalising the wire shape is the API's decision, and an SDK that hides the difference makes the eventual fix harder to reason about.
  • create_masking_policy sends only what the caller set, so the API applies its own defaults for consistent and reversible. Sending explicit nulls would override them - a subtle way to get non-consistent masking without asking for it.

The docstring for reversible also spells out that it only means anything alongside key_map_name, since that pairing is easy to miss.

Deliberately absent

The plan run endpoints (/plans/{id}/run, /runs, /signoffs). They carry artifacts, logs and multi-step state that the API does not yet describe in its spec, and guessing their shape is how an SDK ends up confidently wrong.

Verification

  • 69 tests pass, 24 skipped - unchanged from before.
  • ruff check --select F,E9 clean on both new modules; ruff format --check reports them already formatted. The remaining default-ruleset complaints are UP006/UP045 pyupgrade suggestions that the entire package shares (sets.py has the same 23), so the new files match house style rather than diverging from it.

Two of the gaps between the SDK and the API. The Python package tracks the
newest primitives well - sets and keymaps are both current - but had nothing
for Plans or masking, which are the governed path the product now leads with.

    client.plans.get_plans() / get_plan() / update_plan() / delete_plan()
    client.masking_policies.get_masking_policies() / get_masking_policy()
        / create_masking_policy() / update_masking_policy()
        / delete_masking_policy()

Both mirror the shapes in the API's OpenAPI document, and the method names
match the resource clients that were already here so nothing new has to be
learned.

Two behaviours are documented rather than smoothed over, because an SDK that
quietly disagrees with its server is worse than one that reports it:

- `delete_plan` answers `{"success": true}`, not the `{"message": ...}` every
  other resource returns. Returned as-is; normalising the wire shape is the
  API's decision, not the SDK's.
- `create_masking_policy` sends only the arguments the caller actually set, so
  the API applies its own defaults for `consistent` and `reversible`. Sending
  nulls would override them.

The plan RUN endpoints are deliberately absent: they carry artifacts, logs and
multi-step state that the API does not yet describe in its spec, and guessing
their shape is how an SDK ends up confidently wrong.

69 tests pass, 24 skipped, unchanged from before.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 28, 2026 07:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@AminChirazi
AminChirazi merged commit aa5ec58 into main Jul 28, 2026
6 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