Skip to content

Commit 7d00456

Browse files
Use newer StrEnum syntax (Python 3.11+)
1 parent b876bad commit 7d00456

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

shared/python/apimtypes.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Types and constants for Azure API Management automation and deployment.
33
"""
44

5-
from enum import Enum
5+
from enum import StrEnum
66
from dataclasses import dataclass
77
from typing import List, Optional
88

@@ -51,7 +51,7 @@ def _read_policy_xml(policy_xml_filepath: str) -> str:
5151
# CLASSES
5252
# ------------------------------
5353

54-
class APIMNetworkMode(str, Enum):
54+
class APIMNetworkMode(StrEnum):
5555
"""
5656
Networking configuration modes for Azure API Management (APIM).
5757
"""
@@ -62,7 +62,7 @@ class APIMNetworkMode(str, Enum):
6262
NONE = "None" # No explicit network configuration (legacy or default)
6363

6464

65-
class APIM_SKU(str, Enum):
65+
class APIM_SKU(StrEnum):
6666
"""
6767
APIM SKU types.
6868
"""
@@ -76,7 +76,7 @@ class APIM_SKU(str, Enum):
7676
PREMIUMV2 = "Premiumv2"
7777

7878

79-
class HTTP_VERB(str, Enum):
79+
class HTTP_VERB(StrEnum):
8080
"""
8181
HTTP verbs that can be used for API operations.
8282
"""
@@ -90,7 +90,7 @@ class HTTP_VERB(str, Enum):
9090
HEAD = "HEAD"
9191

9292

93-
class INFRASTRUCTURE(str, Enum):
93+
class INFRASTRUCTURE(StrEnum):
9494
"""
9595
Infrastructure types for APIM automation scenarios.
9696
"""

0 commit comments

Comments
 (0)