-
Notifications
You must be signed in to change notification settings - Fork 3k
SipRouting trunk setting sdk changes. #39858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
API change check APIView has identified API level changes in this PR and created following API reviews. |
User Story 3920786: SDK Implementation: Python
|
...communication-phonenumbers/azure/communication/phonenumbers/siprouting/_generated/_client.py
Show resolved
Hide resolved
...unication-phonenumbers/azure/communication/phonenumbers/siprouting/_generated/aio/_client.py
Show resolved
Hide resolved
...ommunication-phonenumbers/azure/communication/phonenumbers/siprouting/_sip_routing_client.py
Outdated
Show resolved
Hide resolved
...on-phonenumbers/azure/communication/phonenumbers/siprouting/aio/_sip_routing_client_async.py
Outdated
Show resolved
Hide resolved
...ommunication-phonenumbers/azure/communication/phonenumbers/siprouting/_sip_routing_client.py
Outdated
Show resolved
Hide resolved
...on-phonenumbers/azure/communication/phonenumbers/siprouting/aio/_sip_routing_client_async.py
Outdated
Show resolved
Hide resolved
...ommunication-phonenumbers/azure/communication/phonenumbers/siprouting/_sip_routing_client.py
Outdated
Show resolved
Hide resolved
...on-phonenumbers/azure/communication/phonenumbers/siprouting/aio/_sip_routing_client_async.py
Outdated
Show resolved
Hide resolved
...ommunication-phonenumbers/azure/communication/phonenumbers/siprouting/_sip_routing_client.py
Outdated
Show resolved
Hide resolved
...on-phonenumbers/azure/communication/phonenumbers/siprouting/aio/_sip_routing_client_async.py
Outdated
Show resolved
Hide resolved
...ommunication-phonenumbers/azure/communication/phonenumbers/siprouting/_sip_routing_client.py
Outdated
Show resolved
Hide resolved
...on-phonenumbers/azure/communication/phonenumbers/siprouting/aio/_sip_routing_client_async.py
Outdated
Show resolved
Hide resolved
...on-phonenumbers/azure/communication/phonenumbers/siprouting/aio/_sip_routing_client_async.py
Outdated
Show resolved
Hide resolved
...ommunication-phonenumbers/azure/communication/phonenumbers/siprouting/_sip_routing_client.py
Outdated
Show resolved
Hide resolved
...ommunication-phonenumbers/azure/communication/phonenumbers/siprouting/_sip_routing_client.py
Outdated
Show resolved
Hide resolved
...on-phonenumbers/azure/communication/phonenumbers/siprouting/aio/_sip_routing_client_async.py
Outdated
Show resolved
Hide resolved
...ommunication-phonenumbers/azure/communication/phonenumbers/siprouting/_sip_routing_client.py
Outdated
Show resolved
Hide resolved
...ommunication-phonenumbers/azure/communication/phonenumbers/siprouting/_sip_routing_client.py
Outdated
Show resolved
Hide resolved
...on-phonenumbers/azure/communication/phonenumbers/siprouting/aio/_sip_routing_client_async.py
Outdated
Show resolved
Hide resolved
...ommunication-phonenumbers/azure/communication/phonenumbers/siprouting/_sip_routing_client.py
Outdated
Show resolved
Hide resolved
...ommunication-phonenumbers/azure/communication/phonenumbers/siprouting/_sip_routing_client.py
Outdated
Show resolved
Hide resolved
sdk/communication/azure-communication-phonenumbers/swagger/SIP_ROUTING_SWAGGER.md
Show resolved
Hide resolved
sdk/communication/azure-communication-phonenumbers/swagger/SIP_ROUTING_SWAGGER.md
Outdated
Show resolved
Hide resolved
...ommunication-phonenumbers/azure/communication/phonenumbers/siprouting/_sip_routing_client.py
Outdated
Show resolved
Hide resolved
...ommunication-phonenumbers/azure/communication/phonenumbers/siprouting/_sip_routing_client.py
Outdated
Show resolved
Hide resolved
...on-phonenumbers/azure/communication/phonenumbers/siprouting/aio/_sip_routing_client_async.py
Show resolved
Hide resolved
...ommunication-phonenumbers/azure/communication/phonenumbers/siprouting/_sip_routing_client.py
Show resolved
Hide resolved
...ion/azure-communication-phonenumbers/azure/communication/phonenumbers/siprouting/__init__.py
Outdated
Show resolved
Hide resolved
...tion/azure-communication-phonenumbers/azure/communication/phonenumbers/siprouting/_models.py
Outdated
Show resolved
Hide resolved
...ommunication-phonenumbers/azure/communication/phonenumbers/siprouting/_sip_routing_client.py
Outdated
Show resolved
Hide resolved
...ommunication-phonenumbers/azure/communication/phonenumbers/siprouting/_sip_routing_client.py
Outdated
Show resolved
Hide resolved
...on-phonenumbers/azure/communication/phonenumbers/siprouting/aio/_sip_routing_client_async.py
Outdated
Show resolved
Hide resolved
...on-phonenumbers/azure/communication/phonenumbers/siprouting/aio/_sip_routing_client_async.py
Outdated
Show resolved
Hide resolved
@@ -238,10 +254,148 @@ async def set_routes( | |||
] | |||
await self._rest_service.sip_routing.update(body=SipConfiguration(routes=routes_internal), **kwargs) | |||
|
|||
@distributed_trace_async | |||
async def test_routes_with_number_async( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feedback from review:
Change the function def to:
async def get_routes_for_number(self, target_phone_number:str, test_routes: SipTrunkRoute[], **kwargs: Any) : # type: (...) -> SipTrunkRoute[]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function accepts array of routes, internally maps it to SipConfiguration and sends it to API. The response "RoutesForNumber" object is not exposed, instead we just return the contained list of matching routes.
@@ -235,10 +249,148 @@ def set_routes( | |||
] | |||
self._rest_service.sip_routing.update(body=SipConfiguration(routes=routes_internal), **kwargs) | |||
|
|||
@distributed_trace | |||
def test_routes_with_number( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feedback from review:
Change the function def to:
def get_routes_for_number(self, target_phone_number: str, test_routes: SipTrunkRoute[], **kwargs: Any): # type: (...) -> SipTrunkRoute[]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, internally map the test_routes to sipConfiguration and send it to API. And when receiving the response from API, map the resulting RoutesForNumber to SipTrunkRoute[] and return only that.
@@ -83,20 +85,26 @@ def from_connection_string( | |||
async def get_trunk( | |||
self, | |||
trunk_fqdn, # type: str | |||
include_health: Optional[bool] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feedback from review:
Remove include_health parameter and just always return trunk health (always call the GET API with the ExpandEnum.TRUNKS_HEALTH parameter)
@@ -141,10 +149,14 @@ async def delete_trunk( | |||
|
|||
@distributed_trace | |||
def list_trunks( | |||
self, **kwargs # type: Any | |||
self, | |||
include_health: Optional[bool] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feedback from review:
Remove include_health parameter and just always return trunk health (always call the GET API with the ExpandEnum.TRUNKS_HEALTH parameter)
@@ -138,10 +144,14 @@ def delete_trunk( | |||
|
|||
@distributed_trace | |||
def list_trunks( | |||
self, **kwargs # type: Any | |||
self, | |||
include_health: Optional[bool] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feedback from review:
Remove include_health parameter and just always return trunk health (always call the GET API with the ExpandEnum.TRUNKS_HEALTH parameter)
@@ -80,20 +82,24 @@ def from_connection_string( | |||
def get_trunk( | |||
self, | |||
trunk_fqdn, # type: str | |||
include_health: Optional[bool] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feedback from review:
Remove include_health parameter and just always return trunk health (always call the GET API with the ExpandEnum.TRUNKS_HEALTH parameter)
from: swagger-document | ||
where: "$.definitions.OverallHealth" | ||
transform: > | ||
$.properties.reason["x-ms-enum"].name = "UnhealthyStatusReason"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feedback from review:
Rename the UnhealthyStatusReason to HealthStatusReason, so change this directive to:
Directive renaming "InactiveStatusReason" enum to "HealthStatusReason"
directive:
from: swagger-document
where: "$.definitions.OverallHealth"
transform: >
$.properties.reason["x-ms-enum"].name = "HealthStatusReason";
And regenerate the code.
} | ||
|
||
_attribute_map = { | ||
"enabled": {"key": "enabled", "type": "bool"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing "fqdn" property. Please add it and also add it to constructor (similarly as enabled).
Description
Please add an informative description that covers that changes made by the pull request and link all relevant issues.
If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines