diff --git a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/README.md b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/README.md index 12d5cf376cad..ee2f2b1c303a 100644 --- a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/README.md +++ b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Python This is the Microsoft Azure Pineconevectordb 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 @@ -24,7 +24,7 @@ pip install azure-identity ### Authentication -By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables. +By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. diff --git a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/_meta.json b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/_meta.json index 9ec82ee2fea2..4a71a5167dc4 100644 --- a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/_meta.json +++ b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/_meta.json @@ -1,6 +1,6 @@ { - "commit": "70eec0726034ed22734168f3cd3d2b641dbc5723", + "commit": "079f70d6f2b754db6b736e117196104efd2dd496", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/liftrpinecone/Pinecone.VectorDb.Management", - "@azure-tools/typespec-python": "0.39.1" + "@azure-tools/typespec-python": "0.44.2" } \ No newline at end of file diff --git a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/apiview-properties.json b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/apiview-properties.json index d113481c4580..1acc5a1b3c74 100644 --- a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/apiview-properties.json +++ b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/apiview-properties.json @@ -27,12 +27,19 @@ "azure.mgmt.pineconevectordb.models.SingleSignOnType": "LiftrBase.SingleSignOnType", "azure.mgmt.pineconevectordb.models.SingleSignOnStates": "LiftrBase.SingleSignOnStates", "azure.mgmt.pineconevectordb.models.ManagedServiceIdentityType": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType", - "azure.mgmt.pineconevectordb.PineconeVectorDbMgmtClient.operations.list": "Azure.ResourceManager.Operations.list", - "azure.mgmt.pineconevectordb.PineconeVectorDbMgmtClient.organizations.get": "Pinecone.VectorDb.Organizations.get", - "azure.mgmt.pineconevectordb.PineconeVectorDbMgmtClient.organizations.begin_create_or_update": "Pinecone.VectorDb.Organizations.createOrUpdate", - "azure.mgmt.pineconevectordb.PineconeVectorDbMgmtClient.organizations.update": "Pinecone.VectorDb.Organizations.update", - "azure.mgmt.pineconevectordb.PineconeVectorDbMgmtClient.organizations.begin_delete": "Pinecone.VectorDb.Organizations.delete", - "azure.mgmt.pineconevectordb.PineconeVectorDbMgmtClient.organizations.list_by_resource_group": "Pinecone.VectorDb.Organizations.listByResourceGroup", - "azure.mgmt.pineconevectordb.PineconeVectorDbMgmtClient.organizations.list_by_subscription": "Pinecone.VectorDb.Organizations.listBySubscription" + "azure.mgmt.pineconevectordb.operations.Operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.pineconevectordb.aio.operations.Operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.pineconevectordb.operations.OrganizationsOperations.get": "Pinecone.VectorDb.Organizations.get", + "azure.mgmt.pineconevectordb.aio.operations.OrganizationsOperations.get": "Pinecone.VectorDb.Organizations.get", + "azure.mgmt.pineconevectordb.operations.OrganizationsOperations.begin_create_or_update": "Pinecone.VectorDb.Organizations.createOrUpdate", + "azure.mgmt.pineconevectordb.aio.operations.OrganizationsOperations.begin_create_or_update": "Pinecone.VectorDb.Organizations.createOrUpdate", + "azure.mgmt.pineconevectordb.operations.OrganizationsOperations.update": "Pinecone.VectorDb.Organizations.update", + "azure.mgmt.pineconevectordb.aio.operations.OrganizationsOperations.update": "Pinecone.VectorDb.Organizations.update", + "azure.mgmt.pineconevectordb.operations.OrganizationsOperations.begin_delete": "Pinecone.VectorDb.Organizations.delete", + "azure.mgmt.pineconevectordb.aio.operations.OrganizationsOperations.begin_delete": "Pinecone.VectorDb.Organizations.delete", + "azure.mgmt.pineconevectordb.operations.OrganizationsOperations.list_by_resource_group": "Pinecone.VectorDb.Organizations.listByResourceGroup", + "azure.mgmt.pineconevectordb.aio.operations.OrganizationsOperations.list_by_resource_group": "Pinecone.VectorDb.Organizations.listByResourceGroup", + "azure.mgmt.pineconevectordb.operations.OrganizationsOperations.list_by_subscription": "Pinecone.VectorDb.Organizations.listBySubscription", + "azure.mgmt.pineconevectordb.aio.operations.OrganizationsOperations.list_by_subscription": "Pinecone.VectorDb.Organizations.listBySubscription" } } \ No newline at end of file diff --git a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/_client.py b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/_client.py index baf8aef6a25e..77817651663e 100644 --- a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/_client.py +++ b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/_client.py @@ -7,16 +7,18 @@ # -------------------------------------------------------------------------- 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 PineconeVectorDbMgmtClientConfiguration -from ._serialization import Deserializer, Serializer +from ._utils.serialization import Deserializer, Serializer from .operations import Operations, OrganizationsOperations if TYPE_CHECKING: @@ -34,7 +36,7 @@ class PineconeVectorDbMgmtClient: :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-22-preview". Note that overriding this default value may result in unsupported @@ -45,16 +47,22 @@ class PineconeVectorDbMgmtClient: """ 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 = PineconeVectorDbMgmtClientConfiguration( - 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/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/_patch.py b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/_patch.py index f7dd32510333..8bcb627aa475 100644 --- a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/_patch.py +++ b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/_patch.py @@ -1,7 +1,8 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize diff --git a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/_utils/__init__.py b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/_utils/__init__.py new file mode 100644 index 000000000000..8026245c2abc --- /dev/null +++ b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/_utils/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# 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. +# -------------------------------------------------------------------------- diff --git a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/_model_base.py b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/_utils/model_base.py similarity index 98% rename from sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/_model_base.py rename to sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/_utils/model_base.py index 3072ee252ed9..49d5c7259389 100644 --- a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/_model_base.py +++ b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/_utils/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/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/_serialization.py b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/_utils/serialization.py similarity index 98% rename from sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/_serialization.py rename to sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/_utils/serialization.py index 7a0232de5ddc..eb86ea23c965 100644 --- a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/_serialization.py +++ b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/_utils/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/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/_version.py b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/_version.py index bbcd28b4aa67..be71c81bd282 100644 --- a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/_version.py +++ b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/aio/_client.py b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/aio/_client.py index bc05d13b1521..20d8ff049e29 100644 --- a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/aio/_client.py +++ b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/aio/_client.py @@ -7,15 +7,17 @@ # -------------------------------------------------------------------------- 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 .._utils.serialization import Deserializer, Serializer from ._configuration import PineconeVectorDbMgmtClientConfiguration from .operations import Operations, OrganizationsOperations @@ -34,7 +36,7 @@ class PineconeVectorDbMgmtClient: :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-22-preview". Note that overriding this default value may result in unsupported @@ -45,16 +47,22 @@ class PineconeVectorDbMgmtClient: """ 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 = PineconeVectorDbMgmtClientConfiguration( - 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,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/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/aio/_patch.py b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/aio/_patch.py index f7dd32510333..8bcb627aa475 100644 --- a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/aio/_patch.py +++ b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/aio/_patch.py @@ -1,7 +1,8 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize diff --git a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/aio/operations/_operations.py b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/aio/operations/_operations.py index 2da2d0649767..c768ab7cd71e 100644 --- a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/aio/operations/_operations.py +++ b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/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 @@ -33,8 +33,8 @@ from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ..._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize -from ..._serialization import Deserializer, Serializer +from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from ..._utils.serialization import Deserializer, Serializer from ...operations._operations import ( build_operations_list_request, build_organizations_create_or_update_request, @@ -46,13 +46,9 @@ ) from .._configuration import PineconeVectorDbMgmtClientConfiguration -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: @@ -134,7 +130,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Operation], deserialized["value"]) + list_of_elem = _deserialize(List[_models.Operation], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -830,7 +826,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.OrganizationResource], deserialized["value"]) + list_of_elem = _deserialize(List[_models.OrganizationResource], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -915,7 +911,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.OrganizationResource], deserialized["value"]) + list_of_elem = _deserialize(List[_models.OrganizationResource], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) diff --git a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/aio/operations/_patch.py b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/aio/operations/_patch.py index f7dd32510333..8bcb627aa475 100644 --- a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/aio/operations/_patch.py +++ b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/aio/operations/_patch.py @@ -1,7 +1,8 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize diff --git a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/models/_models.py b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/models/_models.py index 64a0bca77b45..05e11533cd96 100644 --- a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/models/_models.py +++ b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/models/_models.py @@ -11,14 +11,13 @@ import datetime from typing import Any, Dict, List, Mapping, Optional, TYPE_CHECKING, Union, overload -from .. import _model_base -from .._model_base import rest_field +from .._utils.model_base import Model as _Model, rest_field if TYPE_CHECKING: from .. import models as _models -class ErrorAdditionalInfo(_model_base.Model): +class ErrorAdditionalInfo(_Model): """The resource management error additional info. :ivar type: The additional info type. @@ -33,7 +32,7 @@ class ErrorAdditionalInfo(_model_base.Model): """The additional info.""" -class ErrorDetail(_model_base.Model): +class ErrorDetail(_Model): """The error detail. :ivar code: The error code. @@ -62,9 +61,8 @@ class ErrorDetail(_model_base.Model): """The error additional info.""" -class ErrorResponse(_model_base.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed - operations. +class ErrorResponse(_Model): + """Error response. :ivar error: The error object. :vartype error: ~azure.mgmt.pineconevectordb.models.ErrorDetail @@ -91,7 +89,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ManagedServiceIdentity(_model_base.Model): +class ManagedServiceIdentity(_Model): """Managed service identity (system assigned and/or user assigned identities). :ivar principal_id: The service principal ID of the system assigned identity. This property @@ -143,7 +141,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MarketplaceDetails(_model_base.Model): +class MarketplaceDetails(_Model): """Marketplace details for an organization. :ivar subscription_id: Azure subscription id for the the marketplace offer is purchased from. @@ -189,7 +187,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OfferDetails(_model_base.Model): +class OfferDetails(_Model): """Offer details for the marketplace that is selected by the user. :ivar publisher_id: Publisher Id for the marketplace offer. Required. @@ -242,8 +240,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Operation(_model_base.Model): - """Details of a REST API operation, returned from the Resource Provider Operations API. +class Operation(_Model): + """REST API Operation. :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". @@ -299,7 +297,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OperationDisplay(_model_base.Model): +class OperationDisplay(_Model): """Localized display information for and operation. :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft @@ -330,7 +328,7 @@ class OperationDisplay(_model_base.Model): views.""" -class OrganizationProperties(_model_base.Model): +class OrganizationProperties(_Model): """Properties specific to Organization. :ivar marketplace: Marketplace details of the resource. Required. @@ -387,8 +385,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Resource(_model_base.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. +class Resource(_Model): + """Resource. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -416,8 +414,7 @@ class Resource(_model_base.Model): class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which - has 'tags' and a 'location'. + """Tracked Resource. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -515,7 +512,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OrganizationResourceUpdate(_model_base.Model): +class OrganizationResourceUpdate(_Model): """The type used for update operations of the Organization Resource. :ivar tags: Resource tags. @@ -550,7 +547,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PartnerProperties(_model_base.Model): +class PartnerProperties(_Model): """Partner's specific Properties. :ivar display_name: Pinecone Organization Name. Required. @@ -578,7 +575,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SingleSignOnPropertiesV2(_model_base.Model): +class SingleSignOnPropertiesV2(_Model): """Properties specific to Single Sign On Resource. :ivar type: Type of Single Sign-On mechanism being used. Required. Known values are: "Saml" and @@ -638,7 +635,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SystemData(_model_base.Model): +class SystemData(_Model): """Metadata pertaining to creation and last modification of the resource. :ivar created_by: The identity that created the resource. @@ -705,22 +702,22 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class UserAssignedIdentity(_model_base.Model): +class UserAssignedIdentity(_Model): """User assigned identity properties. - :ivar client_id: The client ID of the assigned identity. - :vartype client_id: str :ivar principal_id: The principal ID of the assigned identity. :vartype principal_id: str + :ivar client_id: The client ID of the assigned identity. + :vartype client_id: str """ - client_id: Optional[str] = rest_field(name="clientId", visibility=["read"]) - """The client ID of the assigned identity.""" principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) """The principal ID of the assigned identity.""" + client_id: Optional[str] = rest_field(name="clientId", visibility=["read"]) + """The client ID of the assigned identity.""" -class UserDetails(_model_base.Model): +class UserDetails(_Model): """User details for an organization. :ivar first_name: First name of the user. diff --git a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/models/_patch.py b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/models/_patch.py index f7dd32510333..8bcb627aa475 100644 --- a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/models/_patch.py +++ b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/models/_patch.py @@ -1,7 +1,8 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize diff --git a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/operations/_operations.py b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/operations/_operations.py index 942190d443c8..a0d1cee2ce2f 100644 --- a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/operations/_operations.py +++ b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/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 @@ -34,16 +34,12 @@ from .. import models as _models from .._configuration import PineconeVectorDbMgmtClientConfiguration -from .._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize -from .._serialization import Deserializer, Serializer +from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from .._utils.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 @@ -251,7 +247,7 @@ class Operations: :attr:`operations` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: PineconeVectorDbMgmtClientConfiguration = ( @@ -320,7 +316,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Operation], deserialized["value"]) + list_of_elem = _deserialize(List[_models.Operation], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -354,7 +350,7 @@ class OrganizationsOperations: :attr:`organizations` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: PineconeVectorDbMgmtClientConfiguration = ( @@ -1007,7 +1003,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.OrganizationResource], deserialized["value"]) + list_of_elem = _deserialize(List[_models.OrganizationResource], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -1091,7 +1087,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.OrganizationResource], deserialized["value"]) + list_of_elem = _deserialize(List[_models.OrganizationResource], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) diff --git a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/operations/_patch.py b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/operations/_patch.py index f7dd32510333..8bcb627aa475 100644 --- a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/operations/_patch.py +++ b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/azure/mgmt/pineconevectordb/operations/_patch.py @@ -1,7 +1,8 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize diff --git a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/setup.py b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/setup.py index 204fbf6a3474..5cedc1dbaad5 100644 --- a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/setup.py +++ b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/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/pineconevectordb/azure-mgmt-pineconevectordb/tsp-location.yaml b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/tsp-location.yaml index 8f2090197e50..8ac04cc2bd55 100644 --- a/sdk/pineconevectordb/azure-mgmt-pineconevectordb/tsp-location.yaml +++ b/sdk/pineconevectordb/azure-mgmt-pineconevectordb/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/liftrpinecone/Pinecone.VectorDb.Management -commit: 70eec0726034ed22734168f3cd3d2b641dbc5723 +commit: 079f70d6f2b754db6b736e117196104efd2dd496 repo: Azure/azure-rest-api-specs additionalDirectories: