Skip to content

Commit 504b748

Browse files
author
Vinothini Dharmaraj
committed
latest autorest and unit test changes
1 parent ae0a2fe commit 504b748

File tree

6 files changed

+35
-161
lines changed

6 files changed

+35
-161
lines changed

sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from copy import deepcopy
1010
from typing import Any
11+
from typing_extensions import Self
1112

1213
from azure.core import PipelineClient
1314
from azure.core.credentials import AzureKeyCredential
@@ -108,7 +109,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
108109
def close(self) -> None:
109110
self._client.close()
110111

111-
def __enter__(self) -> "AzureCommunicationCallAutomationService":
112+
def __enter__(self) -> Self:
112113
self._client.__enter__()
113114
return self
114115

sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/_serialization.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ def _json_attemp(data):
144144
# context otherwise.
145145
_LOGGER.critical("Wasn't XML not JSON, failing")
146146
raise DeserializationError("XML is invalid") from err
147+
elif content_type.startswith("text/"):
148+
return data_as_str
147149
raise DeserializationError("Cannot deserialize content-type: {}".format(content_type))
148150

149151
@classmethod
@@ -1441,7 +1443,7 @@ def _deserialize(self, target_obj, data):
14411443
elif isinstance(response, type) and issubclass(response, Enum):
14421444
return self.deserialize_enum(data, response)
14431445

1444-
if data is None:
1446+
if data is None or data is CoreNull:
14451447
return data
14461448
try:
14471449
attributes = response._attribute_map # type: ignore

sdk/communication/azure-communication-callautomation/azure/communication/callautomation/_generated/aio/_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from copy import deepcopy
1010
from typing import Any, Awaitable
11+
from typing_extensions import Self
1112

1213
from azure.core import AsyncPipelineClient
1314
from azure.core.credentials import AzureKeyCredential
@@ -111,7 +112,7 @@ def send_request(
111112
async def close(self) -> None:
112113
await self._client.close()
113114

114-
async def __aenter__(self) -> "AzureCommunicationCallAutomationService":
115+
async def __aenter__(self) -> Self:
115116
await self._client.__aenter__()
116117
return self
117118

0 commit comments

Comments
 (0)