Skip to content
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

Add Batch to graph client #915

Merged
merged 5 commits into from
Oct 2, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions msgraph/graph_service_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
if TYPE_CHECKING:
from .generated.users.item.user_item_request_builder import UserItemRequestBuilder


class GraphServiceClient(BaseGraphServiceClient):

def __init__(
self,
credentials: Optional[Union[TokenCredential, AsyncTokenCredential]] = None,
Expand Down Expand Up @@ -60,3 +62,12 @@ def me(self) -> UserItemRequestBuilder:
url_tpl_parameters["user%2Did"] = "me-token-to-replace"

return UserItemRequestBuilder(self.request_adapter, url_tpl_parameters)

@property
def batch(self) -> BatchRequestBuilder:
baywet marked this conversation as resolved.
Show resolved Hide resolved
"""
Returns a BatchRequestBuilder to enable batch requests.
"""
from msgraph_core.requests.batch_request_builder import BatchRequestBuilder

return BatchRequestBuilder(self.request_adapter)
Loading