Skip to content

Commit 673e38e

Browse files
author
SDKAuto
committed
CodeGen from PR 34482 in Azure/azure-rest-api-specs
Merge fa64c1469fbda362463c521e705f73712570e30f into 532b1b8f4efdb960efce95c6694164303d79a3fc
1 parent d4c265e commit 673e38e

File tree

72 files changed

+8889
-10135
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+8889
-10135
lines changed

sdk/face/azure-ai-vision-face/MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ recursive-include tests *.py
55
recursive-include samples *.py *.md
66
include azure/__init__.py
77
include azure/ai/__init__.py
8-
include azure/ai/vision/__init__.py
8+
include azure/ai/vision/__init__.py
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
2-
"commit": "37acfe2967e5e1be1169146ac461eb1875c9476e",
2+
"commit": "7fcb3ce530a86cd875bde639930c856408c54fc4",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"typespec_src": "specification/ai/Face",
5-
"@azure-tools/typespec-python": "0.23.8",
6-
"@autorest/python": "6.13.15"
5+
"@azure-tools/typespec-python": "0.44.1"
76
}

sdk/face/azure-ai-vision-face/apiview-properties.json

Lines changed: 157 additions & 0 deletions
Large diffs are not rendered by default.

sdk/face/azure-ai-vision-face/azure/ai/vision/face/__init__.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,32 @@
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 FaceAdministrationClient
10-
from ._patch import FaceClient
11-
from ._patch import FaceSessionClient
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 FaceClient # type: ignore
16+
from ._client import FaceSessionClient # type: ignore
17+
from ._client import FaceAdministrationClient # type: ignore
1218
from ._version import VERSION
1319

1420
__version__ = VERSION
1521

16-
22+
try:
23+
from ._patch import __all__ as _patch_all
24+
from ._patch import *
25+
except ImportError:
26+
_patch_all = []
1727
from ._patch import patch_sdk as _patch_sdk
1828

1929
__all__ = [
20-
"FaceAdministrationClient",
2130
"FaceClient",
2231
"FaceSessionClient",
32+
"FaceAdministrationClient",
2333
]
24-
34+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2535

2636
_patch_sdk()

