Skip to content

Commit 4b18edf

Browse files
committed
Update PR
1 parent ad9f0ca commit 4b18edf

10 files changed

+81
-72
lines changed

sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_communication_relay_client.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
as CommunicationNetworkTraversalClientGen
1414
from ._shared.utils import parse_connection_str, get_authentication_policy
1515
from ._version import SDK_MONIKER
16+
from ._generated.models import CommunicationRelayConfiguration
1617

1718
if TYPE_CHECKING:
1819
from azure.core.credentials import TokenCredential
1920
from azure.communication.identity import CommunicationUserIdentifier
21+
from azure.communication.networktraversal import RouteType
2022

2123
class CommunicationRelayClient(object):
2224
"""Azure Communication Services Relay client.
@@ -84,12 +86,16 @@ def from_connection_string(
8486
@distributed_trace
8587
def get_relay_configuration(
8688
self,
87-
user: 'CommunicationUserIdentifier' = None,
88-
route_type: 'CommunicationRelayConfigurationRequestRouteType' = None,
89+
user=None, # type: CommunicationUserIdentifier
90+
route_type=None, #type: RouteType
8991
**kwargs # type: Any
90-
) -> 'CommunicationRelayConfiguration':
92+
):
93+
# type: (...) -> CommunicationRelayConfiguration
9194
"""get a Communication Relay configuration
92-
:param: CommunicationUserIdentifier user: A user from which we will get an id
95+
:param user: Azure Communication User
96+
:type user: ~azure.communication.identity.CommunicationUserIdentifier
97+
:param route_type: Azure Communication Route Type
98+
:type route_type: ~azure.communication.networktraversal.RouteType
9399
:return: CommunicationRelayConfiguration
94100
:rtype: ~azure.communication.networktraversal.models.CommunicationRelayConfiguration
95101
"""

sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/aio/_communication_relay_client_async.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ async def get_relay_configuration(
8888
**kwargs # type: Any
8989
) -> 'CommunicationRelayConfiguration':
9090
"""get a Communication Relay configuration.
91-
:param: CommunicationUserIdentifier user: A user from which we will get an id
91+
:param user: Azure Communication User
92+
:type user: ~azure.communication.identity.CommunicationUserIdentifier
93+
:param route_type: Azure Communication Route Type
94+
:type route_type: ~azure.communication.networktraversal.RouteType
9295
:return: CommunicationRelayConfiguration
9396
:rtype: ~azure.communication.networktraversal.models.CommunicationRelayConfiguration
9497
"""

sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration.yaml

+11-11
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ interactions:
1515
User-Agent:
1616
- azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0)
1717
x-ms-date:
18-
- Tue, 16 Nov 2021 04:40:46 GMT
18+
- Tue, 16 Nov 2021 18:12:13 GMT
1919
x-ms-return-client-request-id:
2020
- 'true'
2121
method: POST
@@ -32,17 +32,17 @@ interactions:
3232
content-type:
3333
- application/json; charset=utf-8
3434
date:
35-
- Tue, 16 Nov 2021 04:40:46 GMT
35+
- Tue, 16 Nov 2021 18:12:13 GMT
3636
ms-cv:
37-
- qI09mrYTPUuAtVj/PabBww.0
37+
- rMk10TBNvUqvS4oHz1IS/A.0
3838
request-context:
3939
- appId=
4040
strict-transport-security:
4141
- max-age=2592000
4242
x-cache:
4343
- CONFIG_NOCACHE
4444
x-processing-time:
45-
- 23ms
45+
- 22ms
4646
status:
4747
code: 201
4848
message: Created
@@ -62,7 +62,7 @@ interactions:
6262
User-Agent:
6363
- azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0)
6464
x-ms-date:
65-
- Tue, 16 Nov 2021 04:40:46 GMT
65+
- Tue, 16 Nov 2021 18:12:13 GMT
6666
x-ms-return-client-request-id:
6767
- 'true'
6868
method: POST
@@ -72,27 +72,27 @@ interactions:
7272
string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"],
7373
"username": "sanitized", "credential": "sanitized"}, {"routeType": "nearest",
7474
"urls": ["stun:13.107.17.41:3478", "turn:13.107.17.41:3478"], "username":
75-
"BQAANnQYA/8B19w2XJI64cWPuSblG0LB/y/+9Z+Xbm4AAAAMARCsgNlqhd5IsZldo6P6NifI1sBqyfp3/I9YO2DhmIV60ZOijWg=",
76-
"credential": "K6OG/tyorha4BEYTKagDZt+cxG8="}], "expiresOn": "2021-11-16T04:40:46.495112+00:00"}'
75+
"BQAANs/yomQB19ynHsyCrY2MbvzaJwv0gMDo0xYRPUkAAAAMARCsgNlqhd5IsZldo6P6NifIRdfvTVWYnnh2/8NGGhXsQ4Rxtr4=",
76+
"credential": "lOKKYLHezJ6nfn9w2XkK4VLnn6w="}], "expiresOn": "2021-11-16T18:12:13.7183673+00:00"}'
7777
headers:
7878
api-supported-versions:
7979
- 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview
8080
content-length:
81-
- '559'
81+
- '560'
8282
content-type:
8383
- application/json; charset=utf-8
8484
date:
85-
- Tue, 16 Nov 2021 04:40:46 GMT
85+
- Tue, 16 Nov 2021 18:12:13 GMT
8686
ms-cv:
87-
- h9Fh2W/OIUWhTVn9wTM1oQ.0
87+
- a8WXPhWFpEKMOH10HY4JQw.0
8888
request-context:
8989
- appId=
9090
strict-transport-security:
9191
- max-age=2592000
9292
x-cache:
9393
- CONFIG_NOCACHE
9494
x-processing-time:
95-
- 80ms
95+
- 21ms
9696
status:
9797
code: 200
9898
message: OK

sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_any.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ interactions:
1515
User-Agent:
1616
- azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0)
1717
x-ms-date:
18-
- Tue, 16 Nov 2021 04:40:46 GMT
18+
- Tue, 16 Nov 2021 18:12:13 GMT
1919
x-ms-return-client-request-id:
2020
- 'true'
2121
method: POST
@@ -32,9 +32,9 @@ interactions:
3232
content-type:
3333
- application/json; charset=utf-8
3434
date:
35-
- Tue, 16 Nov 2021 04:40:46 GMT
35+
- Tue, 16 Nov 2021 18:12:13 GMT
3636
ms-cv:
37-
- BfDeZYO3AEyM5dy+AnonDw.0
37+
- tMAatS3hakCNEz7IBeVQuw.0
3838
request-context:
3939
- appId=
4040
strict-transport-security:
@@ -62,15 +62,15 @@ interactions:
6262
User-Agent:
6363
- azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0)
6464
x-ms-date:
65-
- Tue, 16 Nov 2021 04:40:46 GMT
65+
- Tue, 16 Nov 2021 18:12:13 GMT
6666
x-ms-return-client-request-id:
6767
- 'true'
6868
method: POST
6969
uri: https://sanitized.communication.azure.com/networktraversal/:issueRelayConfiguration?api-version=2021-10-08-preview
7070
response:
7171
body:
7272
string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"],
73-
"username": "sanitized", "credential": "sanitized"}], "expiresOn": "2021-11-16T04:40:46.7398695+00:00"}'
73+
"username": "sanitized", "credential": "sanitized"}], "expiresOn": "2021-11-16T18:12:14.2059608+00:00"}'
7474
headers:
7575
api-supported-versions:
7676
- 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview
@@ -79,17 +79,17 @@ interactions:
7979
content-type:
8080
- application/json; charset=utf-8
8181
date:
82-
- Tue, 16 Nov 2021 04:40:46 GMT
82+
- Tue, 16 Nov 2021 18:12:14 GMT
8383
ms-cv:
84-
- ip6U5Ji77k+Q1DO1+2Gg0w.0
84+
- A7op7aWw7E2ZCoEwl5fAmA.0
8585
request-context:
8686
- appId=
8787
strict-transport-security:
8888
- max-age=2592000
8989
x-cache:
9090
- CONFIG_NOCACHE
9191
x-processing-time:
92-
- 22ms
92+
- 251ms
9393
status:
9494
code: 200
9595
message: OK

sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_with_route_type_nearest.yaml

+9-9
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ interactions:
1515
User-Agent:
1616
- azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0)
1717
x-ms-date:
18-
- Tue, 16 Nov 2021 04:40:46 GMT
18+
- Tue, 16 Nov 2021 18:12:14 GMT
1919
x-ms-return-client-request-id:
2020
- 'true'
2121
method: POST
@@ -32,17 +32,17 @@ interactions:
3232
content-type:
3333
- application/json; charset=utf-8
3434
date:
35-
- Tue, 16 Nov 2021 04:40:46 GMT
35+
- Tue, 16 Nov 2021 18:12:14 GMT
3636
ms-cv:
37-
- gI04zYnvoUy8jBb5Y1wBSQ.0
37+
- CmiBTU1NwEyy87FuhEBK7A.0
3838
request-context:
3939
- appId=
4040
strict-transport-security:
4141
- max-age=2592000
4242
x-cache:
4343
- CONFIG_NOCACHE
4444
x-processing-time:
45-
- 25ms
45+
- 27ms
4646
status:
4747
code: 201
4848
message: Created
@@ -62,7 +62,7 @@ interactions:
6262
User-Agent:
6363
- azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0)
6464
x-ms-date:
65-
- Tue, 16 Nov 2021 04:40:46 GMT
65+
- Tue, 16 Nov 2021 18:12:14 GMT
6666
x-ms-return-client-request-id:
6767
- 'true'
6868
method: POST
@@ -71,7 +71,7 @@ interactions:
7171
body:
7272
string: '{"iceServers": [{"routeType": "nearest", "urls": ["turn.skype.com",
7373
"turn:13.107.17.41:3478"], "username": "sanitized", "credential": "sanitized"}],
74-
"expiresOn": "2021-11-16T04:40:47.0013447+00:00"}'
74+
"expiresOn": "2021-11-16T18:12:14.4601949+00:00"}'
7575
headers:
7676
api-supported-versions:
7777
- 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview
@@ -80,17 +80,17 @@ interactions:
8080
content-type:
8181
- application/json; charset=utf-8
8282
date:
83-
- Tue, 16 Nov 2021 04:40:46 GMT
83+
- Tue, 16 Nov 2021 18:12:13 GMT
8484
ms-cv:
85-
- 2x+A1+Jba0WqkXohqm0ICQ.0
85+
- Nb3xPuBb/Uakdw1OPiFXNw.0
8686
request-context:
8787
- appId=
8888
strict-transport-security:
8989
- max-age=2592000
9090
x-cache:
9191
- CONFIG_NOCACHE
9292
x-processing-time:
93-
- 23ms
93+
- 21ms
9494
status:
9595
code: 200
9696
message: OK

sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client.test_get_relay_configuration_without_identity.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ interactions:
1515
User-Agent:
1616
- azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0)
1717
x-ms-date:
18-
- Tue, 16 Nov 2021 04:40:47 GMT
18+
- Tue, 16 Nov 2021 18:12:14 GMT
1919
x-ms-return-client-request-id:
2020
- 'true'
2121
method: POST
@@ -25,8 +25,8 @@ interactions:
2525
string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"],
2626
"username": "sanitized", "credential": "sanitized"}, {"routeType": "nearest",
2727
"urls": ["stun:13.107.17.41:3478", "turn:13.107.17.41:3478"], "username":
28-
"BQAANnSBao0B19w2X3qe7o9e7W+6rvySC4FEqP0Jp0QAAAAMARCsgNlqhd5IsZldo6P6NifIf0Y1au0lIjmsCWlNNw3+1jt/4FE=",
29-
"credential": "jcE0W+ai0GTWM29K0Q4nnsVS4UI="}], "expiresOn": "2021-11-16T04:40:47.1711817+00:00"}'
28+
"BQAANtBz/NYB19yn7SY1nkF612kTjgmPttjhkO6JCNwAAAAMARCsgNlqhd5IsZldo6P6NifID2+vKJ0vXLUjx7ZnoagxJH/7578=",
29+
"credential": "HaIJfgMzmK926LaQhAYHwNHmcl8="}], "expiresOn": "2021-11-16T18:12:14.5755767+00:00"}'
3030
headers:
3131
api-supported-versions:
3232
- 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview
@@ -35,9 +35,9 @@ interactions:
3535
content-type:
3636
- application/json; charset=utf-8
3737
date:
38-
- Tue, 16 Nov 2021 04:40:46 GMT
38+
- Tue, 16 Nov 2021 18:12:14 GMT
3939
ms-cv:
40-
- 7iXw5vjfgkGvhAx8VKBp2Q.0
40+
- tkBLnT2bVEOs+LkVHtAWtA.0
4141
request-context:
4242
- appId=
4343
strict-transport-security:

sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration.yaml

+10-10
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interactions:
1111
User-Agent:
1212
- azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0)
1313
x-ms-date:
14-
- Tue, 16 Nov 2021 04:40:47 GMT
14+
- Tue, 16 Nov 2021 18:12:14 GMT
1515
x-ms-return-client-request-id:
1616
- 'true'
1717
method: POST
@@ -24,12 +24,12 @@ interactions:
2424
2021-03-31-preview1, 2021-10-31-preview, 2021-11-01
2525
content-length: '101'
2626
content-type: application/json; charset=utf-8
27-
date: Tue, 16 Nov 2021 04:40:46 GMT
28-
ms-cv: 3+1oH5z9t0OADoly/cuolA.0
27+
date: Tue, 16 Nov 2021 18:12:14 GMT
28+
ms-cv: BWgT7mkiqkqAXPurnvmOog.0
2929
request-context: appId=
3030
strict-transport-security: max-age=2592000
3131
x-cache: CONFIG_NOCACHE
32-
x-processing-time: 26ms
32+
x-processing-time: 24ms
3333
status:
3434
code: 201
3535
message: Created
@@ -46,7 +46,7 @@ interactions:
4646
User-Agent:
4747
- azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0)
4848
x-ms-date:
49-
- Tue, 16 Nov 2021 04:40:47 GMT
49+
- Tue, 16 Nov 2021 18:12:14 GMT
5050
x-ms-return-client-request-id:
5151
- 'true'
5252
method: POST
@@ -56,18 +56,18 @@ interactions:
5656
string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"],
5757
"username": "sanitized", "credential": "sanitized"}, {"routeType": "nearest",
5858
"urls": ["stun:13.107.17.41:3478", "turn:13.107.17.41:3478"], "username":
59-
"BQAANnSXU4EB19w2aCWTWAJL01t6XoklNPG7HphtE/8AAAAMARCsgNlqhd5IsZldo6P6NifIEHLHZlovGBYG/Um0CEiYowfIPEM=",
60-
"credential": "zQTkxP2TkfXcd37rPKsaK8x47mE="}], "expiresOn": "2021-11-16T04:40:47.3233983+00:00"}'
59+
"BQAANtCRunEB19ynz1zYrstqWuXcDScC9OxMUAmTSGYAAAAMARCsgNlqhd5IsZldo6P6NifIxO0N8PGDcYESPk3DLuFqQUanDuI=",
60+
"credential": "xymBhFWwcyX8FqwGvSK7IiPA2Mo="}], "expiresOn": "2021-11-16T18:12:14.7734624+00:00"}'
6161
headers:
6262
api-supported-versions: 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview
6363
content-length: '560'
6464
content-type: application/json; charset=utf-8
65-
date: Tue, 16 Nov 2021 04:40:46 GMT
66-
ms-cv: adJLtbC3R02Dl6M5sFljLw.0
65+
date: Tue, 16 Nov 2021 18:12:14 GMT
66+
ms-cv: VfNWUpSrr0K5aKqXSx3qTQ.0
6767
request-context: appId=
6868
strict-transport-security: max-age=2592000
6969
x-cache: CONFIG_NOCACHE
70-
x-processing-time: 22ms
70+
x-processing-time: 34ms
7171
status:
7272
code: 200
7373
message: OK

sdk/communication/azure-communication-networktraversal/tests/recordings/test_communication_relay_client_async.test_get_relay_configuration_with_route_type_any.yaml

+9-9
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interactions:
1111
User-Agent:
1212
- azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0)
1313
x-ms-date:
14-
- Tue, 16 Nov 2021 04:40:47 GMT
14+
- Tue, 16 Nov 2021 18:12:14 GMT
1515
x-ms-return-client-request-id:
1616
- 'true'
1717
method: POST
@@ -24,12 +24,12 @@ interactions:
2424
2021-03-31-preview1, 2021-10-31-preview, 2021-11-01
2525
content-length: '101'
2626
content-type: application/json; charset=utf-8
27-
date: Tue, 16 Nov 2021 04:40:47 GMT
28-
ms-cv: m/sTsHdtBUSU/ZLS1u+p4w.0
27+
date: Tue, 16 Nov 2021 18:12:14 GMT
28+
ms-cv: LEAkDfI/fEi/OJCg03CiIQ.0
2929
request-context: appId=
3030
strict-transport-security: max-age=2592000
3131
x-cache: CONFIG_NOCACHE
32-
x-processing-time: 23ms
32+
x-processing-time: 28ms
3333
status:
3434
code: 201
3535
message: Created
@@ -46,21 +46,21 @@ interactions:
4646
User-Agent:
4747
- azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0)
4848
x-ms-date:
49-
- Tue, 16 Nov 2021 04:40:47 GMT
49+
- Tue, 16 Nov 2021 18:12:14 GMT
5050
x-ms-return-client-request-id:
5151
- 'true'
5252
method: POST
5353
uri: https://sanitized.communication.azure.com/networktraversal/:issueRelayConfiguration?api-version=2021-10-08-preview
5454
response:
5555
body:
5656
string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"],
57-
"username": "sanitized", "credential": "sanitized"}], "expiresOn": "2021-11-16T04:40:47.511629+00:00"}'
57+
"username": "sanitized", "credential": "sanitized"}], "expiresOn": "2021-11-16T18:12:14.9614738+00:00"}'
5858
headers:
5959
api-supported-versions: 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview
60-
content-length: '318'
60+
content-length: '319'
6161
content-type: application/json; charset=utf-8
62-
date: Tue, 16 Nov 2021 04:40:47 GMT
63-
ms-cv: d49KyvQFC0Cf2j4Au4SALQ.0
62+
date: Tue, 16 Nov 2021 18:12:14 GMT
63+
ms-cv: t/AVmHA780enpqECFu5waw.0
6464
request-context: appId=
6565
strict-transport-security: max-age=2592000
6666
x-cache: CONFIG_NOCACHE

0 commit comments

Comments
 (0)