Skip to content

Commit

Permalink
Merge branch 'main' into v1.0/pipelinebuild/165500
Browse files Browse the repository at this point in the history
  • Loading branch information
shemogumbe authored Oct 3, 2024
2 parents 9914367 + 5e24963 commit 1088a1b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion msgraph/graph_service_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@
from azure.core.credentials import TokenCredential
from azure.core.credentials_async import AsyncTokenCredential
from kiota_authentication_azure.azure_identity_authentication_provider import AzureIdentityAuthenticationProvider
from httpx import AsyncClient

from .generated.base_graph_service_client import BaseGraphServiceClient
from .graph_request_adapter import GraphRequestAdapter

if TYPE_CHECKING:
from .generated.users.item.user_item_request_builder import UserItemRequestBuilder
from msgraph_core.requests.batch_request_builder import BatchRequestBuilder


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:
"""
Returns a BatchRequestBuilder to enable batch requests.
"""
from msgraph_core.requests.batch_request_builder import BatchRequestBuilder

return BatchRequestBuilder(self.request_adapter)
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ microsoft-kiota-serialization-multipart==0.1.0
microsoft-kiota-serialization-text==1.0.0
msal==1.30.0
msal-extensions==1.2.0
msgraph-core==1.1.2
msgraph-core==1.1.5
multidict==6.0.5
mypy==1.11.2
mypy-extensions==1.0.0
Expand Down

0 comments on commit 1088a1b

Please sign in to comment.