sdk/face/azure-ai-vision-face/azure/ai/vision/face/_client.py

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
FaceClientConfiguration,
2121
FaceSessionClientConfiguration,
2222
)
23-
from ._serialization import Deserializer, Serializer
23+
from ._utils.serialization import Deserializer, Serializer
2424
from .operations import (
2525
FaceClientOperationsMixin,
2626
FaceSessionClientOperationsMixin,
@@ -32,30 +32,25 @@
3232
from azure.core.credentials import TokenCredential
3333

3434

35-
class FaceAdministrationClient:
36-
"""FaceAdministrationClient.
35+
class FaceClient(FaceClientOperationsMixin):
36+
"""FaceClient.
3737
38-
:ivar large_face_list: LargeFaceListOperations operations
39-
:vartype large_face_list: azure.ai.vision.face.operations.LargeFaceListOperations
40-
:ivar large_person_group: LargePersonGroupOperations operations
41-
:vartype large_person_group: azure.ai.vision.face.operations.LargePersonGroupOperations
4238
:param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
4339
https://{resource-name}.cognitiveservices.azure.com). Required.
4440
:type endpoint: str
45-
:param credential: Credential used to authenticate requests to the service. Is either a
46-
AzureKeyCredential type or a TokenCredential type. Required.
41+
:param credential: Credential used to authenticate requests to the service. Is either a key
42+
credential type or a token credential type. Required.
4743
:type credential: ~azure.core.credentials.AzureKeyCredential or
4844
~azure.core.credentials.TokenCredential
49-
:keyword api_version: API Version. Known values are "v1.2-preview.1" and None. Default value is
50-
"v1.2-preview.1". Note that overriding this default value may result in unsupported behavior.
45+
:keyword api_version: API Version. Known values are "v1.2" and None. Default value is "v1.2".
46+
Note that overriding this default value may result in unsupported behavior.
5147
:paramtype api_version: str or ~azure.ai.vision.face.models.Versions
52-
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
53-
Retry-After header is present.
5448
"""
5549

5650
def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], **kwargs: Any) -> None:
5751
_endpoint = "{endpoint}/face/{apiVersion}"
58-
self._config = FaceAdministrationClientConfiguration(endpoint=endpoint, credential=credential, **kwargs)
52+
self._config = FaceClientConfiguration(endpoint=endpoint, credential=credential, **kwargs)
53+
5954
_policies = kwargs.pop("policies", None)
6055
if _policies is None:
6156
_policies = [
@@ -78,10 +73,6 @@ def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCr
7873
self._serialize = Serializer()
7974
self._deserialize = Deserializer()
8075
self._serialize.client_side_validation = False
81-
self.large_face_list = LargeFaceListOperations(self._client, self._config, self._serialize, self._deserialize)
82-
self.large_person_group = LargePersonGroupOperations(
83-
self._client, self._config, self._serialize, self._deserialize
84-
)
8576

8677
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
8778
"""Runs the network request through the client's chained policies.
@@ -121,24 +112,25 @@ def __exit__(self, *exc_details: Any) -> None:
121112
self._client.__exit__(*exc_details)
122113

123114

124-
class FaceClient(FaceClientOperationsMixin):
125-
"""FaceClient.
115+
class FaceSessionClient(FaceSessionClientOperationsMixin):
116+
"""FaceSessionClient.
126117
127118
:param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
128119
https://{resource-name}.cognitiveservices.azure.com). Required.
129120
:type endpoint: str
130-
:param credential: Credential used to authenticate requests to the service. Is either a
131-
AzureKeyCredential type or a TokenCredential type. Required.
121+
:param credential: Credential used to authenticate requests to the service. Is either a key
122+
credential type or a token credential type. Required.
132123
:type credential: ~azure.core.credentials.AzureKeyCredential or
133124
~azure.core.credentials.TokenCredential
134-
:keyword api_version: API Version. Known values are "v1.2-preview.1" and None. Default value is
135-
"v1.2-preview.1". Note that overriding this default value may result in unsupported behavior.
125+
:keyword api_version: API Version. Known values are "v1.2" and None. Default value is "v1.2".
126+
Note that overriding this default value may result in unsupported behavior.
136127
:paramtype api_version: str or ~azure.ai.vision.face.models.Versions
137128
"""
138129

139130
def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], **kwargs: Any) -> None:
140131
_endpoint = "{endpoint}/face/{apiVersion}"
141-
self._config = FaceClientConfiguration(endpoint=endpoint, credential=credential, **kwargs)
132+
self._config = FaceSessionClientConfiguration(endpoint=endpoint, credential=credential, **kwargs)
133+
142134
_policies = kwargs.pop("policies", None)
143135
if _policies is None:
144136
_policies = [
@@ -200,24 +192,31 @@ def __exit__(self, *exc_details: Any) -> None:
200192
self._client.__exit__(*exc_details)
201193

202194

203-
class FaceSessionClient(FaceSessionClientOperationsMixin):
204-
"""FaceSessionClient.
195+
class FaceAdministrationClient:
196+
"""FaceAdministrationClient.
205197
198+
:ivar large_face_list: LargeFaceListOperations operations
199+
:vartype large_face_list: azure.ai.vision.face.operations.LargeFaceListOperations
200+
:ivar large_person_group: LargePersonGroupOperations operations
201+
:vartype large_person_group: azure.ai.vision.face.operations.LargePersonGroupOperations
206202
:param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
207203
https://{resource-name}.cognitiveservices.azure.com). Required.
208204
:type endpoint: str
209-
:param credential: Credential used to authenticate requests to the service. Is either a
210-
AzureKeyCredential type or a TokenCredential type. Required.
205+
:param credential: Credential used to authenticate requests to the service. Is either a key
206+
credential type or a token credential type. Required.
211207
:type credential: ~azure.core.credentials.AzureKeyCredential or
212208
~azure.core.credentials.TokenCredential
213-
:keyword api_version: API Version. Known values are "v1.2-preview.1" and None. Default value is
214-
"v1.2-preview.1". Note that overriding this default value may result in unsupported behavior.
209+
:keyword api_version: API Version. Known values are "v1.2" and None. Default value is "v1.2".
210+
Note that overriding this default value may result in unsupported behavior.
215211
:paramtype api_version: str or ~azure.ai.vision.face.models.Versions
212+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
213+
Retry-After header is present.
216214
"""
217215

218216
def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], **kwargs: Any) -> None:
219217
_endpoint = "{endpoint}/face/{apiVersion}"
220-
self._config = FaceSessionClientConfiguration(endpoint=endpoint, credential=credential, **kwargs)
218+
self._config = FaceAdministrationClientConfiguration(endpoint=endpoint, credential=credential, **kwargs)
219+
221220
_policies = kwargs.pop("policies", None)
222221
if _policies is None:
223222
_policies = [
@@ -240,6 +239,10 @@ def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCr
240239
self._serialize = Serializer()
241240
self._deserialize = Deserializer()
242241
self._serialize.client_side_validation = False
242+
self.large_face_list = LargeFaceListOperations(self._client, self._config, self._serialize, self._deserialize)
243+
self.large_person_group = LargePersonGroupOperations(
244+
self._client, self._config, self._serialize, self._deserialize
245+
)
243246

244247
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
245248
"""Runs the network request through the client's chained policies.

sdk/face/azure-ai-vision-face/azure/ai/vision/face/_configuration.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,26 @@
1717
from azure.core.credentials import TokenCredential
1818

1919

20-
class FaceAdministrationClientConfiguration: # pylint: disable=too-many-instance-attributes
21-
"""Configuration for FaceAdministrationClient.
20+
class FaceClientConfiguration: # pylint: disable=too-many-instance-attributes
21+
"""Configuration for FaceClient.
2222
2323
Note that all parameters used to create this instance are saved as instance
2424
attributes.
2525
2626
:param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
2727
https://{resource-name}.cognitiveservices.azure.com). Required.
2828
:type endpoint: str
29-
:param credential: Credential used to authenticate requests to the service. Is either a
30-
AzureKeyCredential type or a TokenCredential type. Required.
29+
:param credential: Credential used to authenticate requests to the service. Is either a key
30+
credential type or a token credential type. Required.
3131
:type credential: ~azure.core.credentials.AzureKeyCredential or
3232
~azure.core.credentials.TokenCredential
33-
:keyword api_version: API Version. Known values are "v1.2-preview.1" and None. Default value is
34-
"v1.2-preview.1". Note that overriding this default value may result in unsupported behavior.
33+
:keyword api_version: API Version. Known values are "v1.2" and None. Default value is "v1.2".
34+
Note that overriding this default value may result in unsupported behavior.
3535
:paramtype api_version: str or ~azure.ai.vision.face.models.Versions
3636
"""
3737

3838
def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], **kwargs: Any) -> None:
39-
api_version: str = kwargs.pop("api_version", "v1.2-preview.1")
39+
api_version: str = kwargs.pop("api_version", "v1.2")
4040

