1515from azure .core .pipeline import policies
1616from azure .core .rest import HttpRequest , HttpResponse
1717
18- from ._configuration import MessageTemplateClientConfiguration , NotificationMessagesClientConfiguration
19- from ._operations import MessageTemplateClientOperationsMixin , NotificationMessagesClientOperationsMixin
20- from ._serialization import Deserializer , Serializer
18+ from ._configuration import (
19+ ConversationAdministrationClientConfiguration ,
20+ ConversationThreadClientConfiguration ,
21+ MessageTemplateClientConfiguration ,
22+ NotificationMessagesClientConfiguration ,
23+ )
24+ from ._operations import (
25+ ConversationAdministrationClientOperationsMixin ,
26+ ConversationThreadClientOperationsMixin ,
27+ MessageTemplateClientOperationsMixin ,
28+ NotificationMessagesClientOperationsMixin ,
29+ )
30+ from ._utils .serialization import Deserializer , Serializer
2131
2232if TYPE_CHECKING :
2333 from azure .core .credentials import TokenCredential
@@ -27,21 +37,23 @@ class NotificationMessagesClient(NotificationMessagesClientOperationsMixin):
2737 """NotificationMessagesClient.
2838
2939 :param endpoint: The communication resource, for example
30- https://my-resource.communication.azure.com. Required.
40+ `https://my-resource.communication.azure.com <https://my-resource.communication.azure.com>`_.
41+ Required.
3142 :type endpoint: str
3243 :param credential: Credential used to authenticate requests to the service. Is either a token
33- credential type or a AzureKeyCredential type. Required.
44+ credential type or a key credential type. Required.
3445 :type credential: ~azure.core.credentials.TokenCredential or
35- ~azure.core.credentials.AzureKeyCredential
46+ ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials.AzureKeyCredential
3647 :keyword api_version: The API version to use for this operation. Default value is
37- "2025-01-15 -preview". Note that overriding this default value may result in unsupported
48+ "2025-04-01 -preview". Note that overriding this default value may result in unsupported
3849 behavior.
3950 :paramtype api_version: str
4051 """
4152
4253 def __init__ (self , endpoint : str , credential : Union ["TokenCredential" , AzureKeyCredential ], ** kwargs : Any ) -> None :
4354 _endpoint = "{endpoint}"
4455 self ._config = NotificationMessagesClientConfiguration (endpoint = endpoint , credential = credential , ** kwargs )
56+
4557 _policies = kwargs .pop ("policies" , None )
4658 if _policies is None :
4759 _policies = [
@@ -106,21 +118,185 @@ class MessageTemplateClient(MessageTemplateClientOperationsMixin):
106118 """MessageTemplateClient.
107119
108120 :param endpoint: The communication resource, for example
109- https://my-resource.communication.azure.com. Required.
121+ `https://my-resource.communication.azure.com <https://my-resource.communication.azure.com>`_.
122+ Required.
110123 :type endpoint: str
111124 :param credential: Credential used to authenticate requests to the service. Is either a token
112- credential type or a AzureKeyCredential type. Required.
125+ credential type or a key credential type. Required.
113126 :type credential: ~azure.core.credentials.TokenCredential or
114- ~azure.core.credentials.AzureKeyCredential
127+ ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials.AzureKeyCredential
115128 :keyword api_version: The API version to use for this operation. Default value is
116- "2025-01-15 -preview". Note that overriding this default value may result in unsupported
129+ "2025-04-01 -preview". Note that overriding this default value may result in unsupported
117130 behavior.
118131 :paramtype api_version: str
119132 """
120133
121134 def __init__ (self , endpoint : str , credential : Union ["TokenCredential" , AzureKeyCredential ], ** kwargs : Any ) -> None :
122135 _endpoint = "{endpoint}"
123136 self ._config = MessageTemplateClientConfiguration (endpoint = endpoint , credential = credential , ** kwargs )
137+
138+ _policies = kwargs .pop ("policies" , None )
139+ if _policies is None :
140+ _policies = [
141+ policies .RequestIdPolicy (** kwargs ),
142+ self ._config .headers_policy ,
143+ self ._config .user_agent_policy ,
144+ self ._config .proxy_policy ,
145+ policies .ContentDecodePolicy (** kwargs ),
146+ self ._config .redirect_policy ,
147+ self ._config .retry_policy ,
148+ self ._config .authentication_policy ,
149+ self ._config .custom_hook_policy ,
150+ self ._config .logging_policy ,
151+ policies .DistributedTracingPolicy (** kwargs ),
152+ policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
153+ self ._config .http_logging_policy ,
154+ ]
155+ self ._client : PipelineClient = PipelineClient (base_url = _endpoint , policies = _policies , ** kwargs )
156+
157+ self ._serialize = Serializer ()
158+ self ._deserialize = Deserializer ()
159+ self ._serialize .client_side_validation = False
160+
161+ def send_request (self , request : HttpRequest , * , stream : bool = False , ** kwargs : Any ) -> HttpResponse :
162+ """Runs the network request through the client's chained policies.
163+
164+ >>> from azure.core.rest import HttpRequest
165+ >>> request = HttpRequest("GET", "https://www.example.org/")
166+ <HttpRequest [GET], url: 'https://www.example.org/'>
167+ >>> response = client.send_request(request)
168+ <HttpResponse: 200 OK>
169+
170+ For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
171+
172+ :param request: The network request you want to make. Required.
173+ :type request: ~azure.core.rest.HttpRequest
174+ :keyword bool stream: Whether the response payload will be streamed. Defaults to False.
175+ :return: The response of your network call. Does not do error handling on your response.
176+ :rtype: ~azure.core.rest.HttpResponse
177+ """
178+
179+ request_copy = deepcopy (request )
180+ path_format_arguments = {
181+ "endpoint" : self ._serialize .url ("self._config.endpoint" , self ._config .endpoint , "str" , skip_quote = True ),
182+ }
183+
184+ request_copy .url = self ._client .format_url (request_copy .url , ** path_format_arguments )
185+ return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
186+
187+ def close (self ) -> None :
188+ self ._client .close ()
189+
190+ def __enter__ (self ) -> Self :
191+ self ._client .__enter__ ()
192+ return self
193+
194+ def __exit__ (self , * exc_details : Any ) -> None :
195+ self ._client .__exit__ (* exc_details )
196+
197+
198+ class ConversationAdministrationClient (ConversationAdministrationClientOperationsMixin ):
199+ """ConversationAdministrationClient.
200+
201+ :param endpoint: The communication resource, for example
202+ `https://my-resource.communication.azure.com <https://my-resource.communication.azure.com>`_.
203+ Required.
204+ :type endpoint: str
205+ :param credential: Credential used to authenticate requests to the service. Is either a token
206+ credential type or a key credential type. Required.
207+ :type credential: ~azure.core.credentials.TokenCredential or
208+ ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials.AzureKeyCredential
209+ :keyword api_version: The API version to use for this operation. Default value is
210+ "2025-04-01-preview". Note that overriding this default value may result in unsupported
211+ behavior.
212+ :paramtype api_version: str
213+ """
214+
215+ def __init__ (self , endpoint : str , credential : Union ["TokenCredential" , AzureKeyCredential ], ** kwargs : Any ) -> None :
216+ _endpoint = "{endpoint}"
217+ self ._config = ConversationAdministrationClientConfiguration (endpoint = endpoint , credential = credential , ** kwargs )
218+
219+ _policies = kwargs .pop ("policies" , None )
220+ if _policies is None :
221+ _policies = [
222+ policies .RequestIdPolicy (** kwargs ),
223+ self ._config .headers_policy ,
224+ self ._config .user_agent_policy ,
225+ self ._config .proxy_policy ,
226+ policies .ContentDecodePolicy (** kwargs ),
227+ self ._config .redirect_policy ,
228+ self ._config .retry_policy ,
229+ self ._config .authentication_policy ,
230+ self ._config .custom_hook_policy ,
231+ self ._config .logging_policy ,
232+ policies .DistributedTracingPolicy (** kwargs ),
233+ policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
234+ self ._config .http_logging_policy ,
235+ ]
236+ self ._client : PipelineClient = PipelineClient (base_url = _endpoint , policies = _policies , ** kwargs )
237+
238+ self ._serialize = Serializer ()
239+ self ._deserialize = Deserializer ()
240+ self ._serialize .client_side_validation = False
241+
242+ def send_request (self , request : HttpRequest , * , stream : bool = False , ** kwargs : Any ) -> HttpResponse :
243+ """Runs the network request through the client's chained policies.
244+
245+ >>> from azure.core.rest import HttpRequest
246+ >>> request = HttpRequest("GET", "https://www.example.org/")
247+ <HttpRequest [GET], url: 'https://www.example.org/'>
248+ >>> response = client.send_request(request)
249+ <HttpResponse: 200 OK>
250+
251+ For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
252+
253+ :param request: The network request you want to make. Required.
254+ :type request: ~azure.core.rest.HttpRequest
255+ :keyword bool stream: Whether the response payload will be streamed. Defaults to False.
256+ :return: The response of your network call. Does not do error handling on your response.
257+ :rtype: ~azure.core.rest.HttpResponse
258+ """
259+
260+ request_copy = deepcopy (request )
261+ path_format_arguments = {
262+ "endpoint" : self ._serialize .url ("self._config.endpoint" , self ._config .endpoint , "str" , skip_quote = True ),
263+ }
264+
265+ request_copy .url = self ._client .format_url (request_copy .url , ** path_format_arguments )
266+ return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
267+
268+ def close (self ) -> None :
269+ self ._client .close ()
270+
271+ def __enter__ (self ) -> Self :
272+ self ._client .__enter__ ()
273+ return self
274+
275+ def __exit__ (self , * exc_details : Any ) -> None :
276+ self ._client .__exit__ (* exc_details )
277+
278+
279+ class ConversationThreadClient (ConversationThreadClientOperationsMixin ):
280+ """ConversationThreadClient.
281+
282+ :param endpoint: The communication resource, for example
283+ `https://my-resource.communication.azure.com <https://my-resource.communication.azure.com>`_.
284+ Required.
285+ :type endpoint: str
286+ :param credential: Credential used to authenticate requests to the service. Is either a token
287+ credential type or a key credential type. Required.
288+ :type credential: ~azure.core.credentials.TokenCredential or
289+ ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials.AzureKeyCredential
290+ :keyword api_version: The API version to use for this operation. Default value is
291+ "2025-04-01-preview". Note that overriding this default value may result in unsupported
292+ behavior.
293+ :paramtype api_version: str
294+ """
295+
296+ def __init__ (self , endpoint : str , credential : Union ["TokenCredential" , AzureKeyCredential ], ** kwargs : Any ) -> None :
297+ _endpoint = "{endpoint}"
298+ self ._config = ConversationThreadClientConfiguration (endpoint = endpoint , credential = credential , ** kwargs )
299+
124300 _policies = kwargs .pop ("policies" , None )
125301 if _policies is None :
126302 _policies = [
0 commit comments