Skip to content

Commit aec29fe

Browse files
author
SDKAuto
committed
CodeGen from PR 34151 in Azure/azure-rest-api-specs
Merge c1506d0ae032c43d982826fd676bab1f0461e3d9 into 8aec79a152427661e737c7d569772709f921d943
1 parent 3be08f1 commit aec29fe

File tree

10 files changed

+63
-75
lines changed

10 files changed

+63
-75
lines changed

sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Arizeaiobservabilityeval Management Client Library.
4-
This package has been tested with Python 3.8+.
4+
This package has been tested with Python 3.9+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
@@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
1212

1313
### Prerequisites
1414

15-
- Python 3.8+ is required to use this package.
15+
- Python 3.9+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"commit": "1b47f62ee9da78db7e011c709c48ecd700095a5a",
2+
"commit": "0f615e3d0511503ee1cbf69629fd3d0e66a9ac46",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"typespec_src": "specification/liftrarize/ArizeAi.ObservabilityEval.Management",
5-
"@azure-tools/typespec-python": "0.41.0"
5+
"@azure-tools/typespec-python": "0.43.0"
66
}

sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/azure/mgmt/arizeaiobservabilityeval/_client.py

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
# --------------------------------------------------------------------------
88

99
from copy import deepcopy
10-
from typing import Any, TYPE_CHECKING
10+
from typing import Any, Optional, TYPE_CHECKING, cast
1111
from typing_extensions import Self
1212

1313
from azure.core.pipeline import policies
1414
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.core.settings import settings
1516
from azure.mgmt.core import ARMPipelineClient
1617
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
1719

1820
from ._configuration import ArizeAIObservabilityEvalMgmtClientConfiguration
1921
from ._serialization import Deserializer, Serializer
@@ -34,7 +36,7 @@ class ArizeAIObservabilityEvalMgmtClient:
3436
:type credential: ~azure.core.credentials.TokenCredential
3537
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3638
:type subscription_id: str
37-
:param base_url: Service host. Default value is "https://management.azure.com".
39+
:param base_url: Service host. Default value is None.
3840
:type base_url: str
3941
:keyword api_version: The API version to use for this operation. Default value is
4042
"2024-10-01-preview". Note that overriding this default value may result in unsupported
@@ -45,16 +47,22 @@ class ArizeAIObservabilityEvalMgmtClient:
4547
"""
4648

4749
def __init__(
48-
self,
49-
credential: "TokenCredential",
50-
subscription_id: str,
51-
base_url: str = "https://management.azure.com",
52-
**kwargs: Any
50+
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
5351
) -> None:
5452
_endpoint = "{endpoint}"
53+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
54+
_endpoints = get_arm_endpoints(_cloud)
55+
if not base_url:
56+
base_url = _endpoints["resource_manager"]
57+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
5558
self._config = ArizeAIObservabilityEvalMgmtClientConfiguration(
56-
credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs
59+
credential=credential,
60+
subscription_id=subscription_id,
61+
base_url=cast(str, base_url),
62+
credential_scopes=credential_scopes,
63+
**kwargs
5764
)
65+
5866
_policies = kwargs.pop("policies", None)
5967
if _policies is None:
6068
_policies = [
@@ -73,7 +81,7 @@ def __init__(
7381
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
7482
self._config.http_logging_policy,
7583
]
76-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs)
84+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs)
7785

7886
self._serialize = Serializer()
7987
self._deserialize = Deserializer()

sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/azure/mgmt/arizeaiobservabilityeval/_model_base.py

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
# coding=utf-8
33
# --------------------------------------------------------------------------
44
# Copyright (c) Microsoft Corporation. All rights reserved.
5-
# Licensed under the MIT License. See License.txt in the project root for
6-
# license information.
5+
# Licensed under the MIT License. See License.txt in the project root for license information.
6+
# Code generated by Microsoft (R) Python Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
78
# --------------------------------------------------------------------------
89
# pylint: disable=protected-access, broad-except
910

@@ -21,18 +22,14 @@
2122
from datetime import datetime, date, time, timedelta, timezone
2223
from json import JSONEncoder
2324
import xml.etree.ElementTree as ET
25+
from collections.abc import MutableMapping
2426
from typing_extensions import Self
2527
import isodate
2628
from azure.core.exceptions import DeserializationError
2729
from azure.core import CaseInsensitiveEnumMeta
2830
from azure.core.pipeline import PipelineResponse
2931
from azure.core.serialization import _Null
3032

31-
if sys.version_info >= (3, 9):
32-
from collections.abc import MutableMapping
33-
else:
34-
from typing import MutableMapping
35-
3633
_LOGGER = logging.getLogger(__name__)
3734

3835
__all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"]
@@ -347,7 +344,7 @@ def _get_model(module_name: str, model_name: str):
347344
_UNSET = object()
348345

349346

350-
class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object
347+
class _MyMutableMapping(MutableMapping[str, typing.Any]):
351348
def __init__(self, data: typing.Dict[str, typing.Any]) -> None:
352349
self._data = data
353350

@@ -407,13 +404,13 @@ def get(self, key: str, default: typing.Any = None) -> typing.Any:
407404
return default
408405

409406
@typing.overload
410-
def pop(self, key: str) -> typing.Any: ...
407+
def pop(self, key: str) -> typing.Any: ... # pylint: disable=arguments-differ
411408

412409
@typing.overload
413-
def pop(self, key: str, default: _T) -> _T: ...
410+
def pop(self, key: str, default: _T) -> _T: ... # pylint: disable=signature-differs
414411

415412
@typing.overload
416-
def pop(self, key: str, default: typing.Any) -> typing.Any: ...
413+
def pop(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs
417414

418415
def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any:
419416
"""
@@ -443,7 +440,7 @@ def clear(self) -> None:
443440
"""
444441
self._data.clear()
445442

446-
def update(self, *args: typing.Any, **kwargs: typing.Any) -> None:
443+
def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ
447444
"""
448445
Updates D from mapping/iterable E and F.
449446
: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:
454451
def setdefault(self, key: str, default: None = None) -> None: ...
455452

