|
1 | 1 | # coding=utf-8
|
2 | 2 | # --------------------------------------------------------------------------
|
3 | 3 | # Copyright (c) Microsoft Corporation. All rights reserved.
|
4 |
| -# Licensed under the MIT License. See License.txt in the project root for |
5 |
| -# license information. |
6 |
| -# |
| 4 | +# Licensed under the MIT License. See License.txt in the project root for license information. |
7 | 5 | # Code generated by Microsoft (R) AutoRest Code Generator.
|
8 |
| -# Changes may cause incorrect behavior and will be lost if the code is |
9 |
| -# regenerated. |
| 6 | +# Changes may cause incorrect behavior and will be lost if the code is regenerated. |
10 | 7 | # --------------------------------------------------------------------------
|
11 | 8 |
|
12 |
| -from msrest.service_client import SDKClient |
13 |
| -from msrest import Serializer, Deserializer |
| 9 | +from typing import TYPE_CHECKING |
| 10 | + |
| 11 | +from azure.mgmt.core import ARMPipelineClient |
| 12 | +from msrest import Deserializer, Serializer |
| 13 | + |
| 14 | +if TYPE_CHECKING: |
| 15 | + # pylint: disable=unused-import,ungrouped-imports |
| 16 | + from typing import Any, Optional |
| 17 | + |
| 18 | + from azure.core.credentials import TokenCredential |
14 | 19 |
|
15 | 20 | from ._configuration import FrontDoorManagementClientConfiguration
|
16 |
| -from .operations import FrontDoorManagementClientOperationsMixin |
17 | 21 | from .operations import NetworkExperimentProfilesOperations
|
18 | 22 | from .operations import PreconfiguredEndpointsOperations
|
19 | 23 | from .operations import ExperimentsOperations
|
20 | 24 | from .operations import ReportsOperations
|
| 25 | +from .operations import FrontDoorNameAvailabilityOperations |
| 26 | +from .operations import FrontDoorNameAvailabilityWithSubscriptionOperations |
21 | 27 | from .operations import FrontDoorsOperations
|
22 | 28 | from .operations import FrontendEndpointsOperations
|
23 | 29 | from .operations import EndpointsOperations
|
| 30 | +from .operations import RulesEnginesOperations |
24 | 31 | from .operations import PoliciesOperations
|
25 | 32 | from .operations import ManagedRuleSetsOperations
|
26 | 33 | from . import models
|
27 | 34 |
|
28 | 35 |
|
29 |
| -class FrontDoorManagementClient(FrontDoorManagementClientOperationsMixin, SDKClient): |
30 |
| - """FrontDoor Client |
| 36 | +class FrontDoorManagementClient(object): |
| 37 | + """FrontDoor Client. |
31 | 38 |
|
32 |
| - :ivar config: Configuration for client. |
33 |
| - :vartype config: FrontDoorManagementClientConfiguration |
34 |
| -
|
35 |
| - :ivar network_experiment_profiles: NetworkExperimentProfiles operations |
| 39 | + :ivar network_experiment_profiles: NetworkExperimentProfilesOperations operations |
36 | 40 | :vartype network_experiment_profiles: azure.mgmt.frontdoor.operations.NetworkExperimentProfilesOperations
|
37 |
| - :ivar preconfigured_endpoints: PreconfiguredEndpoints operations |
| 41 | + :ivar preconfigured_endpoints: PreconfiguredEndpointsOperations operations |
38 | 42 | :vartype preconfigured_endpoints: azure.mgmt.frontdoor.operations.PreconfiguredEndpointsOperations
|
39 |
| - :ivar experiments: Experiments operations |
| 43 | + :ivar experiments: ExperimentsOperations operations |
40 | 44 | :vartype experiments: azure.mgmt.frontdoor.operations.ExperimentsOperations
|
41 |
| - :ivar reports: Reports operations |
| 45 | + :ivar reports: ReportsOperations operations |
42 | 46 | :vartype reports: azure.mgmt.frontdoor.operations.ReportsOperations
|
43 |
| - :ivar front_doors: FrontDoors operations |
| 47 | + :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 |
| 51 | + :ivar front_doors: FrontDoorsOperations operations |
44 | 52 | :vartype front_doors: azure.mgmt.frontdoor.operations.FrontDoorsOperations
|
45 |
| - :ivar frontend_endpoints: FrontendEndpoints operations |
| 53 | + :ivar frontend_endpoints: FrontendEndpointsOperations operations |
46 | 54 | :vartype frontend_endpoints: azure.mgmt.frontdoor.operations.FrontendEndpointsOperations
|
47 |
| - :ivar endpoints: Endpoints operations |
| 55 | + :ivar endpoints: EndpointsOperations operations |
48 | 56 | :vartype endpoints: azure.mgmt.frontdoor.operations.EndpointsOperations
|
49 |
| - :ivar policies: Policies operations |
| 57 | + :ivar rules_engines: RulesEnginesOperations operations |
| 58 | + :vartype rules_engines: azure.mgmt.frontdoor.operations.RulesEnginesOperations |
| 59 | + :ivar policies: PoliciesOperations operations |
50 | 60 | :vartype policies: azure.mgmt.frontdoor.operations.PoliciesOperations
|
51 |
| - :ivar managed_rule_sets: ManagedRuleSets operations |
| 61 | + :ivar managed_rule_sets: ManagedRuleSetsOperations operations |
52 | 62 | :vartype managed_rule_sets: azure.mgmt.frontdoor.operations.ManagedRuleSetsOperations
|
53 |
| -
|
54 |
| - :param credentials: Credentials needed for the client to connect to Azure. |
55 |
| - :type credentials: :mod:`A msrestazure Credentials |
56 |
| - object<msrestazure.azure_active_directory>` |
57 |
| - :param subscription_id: The subscription credentials which uniquely |
58 |
| - identify the Microsoft Azure subscription. The subscription ID forms part |
59 |
| - of the URI for every service call. |
| 63 | + :param credential: Credential needed for the client to connect to Azure. |
| 64 | + :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. |
60 | 66 | :type subscription_id: str
|
61 | 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. |
62 | 69 | """
|
63 | 70 |
|
64 | 71 | def __init__(
|
65 |
| - self, credentials, subscription_id, base_url=None): |
66 |
| - |
67 |
| - self.config = FrontDoorManagementClientConfiguration(credentials, subscription_id, base_url) |
68 |
| - super(FrontDoorManagementClient, self).__init__(self.config.credentials, self.config) |
| 72 | + 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) |
| 82 | + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) |
69 | 83 |
|
70 | 84 | client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
|
71 | 85 | self._serialize = Serializer(client_models)
|
72 | 86 | self._deserialize = Deserializer(client_models)
|
73 | 87 |
|
74 | 88 | self.network_experiment_profiles = NetworkExperimentProfilesOperations(
|
75 |
| - self._client, self.config, self._serialize, self._deserialize) |
| 89 | + self._client, self._config, self._serialize, self._deserialize) |
76 | 90 | self.preconfigured_endpoints = PreconfiguredEndpointsOperations(
|
77 |
| - self._client, self.config, self._serialize, self._deserialize) |
| 91 | + self._client, self._config, self._serialize, self._deserialize) |
78 | 92 | self.experiments = ExperimentsOperations(
|
79 |
| - self._client, self.config, self._serialize, self._deserialize) |
| 93 | + self._client, self._config, self._serialize, self._deserialize) |
80 | 94 | self.reports = ReportsOperations(
|
81 |
| - self._client, self.config, self._serialize, self._deserialize) |
| 95 | + self._client, self._config, self._serialize, self._deserialize) |
| 96 | + self.front_door_name_availability = FrontDoorNameAvailabilityOperations( |
| 97 | + self._client, self._config, self._serialize, self._deserialize) |
| 98 | + self.front_door_name_availability_with_subscription = FrontDoorNameAvailabilityWithSubscriptionOperations( |
| 99 | + self._client, self._config, self._serialize, self._deserialize) |
82 | 100 | self.front_doors = FrontDoorsOperations(
|
83 |
| - self._client, self.config, self._serialize, self._deserialize) |
| 101 | + self._client, self._config, self._serialize, self._deserialize) |
84 | 102 | self.frontend_endpoints = FrontendEndpointsOperations(
|
85 |
| - self._client, self.config, self._serialize, self._deserialize) |
| 103 | + self._client, self._config, self._serialize, self._deserialize) |
86 | 104 | self.endpoints = EndpointsOperations(
|
87 |
| - self._client, self.config, self._serialize, self._deserialize) |
| 105 | + self._client, self._config, self._serialize, self._deserialize) |
| 106 | + self.rules_engines = RulesEnginesOperations( |
| 107 | + self._client, self._config, self._serialize, self._deserialize) |
88 | 108 | self.policies = PoliciesOperations(
|
89 |
| - self._client, self.config, self._serialize, self._deserialize) |
| 109 | + self._client, self._config, self._serialize, self._deserialize) |
90 | 110 | self.managed_rule_sets = ManagedRuleSetsOperations(
|
91 |
| - self._client, self.config, self._serialize, self._deserialize) |
| 111 | + self._client, self._config, self._serialize, self._deserialize) |
| 112 | + |
| 113 | + def close(self): |
| 114 | + # type: () -> None |
| 115 | + self._client.close() |
| 116 | + |
| 117 | + def __enter__(self): |
| 118 | + # type: () -> FrontDoorManagementClient |
| 119 | + self._client.__enter__() |
| 120 | + return self |
| 121 | + |
| 122 | + def __exit__(self, *exc_details): |
| 123 | + # type: (Any) -> None |
| 124 | + self._client.__exit__(*exc_details) |
0 commit comments