-
Notifications
You must be signed in to change notification settings - Fork 570
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[wip] Implement webhooks API (#2209)
* first draft for discussion * Restyling + reintroduce webhook secret + WatchedItem to dataclass * Added webhook apis to __init__.py * Added WEBHOOK_DOMAIN_T as constant * Updated update_webhook docstring * lint * style * style * style * style * style * Add Webhook dataclass as return value and update docstrings' * Update links to Webhook definition in docstrings * Update docstring style * Update token typing and description * Update token typing and description to newest version * Rename Webhook dataclass to WebhookInfo" * Add WebhookInfo dataclass to huggingface_hub/__init__.py * Add import statements in examples * Update WebhookInfo references and standardize wording * Add WebhookWatchedItem to huggingface_hub/__init__.py * Apply suggestions: Args kw-only, all (not necessary) args optional Co-authored-by: Lucain <lucainp@gmail.com> * Apply suggestion: Add WebhookWatchedItem as import in example Co-authored-by: Lucain <lucainp@gmail.com> * Fix JSON parsing and dataclass serialization issues * Reorder args for consistency * Fix typo * Fix TypeError in update_webhook by ensuring watched is iterable and dataclass is serializable * Add tests * Update args order in WebhookInfo dataclass * Rename .../webhooks_server.md to .../webhooks.md * Apply suggestions * Fix commit issue * Add 'Managing Webhooks' section to docs * Update _redirects.yml * Update _toctree.yml * Update package_reference with WebhookInfo and WatchedWebhookInfo * Fix typos in hf_api.md * Update _toctree.yml * Update _toctree.yml and _redirects.yml * Update titles in guides/webhooks.md * Format and rephrase guides/webhooks` * switch docs sections + fix code quality * test dicts as well --------- Co-authored-by: Lucain Pouget <lucainp@gmail.com>
- Loading branch information
Showing
8 changed files
with
632 additions
and
17 deletions.
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
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.