Skip to content

Commit f688888

Browse files
committed
CallLocator schema and deserializer change based on latest swagger.
1 parent f173513 commit f688888

File tree

2 files changed

+11
-20
lines changed

2 files changed

+11
-20
lines changed

sdk/communication/azure-communication-callingserver/azure/communication/callingserver/_communication_call_locator_serializer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ def deserialize_call_locator(call_locator_model):
4444
:return: CallLocator
4545
"""
4646

47-
if call_locator_model.group_call_locator:
48-
return GroupCallLocator(call_locator_model.group_call_locator.group_id)
49-
if call_locator_model.server_call_locator:
50-
return ServerCallLocator(call_locator_model.server_call_locator.server_call_id)
47+
if call_locator_model.group_call_id and call_locator_model.kind == "groupCallLocator":
48+
return GroupCallLocator(call_locator_model.group_call_id)
49+
if call_locator_model.server_call_id and call_locator_model.kind == "serverCallLocator":
50+
return ServerCallLocator(call_locator_model.server_call_id)
5151
return None

sdk/communication/azure-communication-callingserver/azure/communication/callingserver/_models.py

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
class CallLocatorKind(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
2525
"""Call Locator Kind."""
2626

27-
GROUP_CALL_LOCATOR = "group_call_locator"
28-
SERVER_CALL_LOCATOR = "server_call_locator"
27+
GROUP_CALL_LOCATOR = "groupCallLocator"
28+
SERVER_CALL_LOCATOR = "serverCallLocator"
2929

3030
class CallLocator(object):
3131
"""Call Locator.
@@ -34,14 +34,10 @@ class CallLocator(object):
3434
:vartype kind: str or CallLocatorKind
3535
:ivar Mapping[str, Any] properties: The properties of the locator.
3636
"""
37+
id = None # type: Optional[str]
3738
kind = None # type: Optional[Union[CallLocatorKind, str]]
3839
properties = {} # type: Mapping[str, Any]
3940

40-
GroupCallProperties = TypedDict(
41-
'GroupCallProperties',
42-
id=str
43-
)
44-
4541
class GroupCallLocator(CallLocator):
4642
"""The group call locator.
4743
@@ -62,13 +58,8 @@ def __init__(self, id):
6258
# type: (str) -> None
6359
if not id:
6460
raise ValueError("id can not be None or empty")
65-
66-
self.properties = GroupCallProperties(id=id)
67-
68-
ServerCallProperties = TypedDict(
69-
'ServerCallProperties',
70-
id=str
71-
)
61+
self.id = id
62+
self.properties = {}
7263

7364
class ServerCallLocator(CallLocator):
7465
"""The server call locator.
@@ -90,8 +81,8 @@ def __init__(self, id):
9081
# type: (str) -> None
9182
if not id:
9283
raise ValueError("id can not be None or empty")
93-
94-
self.properties = ServerCallProperties(id=id)
84+
self.id = id
85+
self.properties = {}
9586

9687
class CreateCallOptions(object):
9788
"""The options for creating a call.

0 commit comments

Comments
 (0)