Skip to content

Commit 91eb194

Browse files
[AutoRelease] t2-notificationhubs-2024-03-21-57186(can only be merged by SDK owner) (#34871)
* code and test * Update testcase --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: ChenxiJiang333 <[email protected]>
1 parent 41556d7 commit 91eb194

File tree

67 files changed

+8001
-4043
lines changed

Some content is hidden

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

67 files changed

+8001
-4043
lines changed

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

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

3+
## 8.1.0b2 (2024-03-21)
4+
5+
### Features Added
6+
7+
- Added operation NamespacesOperations.delete
8+
- Added operation NamespacesOperations.get_pns_credentials
9+
- Added operation NamespacesOperations.update
10+
- Added operation NotificationHubsOperations.update
11+
- Added operation group PrivateEndpointConnectionsOperations
12+
- Model CheckAvailabilityResult has a new parameter system_data
13+
- Model DebugSendResponse has a new parameter system_data
14+
- Model ErrorResponse has a new parameter error
15+
- Model NamespacePatchParameters has a new parameter properties
16+
- Model NamespaceResource has a new parameter network_acls
17+
- Model NamespaceResource has a new parameter pns_credentials
18+
- Model NamespaceResource has a new parameter private_endpoint_connections
19+
- Model NamespaceResource has a new parameter public_network_access
20+
- Model NamespaceResource has a new parameter replication_region
21+
- Model NamespaceResource has a new parameter system_data
22+
- Model NamespaceResource has a new parameter zone_redundancy
23+
- Model NotificationHubPatchParameters has a new parameter browser_credential
24+
- Model NotificationHubPatchParameters has a new parameter daily_max_active_devices
25+
- Model NotificationHubPatchParameters has a new parameter fcm_v1_credential
26+
- Model NotificationHubPatchParameters has a new parameter xiaomi_credential
27+
- Model NotificationHubResource has a new parameter browser_credential
28+
- Model NotificationHubResource has a new parameter daily_max_active_devices
29+
- Model NotificationHubResource has a new parameter fcm_v1_credential
30+
- Model NotificationHubResource has a new parameter system_data
31+
- Model NotificationHubResource has a new parameter xiaomi_credential
32+
- Model Operation has a new parameter is_data_action
33+
- Model Operation has a new parameter properties
34+
- Model OperationDisplay has a new parameter description
35+
- Model PnsCredentialsResource has a new parameter browser_credential
36+
- Model PnsCredentialsResource has a new parameter fcm_v1_credential
37+
- Model PnsCredentialsResource has a new parameter system_data
38+
- Model PnsCredentialsResource has a new parameter xiaomi_credential
39+
- Model Resource has a new parameter system_data
40+
- Model SharedAccessAuthorizationRuleResource has a new parameter system_data
41+
- Model WnsCredential has a new parameter certificate_key
42+
- Model WnsCredential has a new parameter wns_certificate
43+
- Operation NamespacesOperations.list has a new optional parameter skip_token
44+
- Operation NamespacesOperations.list has a new optional parameter top
45+
- Operation NamespacesOperations.list_all has a new optional parameter skip_token
46+
- Operation NamespacesOperations.list_all has a new optional parameter top
47+
- Operation NotificationHubsOperations.list has a new optional parameter skip_token
48+
- Operation NotificationHubsOperations.list has a new optional parameter top
49+
50+
### Breaking Changes
51+
52+
- Model DebugSendResponse no longer has parameter sku
53+
- Model ErrorResponse no longer has parameter code
54+
- Model ErrorResponse no longer has parameter message
55+
- Model NotificationHubPatchParameters no longer has parameter id
56+
- Model NotificationHubPatchParameters no longer has parameter location
57+
- Model NotificationHubPatchParameters no longer has parameter name_properties_name
58+
- Model NotificationHubPatchParameters no longer has parameter type
59+
- Model PnsCredentialsResource no longer has parameter sku
60+
- Model Resource no longer has parameter location
61+
- Model Resource no longer has parameter sku
62+
- Model Resource no longer has parameter tags
63+
- Model SharedAccessAuthorizationRuleResource no longer has parameter sku
64+
- Operation NotificationHubsOperations.debug_send no longer has parameter parameters
65+
- Parameter auth_token_url of model AdmCredential is now required
66+
- Parameter baidu_api_key of model BaiduCredential is now required
67+
- Parameter baidu_end_point of model BaiduCredential is now required
68+
- Parameter baidu_secret_key of model BaiduCredential is now required
69+
- Parameter certificate_key of model MpnsCredential is now required
70+
- Parameter client_id of model AdmCredential is now required
71+
- Parameter client_secret of model AdmCredential is now required
72+
- Parameter endpoint of model ApnsCredential is now required
73+
- Parameter google_api_key of model GcmCredential is now required
74+
- Parameter location of model NamespaceResource is now required
75+
- Parameter location of model NotificationHubResource is now required
76+
- Parameter mpns_certificate of model MpnsCredential is now required
77+
- Parameter rights of model SharedAccessAuthorizationRuleProperties is now required
78+
- Parameter sku of model NamespaceResource is now required
79+
- Parameter thumbprint of model MpnsCredential is now required
80+
- Removed operation NamespacesOperations.begin_delete
81+
- Removed operation NamespacesOperations.patch
82+
- Removed operation NotificationHubsOperations.patch
83+
- Renamed operation NamespacesOperations.create_or_update to NamespacesOperations.begin_create_or_update
84+
385
## 8.1.0b1 (2022-11-11)
486

587
### Other Changes

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

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,61 @@
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.7+.
4+
This package has been tested with Python 3.8+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
88

99
_Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_
1010

11-
# Usage
11+
## Getting started
1212

13+
### Prerequisites
1314

14-
To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt)
15-
16-
For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/notification-hubs)
17-
Code samples for this package can be found at [Notification Hubs Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com.
18-
Additional code samples for different Azure services are available at [Samples Repo](https://github.com/Azure-Samples/azure-samples-python-management/tree/main/samples/notificationhubs)
15+
- Python 3.8+ is required to use this package.
16+
- [Azure subscription](https://azure.microsoft.com/free/)
1917

18+
### Install the package
2019

21-
# Provide Feedback
20+
```bash
21+
pip install azure-mgmt-notificationhubs
22+
pip install azure-identity
23+
```
24+
25+
### Authentication
26+
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
28+
29+
- `AZURE_CLIENT_ID` for Azure client ID.
30+
- `AZURE_TENANT_ID` for Azure tenant ID.
31+
- `AZURE_CLIENT_SECRET` for Azure client secret.
32+
33+
In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`.
34+
35+
With above configuration, client can be authenticated by following code:
36+
37+
```python
38+
from azure.identity import DefaultAzureCredential
39+
from azure.mgmt.notificationhubs import NotificationHubsManagementClient
40+
import os
41+
42+
sub_id = os.getenv("AZURE_SUBSCRIPTION_ID")
43+
client = NotificationHubsManagementClient(credential=DefaultAzureCredential(), subscription_id=sub_id)
44+
```
45+
46+
## Examples
47+
48+
Code samples for this package can be found at:
49+
- [Search Notification Hubs Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com
50+
- [Azure Python Mgmt SDK Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
51+
52+
53+
## Troubleshooting
54+
55+
## Next steps
56+
57+
## Provide Feedback
2258

2359
If you encounter any bugs or have suggestions, please file an issue in the
2460
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
2561
section of the project.
26-
27-
28-
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-notificationhubs%2FREADME.png)
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "a2da92ad78961529a087f9d0e65394174ac50794",
2+
"commit": "cd47c0b7ed3cf03a738ab5a96f9543a733aae1fd",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.2",
4+
"autorest": "3.9.7",
55
"use": [
6-
"@autorest/python@6.2.1",
7-
"@autorest/modelerfour@4.24.3"
6+
"@autorest/python@6.13.7",
7+
"@autorest/modelerfour@4.27.0"
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.2.1 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
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/modelerfour@4.27.0 --version=3.9.7 --version-tolerant=False",
1010
"readme": "specification/notificationhubs/resource-manager/readme.md"
1111
}

sdk/notificationhubs/azure-mgmt-notificationhubs/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "python",
44
"TagPrefix": "python/notificationhubs/azure-mgmt-notificationhubs",
5-
"Tag": "python/notificationhubs/azure-mgmt-notificationhubs_9cf878501b"
5+
"Tag": "python/notificationhubs/azure-mgmt-notificationhubs_b564cec600"
66
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
try:
1515
from ._patch import __all__ as _patch_all
16-
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
16+
from ._patch import * # pylint: disable=unused-wildcard-import
1717
except ImportError:
1818
_patch_all = []
1919
from ._patch import patch_sdk as _patch_sdk

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

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,35 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
import sys
109
from typing import Any, TYPE_CHECKING
1110

12-
from azure.core.configuration import Configuration
1311
from azure.core.pipeline import policies
1412
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1513

1614
from ._version import VERSION
1715

18-
if sys.version_info >= (3, 8):
19-
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
20-
else:
21-
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
22-
2316
if TYPE_CHECKING:
2417
# pylint: disable=unused-import,ungrouped-imports
2518
from azure.core.credentials import TokenCredential
2619

2720

28-
class NotificationHubsManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
21+
class NotificationHubsManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
2922
"""Configuration for NotificationHubsManagementClient.
3023
3124
Note that all parameters used to create this instance are saved as instance
3225
attributes.
3326
3427
:param credential: Credential needed for the client to connect to Azure. Required.
3528
:type credential: ~azure.core.credentials.TokenCredential
36-
:param subscription_id: Gets subscription credentials which uniquely identify Microsoft Azure
37-
subscription. The subscription ID forms part of the URI for every service call. Required.
29+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3830
:type subscription_id: str
39-
:keyword api_version: Api Version. Default value is "2017-04-01". Note that overriding this
40-
default value may result in unsupported behavior.
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.
4133
:paramtype api_version: str
4234
"""
4335

4436
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
45-
super(NotificationHubsManagementClientConfiguration, self).__init__(**kwargs)
46-
api_version = kwargs.pop("api_version", "2017-04-01") # type: Literal["2017-04-01"]
37+
api_version: str = kwargs.pop("api_version", "2023-10-01-preview")
4738

4839
if credential is None:
4940
raise ValueError("Parameter 'credential' must not be None.")
@@ -55,20 +46,18 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
5546
self.api_version = api_version
5647
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
5748
kwargs.setdefault("sdk_moniker", "mgmt-notificationhubs/{}".format(VERSION))
49+
self.polling_interval = kwargs.get("polling_interval", 30)
5850
self._configure(**kwargs)
5951

60-
def _configure(
61-
self, **kwargs # type: Any
62-
):
63-
# type: (...) -> None
52+
def _configure(self, **kwargs: Any) -> None:
6453
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
6554
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
6655
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
6756
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
6857
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
69-
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
7058
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
7159
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
60+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
7261
self.authentication_policy = kwargs.get("authentication_policy")
7362
if self.credential and not self.authentication_policy:
7463
self.authentication_policy = ARMChallengeAuthenticationPolicy(

0 commit comments

Comments
 (0)