Skip to content

Commit 0011cdf

Browse files
author
SDKAuto
committed
CodeGen from PR 30073 in Azure/azure-rest-api-specs
Merge 7e287313881f9c22e7d584aadc1f1cf5b62cdb62 into b61dcef24c4dbd9d1c26e321c9ea67465a5d8be7
1 parent d42433b commit 0011cdf

28 files changed

+2584
-704
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"commit": "e7380c03c1e72df4e61406b1ccbd3b9f8df367d6",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"typespec_src": "specification/cognitiveservices/ContentSafety",
5+
"@azure-tools/typespec-python": "0.33.0"
6+
}

sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_client.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from copy import deepcopy
1010
from typing import Any, TYPE_CHECKING, Union
11+
from typing_extensions import Self
1112

1213
from azure.core import PipelineClient
1314
from azure.core.credentials import AzureKeyCredential
@@ -29,12 +30,13 @@ class ContentSafetyClient(ContentSafetyClientOperationsMixin): # pylint: disabl
2930
:param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
3031
https://:code:`<resource-name>`.cognitiveservices.azure.com). Required.
3132
:type endpoint: str
32-
:param credential: Credential needed for the client to connect to Azure. Is either a
33+
:param credential: Credential used to authenticate requests to the service. Is either a
3334
AzureKeyCredential type or a TokenCredential type. Required.
3435
:type credential: ~azure.core.credentials.AzureKeyCredential or
3536
~azure.core.credentials.TokenCredential
36-
:keyword api_version: The API version to use for this operation. Default value is "2023-10-01".
37-
Note that overriding this default value may result in unsupported behavior.
37+
:keyword api_version: The API version to use for this operation. Default value is
38+
"2024-09-15-preview". Note that overriding this default value may result in unsupported
39+
behavior.
3840
:paramtype api_version: str
3941
"""
4042

@@ -84,7 +86,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
8486

8587
request_copy = deepcopy(request)
8688
path_format_arguments = {
87-
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
89+
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"),
8890
}
8991

9092
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
@@ -93,7 +95,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
9395
def close(self) -> None:
9496
self._client.close()
9597

96-
def __enter__(self) -> "ContentSafetyClient":
98+
def __enter__(self) -> Self:
9799
self._client.__enter__()
98100
return self
99101

@@ -107,12 +109,13 @@ class BlocklistClient(BlocklistClientOperationsMixin): # pylint: disable=client
107109
:param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
108110
https://:code:`<resource-name>`.cognitiveservices.azure.com). Required.
109111
:type endpoint: str
110-
:param credential: Credential needed for the client to connect to Azure. Is either a
112+
:param credential: Credential used to authenticate requests to the service. Is either a
111113
AzureKeyCredential type or a TokenCredential type. Required.
112114
:type credential: ~azure.core.credentials.AzureKeyCredential or
113115
~azure.core.credentials.TokenCredential
114-
:keyword api_version: The API version to use for this operation. Default value is "2023-10-01".
115-
Note that overriding this default value may result in unsupported behavior.
116+
:keyword api_version: The API version to use for this operation. Default value is
117+
"2024-09-15-preview". Note that overriding this default value may result in unsupported
118+
behavior.
116119
:paramtype api_version: str
117120
"""
118121

@@ -162,7 +165,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
162165

163166
request_copy = deepcopy(request)
164167
path_format_arguments = {
165-
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
168+
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"),
166169
}
167170

168171
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
@@ -171,7 +174,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
171174
def close(self) -> None:
172175
self._client.close()
173176

174-
def __enter__(self) -> "BlocklistClient":
177+
def __enter__(self) -> Self:
175178
self._client.__enter__()
176179
return self
177180

sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_configuration.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,18 @@ class ContentSafetyClientConfiguration: # pylint: disable=too-many-instance-att
2727
:param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
2828
https://:code:`<resource-name>`.cognitiveservices.azure.com). Required.
2929
:type endpoint: str
30-
:param credential: Credential needed for the client to connect to Azure. Is either a
30+
:param credential: Credential used to authenticate requests to the service. Is either a
3131
AzureKeyCredential type or a TokenCredential type. Required.
3232
:type credential: ~azure.core.credentials.AzureKeyCredential or
3333
~azure.core.credentials.TokenCredential
34-
:keyword api_version: The API version to use for this operation. Default value is "2023-10-01".
35-
Note that overriding this default value may result in unsupported behavior.
34+
:keyword api_version: The API version to use for this operation. Default value is
35+
"2024-09-15-preview". Note that overriding this default value may result in unsupported
36+
behavior.
3637
:paramtype api_version: str
3738
"""
3839

3940
def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], **kwargs: Any) -> None:
40-
api_version: str = kwargs.pop("api_version", "2023-10-01")
41+
api_version: str = kwargs.pop("api_version", "2024-09-15-preview")
4142

4243
if endpoint is None:
4344
raise ValueError("Parameter 'endpoint' must not be None.")
@@ -82,17 +83,18 @@ class BlocklistClientConfiguration: # pylint: disable=too-many-instance-attribu
8283
:param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
8384
https://:code:`<resource-name>`.cognitiveservices.azure.com). Required.
8485
:type endpoint: str
85-
:param credential: Credential needed for the client to connect to Azure. Is either a
86+
:param credential: Credential used to authenticate requests to the service. Is either a
8687
AzureKeyCredential type or a TokenCredential type. Required.
8788
:type credential: ~azure.core.credentials.AzureKeyCredential or
8889
~azure.core.credentials.TokenCredential
89-
:keyword api_version: The API version to use for this operation. Default value is "2023-10-01".
90-
Note that overriding this default value may result in unsupported behavior.
90+
:keyword api_version: The API version to use for this operation. Default value is
91+
"2024-09-15-preview". Note that overriding this default value may result in unsupported
92+
behavior.
9193
:paramtype api_version: str
9294
"""
9395

9496
def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], **kwargs: Any) -> None:
95-
api_version: str = kwargs.pop("api_version", "2023-10-01")
97+
api_version: str = kwargs.pop("api_version", "2024-09-15-preview")
9698

9799
if endpoint is None:
98100
raise ValueError("Parameter 'endpoint' must not be None.")

0 commit comments

Comments
 (0)