Skip to content

Commit 6f6584b

Browse files
author
SDKAuto
committed
CodeGen from PR 34270 in Azure/azure-rest-api-specs
Merge 447c4193246efcde66d0d0feaa59da2c756c794f into a19648565889eaae019e531c15f3045d1244c7ce
1 parent 6c30600 commit 6f6584b

24 files changed

+425
-351
lines changed

sdk/databasewatcher/azure-mgmt-databasewatcher/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 Databasewatcher 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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"commit": "07da438f8dc690946b39511467744ed889434de5",
2+
"commit": "5ab69662eff4ee3c2bc93c2a4959470ab9867c99",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"typespec_src": "specification/databasewatcher/DatabaseWatcher.Management",
5-
"@azure-tools/typespec-python": "0.38.2"
5+
"@azure-tools/typespec-python": "0.44.2"
66
}

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

Lines changed: 48 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -42,29 +42,53 @@
4242
"azure.mgmt.databasewatcher.models.ValidationStatus": "Microsoft.DatabaseWatcher.validationStatus",
4343
"azure.mgmt.databasewatcher.models.TargetAuthenticationType": "Microsoft.DatabaseWatcher.TargetAuthenticationType",
4444
"azure.mgmt.databasewatcher.models.SharedPrivateLinkResourceStatus": "Microsoft.DatabaseWatcher.SharedPrivateLinkResourceStatus",
45-
"azure.mgmt.databasewatcher.DatabaseWatcherMgmtClient.operations.list": "Azure.ResourceManager.Operations.list",
46-
"azure.mgmt.databasewatcher.DatabaseWatcherMgmtClient.watchers.get": "Microsoft.DatabaseWatcher.Watchers.get",
47-
"azure.mgmt.databasewatcher.DatabaseWatcherMgmtClient.watchers.begin_create_or_update": "Microsoft.DatabaseWatcher.Watchers.createOrUpdate",
48-
"azure.mgmt.databasewatcher.DatabaseWatcherMgmtClient.watchers.begin_update": "Microsoft.DatabaseWatcher.Watchers.update",
49-
"azure.mgmt.databasewatcher.DatabaseWatcherMgmtClient.watchers.begin_delete": "Microsoft.DatabaseWatcher.Watchers.delete",
50-
"azure.mgmt.databasewatcher.DatabaseWatcherMgmtClient.watchers.list_by_resource_group": "Microsoft.DatabaseWatcher.Watchers.listByResourceGroup",
51-
"azure.mgmt.databasewatcher.DatabaseWatcherMgmtClient.watchers.list_by_subscription": "Microsoft.DatabaseWatcher.Watchers.listBySubscription",
52-
"azure.mgmt.databasewatcher.DatabaseWatcherMgmtClient.watchers.begin_start": "Microsoft.DatabaseWatcher.Watchers.start",
53-
"azure.mgmt.databasewatcher.DatabaseWatcherMgmtClient.watchers.begin_stop": "Microsoft.DatabaseWatcher.Watchers.stop",
54-
"azure.mgmt.databasewatcher.DatabaseWatcherMgmtClient.alert_rule_resources.get": "Microsoft.DatabaseWatcher.AlertRuleResources.get",
55-
"azure.mgmt.databasewatcher.DatabaseWatcherMgmtClient.alert_rule_resources.create_or_update": "Microsoft.DatabaseWatcher.AlertRuleResources.createOrUpdate",
56-
"azure.mgmt.databasewatcher.DatabaseWatcherMgmtClient.alert_rule_resources.delete": "Microsoft.DatabaseWatcher.AlertRuleResources.delete",
57-
"azure.mgmt.databasewatcher.DatabaseWatcherMgmtClient.alert_rule_resources.list_by_parent": "Microsoft.DatabaseWatcher.AlertRuleResources.listByParent",
58-
"azure.mgmt.databasewatcher.DatabaseWatcherMgmtClient.health_validations.get": "Microsoft.DatabaseWatcher.HealthValidations.get",
59-
"azure.mgmt.databasewatcher.DatabaseWatcherMgmtClient.health_validations.list_by_parent": "Microsoft.DatabaseWatcher.HealthValidations.listByParent",
60-
"azure.mgmt.databasewatcher.DatabaseWatcherMgmtClient.health_validations.begin_start_validation": "Microsoft.DatabaseWatcher.HealthValidations.startValidation",
61-
"azure.mgmt.databasewatcher.DatabaseWatcherMgmtClient.targets.get": "Microsoft.DatabaseWatcher.Targets.get",
62-
"azure.mgmt.databasewatcher.DatabaseWatcherMgmtClient.targets.create_or_update": "Microsoft.DatabaseWatcher.Targets.createOrUpdate",
63-
"azure.mgmt.databasewatcher.DatabaseWatcherMgmtClient.targets.delete": "Microsoft.DatabaseWatcher.Targets.delete",
64-
"azure.mgmt.databasewatcher.DatabaseWatcherMgmtClient.targets.list_by_watcher": "Microsoft.DatabaseWatcher.Targets.listByWatcher",
65-
"azure.mgmt.databasewatcher.DatabaseWatcherMgmtClient.shared_private_link_resources.get": "Microsoft.DatabaseWatcher.SharedPrivateLinkResources.get",
66-
"azure.mgmt.databasewatcher.DatabaseWatcherMgmtClient.shared_private_link_resources.begin_create": "Microsoft.DatabaseWatcher.SharedPrivateLinkResources.create",
67-
"azure.mgmt.databasewatcher.DatabaseWatcherMgmtClient.shared_private_link_resources.begin_delete": "Microsoft.DatabaseWatcher.SharedPrivateLinkResources.delete",
68-
"azure.mgmt.databasewatcher.DatabaseWatcherMgmtClient.shared_private_link_resources.list_by_watcher": "Microsoft.DatabaseWatcher.SharedPrivateLinkResources.listByWatcher"
45+
"azure.mgmt.databasewatcher.operations.Operations.list": "Azure.ResourceManager.Operations.list",
46+
"azure.mgmt.databasewatcher.aio.operations.Operations.list": "Azure.ResourceManager.Operations.list",
47+
"azure.mgmt.databasewatcher.operations.WatchersOperations.get": "Microsoft.DatabaseWatcher.Watchers.get",
48+
"azure.mgmt.databasewatcher.aio.operations.WatchersOperations.get": "Microsoft.DatabaseWatcher.Watchers.get",
49+
"azure.mgmt.databasewatcher.operations.WatchersOperations.begin_create_or_update": "Microsoft.DatabaseWatcher.Watchers.createOrUpdate",
50+
"azure.mgmt.databasewatcher.aio.operations.WatchersOperations.begin_create_or_update": "Microsoft.DatabaseWatcher.Watchers.createOrUpdate",
51+
"azure.mgmt.databasewatcher.operations.WatchersOperations.begin_update": "Microsoft.DatabaseWatcher.Watchers.update",
52+
"azure.mgmt.databasewatcher.aio.operations.WatchersOperations.begin_update": "Microsoft.DatabaseWatcher.Watchers.update",
53+
"azure.mgmt.databasewatcher.operations.WatchersOperations.begin_delete": "Microsoft.DatabaseWatcher.Watchers.delete",
54+
"azure.mgmt.databasewatcher.aio.operations.WatchersOperations.begin_delete": "Microsoft.DatabaseWatcher.Watchers.delete",
55+
"azure.mgmt.databasewatcher.operations.WatchersOperations.list_by_resource_group": "Microsoft.DatabaseWatcher.Watchers.listByResourceGroup",
56+
"azure.mgmt.databasewatcher.aio.operations.WatchersOperations.list_by_resource_group": "Microsoft.DatabaseWatcher.Watchers.listByResourceGroup",
57+
"azure.mgmt.databasewatcher.operations.WatchersOperations.list_by_subscription": "Microsoft.DatabaseWatcher.Watchers.listBySubscription",
58+
"azure.mgmt.databasewatcher.aio.operations.WatchersOperations.list_by_subscription": "Microsoft.DatabaseWatcher.Watchers.listBySubscription",
59+
"azure.mgmt.databasewatcher.operations.WatchersOperations.begin_start": "Microsoft.DatabaseWatcher.Watchers.start",
60+
"azure.mgmt.databasewatcher.aio.operations.WatchersOperations.begin_start": "Microsoft.DatabaseWatcher.Watchers.start",
61+
"azure.mgmt.databasewatcher.operations.WatchersOperations.begin_stop": "Microsoft.DatabaseWatcher.Watchers.stop",
62+
"azure.mgmt.databasewatcher.aio.operations.WatchersOperations.begin_stop": "Microsoft.DatabaseWatcher.Watchers.stop",
63+
"azure.mgmt.databasewatcher.operations.AlertRuleResourcesOperations.get": "Microsoft.DatabaseWatcher.AlertRuleResources.get",
64+
"azure.mgmt.databasewatcher.aio.operations.AlertRuleResourcesOperations.get": "Microsoft.DatabaseWatcher.AlertRuleResources.get",
65+
"azure.mgmt.databasewatcher.operations.AlertRuleResourcesOperations.create_or_update": "Microsoft.DatabaseWatcher.AlertRuleResources.createOrUpdate",
66+
"azure.mgmt.databasewatcher.aio.operations.AlertRuleResourcesOperations.create_or_update": "Microsoft.DatabaseWatcher.AlertRuleResources.createOrUpdate",
67+
"azure.mgmt.databasewatcher.operations.AlertRuleResourcesOperations.delete": "Microsoft.DatabaseWatcher.AlertRuleResources.delete",
68+
"azure.mgmt.databasewatcher.aio.operations.AlertRuleResourcesOperations.delete": "Microsoft.DatabaseWatcher.AlertRuleResources.delete",
69+
"azure.mgmt.databasewatcher.operations.AlertRuleResourcesOperations.list_by_parent": "Microsoft.DatabaseWatcher.AlertRuleResources.listByParent",
70+
"azure.mgmt.databasewatcher.aio.operations.AlertRuleResourcesOperations.list_by_parent": "Microsoft.DatabaseWatcher.AlertRuleResources.listByParent",
71+
"azure.mgmt.databasewatcher.operations.HealthValidationsOperations.get": "Microsoft.DatabaseWatcher.HealthValidations.get",
72+
"azure.mgmt.databasewatcher.aio.operations.HealthValidationsOperations.get": "Microsoft.DatabaseWatcher.HealthValidations.get",
73+
"azure.mgmt.databasewatcher.operations.HealthValidationsOperations.list_by_parent": "Microsoft.DatabaseWatcher.HealthValidations.listByParent",
74+
"azure.mgmt.databasewatcher.aio.operations.HealthValidationsOperations.list_by_parent": "Microsoft.DatabaseWatcher.HealthValidations.listByParent",
75+
"azure.mgmt.databasewatcher.operations.HealthValidationsOperations.begin_start_validation": "Microsoft.DatabaseWatcher.HealthValidations.startValidation",
76+
"azure.mgmt.databasewatcher.aio.operations.HealthValidationsOperations.begin_start_validation": "Microsoft.DatabaseWatcher.HealthValidations.startValidation",
77+
"azure.mgmt.databasewatcher.operations.TargetsOperations.get": "Microsoft.DatabaseWatcher.Targets.get",
78+
"azure.mgmt.databasewatcher.aio.operations.TargetsOperations.get": "Microsoft.DatabaseWatcher.Targets.get",
79+
"azure.mgmt.databasewatcher.operations.TargetsOperations.create_or_update": "Microsoft.DatabaseWatcher.Targets.createOrUpdate",
80+
"azure.mgmt.databasewatcher.aio.operations.TargetsOperations.create_or_update": "Microsoft.DatabaseWatcher.Targets.createOrUpdate",
81+
"azure.mgmt.databasewatcher.operations.TargetsOperations.delete": "Microsoft.DatabaseWatcher.Targets.delete",
82+
"azure.mgmt.databasewatcher.aio.operations.TargetsOperations.delete": "Microsoft.DatabaseWatcher.Targets.delete",
83+
"azure.mgmt.databasewatcher.operations.TargetsOperations.list_by_watcher": "Microsoft.DatabaseWatcher.Targets.listByWatcher",
84+
"azure.mgmt.databasewatcher.aio.operations.TargetsOperations.list_by_watcher": "Microsoft.DatabaseWatcher.Targets.listByWatcher",
85+
"azure.mgmt.databasewatcher.operations.SharedPrivateLinkResourcesOperations.get": "Microsoft.DatabaseWatcher.SharedPrivateLinkResources.get",
86+
"azure.mgmt.databasewatcher.aio.operations.SharedPrivateLinkResourcesOperations.get": "Microsoft.DatabaseWatcher.SharedPrivateLinkResources.get",
87+
"azure.mgmt.databasewatcher.operations.SharedPrivateLinkResourcesOperations.begin_create": "Microsoft.DatabaseWatcher.SharedPrivateLinkResources.create",
88+
"azure.mgmt.databasewatcher.aio.operations.SharedPrivateLinkResourcesOperations.begin_create": "Microsoft.DatabaseWatcher.SharedPrivateLinkResources.create",
89+
"azure.mgmt.databasewatcher.operations.SharedPrivateLinkResourcesOperations.begin_delete": "Microsoft.DatabaseWatcher.SharedPrivateLinkResources.delete",
90+
"azure.mgmt.databasewatcher.aio.operations.SharedPrivateLinkResourcesOperations.begin_delete": "Microsoft.DatabaseWatcher.SharedPrivateLinkResources.delete",
91+
"azure.mgmt.databasewatcher.operations.SharedPrivateLinkResourcesOperations.list_by_watcher": "Microsoft.DatabaseWatcher.SharedPrivateLinkResources.listByWatcher",
92+
"azure.mgmt.databasewatcher.aio.operations.SharedPrivateLinkResourcesOperations.list_by_watcher": "Microsoft.DatabaseWatcher.SharedPrivateLinkResources.listByWatcher"
6993
}
7094
}

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

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,18 @@
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 DatabaseWatcherMgmtClientConfiguration
19-
from ._serialization import Deserializer, Serializer
21+
from ._utils.serialization import Deserializer, Serializer
2022
from .operations import (
2123
AlertRuleResourcesOperations,
2224
HealthValidationsOperations,
@@ -51,7 +53,7 @@ class DatabaseWatcherMgmtClient:
5153
:type credential: ~azure.core.credentials.TokenCredential
5254
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
5355
:type subscription_id: str
54-
:param base_url: Service host. Default value is "https://management.azure.com".
56+
:param base_url: Service host. Default value is None.
5557
:type base_url: str
5658
:keyword api_version: The API version to use for this operation. Default value is "2025-01-02".
5759
Note that overriding this default value may result in unsupported behavior.
@@ -61,16 +63,22 @@ class DatabaseWatcherMgmtClient:
6163
"""
6264

6365
def __init__(
64-
self,
65-
credential: "TokenCredential",
66-
subscription_id: str,
67-
base_url: str = "https://management.azure.com",
68-
**kwargs: Any
66+
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
6967
) -> None:
7068
_endpoint = "{endpoint}"
69+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
70+
_endpoints = get_arm_endpoints(_cloud)
71+
if not base_url:
72+
base_url = _endpoints["resource_manager"]
73+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
7174
self._config = DatabaseWatcherMgmtClientConfiguration(
72-
credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs
75+
credential=credential,
76+
subscription_id=subscription_id,
77+
base_url=cast(str, base_url),
78+
credential_scopes=credential_scopes,
79+
**kwargs
7380
)
81+
7482
_policies = kwargs.pop("policies", None)
7583
if _policies is None:
7684
_policies = [
@@ -89,7 +97,7 @@ def __init__(
8997
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
9098
self._config.http_logging_policy,
9199
]
92-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs)
100+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs)
93101

94102
self._serialize = Serializer()
95103
self._deserialize = Deserializer()

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# ------------------------------------
2-
# Copyright (c) Microsoft Corporation.
3-
# Licensed under the MIT License.
4-
# ------------------------------------
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+
# --------------------------------------------------------------------------
56
"""Customize generated code here.
67
78
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
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+
# --------------------------------------------------------------------------

0 commit comments

Comments
 (0)