Skip to content

Commit 08c335a

Browse files
author
SDKAuto
committed
CodeGen from PR 3554 in test-repo-billy/azure-rest-api-specs
Merge 1dd21a739a574253b3d0b10ab11e9986d3263f50 into 35a65fea3e15956e7742e6b6d821768e8aff2903
1 parent b2b0c35 commit 08c335a

24 files changed

+2374
-726
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"commit": "0b0f839ef7dd6b5dd80eae131d2a0cff6f8c189a",
3+
"repository_url": "https://github.com/test-repo-billy/azure-rest-api-specs",
4+
"typespec_src": "specification/cognitiveservices/ContentSafety",
5+
"@azure-tools/typespec-python": "0.31.1"
6+
}

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

Lines changed: 9 additions & 8 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,11 +30,11 @@ 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+
:keyword api_version: The API version to use for this operation. Default value is "2024-09-01".
3738
Note that overriding this default value may result in unsupported behavior.
3839
:paramtype api_version: str
3940
"""
@@ -84,7 +85,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
8485

8586
request_copy = deepcopy(request)
8687
path_format_arguments = {
87-
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
88+
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"),
8889
}
8990

9091
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
@@ -93,7 +94,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
9394
def close(self) -> None:
9495
self._client.close()
9596

96-
def __enter__(self) -> "ContentSafetyClient":
97+
def __enter__(self) -> Self:
9798
self._client.__enter__()
9899
return self
99100

@@ -107,11 +108,11 @@ class BlocklistClient(BlocklistClientOperationsMixin): # pylint: disable=client
107108
:param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
108109
https://:code:`<resource-name>`.cognitiveservices.azure.com). Required.
109110
:type endpoint: str
110-
:param credential: Credential needed for the client to connect to Azure. Is either a
111+
:param credential: Credential used to authenticate requests to the service. Is either a
111112
AzureKeyCredential type or a TokenCredential type. Required.
112113
:type credential: ~azure.core.credentials.AzureKeyCredential or
113114
~azure.core.credentials.TokenCredential
114-
:keyword api_version: The API version to use for this operation. Default value is "2023-10-01".
115+
:keyword api_version: The API version to use for this operation. Default value is "2024-09-01".
115116
Note that overriding this default value may result in unsupported behavior.
116117
:paramtype api_version: str
117118
"""
@@ -162,7 +163,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
162163

163164
request_copy = deepcopy(request)
164165
path_format_arguments = {
165-
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
166+
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"),
166167
}
167168

168169
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
@@ -171,7 +172,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
171172
def close(self) -> None:
172173
self._client.close()
173174

174-
def __enter__(self) -> "BlocklistClient":
175+
def __enter__(self) -> Self:
175176
self._client.__enter__()
176177
return self
177178

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@ 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".
34+
:keyword api_version: The API version to use for this operation. Default value is "2024-09-01".
3535
Note that overriding this default value may result in unsupported behavior.
3636
:paramtype api_version: str
3737
"""
3838

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

4242
if endpoint is None:
4343
raise ValueError("Parameter 'endpoint' must not be None.")
@@ -82,17 +82,17 @@ class BlocklistClientConfiguration: # pylint: disable=too-many-instance-attribu
8282
:param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
8383
https://:code:`<resource-name>`.cognitiveservices.azure.com). Required.
8484
:type endpoint: str
85-
:param credential: Credential needed for the client to connect to Azure. Is either a
85+
:param credential: Credential used to authenticate requests to the service. Is either a
8686
AzureKeyCredential type or a TokenCredential type. Required.
8787
:type credential: ~azure.core.credentials.AzureKeyCredential or
8888
~azure.core.credentials.TokenCredential
89-
:keyword api_version: The API version to use for this operation. Default value is "2023-10-01".
89+
:keyword api_version: The API version to use for this operation. Default value is "2024-09-01".
9090
Note that overriding this default value may result in unsupported behavior.
9191
:paramtype api_version: str
9292
"""
9393

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

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

0 commit comments

Comments
 (0)