456453
@typing.overload
457-
def setdefault(self, key: str, default: typing.Any) -> typing.Any: ...
454+
def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs
458455

459456
def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any:
460457
"""
@@ -644,7 +641,7 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self:
644641
cls._attr_to_rest_field: typing.Dict[str, _RestField] = dict(attr_to_rest_field.items())
645642
cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}")
646643

647-
return super().__new__(cls) # pylint: disable=no-value-for-parameter
644+
return super().__new__(cls)
648645

649646
def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None:
650647
for base in cls.__bases__:
@@ -680,7 +677,7 @@ def _deserialize(cls, data, exist_discriminators):
680677
discriminator_value = data.find(xml_name).text # pyright: ignore
681678
else:
682679
discriminator_value = data.get(discriminator._rest_name)
683-
mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore
680+
mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member
684681
return mapped_cls._deserialize(data, exist_discriminators)
685682

686683
def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]:

sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/azure/mgmt/arizeaiobservabilityeval/_serialization.py

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,10 @@
11
# pylint: disable=line-too-long,useless-suppression,too-many-lines
2+
# coding=utf-8
23
# --------------------------------------------------------------------------
3-
#
44
# Copyright (c) Microsoft Corporation. All rights reserved.
5-
#
6-
# The MIT License (MIT)
7-
#
8-
# Permission is hereby granted, free of charge, to any person obtaining a copy
9-
# of this software and associated documentation files (the ""Software""), to
10-
# deal in the Software without restriction, including without limitation the
11-
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12-
# sell copies of the Software, and to permit persons to whom the Software is
13-
# furnished to do so, subject to the following conditions:
14-
#
15-
# The above copyright notice and this permission notice shall be included in
16-
# all copies or substantial portions of the Software.
17-
#
18-
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23-
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24-
# IN THE SOFTWARE.
25-
#
5+
# Licensed under the MIT License. See License.txt in the project root for license information.
6+
# Code generated by Microsoft (R) Python Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
268
# --------------------------------------------------------------------------
279

2810
# pyright: reportUnnecessaryTypeIgnoreComment=false

sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/azure/mgmt/arizeaiobservabilityeval/aio/_client.py

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
# --------------------------------------------------------------------------
88

99
from copy import deepcopy
10-
from typing import Any, Awaitable, TYPE_CHECKING
10+
from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast
1111
from typing_extensions import Self
1212

1313
from azure.core.pipeline import policies
1414
from azure.core.rest import AsyncHttpResponse, HttpRequest
15+
from azure.core.settings import settings
1516
from azure.mgmt.core import AsyncARMPipelineClient
1617
from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
1719

1820
from .._serialization import Deserializer, Serializer
1921
from ._configuration import ArizeAIObservabilityEvalMgmtClientConfiguration
@@ -35,7 +37,7 @@ class ArizeAIObservabilityEvalMgmtClient:
3537
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
3638
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3739
:type subscription_id: str
38-
:param base_url: Service host. Default value is "https://management.azure.com".
40+
:param base_url: Service host. Default value is None.
3941
:type base_url: str
4042
:keyword api_version: The API version to use for this operation. Default value is
4143
"2024-10-01-preview". Note that overriding this default value may result in unsupported
@@ -46,16 +48,22 @@ class ArizeAIObservabilityEvalMgmtClient:
4648
"""
4749

