Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/face/azure-ai-vision-face/MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ recursive-include tests *.py
recursive-include samples *.py *.md
include azure/__init__.py
include azure/ai/__init__.py
include azure/ai/vision/__init__.py
include azure/ai/vision/__init__.py
5 changes: 2 additions & 3 deletions sdk/face/azure-ai-vision-face/_meta.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"commit": "37acfe2967e5e1be1169146ac461eb1875c9476e",
"commit": "f79d4ed573ec12a63917b01e54baeaa52a914f3f",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"typespec_src": "specification/ai/Face",
"@azure-tools/typespec-python": "0.23.8",
"@autorest/python": "6.13.15"
"@azure-tools/typespec-python": "0.44.1"
}
157 changes: 157 additions & 0 deletions sdk/face/azure-ai-vision-face/apiview-properties.json

Large diffs are not rendered by default.

22 changes: 16 additions & 6 deletions sdk/face/azure-ai-vision-face/azure/ai/vision/face/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,32 @@
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wrong-import-position

from ._client import FaceAdministrationClient
from ._patch import FaceClient
from ._patch import FaceSessionClient
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from ._patch import * # pylint: disable=unused-wildcard-import

from ._client import FaceClient # type: ignore
from ._client import FaceSessionClient # type: ignore
from ._client import FaceAdministrationClient # type: ignore
from ._version import VERSION

__version__ = VERSION


try:
from ._patch import __all__ as _patch_all
from ._patch import *
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk

__all__ = [
"FaceAdministrationClient",
"FaceClient",
"FaceSessionClient",
"FaceAdministrationClient",
]

__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore

_patch_sdk()
67 changes: 35 additions & 32 deletions sdk/face/azure-ai-vision-face/azure/ai/vision/face/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
FaceClientConfiguration,
FaceSessionClientConfiguration,
)
from ._serialization import Deserializer, Serializer
from ._utils.serialization import Deserializer, Serializer
from .operations import (
FaceClientOperationsMixin,
FaceSessionClientOperationsMixin,
Expand All @@ -32,30 +32,25 @@
from azure.core.credentials import TokenCredential


class FaceAdministrationClient:
"""FaceAdministrationClient.
class FaceClient(FaceClientOperationsMixin):
"""FaceClient.

:ivar large_face_list: LargeFaceListOperations operations
:vartype large_face_list: azure.ai.vision.face.operations.LargeFaceListOperations
:ivar large_person_group: LargePersonGroupOperations operations
:vartype large_person_group: azure.ai.vision.face.operations.LargePersonGroupOperations
:param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
https://{resource-name}.cognitiveservices.azure.com). Required.
:type endpoint: str
:param credential: Credential used to authenticate requests to the service. Is either a
AzureKeyCredential type or a TokenCredential type. Required.
:param credential: Credential used to authenticate requests to the service. Is either a key
credential type or a token credential type. Required.
:type credential: ~azure.core.credentials.AzureKeyCredential or
~azure.core.credentials.TokenCredential
:keyword api_version: API Version. Known values are "v1.2-preview.1" and None. Default value is
"v1.2-preview.1". Note that overriding this default value may result in unsupported behavior.
:keyword api_version: API Version. Known values are "v1.2" and None. Default value is "v1.2".
Note that overriding this default value may result in unsupported behavior.
:paramtype api_version: str or ~azure.ai.vision.face.models.Versions
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
"""

def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], **kwargs: Any) -> None:
_endpoint = "{endpoint}/face/{apiVersion}"
self._config = FaceAdministrationClientConfiguration(endpoint=endpoint, credential=credential, **kwargs)
self._config = FaceClientConfiguration(endpoint=endpoint, credential=credential, **kwargs)

_policies = kwargs.pop("policies", None)
if _policies is None:
_policies = [
Expand All @@ -78,10 +73,6 @@ def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCr
self._serialize = Serializer()
self._deserialize = Deserializer()
self._serialize.client_side_validation = False
self.large_face_list = LargeFaceListOperations(self._client, self._config, self._serialize, self._deserialize)
self.large_person_group = LargePersonGroupOperations(
self._client, self._config, self._serialize, self._deserialize
)

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


class FaceClient(FaceClientOperationsMixin):
"""FaceClient.
class FaceSessionClient(FaceSessionClientOperationsMixin):
"""FaceSessionClient.

:param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
https://{resource-name}.cognitiveservices.azure.com). Required.
:type endpoint: str
:param credential: Credential used to authenticate requests to the service. Is either a
AzureKeyCredential type or a TokenCredential type. Required.
:param credential: Credential used to authenticate requests to the service. Is either a key
credential type or a token credential type. Required.
:type credential: ~azure.core.credentials.AzureKeyCredential or
~azure.core.credentials.TokenCredential
:keyword api_version: API Version. Known values are "v1.2-preview.1" and None. Default value is
"v1.2-preview.1". Note that overriding this default value may result in unsupported behavior.
:keyword api_version: API Version. Known values are "v1.2" and None. Default value is "v1.2".
Note that overriding this default value may result in unsupported behavior.
:paramtype api_version: str or ~azure.ai.vision.face.models.Versions
"""

def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], **kwargs: Any) -> None:
_endpoint = "{endpoint}/face/{apiVersion}"
self._config = FaceClientConfiguration(endpoint=endpoint, credential=credential, **kwargs)
self._config = FaceSessionClientConfiguration(endpoint=endpoint, credential=credential, **kwargs)

