Skip to content

Commit

Permalink
Merge pull request #233 from microsoftgraph/fix/replace-me
Browse files Browse the repository at this point in the history
Enable /me URL replacement
  • Loading branch information
Ndiritu authored Oct 19, 2023
2 parents 85927dc + 0f344e4 commit 9530874
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion msgraph/graph_request_adapter.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
from typing import Dict, Optional
import httpx
from kiota_abstractions.authentication import AuthenticationProvider
from kiota_http.middleware.options import UrlReplaceHandlerOption
from msgraph_core import APIVersion, BaseGraphRequestAdapter, GraphClientFactory
from msgraph_core.middleware.options import GraphTelemetryHandlerOption

from ._version import VERSION

options = {GraphTelemetryHandlerOption.get_key(): GraphTelemetryHandlerOption(api_version=APIVersion.beta, sdk_version=VERSION)}
options = {
UrlReplaceHandlerOption.get_key(): UrlReplaceHandlerOption(
enabled = True,
replacement_pairs = {"/users/me-token-to-replace": "/me"}
),
GraphTelemetryHandlerOption.get_key(): GraphTelemetryHandlerOption(
api_version=APIVersion.beta,
sdk_version=VERSION)
}

class GraphRequestAdapter(BaseGraphRequestAdapter):
def __init__(self, auth_provider: AuthenticationProvider,
Expand Down

0 comments on commit 9530874

Please sign in to comment.