-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: switch User and Content to inherit dict, add update method for User #94
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
df2e8b5
feat: switch User to inherit dict, add update method
nealrichardson db96777
Add custom setattr error to User; start converting ContentItem
nealrichardson b026d58
Use attrs in tests
nealrichardson 7f22e2a
Enumerate updateable fields for User, add related TODOs
nealrichardson 04e3d10
Add all of the ContentItem getters
nealrichardson 8d8d55e
Import Any
nealrichardson 314641c
Tell mypy to ignore all of this
nealrichardson f7c606a
Add links to TODO issues
nealrichardson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. But should we enforce these logical constraints or defer this behavior to the server? In other words, how do we handle behavioral changes to the PATCH endpoint between versions of Connect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suppose a future version of Connect adds a new field you can PATCH to update. We would add it here explicitly, and users would need to upgrade the SDK to the latest to access it. That seems fine.
Suppose a future version of Connect changed it so that
user_role
didn't exist, and instead you provided apermissions
dict of named booleans. We would add a check here for the version of the Connect server, and if you provideduser_role
to a version of Connect that only supportedpermissions
, map our understanding of our current roles to those permissions bundles (or error). We could also do the reverse and map known permission bundles back to user_role (or error).So I think this is ok, or at least we have options.