Skip to content

Commit

Permalink
Update PR, fixes with API view
Browse files Browse the repository at this point in the history
  • Loading branch information
AriZavala2 committed Nov 16, 2021
1 parent 3dcaedc commit d482b99
Show file tree
Hide file tree
Showing 13 changed files with 150 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Licensed under the MIT License.
# ------------------------------------

from typing import TYPE_CHECKING, Any
from typing import TYPE_CHECKING

from azure.core.tracing.decorator import distributed_trace

Expand All @@ -13,7 +13,6 @@
as CommunicationNetworkTraversalClientGen
from ._shared.utils import parse_connection_str, get_authentication_policy
from ._version import SDK_MONIKER
from ._generated.models import CommunicationRelayConfiguration

if TYPE_CHECKING:
from azure.core.credentials import TokenCredential
Expand Down Expand Up @@ -85,15 +84,14 @@ def from_connection_string(
@distributed_trace
def get_relay_configuration(
self,
user=None, # type: CommunicationUserIdentifier
route_type=None, #type: RouteType
user: 'CommunicationUserIdentifier' = None,
route_type: 'CommunicationRelayConfigurationRequestRouteType' = None,
**kwargs # type: Any
):
# type: (Any) -> CommunicationRelayConfiguration
) -> 'CommunicationRelayConfiguration':
"""get a Communication Relay configuration
:param: CommunicationUserIdentifier user: A user from which we will get an id
:return: CommunicationRelayConfiguration
:rtype: ~azure.communication.networktraversal.CommunicationRelayConfiguration
:rtype: ~azure.communication.networktraversal.models.CommunicationRelayConfiguration
"""
if user is None:
return self._network_traversal_service_client.communication_network_traversal.issue_relay_configuration(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
from .._generated.models import RouteType

__all__ = [
'CommunicationRelayClient'
'CommunicationRelayClient',
'RouteType'
]
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ async def get_relay_configuration(
"""get a Communication Relay configuration.
:param: CommunicationUserIdentifier user: A user from which we will get an id
:return: CommunicationRelayConfiguration
:rtype: ~azure.communication.networktraversal.CommunicationRelayConfiguration
:rtype: ~azure.communication.networktraversal.models.CommunicationRelayConfiguration
"""
if user is None:
return await self._network_traversal_service_client.communication_network_traversal. \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interactions:
User-Agent:
- azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0)
x-ms-date:
- Wed, 10 Nov 2021 22:11:50 GMT
- Tue, 16 Nov 2021 04:40:46 GMT
x-ms-return-client-request-id:
- 'true'
method: POST
Expand All @@ -26,23 +26,23 @@ interactions:
headers:
api-supported-versions:
- 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1,
2021-10-31-preview
2021-10-31-preview, 2021-11-01
content-length:
- '101'
content-type:
- application/json; charset=utf-8
date:
- Wed, 10 Nov 2021 22:11:50 GMT
- Tue, 16 Nov 2021 04:40:46 GMT
ms-cv:
- vug3lSbrLUeWHAoTQF9K8A.0
- qI09mrYTPUuAtVj/PabBww.0
request-context:
- appId=
strict-transport-security:
- max-age=2592000
x-cache:
- CONFIG_NOCACHE
x-processing-time:
- 44ms
- 23ms
status:
code: 201
message: Created
Expand All @@ -62,7 +62,7 @@ interactions:
User-Agent:
- azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0)
x-ms-date:
- Wed, 10 Nov 2021 22:11:50 GMT
- Tue, 16 Nov 2021 04:40:46 GMT
x-ms-return-client-request-id:
- 'true'
method: POST
Expand All @@ -72,27 +72,27 @@ interactions:
string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"],
"username": "sanitized", "credential": "sanitized"}, {"routeType": "nearest",
"urls": ["stun:13.107.17.41:3478", "turn:13.107.17.41:3478"], "username":
"BQAANksGVt4B19gS8Lb+vxW6oP1nmVTKtyyuY+TSztUAAAAMARCsgNlqhd5IsZldo6P6NifI1W7m/58vAl5NNuX7wFldw/QrbrI=",
"credential": "qXWLvJMJvz1ERUrh2Rgbq5W7/rg="}], "expiresOn": "2021-11-10T22:11:51.0590396+00:00"}'
"BQAANnQYA/8B19w2XJI64cWPuSblG0LB/y/+9Z+Xbm4AAAAMARCsgNlqhd5IsZldo6P6NifI1sBqyfp3/I9YO2DhmIV60ZOijWg=",
"credential": "K6OG/tyorha4BEYTKagDZt+cxG8="}], "expiresOn": "2021-11-16T04:40:46.495112+00:00"}'
headers:
api-supported-versions:
- 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview
content-length:
- '560'
- '559'
content-type:
- application/json; charset=utf-8
date:
- Wed, 10 Nov 2021 22:11:51 GMT
- Tue, 16 Nov 2021 04:40:46 GMT
ms-cv:
- Z5bc4Wnyz0+tCw6tOOvbNQ.0
- h9Fh2W/OIUWhTVn9wTM1oQ.0
request-context:
- appId=
strict-transport-security:
- max-age=2592000
x-cache:
- CONFIG_NOCACHE
x-processing-time:
- 23ms
- 80ms
status:
code: 200
message: OK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interactions:
User-Agent:
- azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0)
x-ms-date:
- Wed, 10 Nov 2021 22:11:51 GMT
- Tue, 16 Nov 2021 04:40:46 GMT
x-ms-return-client-request-id:
- 'true'
method: POST
Expand All @@ -26,15 +26,15 @@ interactions:
headers:
api-supported-versions:
- 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1,
2021-10-31-preview
2021-10-31-preview, 2021-11-01
content-length:
- '101'
content-type:
- application/json; charset=utf-8
date:
- Wed, 10 Nov 2021 22:11:50 GMT
- Tue, 16 Nov 2021 04:40:46 GMT
ms-cv:
- pea7KFeta0yz+d5I+l5x5A.0
- BfDeZYO3AEyM5dy+AnonDw.0
request-context:
- appId=
strict-transport-security:
Expand Down Expand Up @@ -62,15 +62,15 @@ interactions:
User-Agent:
- azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0)
x-ms-date:
- Wed, 10 Nov 2021 22:11:51 GMT
- Tue, 16 Nov 2021 04:40:46 GMT
x-ms-return-client-request-id:
- 'true'
method: POST
uri: https://sanitized.communication.azure.com/networktraversal/:issueRelayConfiguration?api-version=2021-10-08-preview
response:
body:
string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"],
"username": "sanitized", "credential": "sanitized"}], "expiresOn": "2021-11-10T22:11:51.6345782+00:00"}'
"username": "sanitized", "credential": "sanitized"}], "expiresOn": "2021-11-16T04:40:46.7398695+00:00"}'
headers:
api-supported-versions:
- 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview
Expand All @@ -79,17 +79,17 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Wed, 10 Nov 2021 22:11:51 GMT
- Tue, 16 Nov 2021 04:40:46 GMT
ms-cv:
- JQL72YekxEO0P35AwHKGwQ.0
- ip6U5Ji77k+Q1DO1+2Gg0w.0
request-context:
- appId=
strict-transport-security:
- max-age=2592000
x-cache:
- CONFIG_NOCACHE
x-processing-time:
- 88ms
- 22ms
status:
code: 200
message: OK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interactions:
User-Agent:
- azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0)
x-ms-date:
- Wed, 10 Nov 2021 22:11:51 GMT
- Tue, 16 Nov 2021 04:40:46 GMT
x-ms-return-client-request-id:
- 'true'
method: POST
Expand All @@ -26,23 +26,23 @@ interactions:
headers:
api-supported-versions:
- 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07, 2021-03-31-preview1,
2021-10-31-preview
2021-10-31-preview, 2021-11-01
content-length:
- '101'
content-type:
- application/json; charset=utf-8
date:
- Wed, 10 Nov 2021 22:11:51 GMT
- Tue, 16 Nov 2021 04:40:46 GMT
ms-cv:
- qh9OWFVE6UivRoo1YLvO0w.0
- gI04zYnvoUy8jBb5Y1wBSQ.0
request-context:
- appId=
strict-transport-security:
- max-age=2592000
x-cache:
- CONFIG_NOCACHE
x-processing-time:
- 24ms
- 25ms
status:
code: 201
message: Created
Expand All @@ -62,7 +62,7 @@ interactions:
User-Agent:
- azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0)
x-ms-date:
- Wed, 10 Nov 2021 22:11:51 GMT
- Tue, 16 Nov 2021 04:40:46 GMT
x-ms-return-client-request-id:
- 'true'
method: POST
Expand All @@ -71,7 +71,7 @@ interactions:
body:
string: '{"iceServers": [{"routeType": "nearest", "urls": ["turn.skype.com",
"turn:13.107.17.41:3478"], "username": "sanitized", "credential": "sanitized"}],
"expiresOn": "2021-11-10T22:11:51.8649696+00:00"}'
"expiresOn": "2021-11-16T04:40:47.0013447+00:00"}'
headers:
api-supported-versions:
- 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview
Expand All @@ -80,17 +80,17 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Wed, 10 Nov 2021 22:11:51 GMT
- Tue, 16 Nov 2021 04:40:46 GMT
ms-cv:
- RC7pSMciR0GK77B71fTqjw.0
- 2x+A1+Jba0WqkXohqm0ICQ.0
request-context:
- appId=
strict-transport-security:
- max-age=2592000
x-cache:
- CONFIG_NOCACHE
x-processing-time:
- 21ms
- 23ms
status:
code: 200
message: OK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,38 @@ interactions:
User-Agent:
- azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0)
x-ms-date:
- Wed, 10 Nov 2021 02:43:46 GMT
- Tue, 16 Nov 2021 04:40:47 GMT
x-ms-return-client-request-id:
- 'true'
method: POST
uri: https://sanitized.communication.azure.com/networktraversal/:issueRelayConfiguration?api-version=2021-10-08-preview
response:
body:
string: '{"error": {"code": "Denied", "message": "Denied by the resource provider."}}'
string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"],
"username": "sanitized", "credential": "sanitized"}, {"routeType": "nearest",
"urls": ["stun:13.107.17.41:3478", "turn:13.107.17.41:3478"], "username":
"BQAANnSBao0B19w2X3qe7o9e7W+6rvySC4FEqP0Jp0QAAAAMARCsgNlqhd5IsZldo6P6NifIf0Y1au0lIjmsCWlNNw3+1jt/4FE=",
"credential": "jcE0W+ai0GTWM29K0Q4nnsVS4UI="}], "expiresOn": "2021-11-16T04:40:47.1711817+00:00"}'
headers:
api-supported-versions:
- 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview
content-length:
- '560'
content-type:
- application/json
- application/json; charset=utf-8
date:
- Wed, 10 Nov 2021 02:43:46 GMT
- Tue, 16 Nov 2021 04:40:46 GMT
ms-cv:
- oDaiaJ5PkUq9TNTsJyP6Sg.0
- 7iXw5vjfgkGvhAx8VKBp2Q.0
request-context:
- appId=
strict-transport-security:
- max-age=2592000
transfer-encoding:
- chunked
x-cache:
- CONFIG_NOCACHE
x-processing-time:
- 9ms
- 19ms
status:
code: 401
message: Unauthorized
code: 200
message: OK
version: 1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interactions:
User-Agent:
- azsdk-python-communication-identity/1.1.0b2 Python/3.7.4 (Windows-10-10.0.22494-SP0)
x-ms-date:
- Wed, 10 Nov 2021 22:11:51 GMT
- Tue, 16 Nov 2021 04:40:47 GMT
x-ms-return-client-request-id:
- 'true'
method: POST
Expand All @@ -21,15 +21,15 @@ interactions:
string: '{"identity": {"id": "sanitized"}}'
headers:
api-supported-versions: 2020-07-20-preview2, 2021-02-22-preview1, 2021-03-07,
2021-03-31-preview1, 2021-10-31-preview
2021-03-31-preview1, 2021-10-31-preview, 2021-11-01
content-length: '101'
content-type: application/json; charset=utf-8
date: Wed, 10 Nov 2021 22:11:51 GMT
ms-cv: GynjuQm1oUuxQMqmcjtgyg.0
date: Tue, 16 Nov 2021 04:40:46 GMT
ms-cv: 3+1oH5z9t0OADoly/cuolA.0
request-context: appId=
strict-transport-security: max-age=2592000
x-cache: CONFIG_NOCACHE
x-processing-time: 27ms
x-processing-time: 26ms
status:
code: 201
message: Created
Expand All @@ -46,7 +46,7 @@ interactions:
User-Agent:
- azsdk-python-communication-networktraversal/1.0.0b1 Python/3.7.4 (Windows-10-10.0.22494-SP0)
x-ms-date:
- Wed, 10 Nov 2021 22:11:51 GMT
- Tue, 16 Nov 2021 04:40:47 GMT
x-ms-return-client-request-id:
- 'true'
method: POST
Expand All @@ -56,18 +56,18 @@ interactions:
string: '{"iceServers": [{"routeType": "any", "urls": ["turn.skype.com", "turn:world.relay.skype.com:3478"],
"username": "sanitized", "credential": "sanitized"}, {"routeType": "nearest",
"urls": ["stun:13.107.17.41:3478", "turn:13.107.17.41:3478"], "username":
"BQAANkukXQMB19gSYdXtLqhi7A41dwQPkLVlfAK8wZ8AAAAMARCsgNlqhd5IsZldo6P6NifIM3HjmLwECvQ6BTJYFW5n/fzu2Gg=",
"credential": "5caHpuagc1m5x9BvsVMcbC2D+EQ="}], "expiresOn": "2021-11-10T22:11:52.0851966+00:00"}'
"BQAANnSXU4EB19w2aCWTWAJL01t6XoklNPG7HphtE/8AAAAMARCsgNlqhd5IsZldo6P6NifIEHLHZlovGBYG/Um0CEiYowfIPEM=",
"credential": "zQTkxP2TkfXcd37rPKsaK8x47mE="}], "expiresOn": "2021-11-16T04:40:47.3233983+00:00"}'
headers:
api-supported-versions: 2021-02-22-preview1, 2021-06-21-preview, 2021-10-08-preview
content-length: '560'
content-type: application/json; charset=utf-8
date: Wed, 10 Nov 2021 22:11:51 GMT
ms-cv: rTN2hcJ8DE65nzciBzPGfA.0
date: Tue, 16 Nov 2021 04:40:46 GMT
ms-cv: adJLtbC3R02Dl6M5sFljLw.0
request-context: appId=
strict-transport-security: max-age=2592000
x-cache: CONFIG_NOCACHE
x-processing-time: 20ms
x-processing-time: 22ms
status:
code: 200
message: OK
Expand Down
Loading

0 comments on commit d482b99

Please sign in to comment.