88
99from copy import deepcopy
1010from typing import Any , TYPE_CHECKING , Union
11+ from typing_extensions import Self
1112
1213from azure .core import PipelineClient
1314from azure .core .credentials import AzureKeyCredential
1920from ._serialization import Deserializer , Serializer
2021
2122if TYPE_CHECKING :
22- # pylint: disable=unused-import,ungrouped-imports
2323 from azure .core .credentials import TokenCredential
2424
25- class NotificationMessagesClient (NotificationMessagesClientOperationsMixin ): # pylint: disable=client-accepts-api-version-keyword
25+
26+ class NotificationMessagesClient (NotificationMessagesClientOperationsMixin ):
2627 """NotificationMessagesClient.
2728
2829 :param endpoint: The communication resource, for example
2930 https://my-resource.communication.azure.com. Required.
3031 :type endpoint: str
31- :param credential: Credential needed for the client to connect to Azure . Is either a
32+ :param credential: Credential used to authenticate requests to the service . Is either a
3233 TokenCredential type or a AzureKeyCredential type. Required.
3334 :type credential: ~azure.core.credentials.TokenCredential or
3435 ~azure.core.credentials.AzureKeyCredential
35- :keyword api_version: The API version to use for this operation. Default value is "2024-02-01 ".
36+ :keyword api_version: The API version to use for this operation. Default value is "2024-08-30 ".
3637 Note that overriding this default value may result in unsupported behavior.
3738 :paramtype api_version: str
3839 """
3940
40- def __init__ (
41- self ,
42- endpoint : str ,
43- credential : Union ["TokenCredential" , AzureKeyCredential ],
44- ** kwargs : Any
45- ) -> None :
46- _endpoint = '{endpoint}'
41+ def __init__ (self , endpoint : str , credential : Union ["TokenCredential" , AzureKeyCredential ], ** kwargs : Any ) -> None :
42+ _endpoint = "{endpoint}"
4743 self ._config = NotificationMessagesClientConfiguration (endpoint = endpoint , credential = credential , ** kwargs )
48- _policies = kwargs .pop (' policies' , None )
44+ _policies = kwargs .pop (" policies" , None )
4945 if _policies is None :
50- _policies = [policies .RequestIdPolicy (** kwargs ),self ._config .headers_policy ,
51- self ._config .user_agent_policy ,self ._config .proxy_policy ,
52- policies .ContentDecodePolicy (** kwargs ),
53- self ._config .redirect_policy ,self ._config .retry_policy ,
54- self ._config .authentication_policy ,
55- self ._config .custom_hook_policy ,self ._config .logging_policy ,
56- policies .DistributedTracingPolicy (** kwargs ),
57- policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
58- self ._config .http_logging_policy ]
46+ _policies = [
47+ policies .RequestIdPolicy (** kwargs ),
48+ self ._config .headers_policy ,
49+ self ._config .user_agent_policy ,
50+ self ._config .proxy_policy ,
51+ policies .ContentDecodePolicy (** kwargs ),
52+ self ._config .redirect_policy ,
53+ self ._config .retry_policy ,
54+ self ._config .authentication_policy ,
55+ self ._config .custom_hook_policy ,
56+ self ._config .logging_policy ,
57+ policies .DistributedTracingPolicy (** kwargs ),
58+ policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
59+ self ._config .http_logging_policy ,
60+ ]
5961 self ._client : PipelineClient = PipelineClient (base_url = _endpoint , policies = _policies , ** kwargs )
6062
61-
6263 self ._serialize = Serializer ()
6364 self ._deserialize = Deserializer ()
6465 self ._serialize .client_side_validation = False
6566
66-
67- def send_request (
68- self ,
69- request : HttpRequest , * , stream : bool = False ,
70- ** kwargs : Any
71- ) -> HttpResponse :
67+ def send_request (self , request : HttpRequest , * , stream : bool = False , ** kwargs : Any ) -> HttpResponse :
7268 """Runs the network request through the client's chained policies.
7369
7470 >>> from azure.core.rest import HttpRequest
@@ -88,7 +84,7 @@ def send_request(
8884
8985 request_copy = deepcopy (request )
9086 path_format_arguments = {
91- "endpoint" : self ._serialize .url ("self._config.endpoint" , self ._config .endpoint , ' str' , skip_quote = True ),
87+ "endpoint" : self ._serialize .url ("self._config.endpoint" , self ._config .endpoint , " str" , skip_quote = True ),
9288 }
9389
9490 request_copy .url = self ._client .format_url (request_copy .url , ** path_format_arguments )
@@ -97,56 +93,56 @@ def send_request(
9793 def close (self ) -> None :
9894 self ._client .close ()
9995
100- def __enter__ (self ) -> "NotificationMessagesClient" :
96+ def __enter__ (self ) -> Self :
10197 self ._client .__enter__ ()
10298 return self
10399
104100 def __exit__ (self , * exc_details : Any ) -> None :
105101 self ._client .__exit__ (* exc_details )
106- class MessageTemplateClient (MessageTemplateClientOperationsMixin ): # pylint: disable=client-accepts-api-version-keyword
102+
103+
104+ class MessageTemplateClient (MessageTemplateClientOperationsMixin ):
107105 """MessageTemplateClient.
108106
109107 :param endpoint: The communication resource, for example
110108 https://my-resource.communication.azure.com. Required.
111109 :type endpoint: str
112- :param credential: Credential needed for the client to connect to Azure . Is either a
110+ :param credential: Credential used to authenticate requests to the service . Is either a
113111 TokenCredential type or a AzureKeyCredential type. Required.
114112 :type credential: ~azure.core.credentials.TokenCredential or
115113 ~azure.core.credentials.AzureKeyCredential
116- :keyword api_version: The API version to use for this operation. Default value is "2024-02-01 ".
114+ :keyword api_version: The API version to use for this operation. Default value is "2024-08-30 ".
117115 Note that overriding this default value may result in unsupported behavior.
118116 :paramtype api_version: str
119117 """
120118
121- def __init__ (
122- self ,
123- endpoint : str ,
124- credential : Union ["TokenCredential" , AzureKeyCredential ],
125- ** kwargs : Any
126- ) -> None :
127- _endpoint = '{endpoint}'
119+ def __init__ (self , endpoint : str , credential : Union ["TokenCredential" , AzureKeyCredential ], ** kwargs : Any ) -> None :
120+ _endpoint = "{endpoint}"
128121 self ._config = MessageTemplateClientConfiguration (endpoint = endpoint , credential = credential , ** kwargs )
129- _policies = kwargs .pop (' policies' , None )
122+ _policies = kwargs .pop (" policies" , None )
130123 if _policies is None :
131- _policies = [policies .RequestIdPolicy (** kwargs ),self ._config .headers_policy ,self ._config .user_agent_policy ,
132- self ._config .proxy_policy ,policies .ContentDecodePolicy (** kwargs ),self ._config .redirect_policy ,
133- self ._config .retry_policy ,self ._config .authentication_policy ,self ._config .custom_hook_policy ,
134- self ._config .logging_policy ,policies .DistributedTracingPolicy (** kwargs ),
135- policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
136- self ._config .http_logging_policy ]
124+ _policies = [
125+ policies .RequestIdPolicy (** kwargs ),
126+ self ._config .headers_policy ,
127+ self ._config .user_agent_policy ,
128+ self ._config .proxy_policy ,
129+ policies .ContentDecodePolicy (** kwargs ),
130+ self ._config .redirect_policy ,
131+ self ._config .retry_policy ,
132+ self ._config .authentication_policy ,
133+ self ._config .custom_hook_policy ,
134+ self ._config .logging_policy ,
135+ policies .DistributedTracingPolicy (** kwargs ),
136+ policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
137+ self ._config .http_logging_policy ,
138+ ]
137139 self ._client : PipelineClient = PipelineClient (base_url = _endpoint , policies = _policies , ** kwargs )
138140
139-
140141 self ._serialize = Serializer ()
141142 self ._deserialize = Deserializer ()
142143 self ._serialize .client_side_validation = False
143144
144-
145- def send_request (
146- self ,
147- request : HttpRequest , * , stream : bool = False ,
148- ** kwargs : Any
149- ) -> HttpResponse :
145+ def send_request (self , request : HttpRequest , * , stream : bool = False , ** kwargs : Any ) -> HttpResponse :
150146 """Runs the network request through the client's chained policies.
151147
152148 >>> from azure.core.rest import HttpRequest
@@ -166,7 +162,7 @@ def send_request(
166162
167163 request_copy = deepcopy (request )
168164 path_format_arguments = {
169- "endpoint" : self ._serialize .url ("self._config.endpoint" , self ._config .endpoint , ' str' , skip_quote = True ),
165+ "endpoint" : self ._serialize .url ("self._config.endpoint" , self ._config .endpoint , " str" , skip_quote = True ),
170166 }
171167
172168 request_copy .url = self ._client .format_url (request_copy .url , ** path_format_arguments )
@@ -175,7 +171,7 @@ def send_request(
175171 def close (self ) -> None :
176172 self ._client .close ()
177173
178- def __enter__ (self ) -> "MessageTemplateClient" :
174+ def __enter__ (self ) -> Self :
179175 self ._client .__enter__ ()
180176 return self
181177
0 commit comments