_policies = kwargs.pop("policies", None)
if _policies is None:
_policies = [
Expand Down Expand Up @@ -200,24 +192,31 @@ def __exit__(self, *exc_details: Any) -> None:
self._client.__exit__(*exc_details)


class FaceSessionClient(FaceSessionClientOperationsMixin):
"""FaceSessionClient.
class FaceAdministrationClient:
"""FaceAdministrationClient.

:ivar large_face_list: LargeFaceListOperations operations
:vartype large_face_list: azure.ai.vision.face.operations.LargeFaceListOperations
:ivar large_person_group: LargePersonGroupOperations operations
:vartype large_person_group: azure.ai.vision.face.operations.LargePersonGroupOperations
:param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
https://{resource-name}.cognitiveservices.azure.com). Required.
:type endpoint: str
:param credential: Credential used to authenticate requests to the service. Is either a
AzureKeyCredential type or a TokenCredential type. Required.
:param credential: Credential used to authenticate requests to the service. Is either a key
credential type or a token credential type. Required.
:type credential: ~azure.core.credentials.AzureKeyCredential or
~azure.core.credentials.TokenCredential
:keyword api_version: API Version. Known values are "v1.2-preview.1" and None. Default value is
"v1.2-preview.1". Note that overriding this default value may result in unsupported behavior.
:keyword api_version: API Version. Known values are "v1.2" and None. Default value is "v1.2".
Note that overriding this default value may result in unsupported behavior.
:paramtype api_version: str or ~azure.ai.vision.face.models.Versions
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
"""

def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCredential"], **kwargs: Any) -> None:
_endpoint = "{endpoint}/face/{apiVersion}"
self._config = FaceSessionClientConfiguration(endpoint=endpoint, credential=credential, **kwargs)
self._config = FaceAdministrationClientConfiguration(endpoint=endpoint, credential=credential, **kwargs)

_policies = kwargs.pop("policies", None)
if _policies is None:
_policies = [
Expand All @@ -240,6 +239,10 @@ def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCr
self._serialize = Serializer()
self._deserialize = Deserializer()
self._serialize.client_side_validation = False
self.large_face_list = LargeFaceListOperations(self._client, self._config, self._serialize, self._deserialize)
self.large_person_group = LargePersonGroupOperations(
self._client, self._config, self._serialize, self._deserialize
)

def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,26 @@
from azure.core.credentials import TokenCredential


class FaceAdministrationClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for FaceAdministrationClient.
class FaceClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for FaceClient.

Note that all parameters used to create this instance are saved as instance
attributes.

:param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
https://{resource-name}.cognitiveservices.azure.com). Required.
:type endpoint: str
:param credential: Credential used to authenticate requests to the service. Is either a
AzureKeyCredential type or a TokenCredential type. Required.
:param credential: Credential used to authenticate requests to the service. Is either a key
credential type or a token credential type. Required.
:type credential: ~azure.core.credentials.AzureKeyCredential or
~azure.core.credentials.TokenCredential
:keyword api_version: API Version. Known values are "v1.2-preview.1" and None. Default value is
"v1.2-preview.1". Note that overriding this default value may result in unsupported behavior.
:keyword api_version: API Version. Known values are "v1.2" and None. Default value is "v1.2".
Note that overriding this default value may result in unsupported behavior.
:paramtype api_version: str or ~azure.ai.vision.face.models.Versions
"""

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

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


class FaceClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for FaceClient.
class FaceSessionClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for FaceSessionClient.

Note that all parameters used to create this instance are saved as instance
attributes.

:param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
https://{resource-name}.cognitiveservices.azure.com). Required.
:type endpoint: str
:param credential: Credential used to authenticate requests to the service. Is either a
AzureKeyCredential type or a TokenCredential type. Required.
:param credential: Credential used to authenticate requests to the service. Is either a key
credential type or a token credential type. Required.
:type credential: ~azure.core.credentials.AzureKeyCredential or
~azure.core.credentials.TokenCredential
:keyword api_version: API Version. Known values are "v1.2-preview.1" and None. Default value is
"v1.2-preview.1". Note that overriding this default value may result in unsupported behavior.
:keyword api_version: API Version. Known values are "v1.2" and None. Default value is "v1.2".
Note that overriding this default value may result in unsupported behavior.
:paramtype api_version: str or ~azure.ai.vision.face.models.Versions
"""

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

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


class FaceSessionClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for FaceSessionClient.
class FaceAdministrationClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for FaceAdministrationClient.

Note that all parameters used to create this instance are saved as instance
attributes.

:param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example:
https://{resource-name}.cognitiveservices.azure.com). Required.
:type endpoint: str
:param credential: Credential used to authenticate requests to the service. Is either a
AzureKeyCredential type or a TokenCredential type. Required.
:param credential: Credential used to authenticate requests to the service. Is either a key
credential type or a token credential type. Required.
:type credential: ~azure.core.credentials.AzureKeyCredential or
~azure.core.credentials.TokenCredential
:keyword api_version: API Version. Known values are "v1.2-preview.1" and None. Default value is
"v1.2-preview.1". Note that overriding this default value may result in unsupported behavior.
:keyword api_version: API Version. Known values are "v1.2" and None. Default value is "v1.2".
Note that overriding this default value may result in unsupported behavior.
:paramtype api_version: str or ~azure.ai.vision.face.models.Versions
"""

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

if endpoint is None:
raise ValueError("Parameter 'endpoint' must not be None.")
Expand Down
Loading