4141
if endpoint is None:
4242
raise ValueError("Parameter 'endpoint' must not be None.")
@@ -72,26 +72,26 @@ def _configure(self, **kwargs: Any) -> None:
7272
self.authentication_policy = self._infer_policy(**kwargs)
7373

7474

75-
class FaceClientConfiguration: # pylint: disable=too-many-instance-attributes
76-
"""Configuration for FaceClient.
75+
class FaceSessionClientConfiguration: # pylint: disable=too-many-instance-attributes
76+
"""Configuration for FaceSessionClient.
7777
7878
Note that all parameters used to create this instance are saved as instance
7979
attributes.
8080
8181
:param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
8282
https://{resource-name}.cognitiveservices.azure.com). Required.
8383
:type endpoint: str
84-
:param credential: Credential used to authenticate requests to the service. Is either a
85-
AzureKeyCredential type or a TokenCredential type. Required.
84+
:param credential: Credential used to authenticate requests to the service. Is either a key
85+
credential type or a token credential type. Required.
8686
:type credential: ~azure.core.credentials.AzureKeyCredential or
8787
~azure.core.credentials.TokenCredential
88-
:keyword api_version: API Version. Known values are "v1.2-preview.1" and None. Default value is
89-
"v1.2-preview.1". Note that overriding this default value may result in unsupported behavior.
88+
:keyword api_version: API Version. Known values are "v1.2" and None. Default value is "v1.2".
89+
Note that overriding this default value may result in unsupported behavior.
9090
:paramtype api_version: str or ~azure.ai.vision.face.models.Versions
9191
"""
9292

9393
def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], **kwargs: Any) -> None:
94-
api_version: str = kwargs.pop("api_version", "v1.2-preview.1")
94+
api_version: str = kwargs.pop("api_version", "v1.2")
9595

9696
if endpoint is None:
9797
raise ValueError("Parameter 'endpoint' must not be None.")
@@ -127,26 +127,26 @@ def _configure(self, **kwargs: Any) -> None:
127127
self.authentication_policy = self._infer_policy(**kwargs)
128128

129129

130-
class FaceSessionClientConfiguration: # pylint: disable=too-many-instance-attributes
131-
"""Configuration for FaceSessionClient.
130+
class FaceAdministrationClientConfiguration: # pylint: disable=too-many-instance-attributes
131+
"""Configuration for FaceAdministrationClient.
132132
133133
Note that all parameters used to create this instance are saved as instance
134134
attributes.
135135
136136
:param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
137137
https://{resource-name}.cognitiveservices.azure.com). Required.
138138
:type endpoint: str
139-
:param credential: Credential used to authenticate requests to the service. Is either a
140-
AzureKeyCredential type or a TokenCredential type. Required.
139+
:param credential: Credential used to authenticate requests to the service. Is either a key
140+
credential type or a token credential type. Required.
141141
:type credential: ~azure.core.credentials.AzureKeyCredential or
142142
~azure.core.credentials.TokenCredential
143-
:keyword api_version: API Version. Known values are "v1.2-preview.1" and None. Default value is
144-
"v1.2-preview.1". Note that overriding this default value may result in unsupported behavior.
143+
:keyword api_version: API Version. Known values are "v1.2" and None. Default value is "v1.2".
144+
Note that overriding this default value may result in unsupported behavior.
145145
:paramtype api_version: str or ~azure.ai.vision.face.models.Versions
146146
"""
147147

148148
def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], **kwargs: Any) -> None:
149-
api_version: str = kwargs.pop("api_version", "v1.2-preview.1")
149+
api_version: str = kwargs.pop("api_version", "v1.2")
150150

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

0 commit comments

Comments
 (0)