Skip to content

Commit 5293813

Browse files
author
SDKAuto
committed
CodeGen from PR 34320 in Azure/azure-rest-api-specs
Merge b6c9684e9100712e3541097ab422b5f1640ad236 into 761d8b58e465b26eddb8ad70dda3cde7b4228bdf
1 parent d6612d0 commit 5293813

File tree

71 files changed

+4433
-3006
lines changed

Some content is hidden

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

71 files changed

+4433
-3006
lines changed

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

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

3+
## 8.1.0b3 (2025-05-09)
4+
5+
### Breaking Changes
6+
7+
- Deleted or renamed model `ConnectionDetails`
8+
- Deleted or renamed model `GroupConnectivityInformation`
9+
- Deleted or renamed model `PrivateLinkServiceConnection`
10+
311
## 8.1.0b2 (2024-03-21)
412

513
### Features Added

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

Lines changed: 3 additions & 3 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 Notification Hubs 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
@@ -24,7 +24,7 @@ pip install azure-identity
2424

2525
### Authentication
2626

27-
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.
2828

2929
- `AZURE_CLIENT_ID` for Azure client ID.
3030
- `AZURE_TENANT_ID` for Azure tenant ID.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "cd47c0b7ed3cf03a738ab5a96f9543a733aae1fd",
2+
"commit": "cebde6b24b9493e3398c3c7aaabd8c03df4b9167",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.7",
4+
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/python@6.13.7",
6+
"@autorest/python@6.34.1",
77
"@autorest/[email protected]"
88
],
9-
"autorest_command": "autorest specification/notificationhubs/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.13.7 --use=@autorest/[email protected] --version=3.9.7 --version-tolerant=False",
9+
"autorest_command": "autorest specification/notificationhubs/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.34.1 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/notificationhubs/resource-manager/readme.md"
1111
}

sdk/notificationhubs/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/__init__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,28 @@
55
# Code generated by Microsoft (R) AutoRest Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
89

9-
from ._notification_hubs_management_client import NotificationHubsManagementClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._notification_hubs_management_client import NotificationHubsManagementClient # type: ignore
1016
from ._version import VERSION
1117

1218
__version__ = VERSION
1319

1420
try:
1521
from ._patch import __all__ as _patch_all
16-
from ._patch import * # pylint: disable=unused-wildcard-import
22+
from ._patch import *
1723
except ImportError:
1824
_patch_all = []
1925
from ._patch import patch_sdk as _patch_sdk
2026

2127
__all__ = [
2228
"NotificationHubsManagementClient",
2329
]
24-
__all__.extend([p for p in _patch_all if p not in __all__])
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2531

2632
_patch_sdk()

sdk/notificationhubs/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/_configuration.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from ._version import VERSION
1515

1616
if TYPE_CHECKING:
17-
# pylint: disable=unused-import,ungrouped-imports
1817
from azure.core.credentials import TokenCredential
1918

2019

sdk/notificationhubs/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/_notification_hubs_management_client.py

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

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

1213
from azure.core.pipeline import policies
1314
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.core.settings import settings
1416
from azure.mgmt.core import ARMPipelineClient
1517
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
1619

1720
from . import models as _models
1821
from ._configuration import NotificationHubsManagementClientConfiguration
19-
from ._serialization import Deserializer, Serializer
22+
from ._utils.serialization import Deserializer, Serializer
2023
from .operations import (
2124
NamespacesOperations,
2225
NotificationHubsOperations,
@@ -25,27 +28,26 @@
2528
)
2629

2730
if TYPE_CHECKING:
28-
# pylint: disable=unused-import,ungrouped-imports
2931
from azure.core.credentials import TokenCredential
3032

3133

