Skip to content

Commit 120a26d

Browse files
author
SDKAuto
committed
CodeGen from PR 34283 in Azure/azure-rest-api-specs
Merge 0c401ae7fcd7ca2be2fb335e9dc583a2146d1cd7 into 52a8a4477ea168f175bf73ba64a58543fb0f038b
1 parent aa62911 commit 120a26d

File tree

54 files changed

+404
-302
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+404
-302
lines changed

sdk/neonpostgres/azure-mgmt-neonpostgres/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Release History
22

3+
## 2.0.0 (2025-04-30)
4+
5+
### Breaking Changes
6+
7+
- Deleted or renamed client operation group `NeonPostgresMgmtClient.models`
8+
- Deleted or renamed model `ModelsOperations`
9+
310
## 1.0.0 (2025-04-21)
411

512
### Features Added

sdk/neonpostgres/azure-mgmt-neonpostgres/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 Neonpostgres 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": "917ba27f78348899fba4cafb37fcf018f1987a8e",
2+
"commit": "493f3d15a58aeeeb8f980a5dfa0117f1a01d603c",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"typespec_src": "specification/liftrneon/Neon.Postgres.Management",
5-
"@azure-tools/typespec-python": "0.42.2"
5+
"@azure-tools/typespec-python": "0.44.1"
66
}

sdk/neonpostgres/azure-mgmt-neonpostgres/apiview-properties.json

Lines changed: 90 additions & 51 deletions
Large diffs are not rendered by default.

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

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,22 @@
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 NeonPostgresMgmtClientConfiguration
19-
from ._serialization import Deserializer, Serializer
21+
from ._utils.serialization import Deserializer, Serializer
2022
from .operations import (
2123
BranchesOperations,
2224
ComputesOperations,
2325
EndpointsOperations,
24-
ModelsOperations,
2526
NeonDatabasesOperations,
2627
NeonRolesOperations,
2728
Operations,
@@ -36,8 +37,6 @@
3637
class NeonPostgresMgmtClient: # pylint: disable=too-many-instance-attributes
3738
"""NeonPostgresMgmtClient.
3839
39-
:ivar models: ModelsOperations operations
40-
:vartype models: azure.mgmt.neonpostgres.operations.ModelsOperations
4140
:ivar operations: Operations operations
4241
:vartype operations: azure.mgmt.neonpostgres.operations.Operations
4342
:ivar organizations: OrganizationsOperations operations
@@ -58,7 +57,7 @@ class NeonPostgresMgmtClient: # pylint: disable=too-many-instance-attributes
5857
:type credential: ~azure.core.credentials.TokenCredential
5958
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
6059
:type subscription_id: str
61-
:param base_url: Service host. Default value is "https://management.azure.com".
60+
:param base_url: Service host. Default value is None.
6261
:type base_url: str
6362
:keyword api_version: The API version to use for this operation. Default value is "2025-03-01".
6463
Note that overriding this default value may result in unsupported behavior.
@@ -68,16 +67,22 @@ class NeonPostgresMgmtClient: # pylint: disable=too-many-instance-attributes
6867
"""
6968

7069
def __init__(
71-
self,
72-
credential: "TokenCredential",
73-
subscription_id: str,
74-
base_url: str = "https://management.azure.com",
75-
**kwargs: Any
70+
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
7671
) -> None:
7772
_endpoint = "{endpoint}"
73+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
74+
_endpoints = get_arm_endpoints(_cloud)
75+
if not base_url:
76+
base_url = _endpoints["resource_manager"]
77+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
7878
self._config = NeonPostgresMgmtClientConfiguration(
79-
credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs
79+
credential=credential,
80+
subscription_id=subscription_id,
81+
base_url=cast(str, base_url),
82+
credential_scopes=credential_scopes,
83+
**kwargs
8084
)
85+
8186
_policies = kwargs.pop("policies", None)
8287
if _policies is None:
8388
_policies = [
@@ -96,12 +101,11 @@ def __init__(
96101
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
97102
self._config.http_logging_policy,
98103
]
99-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs)
104+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs)
100105

101106
self._serialize = Serializer()
102107
self._deserialize = Deserializer()
103108
self._serialize.client_side_validation = False
104-
self.models = ModelsOperations(self._client, self._config, self._serialize, self._deserialize)
105109
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
106110
self.organizations = OrganizationsOperations(self._client, self._config, self._serialize, self._deserialize)
107111
self.projects = ProjectsOperations(self._client, self._config, self._serialize, self._deserialize)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
# Code generated by Microsoft (R) Python Code Generator.
5+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
6+
# --------------------------------------------------------------------------

sdk/neonpostgres/azure-mgmt-neonpostgres/azure/mgmt/neonpostgres/_model_base.py renamed to sdk/neonpostgres/azure-mgmt-neonpostgres/azure/mgmt/neonpostgres/_utils/model_base.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,14 @@
2222
from datetime import datetime, date, time, timedelta, timezone
2323
from json import JSONEncoder
2424
import xml.etree.ElementTree as ET
25+
from collections.abc import MutableMapping
2526
from typing_extensions import Self
2627
import isodate
2728
from azure.core.exceptions import DeserializationError
2829
from azure.core import CaseInsensitiveEnumMeta
2930
from azure.core.pipeline import PipelineResponse
3031
from azure.core.serialization import _Null
3132

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

