Skip to content

Add upsert_resource() and external_id support#5

Merged
loookashow merged 4 commits intomainfrom
feat/external-id
Feb 10, 2026
Merged

Add upsert_resource() and external_id support#5
loookashow merged 4 commits intomainfrom
feat/external-id

Conversation

@loookashow
Copy link
Contributor

Summary

  • Add upsert_resource() method to ManagementClient and AsyncManagementClient — creates or updates a resource by external_id in a single call (PUT /folders/:folder/resources/?external_id=<value>)
  • Add optional external_id parameter to create_resource() — passes it in the request body so the API assigns the identifier on creation
  • Add external_id field to ResourceSummary model

Changes

SDK (src/foxnose_sdk/management/)

  • models.pyexternal_id: str | None = None on ResourceSummary
  • client.pyupsert_resource() and external_id param on create_resource() for both sync and async clients

Tests (tests/)

  • 16 new unit tests (11 sync, 5 async) covering upsert, external_id in create, payload immutability, backward compatibility

Docs (docs/)

  • management-client.md — Create Resource updated, new Upsert Resource section
  • examples.md — new Upsert section with usage examples
  • changelog.md — v0.3.0 release notes

Test plan

  • All tests pass (pytest tests/ -v)

@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@loookashow loookashow merged commit 1d3be2b into main Feb 10, 2026
6 checks passed
@loookashow loookashow deleted the feat/external-id branch February 10, 2026 14:38
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.

1 participant