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: Your Azure subscription ID. This is a GUID-formatted string (e.g.
43- 00000000-0000-0000-0000-000000000000). Required.
41+ :param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
4442 :type subscription_id: str
45- :param base_url: Service URL . Default value is None.
43+ :param base_url: Service host . Default value is None.
4644 :type base_url: str
4745 :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
4846 None.
4947 :paramtype cloud_setting: ~azure.core.AzureClouds
50- :keyword api_version: Api Version . Default value is "2024-11-01". Note that overriding this
51- 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.
5250 :paramtype api_version: str
5351 :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
5452 Retry-After header is present.
@@ -63,14 +61,16 @@ def __init__(
6361 cloud_setting : Optional ["AzureClouds" ] = None ,
6462 ** kwargs : Any
6563 ) -> None :
64+ _endpoint = "{endpoint}"
6665 _cloud = cloud_setting or settings .current .azure_cloud # type: ignore
6766 _endpoints = get_arm_endpoints (_cloud )
6867 if not base_url :
6968 base_url = _endpoints ["resource_manager" ]
7069 credential_scopes = kwargs .pop ("credential_scopes" , _endpoints ["credential_scopes" ])
71- self ._config = WebSiteManagementClientConfiguration (
70+ self ._config = DomainRegistrationClientConfiguration (
7271 credential = credential ,
7372 subscription_id = subscription_id ,
73+ base_url = cast (str , base_url ),
7474 cloud_setting = cloud_setting ,
7575 credential_scopes = credential_scopes ,
7676 ** kwargs
@@ -94,27 +94,26 @@ def __init__(
9494 policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
9595 self ._config .http_logging_policy ,
9696 ]
97- 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 )
9898
99- client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
100- self ._serialize = Serializer (client_models )
101- self ._deserialize = Deserializer (client_models )
99+ self ._serialize = Serializer ()
100+ self ._deserialize = Deserializer ()
102101 self ._serialize .client_side_validation = False
103- self .domain_registration_provider = DomainRegistrationProviderOperations (
104- self ._client , self ._config , self ._serialize , self ._deserialize
105- )
106102 self .domains = DomainsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
107103 self .top_level_domains = TopLevelDomainsOperations (
108104 self ._client , self ._config , self ._serialize , self ._deserialize
109105 )
106+ self .domain_registration_provider = DomainRegistrationProviderOperations (
107+ self ._client , self ._config , self ._serialize , self ._deserialize
108+ )
110109
111- 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 :
112111 """Runs the network request through the client's chained policies.
113112
114113 >>> from azure.core.rest import HttpRequest
115114 >>> request = HttpRequest("GET", "https://www.example.org/")
116115 <HttpRequest [GET], url: 'https://www.example.org/'>
117- >>> response = client._send_request (request)
116+ >>> response = client.send_request (request)
118117 <HttpResponse: 200 OK>
119118
120119 For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
@@ -127,7 +126,11 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
127126 """
128127
129128 request_copy = deepcopy (request )
130- 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 )
131134 return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
132135
133136 def close (self ) -> None :
0 commit comments