Skip to content

Commit be7bb37

Browse files
author
SDKAuto
committed
CodeGen from PR 32705 in Azure/azure-rest-api-specs
Merge 139ae9602ffb73d31014693f98142d0aca29653d into dc2b7baf6b8845d955f83c16800522f60e343149
1 parent 8a87462 commit be7bb37

24 files changed

+532
-12573
lines changed

sdk/ai/azure-ai-projects/_meta.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"commit": "71316af68aa90dad30c979fe6fea0103244b6638",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"typespec_src": "specification/ai/Azure.AI.Projects",
5+
"@azure-tools/typespec-python": "0.43.0"
6+
}

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ def __init__(
7272
credential=credential,
7373
**kwargs
7474
)
75+
7576
_policies = kwargs.pop("policies", None)
7677
if _policies is None:
7778
_policies = [
@@ -119,16 +120,12 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
119120

120121
request_copy = deepcopy(request)
121122
path_format_arguments = {
122-
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
123-
"subscriptionId": self._serialize.url(
124-
"self._config.subscription_id", self._config.subscription_id, "str", skip_quote=True
125-
),
123+
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"),
124+
"subscriptionId": self._serialize.url("self._config.subscription_id", self._config.subscription_id, "str"),
126125
"resourceGroupName": self._serialize.url(
127-
"self._config.resource_group_name", self._config.resource_group_name, "str", skip_quote=True
128-
),
129-
"projectName": self._serialize.url(
130-
"self._config.project_name", self._config.project_name, "str", skip_quote=True
126+
"self._config.resource_group_name", self._config.resource_group_name, "str"
131127
),
128+
"projectName": self._serialize.url("self._config.project_name", self._config.project_name, "str"),
132129
}
133130

134131
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)

sdk/ai/azure-ai-projects/azure/ai/projects/_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]:

0 commit comments

Comments
 (0)