From aec29fe3419d48a8dc95e75b148ae3fb84175db5 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 23 Apr 2025 06:14:45 +0000 Subject: [PATCH] CodeGen from PR 34151 in Azure/azure-rest-api-specs Merge c1506d0ae032c43d982826fd676bab1f0461e3d9 into 8aec79a152427661e737c7d569772709f921d943 --- .../README.md | 4 +-- .../_meta.json | 4 +-- .../mgmt/arizeaiobservabilityeval/_client.py | 26 +++++++++++------ .../arizeaiobservabilityeval/_model_base.py | 27 ++++++++---------- .../_serialization.py | 26 +++-------------- .../arizeaiobservabilityeval/aio/_client.py | 28 +++++++++++++------ .../aio/operations/_operations.py | 8 ++---- .../operations/_operations.py | 8 ++---- .../setup.py | 5 ++-- .../tsp-location.yaml | 2 +- 10 files changed, 63 insertions(+), 75 deletions(-) diff --git a/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/README.md b/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/README.md index 6ede51028f54..df94b225ea62 100644 --- a/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/README.md +++ b/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Python This is the Microsoft Azure Arizeaiobservabilityeval Management Client Library. -This package has been tested with Python 3.8+. +This package has been tested with Python 3.9+. For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). ## _Disclaimer_ @@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites -- Python 3.8+ is required to use this package. +- Python 3.9+ is required to use this package. - [Azure subscription](https://azure.microsoft.com/free/) ### Install the package diff --git a/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/_meta.json b/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/_meta.json index 83a7359571e9..ac8ab8d431f1 100644 --- a/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/_meta.json +++ b/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/_meta.json @@ -1,6 +1,6 @@ { - "commit": "1b47f62ee9da78db7e011c709c48ecd700095a5a", + "commit": "0f615e3d0511503ee1cbf69629fd3d0e66a9ac46", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/liftrarize/ArizeAi.ObservabilityEval.Management", - "@azure-tools/typespec-python": "0.41.0" + "@azure-tools/typespec-python": "0.43.0" } \ No newline at end of file diff --git a/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/azure/mgmt/arizeaiobservabilityeval/_client.py b/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/azure/mgmt/arizeaiobservabilityeval/_client.py index 4a2616d32b0f..5216c48b2c5c 100644 --- a/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/azure/mgmt/arizeaiobservabilityeval/_client.py +++ b/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/azure/mgmt/arizeaiobservabilityeval/_client.py @@ -7,13 +7,15 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING, cast from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse +from azure.core.settings import settings from azure.mgmt.core import ARMPipelineClient from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints from ._configuration import ArizeAIObservabilityEvalMgmtClientConfiguration from ._serialization import Deserializer, Serializer @@ -34,7 +36,7 @@ class ArizeAIObservabilityEvalMgmtClient: :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service host. Default value is "https://management.azure.com". + :param base_url: Service host. Default value is None. :type base_url: str :keyword api_version: The API version to use for this operation. Default value is "2024-10-01-preview". Note that overriding this default value may result in unsupported @@ -45,16 +47,22 @@ class ArizeAIObservabilityEvalMgmtClient: """ def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any + self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: _endpoint = "{endpoint}" + _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = ArizeAIObservabilityEvalMgmtClientConfiguration( - credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs + credential=credential, + subscription_id=subscription_id, + base_url=cast(str, base_url), + credential_scopes=credential_scopes, + **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -73,7 +81,7 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs) self._serialize = Serializer() self._deserialize = Deserializer() diff --git a/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/azure/mgmt/arizeaiobservabilityeval/_model_base.py b/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/azure/mgmt/arizeaiobservabilityeval/_model_base.py index 3072ee252ed9..49d5c7259389 100644 --- a/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/azure/mgmt/arizeaiobservabilityeval/_model_base.py +++ b/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/azure/mgmt/arizeaiobservabilityeval/_model_base.py @@ -2,8 +2,9 @@ # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=protected-access, broad-except @@ -21,6 +22,7 @@ from datetime import datetime, date, time, timedelta, timezone from json import JSONEncoder import xml.etree.ElementTree as ET +from collections.abc import MutableMapping from typing_extensions import Self import isodate from azure.core.exceptions import DeserializationError @@ -28,11 +30,6 @@ from azure.core.pipeline import PipelineResponse from azure.core.serialization import _Null -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping - _LOGGER = logging.getLogger(__name__) __all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] @@ -347,7 +344,7 @@ def _get_model(module_name: str, model_name: str): _UNSET = object() -class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object +class _MyMutableMapping(MutableMapping[str, typing.Any]): def __init__(self, data: typing.Dict[str, typing.Any]) -> None: self._data = data @@ -407,13 +404,13 @@ def get(self, key: str, default: typing.Any = None) -> typing.Any: return default @typing.overload - def pop(self, key: str) -> typing.Any: ... + def pop(self, key: str) -> typing.Any: ... # pylint: disable=arguments-differ @typing.overload - def pop(self, key: str, default: _T) -> _T: ... + def pop(self, key: str, default: _T) -> _T: ... # pylint: disable=signature-differs @typing.overload - def pop(self, key: str, default: typing.Any) -> typing.Any: ... + def pop(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: """ @@ -443,7 +440,7 @@ def clear(self) -> None: """ self._data.clear() - def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: + def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ """ Updates D from mapping/iterable E and F. :param any args: Either a mapping object or an iterable of key-value pairs. @@ -454,7 +451,7 @@ def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: def setdefault(self, key: str, default: None = None) -> None: ... @typing.overload - def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... + def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: """ @@ -644,7 +641,7 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: cls._attr_to_rest_field: typing.Dict[str, _RestField] = dict(attr_to_rest_field.items()) cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") - return super().__new__(cls) # pylint: disable=no-value-for-parameter + return super().__new__(cls) def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: for base in cls.__bases__: @@ -680,7 +677,7 @@ def _deserialize(cls, data, exist_discriminators): discriminator_value = data.find(xml_name).text # pyright: ignore else: discriminator_value = data.get(discriminator._rest_name) - mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member return mapped_cls._deserialize(data, exist_discriminators) def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: diff --git a/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/azure/mgmt/arizeaiobservabilityeval/_serialization.py b/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/azure/mgmt/arizeaiobservabilityeval/_serialization.py index 7a0232de5ddc..eb86ea23c965 100644 --- a/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/azure/mgmt/arizeaiobservabilityeval/_serialization.py +++ b/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/azure/mgmt/arizeaiobservabilityeval/_serialization.py @@ -1,28 +1,10 @@ # pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 # -------------------------------------------------------------------------- -# # Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pyright: reportUnnecessaryTypeIgnoreComment=false diff --git a/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/azure/mgmt/arizeaiobservabilityeval/aio/_client.py b/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/azure/mgmt/arizeaiobservabilityeval/aio/_client.py index 39921bca2337..2fbc5286817b 100644 --- a/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/azure/mgmt/arizeaiobservabilityeval/aio/_client.py +++ b/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/azure/mgmt/arizeaiobservabilityeval/aio/_client.py @@ -7,13 +7,15 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING +from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.settings import settings from azure.mgmt.core import AsyncARMPipelineClient from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints from .._serialization import Deserializer, Serializer from ._configuration import ArizeAIObservabilityEvalMgmtClientConfiguration @@ -35,7 +37,7 @@ class ArizeAIObservabilityEvalMgmtClient: :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service host. Default value is "https://management.azure.com". + :param base_url: Service host. Default value is None. :type base_url: str :keyword api_version: The API version to use for this operation. Default value is "2024-10-01-preview". Note that overriding this default value may result in unsupported @@ -46,16 +48,22 @@ class ArizeAIObservabilityEvalMgmtClient: """ def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: str = "https://management.azure.com", - **kwargs: Any + self, credential: "AsyncTokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: _endpoint = "{endpoint}" + _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = ArizeAIObservabilityEvalMgmtClientConfiguration( - credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs + credential=credential, + subscription_id=subscription_id, + base_url=cast(str, base_url), + credential_scopes=credential_scopes, + **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -74,7 +82,9 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient( + base_url=cast(str, _endpoint), policies=_policies, **kwargs + ) self._serialize = Serializer() self._deserialize = Deserializer() diff --git a/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/azure/mgmt/arizeaiobservabilityeval/aio/operations/_operations.py b/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/azure/mgmt/arizeaiobservabilityeval/aio/operations/_operations.py index 978a312584d9..7ade35da9abc 100644 --- a/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/azure/mgmt/arizeaiobservabilityeval/aio/operations/_operations.py +++ b/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/azure/mgmt/arizeaiobservabilityeval/aio/operations/_operations.py @@ -5,9 +5,9 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase import json -import sys from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -46,13 +46,9 @@ ) from .._configuration import ArizeAIObservabilityEvalMgmtClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +JSON = MutableMapping[str, Any] class Operations: diff --git a/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/azure/mgmt/arizeaiobservabilityeval/operations/_operations.py b/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/azure/mgmt/arizeaiobservabilityeval/operations/_operations.py index 2a682712e1d5..92f2fd1ada47 100644 --- a/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/azure/mgmt/arizeaiobservabilityeval/operations/_operations.py +++ b/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/azure/mgmt/arizeaiobservabilityeval/operations/_operations.py @@ -6,9 +6,9 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase import json -import sys from typing import Any, Callable, Dict, IO, Iterable, Iterator, List, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -37,13 +37,9 @@ from .._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._serialization import Deserializer, Serializer -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +JSON = MutableMapping[str, Any] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False diff --git a/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/setup.py b/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/setup.py index 059e33c858c1..67fa643d435a 100644 --- a/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/setup.py +++ b/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/setup.py @@ -53,7 +53,6 @@ "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -77,7 +76,7 @@ "isodate>=0.6.1", "typing-extensions>=4.6.0", "azure-common>=1.1", - "azure-mgmt-core>=1.3.2", + "azure-mgmt-core>=1.5.0", ], - python_requires=">=3.8", + python_requires=">=3.9", ) diff --git a/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/tsp-location.yaml b/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/tsp-location.yaml index d1ed09794200..bc41ce841e36 100644 --- a/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/tsp-location.yaml +++ b/sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/liftrarize/ArizeAi.ObservabilityEval.Management -commit: 1b47f62ee9da78db7e011c709c48ecd700095a5a +commit: 0f615e3d0511503ee1cbf69629fd3d0e66a9ac46 repo: Azure/azure-rest-api-specs additionalDirectories: