Skip to content

Commit 7f890d9

Browse files
author
SDKAuto
committed
CodeGen from PR 3383 in test-repo-billy/azure-rest-api-specs
Merge 24e8fc9a3de89c41812f7390e4fb266159ab2929 into 38f1c3fea49fef7f917ab06516df896f11b4741a
1 parent a1a6086 commit 7f890d9

34 files changed

+2706
-792
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"commit": "df98780fe1e53713c0f5c3785409c1e07529355b",
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.37.1"
6+
}

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,22 @@
55
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
89

9-
from ._client import ContentSafetyClient
10-
from ._client import BlocklistClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._client import ContentSafetyClient # type: ignore
16+
from ._client import BlocklistClient # type: ignore
1117
from ._version import VERSION
1218

1319
__version__ = VERSION
1420

1521
try:
1622
from ._patch import __all__ as _patch_all
17-
from ._patch import * # pylint: disable=unused-wildcard-import
23+
from ._patch import *
1824
except ImportError:
1925
_patch_all = []
2026
from ._patch import patch_sdk as _patch_sdk
@@ -23,6 +29,6 @@
2329
"ContentSafetyClient",
2430
"BlocklistClient",
2531
]
26-
__all__.extend([p for p in _patch_all if p not in __all__])
32+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2733

2834
_patch_sdk()

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

Lines changed: 11 additions & 11 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
@@ -19,21 +20,20 @@
1920
from ._serialization import Deserializer, Serializer
2021

2122
if 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:
3030
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
32+
:param credential: Credential used to authenticate requests to the service. Is either a
3333
AzureKeyCredential type or a TokenCredential 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:
108108
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
110+
:param credential: Credential used to authenticate requests to the service. Is either a
111111
AzureKeyCredential type or a TokenCredential 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

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

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@
1414
from ._version import VERSION
1515

1616
if TYPE_CHECKING:
17-
# pylint: disable=unused-import,ungrouped-imports
1817
from azure.core.credentials import TokenCredential
1918

2019

21-
class ContentSafetyClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
20+
class ContentSafetyClientConfiguration: # pylint: disable=too-many-instance-attributes
2221
"""Configuration for ContentSafetyClient.
2322
2423
Note that all parameters used to create this instance are saved as instance
@@ -27,17 +26,17 @@ class ContentSafetyClientConfiguration: # pylint: disable=too-many-instance-att
2726
:param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
2827
https://:code:`<resource-name>`.cognitiveservices.azure.com). Required.
2928
:type endpoint: str
30-
:param credential: Credential needed for the client to connect to Azure. Is either a
29+
:param credential: Credential used to authenticate requests to the service. Is either a
3130
AzureKeyCredential type or a TokenCredential type. Required.
3231
:type credential: ~azure.core.credentials.AzureKeyCredential or
3332
~azure.core.credentials.TokenCredential
34-
:keyword api_version: The API version to use for this operation. Default value is "2023-10-01".
33+
:keyword api_version: The API version to use for this operation. Default value is "2024-09-01".
3534
Note that overriding this default value may result in unsupported behavior.
3635
:paramtype api_version: str
3736
"""
3837

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

4241
if endpoint is None:
4342
raise ValueError("Parameter 'endpoint' must not be None.")
@@ -73,7 +72,7 @@ def _configure(self, **kwargs: Any) -> None:
7372
self.authentication_policy = self._infer_policy(**kwargs)
7473

7574

76-
class BlocklistClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
75+
class BlocklistClientConfiguration: # pylint: disable=too-many-instance-attributes
7776
"""Configuration for BlocklistClient.
7877
7978
Note that all parameters used to create this instance are saved as instance
@@ -82,17 +81,17 @@ class BlocklistClientConfiguration: # pylint: disable=too-many-instance-attribu
8281
:param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
8382
https://:code:`<resource-name>`.cognitiveservices.azure.com). Required.
8483
:type endpoint: str
85-
:param credential: Credential needed for the client to connect to Azure. Is either a
84+
:param credential: Credential used to authenticate requests to the service. Is either a
8685
AzureKeyCredential type or a TokenCredential type. Required.
8786
:type credential: ~azure.core.credentials.AzureKeyCredential or
8887
~azure.core.credentials.TokenCredential
89-
:keyword api_version: The API version to use for this operation. Default value is "2023-10-01".
88+
:keyword api_version: The API version to use for this operation. Default value is "2024-09-01".
9089
Note that overriding this default value may result in unsupported behavior.
9190
:paramtype api_version: str
9291
"""
9392

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

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

0 commit comments

Comments
 (0)