32-
class NotificationHubsManagementClient: # pylint: disable=client-accepts-api-version-keyword
34+
class NotificationHubsManagementClient:
3335
"""Microsoft Notification Hubs Resource Provider REST API.
3436
35-
:ivar notification_hubs: NotificationHubsOperations operations
36-
:vartype notification_hubs: azure.mgmt.notificationhubs.operations.NotificationHubsOperations
37-
:ivar namespaces: NamespacesOperations operations
38-
:vartype namespaces: azure.mgmt.notificationhubs.operations.NamespacesOperations
3937
:ivar operations: Operations operations
4038
:vartype operations: azure.mgmt.notificationhubs.operations.Operations
39+
:ivar namespaces: NamespacesOperations operations
40+
:vartype namespaces: azure.mgmt.notificationhubs.operations.NamespacesOperations
41+
:ivar notification_hubs: NotificationHubsOperations operations
42+
:vartype notification_hubs: azure.mgmt.notificationhubs.operations.NotificationHubsOperations
4143
:ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
4244
:vartype private_endpoint_connections:
4345
azure.mgmt.notificationhubs.operations.PrivateEndpointConnectionsOperations
4446
:param credential: Credential needed for the client to connect to Azure. Required.
4547
:type credential: ~azure.core.credentials.TokenCredential
4648
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
4749
:type subscription_id: str
48-
:param base_url: Service URL. Default value is "https://management.azure.com".
50+
:param base_url: Service URL. Default value is None.
4951
:type base_url: str
5052
:keyword api_version: Api Version. Default value is "2023-10-01-preview". Note that overriding
5153
this default value may result in unsupported behavior.
@@ -55,15 +57,17 @@ class NotificationHubsManagementClient: # pylint: disable=client-accepts-api-ve
5557
"""
5658

5759
def __init__(
58-
self,
59-
credential: "TokenCredential",
60-
subscription_id: str,
61-
base_url: str = "https://management.azure.com",
62-
**kwargs: Any
60+
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
6361
) -> None:
62+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
63+
_endpoints = get_arm_endpoints(_cloud)
64+
if not base_url:
65+
base_url = _endpoints["resource_manager"]
66+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
6467
self._config = NotificationHubsManagementClientConfiguration(
65-
credential=credential, subscription_id=subscription_id, **kwargs
68+
credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs
6669
)
70+
6771
_policies = kwargs.pop("policies", None)
6872
if _policies is None:
6973
_policies = [
@@ -82,17 +86,17 @@ def __init__(
8286
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
8387
self._config.http_logging_policy,
8488
]
85-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
89+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs)
8690

8791
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
8892
self._serialize = Serializer(client_models)
8993
self._deserialize = Deserializer(client_models)
9094
self._serialize.client_side_validation = False
95+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
96+
self.namespaces = NamespacesOperations(self._client, self._config, self._serialize, self._deserialize)
9197
self.notification_hubs = NotificationHubsOperations(
9298
self._client, self._config, self._serialize, self._deserialize
9399
)
94-
self.namespaces = NamespacesOperations(self._client, self._config, self._serialize, self._deserialize)
95-
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
96100
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(
97101
self._client, self._config, self._serialize, self._deserialize
98102
)
@@ -122,7 +126,7 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
122126
def close(self) -> None:
123127
self._client.close()
124128

125-
def __enter__(self) -> "NotificationHubsManagementClient":
129+
def __enter__(self) -> Self:
126130
self._client.__enter__()
127131
return self
128132

sdk/notificationhubs/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/_patch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#
2626
# --------------------------------------------------------------------------
2727

28+
2829
# This file is used for handwritten extensions to the generated code. Example:
2930
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
3031
def patch_sdk():

sdk/notificationhubs/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/_vendor.py renamed to sdk/notificationhubs/azure-mgmt-notificationhubs/azure/mgmt/notificationhubs/_utils/__init__.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,3 @@
44
# Code generated by Microsoft (R) AutoRest Code Generator.
55
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
66
# --------------------------------------------------------------------------
7-
8-
from azure.core.pipeline.transport import HttpRequest
9-
10-
11-
def _convert_request(request, files=None):
12-
data = request.content if not files else None
13-
request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data)
14-
if files:
15-
request.set_formdata_body(files)
16-
return request

0 commit comments

Comments
 (0)