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) Python Code Generator.
5+ # Code generated by Microsoft (R) AutoRest Code Generator.
66# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77# --------------------------------------------------------------------------
88
1515from azure .mgmt .core import ARMPipelineClient
1616from azure .mgmt .core .policies import ARMAutoResourceProviderRegistrationPolicy
1717
18- from ._configuration import DatabaseWatcherMgmtClientConfiguration
18+ from . import models as _models
19+ from ._configuration import MicrosoftDatabaseWatcherConfiguration
1920from ._serialization import Deserializer , Serializer
2021from .operations import (
2122 AlertRuleResourcesOperations ,
3031 from azure .core .credentials import TokenCredential
3132
3233
33- class DatabaseWatcherMgmtClient :
34- """DatabaseWatcherMgmtClient .
34+ class MicrosoftDatabaseWatcher :
35+ """MicrosoftDatabaseWatcher .
3536
3637 :ivar operations: Operations operations
3738 :vartype operations: azure.mgmt.databasewatcher.operations.Operations
@@ -42,19 +43,19 @@ class DatabaseWatcherMgmtClient:
4243 azure.mgmt.databasewatcher.operations.AlertRuleResourcesOperations
4344 :ivar health_validations: HealthValidationsOperations operations
4445 :vartype health_validations: azure.mgmt.databasewatcher.operations.HealthValidationsOperations
45- :ivar targets: TargetsOperations operations
46- :vartype targets: azure.mgmt.databasewatcher.operations.TargetsOperations
4746 :ivar shared_private_link_resources: SharedPrivateLinkResourcesOperations operations
4847 :vartype shared_private_link_resources:
4948 azure.mgmt.databasewatcher.operations.SharedPrivateLinkResourcesOperations
50- :param credential: Credential used to authenticate requests to the service. Required.
49+ :ivar targets: TargetsOperations operations
50+ :vartype targets: azure.mgmt.databasewatcher.operations.TargetsOperations
51+ :param credential: Credential needed for the client to connect to Azure. Required.
5152 :type credential: ~azure.core.credentials.TokenCredential
5253 :param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
5354 :type subscription_id: str
54- :param base_url: Service host . Default value is "https://management.azure.com".
55+ :param base_url: Service URL . Default value is "https://management.azure.com".
5556 :type base_url: str
56- :keyword api_version: The API version to use for this operation . Default value is "2025-01-02".
57- Note that overriding this default value may result in unsupported behavior.
57+ :keyword api_version: Api Version . Default value is "2025-01-02". Note that overriding this
58+ default value may result in unsupported behavior.
5859 :paramtype api_version: str
5960 :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
6061 Retry-After header is present.
@@ -67,9 +68,8 @@ def __init__(
6768 base_url : str = "https://management.azure.com" ,
6869 ** kwargs : Any
6970 ) -> None :
70- _endpoint = "{endpoint}"
71- self ._config = DatabaseWatcherMgmtClientConfiguration (
72- credential = credential , subscription_id = subscription_id , base_url = base_url , ** kwargs
71+ self ._config = MicrosoftDatabaseWatcherConfiguration (
72+ credential = credential , subscription_id = subscription_id , ** kwargs
7373 )
7474 _policies = kwargs .pop ("policies" , None )
7575 if _policies is None :
@@ -89,10 +89,11 @@ def __init__(
8989 policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
9090 self ._config .http_logging_policy ,
9191 ]
92- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = _endpoint , policies = _policies , ** kwargs )
92+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
9393
94- self ._serialize = Serializer ()
95- self ._deserialize = Deserializer ()
94+ client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
95+ self ._serialize = Serializer (client_models )
96+ self ._deserialize = Deserializer (client_models )
9697 self ._serialize .client_side_validation = False
9798 self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
9899 self .watchers = WatchersOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
@@ -102,18 +103,18 @@ def __init__(
102103 self .health_validations = HealthValidationsOperations (
103104 self ._client , self ._config , self ._serialize , self ._deserialize
104105 )
105- self .targets = TargetsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
106106 self .shared_private_link_resources = SharedPrivateLinkResourcesOperations (
107107 self ._client , self ._config , self ._serialize , self ._deserialize
108108 )
109+ self .targets = TargetsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
109110
110- def send_request (self , request : HttpRequest , * , stream : bool = False , ** kwargs : Any ) -> HttpResponse :
111+ def _send_request (self , request : HttpRequest , * , stream : bool = False , ** kwargs : Any ) -> HttpResponse :
111112 """Runs the network request through the client's chained policies.
112113
113114 >>> from azure.core.rest import HttpRequest
114115 >>> request = HttpRequest("GET", "https://www.example.org/")
115116 <HttpRequest [GET], url: 'https://www.example.org/'>
116- >>> response = client.send_request (request)
117+ >>> response = client._send_request (request)
117118 <HttpResponse: 200 OK>
118119
119120 For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
@@ -126,11 +127,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
126127 """
127128
128129 request_copy = deepcopy (request )
129- path_format_arguments = {
130- "endpoint" : self ._serialize .url ("self._config.base_url" , self ._config .base_url , "str" , skip_quote = True ),
131- }
132-
133- request_copy .url = self ._client .format_url (request_copy .url , ** path_format_arguments )
130+ request_copy .url = self ._client .format_url (request_copy .url )
134131 return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
135132
136133 def close (self ) -> None :
0 commit comments