Skip to content

Commit 75e1a66

Browse files
committed
Provide api version as an enum instead of hardcoded string
1 parent f4f6f94 commit 75e1a66

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

msgraphcore/graph_session.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
"""
22
Graph Session
33
"""
4+
from enum import Enum
5+
46
from requests import Session
57

68
from msgraphcore.constants import BASE_URL, SDK_VERSION
@@ -11,6 +13,11 @@
1113
from msgraphcore.middleware.retry_middleware import RetryMiddleware
1214

1315

16+
class APIVersion(str, Enum):
17+
beta = 'beta'
18+
v1 = 'v1.0'
19+
20+
1421
class GraphSession(Session):
1522
"""Extends Session with Graph functionality
1623
@@ -22,7 +29,7 @@ def __init__(
2229
scopes: [str] = ['.default'],
2330
retry_config: dict = {},
2431
middleware: list = [],
25-
api_version: str = 'v1.0'
32+
api_version: APIVersion = APIVersion.v1,
2633
):
2734
super().__init__()
2835
self._append_sdk_version()

0 commit comments

Comments
 (0)