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
1717from azure .mgmt .core .policies import ARMAutoResourceProviderRegistrationPolicy
1818from azure .mgmt .core .tools import get_arm_endpoints
1919
20+ from . import models as _models
2021from ._configuration import PeeringManagementClientConfiguration
2122from ._utils .serialization import Deserializer , Serializer
2223from .operations import (
23- CdnPeeringPrefixesOperations ,
24- ConnectionMonitorTestsOperations ,
2524 LegacyPeeringsOperations ,
26- LookingGlassOperations ,
2725 Operations ,
2826 PeerAsnsOperations ,
2927 PeeringLocationsOperations ,
30- PeeringServiceCountriesOperations ,
3128 PeeringServiceLocationsOperations ,
29+ PeeringServicePrefixesOperations ,
3230 PeeringServiceProvidersOperations ,
3331 PeeringServicesOperations ,
3432 PeeringsOperations ,
3533 PrefixesOperations ,
36- ReceivedRoutesOperations ,
37- RegisteredAsnsOperations ,
38- RegisteredPrefixesOperations ,
39- RpUnbilledPrefixesOperations ,
4034 _PeeringManagementClientOperationsMixin ,
4135)
4236
4842class PeeringManagementClient (_PeeringManagementClientOperationsMixin ): # pylint: disable=too-many-instance-attributes
4943 """Peering Client.
5044
51- :ivar peer_asns: PeerAsnsOperations operations
52- :vartype peer_asns: azure.mgmt.peering.operations.PeerAsnsOperations
53- :ivar peerings: PeeringsOperations operations
54- :vartype peerings: azure.mgmt.peering.operations.PeeringsOperations
55- :ivar connection_monitor_tests: ConnectionMonitorTestsOperations operations
56- :vartype connection_monitor_tests:
57- azure.mgmt.peering.operations.ConnectionMonitorTestsOperations
58- :ivar peering_services: PeeringServicesOperations operations
59- :vartype peering_services: azure.mgmt.peering.operations.PeeringServicesOperations
60- :ivar operations: Operations operations
61- :vartype operations: azure.mgmt.peering.operations.Operations
62- :ivar registered_asns: RegisteredAsnsOperations operations
63- :vartype registered_asns: azure.mgmt.peering.operations.RegisteredAsnsOperations
64- :ivar received_routes: ReceivedRoutesOperations operations
65- :vartype received_routes: azure.mgmt.peering.operations.ReceivedRoutesOperations
66- :ivar rp_unbilled_prefixes: RpUnbilledPrefixesOperations operations
67- :vartype rp_unbilled_prefixes: azure.mgmt.peering.operations.RpUnbilledPrefixesOperations
68- :ivar registered_prefixes: RegisteredPrefixesOperations operations
69- :vartype registered_prefixes: azure.mgmt.peering.operations.RegisteredPrefixesOperations
70- :ivar prefixes: PrefixesOperations operations
71- :vartype prefixes: azure.mgmt.peering.operations.PrefixesOperations
72- :ivar cdn_peering_prefixes: CdnPeeringPrefixesOperations operations
73- :vartype cdn_peering_prefixes: azure.mgmt.peering.operations.CdnPeeringPrefixesOperations
7445 :ivar legacy_peerings: LegacyPeeringsOperations operations
7546 :vartype legacy_peerings: azure.mgmt.peering.operations.LegacyPeeringsOperations
76- :ivar looking_glass: LookingGlassOperations operations
77- :vartype looking_glass: azure.mgmt.peering.operations.LookingGlassOperations
47+ :ivar operations: Operations operations
48+ :vartype operations: azure.mgmt.peering.operations.Operations
49+ :ivar peer_asns: PeerAsnsOperations operations
50+ :vartype peer_asns: azure.mgmt.peering.operations.PeerAsnsOperations
7851 :ivar peering_locations: PeeringLocationsOperations operations
7952 :vartype peering_locations: azure.mgmt.peering.operations.PeeringLocationsOperations
80- :ivar peering_service_countries: PeeringServiceCountriesOperations operations
81- :vartype peering_service_countries:
82- azure.mgmt.peering.operations.PeeringServiceCountriesOperations
53+ :ivar peerings: PeeringsOperations operations
54+ :vartype peerings: azure.mgmt.peering.operations.PeeringsOperations
8355 :ivar peering_service_locations: PeeringServiceLocationsOperations operations
8456 :vartype peering_service_locations:
8557 azure.mgmt.peering.operations.PeeringServiceLocationsOperations
58+ :ivar peering_service_prefixes: PeeringServicePrefixesOperations operations
59+ :vartype peering_service_prefixes:
60+ azure.mgmt.peering.operations.PeeringServicePrefixesOperations
61+ :ivar prefixes: PrefixesOperations operations
62+ :vartype prefixes: azure.mgmt.peering.operations.PrefixesOperations
8663 :ivar peering_service_providers: PeeringServiceProvidersOperations operations
8764 :vartype peering_service_providers:
8865 azure.mgmt.peering.operations.PeeringServiceProvidersOperations
89- :param credential: Credential used to authenticate requests to the service. Required.
66+ :ivar peering_services: PeeringServicesOperations operations
67+ :vartype peering_services: azure.mgmt.peering.operations.PeeringServicesOperations
68+ :param credential: Credential needed for the client to connect to Azure. Required.
9069 :type credential: ~azure.core.credentials.TokenCredential
91- :param subscription_id: The ID of the target subscription. The value must be an UUID . Required.
70+ :param subscription_id: The Azure subscription ID . Required.
9271 :type subscription_id: str
93- :param base_url: Service host . Default value is None.
72+ :param base_url: Service URL . Default value is None.
9473 :type base_url: str
9574 :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
9675 None.
9776 :paramtype cloud_setting: ~azure.core.AzureClouds
98- :keyword api_version: The API version to use for this operation. Known values are "2025-05-01".
99- Default value is "2025-05-01". Note that overriding this default value may result in
100- unsupported behavior.
77+ :keyword api_version: Api Version. Default value is "2019-08-01-preview". Note that overriding
78+ this default value may result in unsupported behavior.
10179 :paramtype api_version: str
10280 """
10381
@@ -110,7 +88,6 @@ def __init__(
11088 cloud_setting : Optional ["AzureClouds" ] = None ,
11189 ** kwargs : Any
11290 ) -> None :
113- _endpoint = "{endpoint}"
11491 _cloud = cloud_setting or settings .current .azure_cloud # type: ignore
11592 _endpoints = get_arm_endpoints (_cloud )
11693 if not base_url :
@@ -119,7 +96,6 @@ def __init__(
11996 self ._config = PeeringManagementClientConfiguration (
12097 credential = credential ,
12198 subscription_id = subscription_id ,
122- base_url = cast (str , base_url ),
12399 cloud_setting = cloud_setting ,
124100 credential_scopes = credential_scopes ,
125101 ** kwargs
@@ -143,54 +119,40 @@ def __init__(
143119 policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
144120 self ._config .http_logging_policy ,
145121 ]
146- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = cast (str , _endpoint ), policies = _policies , ** kwargs )
122+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = cast (str , base_url ), policies = _policies , ** kwargs )
147123
148- self ._serialize = Serializer ()
149- self ._deserialize = Deserializer ()
124+ client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
125+ self ._serialize = Serializer (client_models )
126+ self ._deserialize = Deserializer (client_models )
150127 self ._serialize .client_side_validation = False
128+ self .legacy_peerings = LegacyPeeringsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
129+ self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
151130 self .peer_asns = PeerAsnsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
152- self .peerings = PeeringsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
153- self .connection_monitor_tests = ConnectionMonitorTestsOperations (
154- self ._client , self ._config , self ._serialize , self ._deserialize
155- )
156- self .peering_services = PeeringServicesOperations (
131+ self .peering_locations = PeeringLocationsOperations (
157132 self ._client , self ._config , self ._serialize , self ._deserialize
158133 )
159- self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
160- self .registered_asns = RegisteredAsnsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
161- self .received_routes = ReceivedRoutesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
162- self .rp_unbilled_prefixes = RpUnbilledPrefixesOperations (
134+ self .peerings = PeeringsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
135+ self .peering_service_locations = PeeringServiceLocationsOperations (
163136 self ._client , self ._config , self ._serialize , self ._deserialize
164137 )
165- self .registered_prefixes = RegisteredPrefixesOperations (
138+ self .peering_service_prefixes = PeeringServicePrefixesOperations (
166139 self ._client , self ._config , self ._serialize , self ._deserialize
167140 )
168141 self .prefixes = PrefixesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
169- self .cdn_peering_prefixes = CdnPeeringPrefixesOperations (
170- self ._client , self ._config , self ._serialize , self ._deserialize
171- )
172- self .legacy_peerings = LegacyPeeringsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
173- self .looking_glass = LookingGlassOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
174- self .peering_locations = PeeringLocationsOperations (
175- self ._client , self ._config , self ._serialize , self ._deserialize
176- )
177- self .peering_service_countries = PeeringServiceCountriesOperations (
178- self ._client , self ._config , self ._serialize , self ._deserialize
179- )
180- self .peering_service_locations = PeeringServiceLocationsOperations (
142+ self .peering_service_providers = PeeringServiceProvidersOperations (
181143 self ._client , self ._config , self ._serialize , self ._deserialize
182144 )
183- self .peering_service_providers = PeeringServiceProvidersOperations (
145+ self .peering_services = PeeringServicesOperations (
184146 self ._client , self ._config , self ._serialize , self ._deserialize
185147 )
186148
187- def send_request (self , request : HttpRequest , * , stream : bool = False , ** kwargs : Any ) -> HttpResponse :
149+ def _send_request (self , request : HttpRequest , * , stream : bool = False , ** kwargs : Any ) -> HttpResponse :
188150 """Runs the network request through the client's chained policies.
189151
190152 >>> from azure.core.rest import HttpRequest
191153 >>> request = HttpRequest("GET", "https://www.example.org/")
192154 <HttpRequest [GET], url: 'https://www.example.org/'>
193- >>> response = client.send_request (request)
155+ >>> response = client._send_request (request)
194156 <HttpResponse: 200 OK>
195157
196158 For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
@@ -203,11 +165,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
203165 """
204166
205167 request_copy = deepcopy (request )
206- path_format_arguments = {
207- "endpoint" : self ._serialize .url ("self._config.base_url" , self ._config .base_url , "str" , skip_quote = True ),
208- }
209-
210- request_copy .url = self ._client .format_url (request_copy .url , ** path_format_arguments )
168+ request_copy .url = self ._client .format_url (request_copy .url )
211169 return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
212170
213171 def close (self ) -> None :
0 commit comments