Skip to content

Commit 9cf11bb

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

File tree

92 files changed

+16617
-14267
lines changed

Some content is hidden

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

92 files changed

+16617
-14267
lines changed

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

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

3+
## 8.1.0b3 (2025-05-09)
4+
5+
change log generation failed!!!
6+
37
## 8.1.0b2 (2024-03-21)
48

59
### 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: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
{
2-
"commit": "cd47c0b7ed3cf03a738ab5a96f9543a733aae1fd",
2+
"commit": "667754246f5134bee75359ea2cd11a3c3f52d511",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.7",
5-
"use": [
6-
"@autorest/[email protected]",
7-
"@autorest/[email protected]"
8-
],
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/[email protected] --use=@autorest/[email protected] --version=3.9.7 --version-tolerant=False",
10-
"readme": "specification/notificationhubs/resource-manager/readme.md"
4+
"typespec_src": "specification/notificationhubs/Notificationhubs.Management",
5+
"@azure-tools/typespec-python": "0.44.2"
116
}

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

Lines changed: 146 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,31 @@
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# 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+
# 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 ._client import NotificationHubsClient # 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__ = [
22-
"NotificationHubsManagementClient",
28+
"NotificationHubsClient",
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()
Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) Python Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from copy import deepcopy
10+
from typing import Any, Optional, TYPE_CHECKING, cast
11+
from typing_extensions import Self
12+
13+
from azure.core.pipeline import policies
14+
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.core.settings import settings
16+
from azure.mgmt.core import ARMPipelineClient
17+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
19+
20+
from ._configuration import NotificationHubsClientConfiguration
21+
from ._utils.serialization import Deserializer, Serializer
22+
from .operations import (
23+
NamespaceOpsOperations,
24+
NamespaceResourcesOperations,
25+
NamespacesOperationGroupOperations,
26+
NamespacesOperations,
27+
NotificationHubResourcesOperations,
28+
Operations,
29+
PrivateEndpointConnectionResourcesOperations,
30+
PrivateLinkResourcesOperations,
31+
SharedAccessAuthorizationRuleResourceOpsOperations,
32+
SharedAccessAuthorizationRuleResourcesOperations,
33+
)
34+
35+
if TYPE_CHECKING:
36+
from azure.core.credentials import TokenCredential
37+
38+
39+
class NotificationHubsClient: # pylint: disable=too-many-instance-attributes
40+
"""Microsoft Notification Hubs Resource Provider REST API.
41+
42+
:ivar operations: Operations operations
43+
:vartype operations: azure.mgmt.notificationhubs.operations.Operations
44+
:ivar notification_hub_resources: NotificationHubResourcesOperations operations
45+
:vartype notification_hub_resources:
46+
azure.mgmt.notificationhubs.operations.NotificationHubResourcesOperations
47+
:ivar namespace_resources: NamespaceResourcesOperations operations
48+
:vartype namespace_resources:
49+
azure.mgmt.notificationhubs.operations.NamespaceResourcesOperations
50+
:ivar shared_access_authorization_rule_resource_ops:
51+
SharedAccessAuthorizationRuleResourceOpsOperations operations
52+
:vartype shared_access_authorization_rule_resource_ops:
53+
azure.mgmt.notificationhubs.operations.SharedAccessAuthorizationRuleResourceOpsOperations
54+
:ivar shared_access_authorization_rule_resources:
55+
SharedAccessAuthorizationRuleResourcesOperations operations
56+
:vartype shared_access_authorization_rule_resources:
57+
azure.mgmt.notificationhubs.operations.SharedAccessAuthorizationRuleResourcesOperations
58+
:ivar namespace_ops: NamespaceOpsOperations operations
59+
:vartype namespace_ops: azure.mgmt.notificationhubs.operations.NamespaceOpsOperations
60+
:ivar namespaces: NamespacesOperations operations
61+
:vartype namespaces: azure.mgmt.notificationhubs.operations.NamespacesOperations
62+
:ivar private_endpoint_connection_resources: PrivateEndpointConnectionResourcesOperations
63+
operations
64+
:vartype private_endpoint_connection_resources:
65+
azure.mgmt.notificationhubs.operations.PrivateEndpointConnectionResourcesOperations
66+
:ivar private_link_resources: PrivateLinkResourcesOperations operations
67+
:vartype private_link_resources:
68+
azure.mgmt.notificationhubs.operations.PrivateLinkResourcesOperations
69+
:ivar namespaces_operation_group: NamespacesOperationGroupOperations operations
70+
:vartype namespaces_operation_group:
71+
azure.mgmt.notificationhubs.operations.NamespacesOperationGroupOperations
72+
:param credential: Credential used to authenticate requests to the service. Required.
73+
:type credential: ~azure.core.credentials.TokenCredential
74+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
75+
:type subscription_id: str
76+
:param base_url: Service host. Default value is None.
77+
:type base_url: str
78+
:keyword api_version: The API version to use for this operation. Default value is
79+
"2023-10-01-preview". Note that overriding this default value may result in unsupported
80+
behavior.
81+
:paramtype api_version: str
82+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
83+
Retry-After header is present.
84+
"""
85+
86+
def __init__(
87+
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
88+
) -> None:
89+
_endpoint = "{endpoint}"
90+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
91+
_endpoints = get_arm_endpoints(_cloud)
92+
if not base_url:
93+
base_url = _endpoints["resource_manager"]
94+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
95+
self._config = NotificationHubsClientConfiguration(
96+
credential=credential,
97+
subscription_id=subscription_id,
98+
base_url=cast(str, base_url),
99+
credential_scopes=credential_scopes,
100+
**kwargs
101+
)
102+
103+
_policies = kwargs.pop("policies", None)
104+
if _policies is None:
105+
_policies = [
106+
policies.RequestIdPolicy(**kwargs),
107+
self._config.headers_policy,
108+
self._config.user_agent_policy,
109+
self._config.proxy_policy,
110+
policies.ContentDecodePolicy(**kwargs),
111+
ARMAutoResourceProviderRegistrationPolicy(),
112+
self._config.redirect_policy,
113+
self._config.retry_policy,
114+
self._config.authentication_policy,
115+
self._config.custom_hook_policy,
116+
self._config.logging_policy,
117+
policies.DistributedTracingPolicy(**kwargs),
118+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
119+
self._config.http_logging_policy,
120+
]
121+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs)
122+
123+
self._serialize = Serializer()
124+
self._deserialize = Deserializer()
125+
self._serialize.client_side_validation = False
126+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
127+
self.notification_hub_resources = NotificationHubResourcesOperations(
128+
self._client, self._config, self._serialize, self._deserialize
129+
)
130+
self.namespace_resources = NamespaceResourcesOperations(
131+
self._client, self._config, self._serialize, self._deserialize
132+
)
133+
self.shared_access_authorization_rule_resource_ops = SharedAccessAuthorizationRuleResourceOpsOperations(
134+
self._client, self._config, self._serialize, self._deserialize
135+
)
136+
self.shared_access_authorization_rule_resources = SharedAccessAuthorizationRuleResourcesOperations(
137+
self._client, self._config, self._serialize, self._deserialize
138+
)
139+
self.namespace_ops = NamespaceOpsOperations(self._client, self._config, self._serialize, self._deserialize)
140+
self.namespaces = NamespacesOperations(self._client, self._config, self._serialize, self._deserialize)
141+
self.private_endpoint_connection_resources = PrivateEndpointConnectionResourcesOperations(
142+
self._client, self._config, self._serialize, self._deserialize
143+
)
144+
self.private_link_resources = PrivateLinkResourcesOperations(
145+
self._client, self._config, self._serialize, self._deserialize
146+
)
147+
self.namespaces_operation_group = NamespacesOperationGroupOperations(
148+
self._client, self._config, self._serialize, self._deserialize
149+
)
150+
151+
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
152+
"""Runs the network request through the client's chained policies.
153+
154+
>>> from azure.core.rest import HttpRequest
155+
>>> request = HttpRequest("GET", "https://www.example.org/")
156+
<HttpRequest [GET], url: 'https://www.example.org/'>
157+
>>> response = client.send_request(request)
158+
<HttpResponse: 200 OK>
159+
160+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
161+
162+
:param request: The network request you want to make. Required.
163+
:type request: ~azure.core.rest.HttpRequest
164+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
165+
:return: The response of your network call. Does not do error handling on your response.
166+
:rtype: ~azure.core.rest.HttpResponse
167+
"""
168+
169+
request_copy = deepcopy(request)
170+
path_format_arguments = {
171+
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
172+
}
173+
174+
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
175+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
176+
177+
def close(self) -> None:
178+
self._client.close()
179+
180+
def __enter__(self) -> Self:
181+
self._client.__enter__()
182+
return self
183+
184+
def __exit__(self, *exc_details: Any) -> None:
185+
self._client.__exit__(*exc_details)

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

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

