6
6
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
# --------------------------------------------------------------------------
8
8
9
- from typing import TYPE_CHECKING
9
+ from copy import deepcopy
10
+ from typing import Any , Optional , TYPE_CHECKING
10
11
12
+ from azure .core .rest import HttpRequest , HttpResponse
11
13
from azure .mgmt .core import ARMPipelineClient
12
14
from msrest import Deserializer , Serializer
13
15
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
+
14
20
if TYPE_CHECKING :
15
21
# pylint: disable=unused-import,ungrouped-imports
16
- from typing import Any , Optional
17
-
18
22
from azure .core .credentials import TokenCredential
19
23
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 :
37
25
"""FrontDoor Client.
38
26
39
27
: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
41
30
:ivar preconfigured_endpoints: PreconfiguredEndpointsOperations operations
42
- :vartype preconfigured_endpoints: azure.mgmt.frontdoor.operations.PreconfiguredEndpointsOperations
31
+ :vartype preconfigured_endpoints:
32
+ azure.mgmt.frontdoor.operations.PreconfiguredEndpointsOperations
43
33
:ivar experiments: ExperimentsOperations operations
44
34
:vartype experiments: azure.mgmt.frontdoor.operations.ExperimentsOperations
45
35
:ivar reports: ReportsOperations operations
46
36
:vartype reports: azure.mgmt.frontdoor.operations.ReportsOperations
47
37
: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
51
44
:ivar front_doors: FrontDoorsOperations operations
52
45
:vartype front_doors: azure.mgmt.frontdoor.operations.FrontDoorsOperations
53
46
:ivar frontend_endpoints: FrontendEndpointsOperations operations
@@ -62,54 +55,68 @@ class FrontDoorManagementClient(object):
62
55
:vartype managed_rule_sets: azure.mgmt.frontdoor.operations.ManagedRuleSetsOperations
63
56
:param credential: Credential needed for the client to connect to Azure.
64
57
: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.
66
60
: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.
69
65
"""
70
66
71
67
def __init__ (
72
68
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 )
82
75
self ._client = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
83
76
84
77
client_models = {k : v for k , v in models .__dict__ .items () if isinstance (v , type )}
85
78
self ._serialize = Serializer (client_models )
86
- self ._serialize .client_side_validation = False
87
79
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
+ """
88
116
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 )
113
120
114
121
def close (self ):
115
122
# type: () -> None
0 commit comments