Skip to content

Commit 600cf10

Browse files
author
SDKAuto
committed
CodeGen from PR 30527 in Azure/azure-rest-api-specs
Merge 2cc384eb5ce37e76f6f9cf3fc65a481d798c46fc into 831b6577e1f46ca927a940d0481ab06cea21db85
1 parent 89cdab7 commit 600cf10

28 files changed

+2575
-699
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"commit": "223cfca6f6d93b98496bd1737ce1e1e44749a78c",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"typespec_src": "specification/cognitiveservices/ContentSafety",
5+
"@azure-tools/typespec-python": "0.32.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
@@ -26,14 +27,15 @@
2627
class ContentSafetyClient(ContentSafetyClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword
2728
"""ContentSafetyClient.
2829
29-
:param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
30+
:param endpoint: test
31+
Supported Cognitive Services endpoints (protocol and hostname, for example:
3032
https://:code:`<resource-name>`.cognitiveservices.azure.com). Required.
3133
:type endpoint: str
32-
:param credential: Credential needed for the client to connect to Azure. Is either a
34+
:param credential: Credential used to authenticate requests to the service. Is either a
3335
AzureKeyCredential type or a TokenCredential type. Required.
3436
:type credential: ~azure.core.credentials.AzureKeyCredential or
3537
~azure.core.credentials.TokenCredential
36-
:keyword api_version: The API version to use for this operation. Default value is "2023-10-01".
38+
:keyword api_version: The API version to use for this operation. Default value is "2024-09-01".
3739
Note that overriding this default value may result in unsupported behavior.
3840
:paramtype api_version: str
3941
"""
@@ -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

@@ -104,14 +106,15 @@ def __exit__(self, *exc_details: Any) -> None:
104106
class BlocklistClient(BlocklistClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword
105107
"""BlocklistClient.
106108
107-
:param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
109+
:param endpoint: test
110+
Supported Cognitive Services endpoints (protocol and hostname, for example:
108111
https://:code:`<resource-name>`.cognitiveservices.azure.com). Required.
109112
:type endpoint: str
110-
:param credential: Credential needed for the client to connect to Azure. Is either a
113+
:param credential: Credential used to authenticate requests to the service. Is either a
111114
AzureKeyCredential type or a TokenCredential type. Required.
112115
:type credential: ~azure.core.credentials.AzureKeyCredential or
113116
~azure.core.credentials.TokenCredential
114-
:keyword api_version: The API version to use for this operation. Default value is "2023-10-01".
117+
:keyword api_version: The API version to use for this operation. Default value is "2024-09-01".
115118
Note that overriding this default value may result in unsupported behavior.
116119
:paramtype api_version: str
117120
"""
@@ -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
@@ -24,20 +24,21 @@ class ContentSafetyClientConfiguration: # pylint: disable=too-many-instance-att
2424
Note that all parameters used to create this instance are saved as instance
2525
attributes.
2626
27-
:param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
27+
:param endpoint: test
28+
Supported Cognitive Services endpoints (protocol and hostname, for example:
2829
https://:code:`<resource-name>`.cognitiveservices.azure.com). Required.
2930
:type endpoint: str
30-
:param credential: Credential needed for the client to connect to Azure. Is either a
31+
:param credential: Credential used to authenticate requests to the service. Is either a
3132
AzureKeyCredential type or a TokenCredential type. Required.
3233
:type credential: ~azure.core.credentials.AzureKeyCredential or
3334
~azure.core.credentials.TokenCredential
34-
:keyword api_version: The API version to use for this operation. Default value is "2023-10-01".
35+
:keyword api_version: The API version to use for this operation. Default value is "2024-09-01".
3536
Note that overriding this default value may result in unsupported 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-01")
4142

4243
if endpoint is None:
4344
raise ValueError("Parameter 'endpoint' must not be None.")
@@ -79,20 +80,21 @@ class BlocklistClientConfiguration: # pylint: disable=too-many-instance-attribu
7980
Note that all parameters used to create this instance are saved as instance
8081
attributes.
8182
82-
:param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
83+
:param endpoint: test
84+
Supported Cognitive Services endpoints (protocol and hostname, for example:
8385
https://:code:`<resource-name>`.cognitiveservices.azure.com). Required.
8486
:type endpoint: str
85-
:param credential: Credential needed for the client to connect to Azure. Is either a
87+
:param credential: Credential used to authenticate requests to the service. Is either a
8688
AzureKeyCredential type or a TokenCredential type. Required.
8789
:type credential: ~azure.core.credentials.AzureKeyCredential or
8890
~azure.core.credentials.TokenCredential
89-
:keyword api_version: The API version to use for this operation. Default value is "2023-10-01".
91+
:keyword api_version: The API version to use for this operation. Default value is "2024-09-01".
9092
Note that overriding this default value may result in unsupported 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-01")
9698

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

0 commit comments

Comments
 (0)