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.
Summary | Résumé
Refactoring for Simplification and Optimization
The
google_next
module refactors the service and directory functions to simplify and optimize the codebase. Focuses on reducing redundancy, improving readability, and enhancing maintainability. It will gradually replace thegoogle_workspace
as modules are updated.Service Initialization
The
get_google_service
function ingoogle_next/service.py
is streamlined to handle authentication and service initialization more efficiently. Directly returns the authenticated service resource without additional complexity.Error Handling
The
handle_google_api_errors
decorator ingoogle_next/service.py
is simplified to more easily log warnings and errors, providing better insights into issues.API Call Execution
The
execute_google_api_call
function is updated to receive an initialized service resource as an argument, allowing for more flexibility in API call execution and better performance (no need to re-authenticate for each call).Directory Functions
The directory functions in
google_next/directory.py
are refactored to simplify the code and improve readability. The functions are streamlined to reduce redundancy and improve consistency in handling directory operations.The
list_groups_with_members
function is enhanced to handle member retrieval and error handling more effectively, clearly listing groups and members where an API call raised an error as part of the returned values.