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
1515from azure .mgmt .core import ARMPipelineClient
1616from azure .mgmt .core .policies import ARMAutoResourceProviderRegistrationPolicy
1717
18- from . import models as _models
1918from ._configuration import ServiceNetworkingMgmtClientConfiguration
2019from ._serialization import Deserializer , Serializer
2120from .operations import (
3332class ServiceNetworkingMgmtClient :
3433 """Traffic Controller Provider management API.
3534
36- :ivar operations: Operations operations
37- :vartype operations: azure.mgmt.servicenetworking.operations.Operations
38- :ivar traffic_controller_interface: TrafficControllerInterfaceOperations operations
39- :vartype traffic_controller_interface:
40- azure.mgmt.servicenetworking.operations.TrafficControllerInterfaceOperations
4135 :ivar associations_interface: AssociationsInterfaceOperations operations
4236 :vartype associations_interface:
4337 azure.mgmt.servicenetworking.operations.AssociationsInterfaceOperations
@@ -47,14 +41,19 @@ class ServiceNetworkingMgmtClient:
4741 :ivar security_policies_interface: SecurityPoliciesInterfaceOperations operations
4842 :vartype security_policies_interface:
4943 azure.mgmt.servicenetworking.operations.SecurityPoliciesInterfaceOperations
50- :param credential: Credential needed for the client to connect to Azure. Required.
44+ :ivar traffic_controller_interface: TrafficControllerInterfaceOperations operations
45+ :vartype traffic_controller_interface:
46+ azure.mgmt.servicenetworking.operations.TrafficControllerInterfaceOperations
47+ :ivar operations: Operations operations
48+ :vartype operations: azure.mgmt.servicenetworking.operations.Operations
49+ :param credential: Credential used to authenticate requests to the service. Required.
5150 :type credential: ~azure.core.credentials.TokenCredential
52- :param subscription_id: The ID of the target subscription. Required.
51+ :param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
5352 :type subscription_id: str
54- :param base_url: Service URL . Default value is "https://management.azure.com".
53+ :param base_url: Service host . Default value is "https://management.azure.com".
5554 :type base_url: str
56- :keyword api_version: Api Version . Default value is "2025-01-01". Note that overriding this
57- default value may result in unsupported behavior.
55+ :keyword api_version: The API version to use for this operation . Default value is "2025-01-01".
56+ Note that overriding this default value may result in unsupported behavior.
5857 :paramtype api_version: str
5958 :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
6059 Retry-After header is present.
@@ -67,8 +66,9 @@ def __init__(
6766 base_url : str = "https://management.azure.com" ,
6867 ** kwargs : Any
6968 ) -> None :
69+ _endpoint = "{endpoint}"
7070 self ._config = ServiceNetworkingMgmtClientConfiguration (
71- credential = credential , subscription_id = subscription_id , ** kwargs
71+ credential = credential , subscription_id = subscription_id , base_url = base_url , ** kwargs
7272 )
7373 _policies = kwargs .pop ("policies" , None )
7474 if _policies is None :
@@ -88,16 +88,11 @@ def __init__(
8888 policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
8989 self ._config .http_logging_policy ,
9090 ]
91- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
91+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = _endpoint , policies = _policies , ** kwargs )
9292
93- client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
94- self ._serialize = Serializer (client_models )
95- self ._deserialize = Deserializer (client_models )
93+ self ._serialize = Serializer ()
94+ self ._deserialize = Deserializer ()
9695 self ._serialize .client_side_validation = False
97- self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
98- self .traffic_controller_interface = TrafficControllerInterfaceOperations (
99- self ._client , self ._config , self ._serialize , self ._deserialize
100- )
10196 self .associations_interface = AssociationsInterfaceOperations (
10297 self ._client , self ._config , self ._serialize , self ._deserialize
10398 )
@@ -107,14 +102,18 @@ def __init__(
107102 self .security_policies_interface = SecurityPoliciesInterfaceOperations (
108103 self ._client , self ._config , self ._serialize , self ._deserialize
109104 )
105+ self .traffic_controller_interface = TrafficControllerInterfaceOperations (
106+ self ._client , self ._config , self ._serialize , self ._deserialize
107+ )
108+ self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
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