feat(assets): add asset history API methods#100
Merged
Conversation
Adds asset-history support to AssetSpec: - list_all(): paginated list of assets - list_asset_history_entities(asset_id): history entries for an asset - create_history_entity(asset_id, operation_description, operation_type): record a new history event operation_type accepts a HistoryOperationType enum (new, in models/base for discoverability of known values) or any string, so newly added API operation types keep working without an SDK upgrade. Uses module-level URL constants (LIST_URL, HISTORY_URL) consistent with the rest of the spec. Includes tests for listing, history retrieval, and creation with enum and arbitrary-string operation types. Co-Authored-By: Brian Summa <brian.f.summa@chesa.com> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Adds asset-history support to
AssetSpec. This supersedes #79 (from a fork,based on stale main) — it rebases Brian's original work onto current
main,addresses the review feedback there, and adds test coverage. Brian is credited
as co-author on the commit.
Methods
list_all()— paginated list of assetslist_asset_history_entities(asset_id)— history entries for an assetcreate_history_entity(asset_id, operation_description, operation_type)— record a history eventReview feedback addressed (from #79)
operation_typenow accepts a newHistoryOperationTypeenum or any string,instead of hard-restricting to a fixed list with a
ValueError. New APIoperation types keep working without an SDK upgrade.
LIST_URL,HISTORY_URL) andrelative paths, consistent with the rest of the spec (avoids double
gen_url).Testing
pythonik/tests/test_assets_history.pycovers listing, history retrieval, andcreation with both enum and arbitrary-string operation types. Full suite: 177 passed (Python 3.12).
Closes #79
🤖 Generated with Claude Code