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
1717from azure .mgmt .core .policies import ARMAutoResourceProviderRegistrationPolicy
1818from azure .mgmt .core .tools import get_arm_endpoints
1919
20- from . import models as _models
21- from ._configuration import WebSiteManagementClientConfiguration
20+ from ._configuration import DomainRegistrationClientConfiguration
2221from ._utils .serialization import Deserializer , Serializer
2322from .operations import DomainRegistrationProviderOperations , DomainsOperations , TopLevelDomainsOperations
2423
2726 from azure .core .credentials import TokenCredential
2827
2928
30- class WebSiteManagementClient :
31- """Domain Registration Client .
29+ class DomainRegistrationClient :
30+ """DomainRegistrationClient .
3231
33- :ivar domain_registration_provider: DomainRegistrationProviderOperations operations
34- :vartype domain_registration_provider:
35- azure.mgmt.domainregistration.operations.DomainRegistrationProviderOperations
3632 :ivar domains: DomainsOperations operations
3733 :vartype domains: azure.mgmt.domainregistration.operations.DomainsOperations
3834 :ivar top_level_domains: TopLevelDomainsOperations operations
3935 :vartype top_level_domains: azure.mgmt.domainregistration.operations.TopLevelDomainsOperations
40- :param credential: Credential needed for the client to connect to Azure. Required.
36+ :ivar domain_registration_provider: DomainRegistrationProviderOperations operations
37+ :vartype domain_registration_provider:
38+ azure.mgmt.domainregistration.operations.DomainRegistrationProviderOperations
39+ :param credential: Credential used to authenticate requests to the service. Required.
4140 :type credential: ~azure.core.credentials.TokenCredential
42- :param subscription_id: The ID of the target subscription. Required.
41+ :param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
4342 :type subscription_id: str
44- :param base_url: Service URL . Default value is None.
43+ :param base_url: Service host . Default value is None.
4544 :type base_url: str
4645 :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
4746 None.
4847 :paramtype cloud_setting: ~azure.core.AzureClouds
49- :keyword api_version: Api Version . Default value is "2024-11-01". Note that overriding this
50- default value may result in unsupported behavior.
48+ :keyword api_version: The API version to use for this operation . Default value is "2024-11-01".
49+ Note that overriding this default value may result in unsupported behavior.
5150 :paramtype api_version: str
5251 :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
5352 Retry-After header is present.
@@ -62,14 +61,16 @@ def __init__(
6261 cloud_setting : Optional ["AzureClouds" ] = None ,
6362 ** kwargs : Any
6463 ) -> None :
64+ _endpoint = "{endpoint}"
6565 _cloud = cloud_setting or settings .current .azure_cloud # type: ignore
6666 _endpoints = get_arm_endpoints (_cloud )
6767 if not base_url :
6868 base_url = _endpoints ["resource_manager" ]
6969 credential_scopes = kwargs .pop ("credential_scopes" , _endpoints ["credential_scopes" ])
70- self ._config = WebSiteManagementClientConfiguration (
70+ self ._config = DomainRegistrationClientConfiguration (
7171 credential = credential ,
7272 subscription_id = subscription_id ,
73+ base_url = cast (str , base_url ),
7374 cloud_setting = cloud_setting ,
7475 credential_scopes = credential_scopes ,
7576 ** kwargs
@@ -93,27 +94,26 @@ def __init__(
9394 policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
9495 self ._config .http_logging_policy ,
9596 ]
96- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = cast (str , base_url ), policies = _policies , ** kwargs )
97+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = cast (str , _endpoint ), policies = _policies , ** kwargs )
9798
98- client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
99- self ._serialize = Serializer (client_models )
100- self ._deserialize = Deserializer (client_models )
99+ self ._serialize = Serializer ()
100+ self ._deserialize = Deserializer ()
101101 self ._serialize .client_side_validation = False
102- self .domain_registration_provider = DomainRegistrationProviderOperations (
103- self ._client , self ._config , self ._serialize , self ._deserialize
104- )
105102 self .domains = DomainsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
106103 self .top_level_domains = TopLevelDomainsOperations (
107104 self ._client , self ._config , self ._serialize , self ._deserialize
108105 )
106+ self .domain_registration_provider = DomainRegistrationProviderOperations (
107+ self ._client , self ._config , self ._serialize , self ._deserialize
108+ )
109109
110- def _send_request (self , request : HttpRequest , * , stream : bool = False , ** kwargs : Any ) -> HttpResponse :
110+ def send_request (self , request : HttpRequest , * , stream : bool = False , ** kwargs : Any ) -> HttpResponse :
111111 """Runs the network request through the client's chained policies.
112112
113113 >>> from azure.core.rest import HttpRequest
114114 >>> request = HttpRequest("GET", "https://www.example.org/")
115115 <HttpRequest [GET], url: 'https://www.example.org/'>
116- >>> response = client._send_request (request)
116+ >>> response = client.send_request (request)
117117 <HttpResponse: 200 OK>
118118
119119 For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
@@ -126,7 +126,11 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
126126 """
127127
128128 request_copy = deepcopy (request )
129- request_copy .url = self ._client .format_url (request_copy .url )
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 )
130134 return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
131135
132136 def close (self ) -> None :
0 commit comments