Skip to content

Commit 720ef1b

Browse files
committed
Sync with the lastest swagger.
1 parent d6455f2 commit 720ef1b

File tree

11 files changed

+3967
-4622
lines changed

11 files changed

+3967
-4622
lines changed

sdk/communication/azure-communication-callingserver/azure/communication/callingserver/_generated/_azure_communication_calling_server_service.py

Lines changed: 26 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,28 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
from copy import deepcopy
109
from typing import TYPE_CHECKING
1110

1211
from azure.core import PipelineClient
1312
from msrest import Deserializer, Serializer
1413

15-
from . import models
16-
from ._configuration import AzureCommunicationCallingServerServiceConfiguration
17-
from .operations import CallConnectionsOperations, ServerCallsOperations
18-
1914
if TYPE_CHECKING:
2015
# pylint: disable=unused-import,ungrouped-imports
2116
from typing import Any
2217

23-
from azure.core.rest import HttpRequest, HttpResponse
18+
from azure.core.pipeline.transport import HttpRequest, HttpResponse
19+
20+
from ._configuration import AzureCommunicationCallingServerServiceConfiguration
21+
from .operations import CallConnectionsOperations
22+
from .operations import ServerCallsOperations
23+
from . import models
24+
2425

2526
class AzureCommunicationCallingServerService(object):
2627
"""Azure Communication Service Call Automation APIs.
2728
2829
:ivar call_connections: CallConnectionsOperations operations
29-
:vartype call_connections:
30-
azure.communication.callingserver.operations.CallConnectionsOperations
30+
:vartype call_connections: azure.communication.callingserver.operations.CallConnectionsOperations
3131
:ivar server_calls: ServerCallsOperations operations
3232
:vartype server_calls: azure.communication.callingserver.operations.ServerCallsOperations
3333
:param endpoint: The endpoint of the Azure Communication resource.
@@ -40,48 +40,37 @@ def __init__(
4040
**kwargs # type: Any
4141
):
4242
# type: (...) -> None
43-
_base_url = '{endpoint}'
43+
base_url = '{endpoint}'
4444
self._config = AzureCommunicationCallingServerServiceConfiguration(endpoint, **kwargs)
45-
self._client = PipelineClient(base_url=_base_url, config=self._config, **kwargs)
45+
self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs)
4646

4747
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
4848
self._serialize = Serializer(client_models)
49-
self._deserialize = Deserializer(client_models)
5049
self._serialize.client_side_validation = False
51-
self.call_connections = CallConnectionsOperations(self._client, self._config, self._serialize, self._deserialize)
52-
self.server_calls = ServerCallsOperations(self._client, self._config, self._serialize, self._deserialize)
50+
self._deserialize = Deserializer(client_models)
5351

52+
self.call_connections = CallConnectionsOperations(
53+
self._client, self._config, self._serialize, self._deserialize)
54+
self.server_calls = ServerCallsOperations(
55+
self._client, self._config, self._serialize, self._deserialize)
5456

55-
def _send_request(
56-
self,
57-
request, # type: HttpRequest
58-
**kwargs # type: Any
59-
):
60-
# type: (...) -> HttpResponse
57+
def _send_request(self, http_request, **kwargs):
58+
# type: (HttpRequest, Any) -> HttpResponse
6159
"""Runs the network request through the client's chained policies.
6260
63-
>>> from azure.core.rest import HttpRequest
64-
>>> request = HttpRequest("GET", "https://www.example.org/")
65-
<HttpRequest [GET], url: 'https://www.example.org/'>
66-
>>> response = client._send_request(request)
67-
<HttpResponse: 200 OK>
68-
69-
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
70-
71-
:param request: The network request you want to make. Required.
72-
:type request: ~azure.core.rest.HttpRequest
73-
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
61+
:param http_request: The network request you want to make. Required.
62+
:type http_request: ~azure.core.pipeline.transport.HttpRequest
63+
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
7464
:return: The response of your network call. Does not do error handling on your response.
75-
:rtype: ~azure.core.rest.HttpResponse
65+
:rtype: ~azure.core.pipeline.transport.HttpResponse
7666
"""
77-
78-
request_copy = deepcopy(request)
7967
path_format_arguments = {
80-
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True),
68+
'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True),
8169
}
82-
83-
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
84-
return self._client.send_request(request_copy, **kwargs)
70+
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
71+
stream = kwargs.pop("stream", True)
72+
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
73+
return pipeline_response.http_response
8574

8675
def close(self):
8776
# type: () -> None

sdk/communication/azure-communication-callingserver/azure/communication/callingserver/_generated/aio/_azure_communication_calling_server_service.py

Lines changed: 25 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
from copy import deepcopy
10-
from typing import Any, Awaitable
9+
from typing import Any
1110

1211
from azure.core import AsyncPipelineClient
13-
from azure.core.rest import AsyncHttpResponse, HttpRequest
12+
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
1413
from msrest import Deserializer, Serializer
1514

16-
from .. import models
1715
from ._configuration import AzureCommunicationCallingServerServiceConfiguration
18-
from .operations import CallConnectionsOperations, ServerCallsOperations
16+
from .operations import CallConnectionsOperations
17+
from .operations import ServerCallsOperations
18+
from .. import models
19+
1920

20-
class AzureCommunicationCallingServerService:
21+
class AzureCommunicationCallingServerService(object):
2122
"""Azure Communication Service Call Automation APIs.
2223
2324
:ivar call_connections: CallConnectionsOperations operations
24-
:vartype call_connections:
25-
azure.communication.callingserver.aio.operations.CallConnectionsOperations
25+
:vartype call_connections: azure.communication.callingserver.aio.operations.CallConnectionsOperations
2626
:ivar server_calls: ServerCallsOperations operations
2727
:vartype server_calls: azure.communication.callingserver.aio.operations.ServerCallsOperations
2828
:param endpoint: The endpoint of the Azure Communication resource.
@@ -34,47 +34,36 @@ def __init__(
3434
endpoint: str,
3535
**kwargs: Any
3636
) -> None:
37-
_base_url = '{endpoint}'
37+
base_url = '{endpoint}'
3838
self._config = AzureCommunicationCallingServerServiceConfiguration(endpoint, **kwargs)
39-
self._client = AsyncPipelineClient(base_url=_base_url, config=self._config, **kwargs)
39+
self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs)
4040

