File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
src/codegen/agents/client/openapi_client Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change 1919from typing import Optional , Union
2020from urllib .parse import quote
2121
22- from dateutil .parser import parse
2322from pydantic import SecretStr
2423
2524import codegen .agents .client .openapi_client as openapi_client
@@ -42,8 +41,8 @@ class ApiClient:
4241
4342 :param configuration: .Configuration object for this client
4443 :param header_name: a header to pass when making calls to the API.
45- :param header_value: a header value to pass when making calls to
46- the API.
44+ :param header_value: a header value to pass when making calls
45+ to the API.
4746 :param cookie: a cookie to include in the header when making calls
4847 to the API
4948 """
@@ -618,9 +617,7 @@ def __deserialize_date(self, string):
618617 :return: date.
619618 """
620619 try :
621- return parse (string ).date ()
622- except ImportError :
623- return string
620+ return datetime .datetime .strptime (string , "%Y-%m-%d" ).date ()
624621 except ValueError :
625622 raise rest .ApiException (status = 0 , reason = f"Failed to parse `{ string } ` as date object" )
626623
@@ -633,9 +630,7 @@ def __deserialize_datetime(self, string):
633630 :return: datetime.
634631 """
635632 try :
636- return parse (string )
637- except ImportError :
638- return string
633+ return datetime .datetime .fromisoformat (string .replace ('Z' , '+00:00' ))
639634 except ValueError :
640635 raise rest .ApiException (status = 0 , reason = (f"Failed to parse `{ string } ` as datetime object" ))
641636
You can’t perform that action at this time.
0 commit comments