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
2525
26- class ContentSafetyClient (ContentSafetyClientOperationsMixin ): # pylint: disable=client-accepts-api-version-keyword
26+ class ContentSafetyClient (ContentSafetyClientOperationsMixin ):
2727 """ContentSafetyClient.
2828
2929 :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
30- https://:code:`<resource-name>`.cognitiveservices.azure.com). Required.
30+ https://\\ \\ :code:`<resource-name>`.cognitiveservices.azure.com). Required.
3131 :type endpoint: str
32- :param credential: Credential needed for the client to connect to Azure . Is either a
33- AzureKeyCredential type or a TokenCredential type. Required.
32+ :param credential: Credential used to authenticate requests to the service . Is either a key
33+ credential type or a token credential type. Required.
3434 :type credential: ~azure.core.credentials.AzureKeyCredential or
3535 ~azure.core.credentials.TokenCredential
36- :keyword api_version: The API version to use for this operation. Default value is "2023-10 -01".
36+ :keyword api_version: The API version to use for this operation. Default value is "2024-09 -01".
3737 Note that overriding this default value may result in unsupported behavior.
3838 :paramtype api_version: str
3939 """
@@ -84,7 +84,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
8484
8585 request_copy = deepcopy (request )
8686 path_format_arguments = {
87- "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" ),
8888 }
8989
9090 request_copy .url = self ._client .format_url (request_copy .url , ** path_format_arguments )
@@ -93,25 +93,25 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
9393 def close (self ) -> None :
9494 self ._client .close ()
9595
96- def __enter__ (self ) -> "ContentSafetyClient" :
96+ def __enter__ (self ) -> Self :
9797 self ._client .__enter__ ()
9898 return self
9999
100100 def __exit__ (self , * exc_details : Any ) -> None :
101101 self ._client .__exit__ (* exc_details )
102102
103103
104- class BlocklistClient (BlocklistClientOperationsMixin ): # pylint: disable=client-accepts-api-version-keyword
104+ class BlocklistClient (BlocklistClientOperationsMixin ):
105105 """BlocklistClient.
106106
107107 :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
108- https://:code:`<resource-name>`.cognitiveservices.azure.com). Required.
108+ https://\\ \\ :code:`<resource-name>`.cognitiveservices.azure.com). Required.
109109 :type endpoint: str
110- :param credential: Credential needed for the client to connect to Azure . Is either a
111- AzureKeyCredential type or a TokenCredential type. Required.
110+ :param credential: Credential used to authenticate requests to the service . Is either a key
111+ credential type or a token credential type. Required.
112112 :type credential: ~azure.core.credentials.AzureKeyCredential or
113113 ~azure.core.credentials.TokenCredential
114- :keyword api_version: The API version to use for this operation. Default value is "2023-10 -01".
114+ :keyword api_version: The API version to use for this operation. Default value is "2024-09 -01".
115115 Note that overriding this default value may result in unsupported behavior.
116116 :paramtype api_version: str
117117 """
@@ -162,7 +162,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
162162
163163 request_copy = deepcopy (request )
164164 path_format_arguments = {
165- "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" ),
166166 }
167167
168168 request_copy .url = self ._client .format_url (request_copy .url , ** path_format_arguments )
@@ -171,7 +171,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
171171 def close (self ) -> None :
172172 self ._client .close ()
173173
174- def __enter__ (self ) -> "BlocklistClient" :
174+ def __enter__ (self ) -> Self :
175175 self ._client .__enter__ ()
176176 return self
177177
0 commit comments