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 (
2726)
2827
2928if TYPE_CHECKING :
30- # pylint: disable=unused-import,ungrouped-imports
3129 from azure .core .credentials import TokenCredential
3230
3331
34- class ServiceNetworkingMgmtClient : # pylint: disable=client-accepts-api-version-keyword
32+ class ServiceNetworkingMgmtClient :
3533 """Traffic Controller Provider management API.
3634
37- :ivar operations: Operations operations
38- :vartype operations: azure.mgmt.servicenetworking.operations.Operations
39- :ivar traffic_controller_interface: TrafficControllerInterfaceOperations operations
40- :vartype traffic_controller_interface:
41- azure.mgmt.servicenetworking.operations.TrafficControllerInterfaceOperations
4235 :ivar associations_interface: AssociationsInterfaceOperations operations
4336 :vartype associations_interface:
4437 azure.mgmt.servicenetworking.operations.AssociationsInterfaceOperations
@@ -48,14 +41,20 @@ class ServiceNetworkingMgmtClient: # pylint: disable=client-accepts-api-version
4841 :ivar security_policies_interface: SecurityPoliciesInterfaceOperations operations
4942 :vartype security_policies_interface:
5043 azure.mgmt.servicenetworking.operations.SecurityPoliciesInterfaceOperations
51- :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.
5250 :type credential: ~azure.core.credentials.TokenCredential
53- :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.
5452 :type subscription_id: str
55- :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".
5654 :type base_url: str
57- :keyword api_version: Api Version. Default value is "2024-05-01-preview". Note that overriding
58- this default value may result in unsupported behavior.
55+ :keyword api_version: The API version to use for this operation. Default value is
56+ "2024-11-01-preview". Note that overriding this default value may result in unsupported
57+ behavior.
5958 :paramtype api_version: str
6059 :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
6160 Retry-After header is present.
@@ -68,8 +67,9 @@ def __init__(
6867 base_url : str = "https://management.azure.com" ,
6968 ** kwargs : Any
7069 ) -> None :
70+ _endpoint = "{endpoint}"
7171 self ._config = ServiceNetworkingMgmtClientConfiguration (
72- credential = credential , subscription_id = subscription_id , ** kwargs
72+ credential = credential , subscription_id = subscription_id , base_url = base_url , ** kwargs
7373 )
7474 _policies = kwargs .pop ("policies" , None )
7575 if _policies is None :
@@ -89,16 +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 = base_url , policies = _policies , ** kwargs )
92+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = _endpoint , policies = _policies , ** kwargs )
9393
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 )
94+ self ._serialize = Serializer ()
95+ self ._deserialize = Deserializer ()
9796 self ._serialize .client_side_validation = False
98- self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
99- self .traffic_controller_interface = TrafficControllerInterfaceOperations (
100- self ._client , self ._config , self ._serialize , self ._deserialize
101- )
10297 self .associations_interface = AssociationsInterfaceOperations (
10398 self ._client , self ._config , self ._serialize , self ._deserialize
10499 )
@@ -108,14 +103,18 @@ def __init__(
108103 self .security_policies_interface = SecurityPoliciesInterfaceOperations (
109104 self ._client , self ._config , self ._serialize , self ._deserialize
110105 )
106+ self .traffic_controller_interface = TrafficControllerInterfaceOperations (
107+ self ._client , self ._config , self ._serialize , self ._deserialize
108+ )
109+ self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
111110
112- 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 :
113112 """Runs the network request through the client's chained policies.
114113
115114 >>> from azure.core.rest import HttpRequest
116115 >>> request = HttpRequest("GET", "https://www.example.org/")
117116 <HttpRequest [GET], url: 'https://www.example.org/'>
118- >>> response = client._send_request (request)
117+ >>> response = client.send_request (request)
119118 <HttpResponse: 200 OK>
120119
121120 For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
@@ -128,7 +127,11 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
128127 """
129128
130129 request_copy = deepcopy (request )
131- request_copy .url = self ._client .format_url (request_copy .url )
130+ path_format_arguments = {
131+ "endpoint" : self ._serialize .url ("self._config.base_url" , self ._config .base_url , "str" , skip_quote = True ),
132+ }
133+
134+ request_copy .url = self ._client .format_url (request_copy .url , ** path_format_arguments )
132135 return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
133136
134137 def close (self ) -> None :
0 commit comments