4850
def __init__(
49-
self,
50-
credential: "AsyncTokenCredential",
51-
subscription_id: str,
52-
base_url: str = "https://management.azure.com",
53-
**kwargs: Any
51+
self, credential: "AsyncTokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
5452
) -> None:
5553
_endpoint = "{endpoint}"
54+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
55+
_endpoints = get_arm_endpoints(_cloud)
56+
if not base_url:
57+
base_url = _endpoints["resource_manager"]
58+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
5659
self._config = ArizeAIObservabilityEvalMgmtClientConfiguration(
57-
credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs
60+
credential=credential,
61+
subscription_id=subscription_id,
62+
base_url=cast(str, base_url),
63+
credential_scopes=credential_scopes,
64+
**kwargs
5865
)
66+
5967
_policies = kwargs.pop("policies", None)
6068
if _policies is None:
6169
_policies = [
@@ -74,7 +82,9 @@ def __init__(
7482
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
7583
self._config.http_logging_policy,
7684
]
77-
self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs)
85+
self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(
86+
base_url=cast(str, _endpoint), policies=_policies, **kwargs
87+
)
7888

7989
self._serialize = Serializer()
8090
self._deserialize = Deserializer()

sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/azure/mgmt/arizeaiobservabilityeval/aio/operations/_operations.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
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+
from collections.abc import MutableMapping
89
from io import IOBase
910
import json
10-
import sys
1111
from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload
1212
import urllib.parse
1313

@@ -46,13 +46,9 @@
4646
)
4747
from .._configuration import ArizeAIObservabilityEvalMgmtClientConfiguration
4848

49-
if sys.version_info >= (3, 9):
50-
from collections.abc import MutableMapping
51-
else:
52-
from typing import MutableMapping # type: ignore
5349
T = TypeVar("T")
5450
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
55-
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
51+
JSON = MutableMapping[str, Any]
5652

5753

5854
class Operations:

sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/azure/mgmt/arizeaiobservabilityeval/operations/_operations.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
# Code generated by Microsoft (R) Python Code Generator.
77
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
88
# --------------------------------------------------------------------------
9+
from collections.abc import MutableMapping
910
from io import IOBase
1011
import json
11-
import sys
1212
from typing import Any, Callable, Dict, IO, Iterable, Iterator, List, Optional, TypeVar, Union, cast, overload
1313
import urllib.parse
1414

@@ -37,13 +37,9 @@
3737
from .._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize
3838
from .._serialization import Deserializer, Serializer
3939

40-
if sys.version_info >= (3, 9):
41-
from collections.abc import MutableMapping
42-
else:
43-
from typing import MutableMapping # type: ignore
4440
T = TypeVar("T")
4541
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
46-
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
42+
JSON = MutableMapping[str, Any]
4743

4844
_SERIALIZER = Serializer()
4945
_SERIALIZER.client_side_validation = False

sdk/arizeaiobservabilityeval/azure-mgmt-arizeaiobservabilityeval/setup.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
"Programming Language :: Python",
5454
"Programming Language :: Python :: 3 :: Only",
5555
"Programming Language :: Python :: 3",
56-
"Programming Language :: Python :: 3.8",
5756
"Programming Language :: Python :: 3.9",
5857
"Programming Language :: Python :: 3.10",
5958
"Programming Language :: Python :: 3.11",
@@ -77,7 +76,7 @@
7776
"isodate>=0.6.1",
7877
"typing-extensions>=4.6.0",
7978
"azure-common>=1.1",
80-
"azure-mgmt-core>=1.3.2",
79+
"azure-mgmt-core>=1.5.0",
8180
],
82-
python_requires=">=3.8",
81+
python_requires=">=3.9",
8382
)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
directory: specification/liftrarize/ArizeAi.ObservabilityEval.Management
2-
commit: 1b47f62ee9da78db7e011c709c48ecd700095a5a
2+
commit: 0f615e3d0511503ee1cbf69629fd3d0e66a9ac46
33
repo: Azure/azure-rest-api-specs
44
additionalDirectories:

0 commit comments

Comments
 (0)