Skip to content

Commit 697195b

Browse files
authored
Update _enums.py
#818 Added __str__ methods to get value as default -> Changes Python >=3.11
1 parent e358a5a commit 697195b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/msgraph_core/_enums.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ class APIVersion(str, Enum):
1212
beta = 'beta'
1313
v1 = 'v1.0'
1414

15+
def __str__(self):
16+
return self.value
17+
1518

1619
class FeatureUsageFlag(int, Enum):
1720
"""Enumerated list of values used to flag usage of specific middleware"""
@@ -23,6 +26,9 @@ class FeatureUsageFlag(int, Enum):
2326
DEFAULT_HTTP_PROVIDER_ENABLED = 8
2427
LOGGING_HANDLER_ENABLED = 16
2528

29+
def __str__(self):
30+
return self.value
31+
2632

2733
class NationalClouds(str, Enum):
2834
"""Enumerated list of supported sovereign clouds"""
@@ -32,3 +38,6 @@ class NationalClouds(str, Enum):
3238
Global = 'https://graph.microsoft.com'
3339
US_DoD = 'https://dod-graph.microsoft.us'
3440
US_GOV = 'https://graph.microsoft.us'
41+
42+
def __str__(self):
43+
return self.value

0 commit comments

Comments
 (0)