66# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77# --------------------------------------------------------------------------
88
9- from typing import TYPE_CHECKING
9+ from copy import deepcopy
10+ from typing import Any , Optional , TYPE_CHECKING
1011
12+ from azure .core .rest import HttpRequest , HttpResponse
1113from azure .mgmt .core import ARMPipelineClient
1214from msrest import Deserializer , Serializer
1315
16+ from . import models
17+ from ._configuration import FrontDoorManagementClientConfiguration
18+ from .operations import EndpointsOperations , ExperimentsOperations , FrontDoorNameAvailabilityOperations , FrontDoorNameAvailabilityWithSubscriptionOperations , FrontDoorsOperations , FrontendEndpointsOperations , ManagedRuleSetsOperations , NetworkExperimentProfilesOperations , PoliciesOperations , PreconfiguredEndpointsOperations , ReportsOperations , RulesEnginesOperations
19+
1420if TYPE_CHECKING :
1521 # pylint: disable=unused-import,ungrouped-imports
16- from typing import Any , Optional
17-
1822 from azure .core .credentials import TokenCredential
1923
20- from ._configuration import FrontDoorManagementClientConfiguration
21- from .operations import NetworkExperimentProfilesOperations
22- from .operations import PreconfiguredEndpointsOperations
23- from .operations import ExperimentsOperations
24- from .operations import ReportsOperations
25- from .operations import FrontDoorNameAvailabilityOperations
26- from .operations import FrontDoorNameAvailabilityWithSubscriptionOperations
27- from .operations import FrontDoorsOperations
28- from .operations import FrontendEndpointsOperations
29- from .operations import EndpointsOperations
30- from .operations import RulesEnginesOperations
31- from .operations import PoliciesOperations
32- from .operations import ManagedRuleSetsOperations
33- from . import models
34-
35-
36- class FrontDoorManagementClient (object ):
24+ class FrontDoorManagementClient :
3725 """FrontDoor Client.
3826
3927 :ivar network_experiment_profiles: NetworkExperimentProfilesOperations operations
40- :vartype network_experiment_profiles: azure.mgmt.frontdoor.operations.NetworkExperimentProfilesOperations
28+ :vartype network_experiment_profiles:
29+ azure.mgmt.frontdoor.operations.NetworkExperimentProfilesOperations
4130 :ivar preconfigured_endpoints: PreconfiguredEndpointsOperations operations
42- :vartype preconfigured_endpoints: azure.mgmt.frontdoor.operations.PreconfiguredEndpointsOperations
31+ :vartype preconfigured_endpoints:
32+ azure.mgmt.frontdoor.operations.PreconfiguredEndpointsOperations
4333 :ivar experiments: ExperimentsOperations operations
4434 :vartype experiments: azure.mgmt.frontdoor.operations.ExperimentsOperations
4535 :ivar reports: ReportsOperations operations
4636 :vartype reports: azure.mgmt.frontdoor.operations.ReportsOperations
4737 :ivar front_door_name_availability: FrontDoorNameAvailabilityOperations operations
48- :vartype front_door_name_availability: azure.mgmt.frontdoor.operations.FrontDoorNameAvailabilityOperations
49- :ivar front_door_name_availability_with_subscription: FrontDoorNameAvailabilityWithSubscriptionOperations operations
50- :vartype front_door_name_availability_with_subscription: azure.mgmt.frontdoor.operations.FrontDoorNameAvailabilityWithSubscriptionOperations
38+ :vartype front_door_name_availability:
39+ azure.mgmt.frontdoor.operations.FrontDoorNameAvailabilityOperations
40+ :ivar front_door_name_availability_with_subscription:
41+ FrontDoorNameAvailabilityWithSubscriptionOperations operations
42+ :vartype front_door_name_availability_with_subscription:
43+ azure.mgmt.frontdoor.operations.FrontDoorNameAvailabilityWithSubscriptionOperations
5144 :ivar front_doors: FrontDoorsOperations operations
5245 :vartype front_doors: azure.mgmt.frontdoor.operations.FrontDoorsOperations
5346 :ivar frontend_endpoints: FrontendEndpointsOperations operations
@@ -62,54 +55,68 @@ class FrontDoorManagementClient(object):
6255 :vartype managed_rule_sets: azure.mgmt.frontdoor.operations.ManagedRuleSetsOperations
6356 :param credential: Credential needed for the client to connect to Azure.
6457 :type credential: ~azure.core.credentials.TokenCredential
65- :param subscription_id: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
58+ :param subscription_id: The subscription credentials which uniquely identify the Microsoft
59+ Azure subscription. The subscription ID forms part of the URI for every service call.
6660 :type subscription_id: str
67- :param str base_url: Service URL
68- :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
61+ :param base_url: Service URL. Default value is 'https://management.azure.com'.
62+ :type base_url: str
63+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
64+ Retry-After header is present.
6965 """
7066
7167 def __init__ (
7268 self ,
73- credential , # type: "TokenCredential"
74- subscription_id , # type: str
75- base_url = None , # type: Optional[str]
76- ** kwargs # type: Any
77- ):
78- # type: (...) -> None
79- if not base_url :
80- base_url = 'https://management.azure.com'
81- self ._config = FrontDoorManagementClientConfiguration (credential , subscription_id , ** kwargs )
69+ credential : "TokenCredential" ,
70+ subscription_id : str ,
71+ base_url : str = "https://management.azure.com" ,
72+ ** kwargs : Any
73+ ) -> None :
74+ self ._config = FrontDoorManagementClientConfiguration (credential = credential , subscription_id = subscription_id , ** kwargs )
8275 self ._client = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
8376
8477 client_models = {k : v for k , v in models .__dict__ .items () if isinstance (v , type )}
8578 self ._serialize = Serializer (client_models )
86- self ._serialize .client_side_validation = False
8779 self ._deserialize = Deserializer (client_models )
80+ self ._serialize .client_side_validation = False
81+ self .network_experiment_profiles = NetworkExperimentProfilesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
82+ self .preconfigured_endpoints = PreconfiguredEndpointsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
83+ self .experiments = ExperimentsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
84+ self .reports = ReportsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
85+ self .front_door_name_availability = FrontDoorNameAvailabilityOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
86+ self .front_door_name_availability_with_subscription = FrontDoorNameAvailabilityWithSubscriptionOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
87+ self .front_doors = FrontDoorsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
88+ self .frontend_endpoints = FrontendEndpointsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
89+ self .endpoints = EndpointsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
90+ self .rules_engines = RulesEnginesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
91+ self .policies = PoliciesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
92+ self .managed_rule_sets = ManagedRuleSetsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
93+
94+
95+ def _send_request (
96+ self ,
97+ request , # type: HttpRequest
98+ ** kwargs : Any
99+ ) -> HttpResponse :
100+ """Runs the network request through the client's chained policies.
101+
102+ >>> from azure.core.rest import HttpRequest
103+ >>> request = HttpRequest("GET", "https://www.example.org/")
104+ <HttpRequest [GET], url: 'https://www.example.org/'>
105+ >>> response = client._send_request(request)
106+ <HttpResponse: 200 OK>
107+
108+ For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
109+
110+ :param request: The network request you want to make. Required.
111+ :type request: ~azure.core.rest.HttpRequest
112+ :keyword bool stream: Whether the response payload will be streamed. Defaults to False.
113+ :return: The response of your network call. Does not do error handling on your response.
114+ :rtype: ~azure.core.rest.HttpResponse
115+ """
88116
89- self .network_experiment_profiles = NetworkExperimentProfilesOperations (
90- self ._client , self ._config , self ._serialize , self ._deserialize )
91- self .preconfigured_endpoints = PreconfiguredEndpointsOperations (
92- self ._client , self ._config , self ._serialize , self ._deserialize )
93- self .experiments = ExperimentsOperations (
94- self ._client , self ._config , self ._serialize , self ._deserialize )
95- self .reports = ReportsOperations (
96- self ._client , self ._config , self ._serialize , self ._deserialize )
97- self .front_door_name_availability = FrontDoorNameAvailabilityOperations (
98- self ._client , self ._config , self ._serialize , self ._deserialize )
99- self .front_door_name_availability_with_subscription = FrontDoorNameAvailabilityWithSubscriptionOperations (
100- self ._client , self ._config , self ._serialize , self ._deserialize )
101- self .front_doors = FrontDoorsOperations (
102- self ._client , self ._config , self ._serialize , self ._deserialize )
103- self .frontend_endpoints = FrontendEndpointsOperations (
104- self ._client , self ._config , self ._serialize , self ._deserialize )
105- self .endpoints = EndpointsOperations (
106- self ._client , self ._config , self ._serialize , self ._deserialize )
107- self .rules_engines = RulesEnginesOperations (
108- self ._client , self ._config , self ._serialize , self ._deserialize )
109- self .policies = PoliciesOperations (
110- self ._client , self ._config , self ._serialize , self ._deserialize )
111- self .managed_rule_sets = ManagedRuleSetsOperations (
112- self ._client , self ._config , self ._serialize , self ._deserialize )
117+ request_copy = deepcopy (request )
118+ request_copy .url = self ._client .format_url (request_copy .url )
119+ return self ._client .send_request (request_copy , ** kwargs )
113120
114121 def close (self ):
115122 # type: () -> None
0 commit comments