@@ -14,26 +14,34 @@
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

21-
class NotificationHubsManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
22-
"""Configuration for NotificationHubsManagementClient.
20+
class NotificationHubsClientConfiguration: # pylint: disable=too-many-instance-attributes
21+
"""Configuration for NotificationHubsClient.
2322
2423
Note that all parameters used to create this instance are saved as instance
2524
attributes.
2625
27-
:param credential: Credential needed for the client to connect to Azure. Required.
26+
:param credential: Credential used to authenticate requests to the service. Required.
2827
:type credential: ~azure.core.credentials.TokenCredential
2928
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3029
:type subscription_id: str
31-
:keyword api_version: Api Version. Default value is "2023-10-01-preview". Note that overriding
32-
this default value may result in unsupported behavior.
30+
:param base_url: Service host. Default value is "https://management.azure.com".
31+
:type base_url: str
32+
:keyword api_version: The API version to use for this operation. Default value is
33+
"2023-10-01-preview". Note that overriding this default value may result in unsupported
34+
behavior.
3335
:paramtype api_version: str
3436
"""
3537

36-
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
38+
def __init__(
39+
self,
40+
credential: "TokenCredential",
41+
subscription_id: str,
42+
base_url: str = "https://management.azure.com",
43+
**kwargs: Any
44+
) -> None:
3745
api_version: str = kwargs.pop("api_version", "2023-10-01-preview")
3846

3947
if credential is None:
@@ -43,6 +51,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
4351

4452
self.credential = credential
4553
self.subscription_id = subscription_id
54+
self.base_url = base_url
4655
self.api_version = api_version
4756
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
4857
kwargs.setdefault("sdk_moniker", "mgmt-notificationhubs/{}".format(VERSION))

0 commit comments

Comments
 (0)