Skip to content

Commit 8cd5827

Browse files
committed
get method value if enum is passed
1 parent 784d8d6 commit 8cd5827

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/msgraph_core/requests/batch_request_item.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import re
2+
import enum
23
import json
34
from uuid import uuid4
45
from typing import List, Optional, Dict, Union, Any
@@ -39,7 +40,10 @@ def __init__(
3940
if request_information is None or not request_information.http_method:
4041
raise ValueError("HTTP method cannot be Null/Empty")
4142
self._id = id or str(uuid4())
42-
self.method = request_information.http_method
43+
if isinstance(request_information.http_method, enum.Enum):
44+
self._method = request_information.http_method.name
45+
else:
46+
self._method = request_information.http_method
4347
self._headers = request_information.request_headers
4448
self._body = request_information.content
4549
self.url = request_information.url.replace('/users/me-token-to-replace', '/me', 1)
@@ -183,7 +187,9 @@ def method(self, value: str) -> None:
183187
Sets the HTTP method of the request item.
184188
Args:
185189
value (str): The HTTP method of the request item.
190+
186191
"""
192+
187193
self._method = value
188194

189195
@property

0 commit comments

Comments
 (0)