9
9
from copy import deepcopy
10
10
from typing import Any , TYPE_CHECKING
11
11
12
- from msrest import Deserializer , Serializer
13
-
14
12
from azure .core .rest import HttpRequest , HttpResponse
15
13
from azure .mgmt .core import ARMPipelineClient
16
14
17
- from . import models
15
+ from . import models as _models
18
16
from ._configuration import CommunicationServiceManagementClientConfiguration
17
+ from ._serialization import Deserializer , Serializer
19
18
from .operations import CommunicationServicesOperations , DomainsOperations , EmailServicesOperations , Operations
20
19
21
20
if TYPE_CHECKING :
22
21
# pylint: disable=unused-import,ungrouped-imports
23
22
from azure .core .credentials import TokenCredential
24
23
25
- class CommunicationServiceManagementClient :
24
+
25
+ class CommunicationServiceManagementClient : # pylint: disable=client-accepts-api-version-keyword
26
26
"""REST API for Azure Communication Services.
27
27
28
28
:ivar operations: Operations operations
@@ -34,13 +34,13 @@ class CommunicationServiceManagementClient:
34
34
:vartype domains: azure.mgmt.communication.operations.DomainsOperations
35
35
:ivar email_services: EmailServicesOperations operations
36
36
:vartype email_services: azure.mgmt.communication.operations.EmailServicesOperations
37
- :param credential: Credential needed for the client to connect to Azure.
37
+ :param credential: Credential needed for the client to connect to Azure. Required.
38
38
:type credential: ~azure.core.credentials.TokenCredential
39
- :param subscription_id: The ID of the target subscription.
39
+ :param subscription_id: The ID of the target subscription. Required.
40
40
:type subscription_id: str
41
41
:param base_url: Service URL. Default value is "https://management.azure.com".
42
42
:type base_url: str
43
- :keyword api_version: Api Version. Default value is "2021-10 -01-preview". Note that overriding
43
+ :keyword api_version: Api Version. Default value is "2022-07 -01-preview". Note that overriding
44
44
this default value may result in unsupported behavior.
45
45
:paramtype api_version: str
46
46
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -54,24 +54,23 @@ def __init__(
54
54
base_url : str = "https://management.azure.com" ,
55
55
** kwargs : Any
56
56
) -> None :
57
- self ._config = CommunicationServiceManagementClientConfiguration (credential = credential , subscription_id = subscription_id , ** kwargs )
57
+ self ._config = CommunicationServiceManagementClientConfiguration (
58
+ credential = credential , subscription_id = subscription_id , ** kwargs
59
+ )
58
60
self ._client = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
59
61
60
- client_models = {k : v for k , v in models .__dict__ .items () if isinstance (v , type )}
62
+ client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
61
63
self ._serialize = Serializer (client_models )
62
64
self ._deserialize = Deserializer (client_models )
63
65
self ._serialize .client_side_validation = False
64
66
self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
65
- self .communication_services = CommunicationServicesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
67
+ self .communication_services = CommunicationServicesOperations (
68
+ self ._client , self ._config , self ._serialize , self ._deserialize
69
+ )
66
70
self .domains = DomainsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
67
71
self .email_services = EmailServicesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
68
72
69
-
70
- def _send_request (
71
- self ,
72
- request : HttpRequest ,
73
- ** kwargs : Any
74
- ) -> HttpResponse :
73
+ def _send_request (self , request : HttpRequest , ** kwargs : Any ) -> HttpResponse :
75
74
"""Runs the network request through the client's chained policies.
76
75
77
76
>>> from azure.core.rest import HttpRequest
@@ -80,7 +79,7 @@ def _send_request(
80
79
>>> response = client._send_request(request)
81
80
<HttpResponse: 200 OK>
82
81
83
- For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
82
+ For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/ python/send_request
84
83
85
84
:param request: The network request you want to make. Required.
86
85
:type request: ~azure.core.rest.HttpRequest
@@ -93,15 +92,12 @@ def _send_request(
93
92
request_copy .url = self ._client .format_url (request_copy .url )
94
93
return self ._client .send_request (request_copy , ** kwargs )
95
94
96
- def close (self ):
97
- # type: () -> None
95
+ def close (self ) -> None :
98
96
self ._client .close ()
99
97
100
- def __enter__ (self ):
101
- # type: () -> CommunicationServiceManagementClient
98
+ def __enter__ (self ) -> "CommunicationServiceManagementClient" :
102
99
self ._client .__enter__ ()
103
100
return self
104
101
105
- def __exit__ (self , * exc_details ):
106
- # type: (Any) -> None
102
+ def __exit__ (self , * exc_details ) -> None :
107
103
self ._client .__exit__ (* exc_details )
0 commit comments