[GOLF-12281] Add webhook support to LightspeedRestaurantClient #40
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.
Description:
This pull request introduces webhook support to the LightspeedRestaurantClient library. The updates include:
New Webhook Class:
Added a Webhook class to manage webhook-related operations, including:
list: Retrieve a list of all webhooks.
find: Get details for a specific webhook.
create: Create a new webhook.
renew: Renew an existing webhook.
Improved Response Handling:
Updated handle_list_response to handle API responses containing results or data correctly.
Error Handling Enhancements:
Added handling for unauthorized_error in the Request module to better manage API authentication issues.
Testing Improvements:
Added VCR cassettes for webhook-related tests (create, find, list, renew) to ensure consistency and reliability in test cases.
Why These Changes Are Necessary:
This addition enhances the functionality of LightspeedRestaurantClient by enabling developers to easily manage webhooks through the library, improving usability and API coverage.
Checklist:
Added/updated unit tests.
Additional Notes:
Please review the implementation and test cases for completeness and accuracy. Feedback is appreciated!