4141
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
4242
self._serialize = Serializer(client_models)
43-
self._deserialize = Deserializer(client_models)
4443
self._serialize.client_side_validation = False
45-
self.call_connections = CallConnectionsOperations(self._client, self._config, self._serialize, self._deserialize)
46-
self.server_calls = ServerCallsOperations(self._client, self._config, self._serialize, self._deserialize)
44+
self._deserialize = Deserializer(client_models)
4745

46+
self.call_connections = CallConnectionsOperations(
47+
self._client, self._config, self._serialize, self._deserialize)
48+
self.server_calls = ServerCallsOperations(
49+
self._client, self._config, self._serialize, self._deserialize)
4850

49-
def _send_request(
50-
self,
51-
request: HttpRequest,
52-
**kwargs: Any
53-
) -> Awaitable[AsyncHttpResponse]:
51+
async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse:
5452
"""Runs the network request through the client's chained policies.
5553
56-
>>> from azure.core.rest import HttpRequest
57-
>>> request = HttpRequest("GET", "https://www.example.org/")
58-
<HttpRequest [GET], url: 'https://www.example.org/'>
59-
>>> response = await client._send_request(request)
60-
<AsyncHttpResponse: 200 OK>
61-
62-
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
63-
64-
:param request: The network request you want to make. Required.
65-
:type request: ~azure.core.rest.HttpRequest
66-
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
54+
:param http_request: The network request you want to make. Required.
55+
:type http_request: ~azure.core.pipeline.transport.HttpRequest
56+
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
6757
:return: The response of your network call. Does not do error handling on your response.
68-
:rtype: ~azure.core.rest.AsyncHttpResponse
58+
:rtype: ~azure.core.pipeline.transport.AsyncHttpResponse
6959
"""
70-
71-
request_copy = deepcopy(request)
7260
path_format_arguments = {
73-
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True),
61+
'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True),
7462
}
75-
76-
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
77-
return self._client.send_request(request_copy, **kwargs)
63+
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
64+
stream = kwargs.pop("stream", True)
65+
pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs)
66+
return pipeline_response.http_response
7867

7968
async def close(self) -> None:
8069
await self._client.close()

0 commit comments

Comments
 (0)