3935
__all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"]
@@ -348,7 +344,7 @@ def _get_model(module_name: str, model_name: str):
348344
_UNSET = object()
349345

350346

351-
class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object
347+
class _MyMutableMapping(MutableMapping[str, typing.Any]):
352348
def __init__(self, data: typing.Dict[str, typing.Any]) -> None:
353349
self._data = data
354350

@@ -408,13 +404,13 @@ def get(self, key: str, default: typing.Any = None) -> typing.Any:
408404
return default
409405

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

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

416412
@typing.overload
417-
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
418414

419415
def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any:
420416
"""
@@ -444,7 +440,7 @@ def clear(self) -> None:
444440
"""
445441
self._data.clear()
446442

447-
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
448444
"""
449445
Updates D from mapping/iterable E and F.
450446
:param any args: Either a mapping object or an iterable of key-value pairs.
@@ -455,7 +451,7 @@ def update(self, *args: typing.Any, **kwargs: typing.Any) -> None:
455451
def setdefault(self, key: str, default: None = None) -> None: ...
456452

457453
@typing.overload
458-
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
459455

460456
def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any:
461457
"""
@@ -645,7 +641,7 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self:
645641
cls._attr_to_rest_field: typing.Dict[str, _RestField] = dict(attr_to_rest_field.items())
646642
cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}")
647643

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

650646
def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None:
651647
for base in cls.__bases__:
@@ -681,7 +677,7 @@ def _deserialize(cls, data, exist_discriminators):
681677
discriminator_value = data.find(xml_name).text # pyright: ignore
682678
else:
683679
discriminator_value = data.get(discriminator._rest_name)
684-
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
685681
return mapped_cls._deserialize(data, exist_discriminators)
686682

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

sdk/neonpostgres/azure-mgmt-neonpostgres/azure/mgmt/neonpostgres/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "1.0.0"
9+
VERSION = "2.0.0"

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

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,22 @@
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

18-
from .._serialization import Deserializer, Serializer
20+
from .._utils.serialization import Deserializer, Serializer
1921
from ._configuration import NeonPostgresMgmtClientConfiguration
2022
from .operations import (
2123
BranchesOperations,
2224
ComputesOperations,
2325
EndpointsOperations,
24-
ModelsOperations,
2526
NeonDatabasesOperations,
2627
NeonRolesOperations,
2728
Operations,
@@ -36,8 +37,6 @@
3637
class NeonPostgresMgmtClient: # pylint: disable=too-many-instance-attributes
3738
"""NeonPostgresMgmtClient.
3839
39-
:ivar models: ModelsOperations operations
40-
:vartype models: azure.mgmt.neonpostgres.aio.operations.ModelsOperations
4140
:ivar operations: Operations operations
4241
:vartype operations: azure.mgmt.neonpostgres.aio.operations.Operations
4342
:ivar organizations: OrganizationsOperations operations
@@ -58,7 +57,7 @@ class NeonPostgresMgmtClient: # pylint: disable=too-many-instance-attributes
5857
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
5958
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
6059
:type subscription_id: str
61-
:param base_url: Service host. Default value is "https://management.azure.com".
60+
:param base_url: Service host. Default value is None.
6261
:type base_url: str
6362
:keyword api_version: The API version to use for this operation. Default value is "2025-03-01".
6463
Note that overriding this default value may result in unsupported behavior.
@@ -68,16 +67,22 @@ class NeonPostgresMgmtClient: # pylint: disable=too-many-instance-attributes
6867
"""
6968

7069
def __init__(
71-
self,
72-
credential: "AsyncTokenCredential",
73-
subscription_id: str,
74-
base_url: str = "https://management.azure.com",
75-
**kwargs: Any
70+
self, credential: "AsyncTokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
7671
) -> None:
7772
_endpoint = "{endpoint}"
73+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
74+
_endpoints = get_arm_endpoints(_cloud)
75+
if not base_url:
76+
base_url = _endpoints["resource_manager"]
77+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
7878
self._config = NeonPostgresMgmtClientConfiguration(
79-
credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs
79+
credential=credential,
80+
subscription_id=subscription_id,
81+
base_url=cast(str, base_url),
82+
credential_scopes=credential_scopes,
83+
**kwargs
8084
)
85+
8186
_policies = kwargs.pop("policies", None)
8287
if _policies is None:
8388
_policies = [
@@ -96,12 +101,13 @@ def __init__(
96101
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
97102
self._config.http_logging_policy,
98103
]
99-
self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs)
104+
self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(
105+
base_url=cast(str, _endpoint), policies=_policies, **kwargs
106+
)
100107

101108
self._serialize = Serializer()
102109
self._deserialize = Deserializer()
103110
self._serialize.client_side_validation = False
104-
self.models = ModelsOperations(self._client, self._config, self._serialize, self._deserialize)
105111
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
106112
self.organizations = OrganizationsOperations(self._client, self._config, self._serialize, self._deserialize)
107113
self.projects = ProjectsOperations(self._client, self._config, self._serialize, self._deserialize)

0 commit comments

Comments
 (0)