From 697195bdaa10a88680332a6527006d290380443b Mon Sep 17 00:00:00 2001 From: chrizzo1984 <57208812+chrizzo1984@users.noreply.github.com> Date: Thu, 30 Jan 2025 12:58:16 +0100 Subject: [PATCH] Update _enums.py https://github.com/microsoftgraph/msgraph-sdk-python-core/issues/818 Added __str__ methods to get value as default -> Changes Python >=3.11 --- src/msgraph_core/_enums.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/msgraph_core/_enums.py b/src/msgraph_core/_enums.py index 02fb580e..5f217fe8 100644 --- a/src/msgraph_core/_enums.py +++ b/src/msgraph_core/_enums.py @@ -12,6 +12,9 @@ class APIVersion(str, Enum): beta = 'beta' v1 = 'v1.0' + def __str__(self): + return self.value + class FeatureUsageFlag(int, Enum): """Enumerated list of values used to flag usage of specific middleware""" @@ -23,6 +26,9 @@ class FeatureUsageFlag(int, Enum): DEFAULT_HTTP_PROVIDER_ENABLED = 8 LOGGING_HANDLER_ENABLED = 16 + def __str__(self): + return self.value + class NationalClouds(str, Enum): """Enumerated list of supported sovereign clouds""" @@ -32,3 +38,6 @@ class NationalClouds(str, Enum): Global = 'https://graph.microsoft.com' US_DoD = 'https://dod-graph.microsoft.us' US_GOV = 'https://graph.microsoft.us' + + def __str__(self): + return self.value