|
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 license information. |
| 4 | +# Licensed under the MIT License. See License.txt in the project root for |
| 5 | +# license information. |
| 6 | +# |
5 | 7 | # Code generated by Microsoft (R) AutoRest Code Generator.
|
6 |
| -# Changes may cause incorrect behavior and will be lost if the code is regenerated. |
| 8 | +# Changes may cause incorrect behavior and will be lost if the code is |
| 9 | +# regenerated. |
7 | 10 | # --------------------------------------------------------------------------
|
8 |
| - |
9 | 11 | from typing import Any, TYPE_CHECKING
|
10 | 12 |
|
11 | 13 | from azure.core.configuration import Configuration
|
|
18 | 20 | # pylint: disable=unused-import,ungrouped-imports
|
19 | 21 | from azure.core.credentials import TokenCredential
|
20 | 22 |
|
21 |
| - |
22 |
| -class NetworkManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes |
| 23 | +class NetworkManagementClientConfiguration(Configuration): |
23 | 24 | """Configuration for NetworkManagementClient.
|
24 | 25 |
|
25 | 26 | Note that all parameters used to create this instance are saved as instance
|
26 | 27 | attributes.
|
27 | 28 |
|
28 | 29 | :param credential: Credential needed for the client to connect to Azure. Required.
|
29 | 30 | :type credential: ~azure.core.credentials.TokenCredential
|
30 |
| - :param subscription_id: The subscription credentials which uniquely identify the Microsoft |
31 |
| - Azure subscription. The subscription ID forms part of the URI for every service call. Required. |
| 31 | + :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. Required. |
32 | 32 | :type subscription_id: str
|
33 | 33 | """
|
34 | 34 |
|
35 |
| - def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: |
36 |
| - super(NetworkManagementClientConfiguration, self).__init__(**kwargs) |
| 35 | + def __init__( |
| 36 | + self, |
| 37 | + credential: "TokenCredential", |
| 38 | + subscription_id: str, |
| 39 | + **kwargs: Any |
| 40 | + ): |
37 | 41 | if credential is None:
|
38 | 42 | raise ValueError("Parameter 'credential' must not be None.")
|
39 | 43 | if subscription_id is None:
|
40 | 44 | raise ValueError("Parameter 'subscription_id' must not be None.")
|
| 45 | + super(NetworkManagementClientConfiguration, self).__init__(**kwargs) |
41 | 46 |
|
42 | 47 | self.credential = credential
|
43 | 48 | self.subscription_id = subscription_id
|
44 |
| - self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) |
45 |
| - kwargs.setdefault("sdk_moniker", "mgmt-network/{}".format(VERSION)) |
| 49 | + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) |
| 50 | + kwargs.setdefault('sdk_moniker', 'azure-mgmt-network/{}'.format(VERSION)) |
46 | 51 | self._configure(**kwargs)
|
47 | 52 |
|
48 |
| - def _configure(self, **kwargs: Any) -> None: |
49 |
| - self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) |
50 |
| - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) |
51 |
| - self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) |
52 |
| - self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) |
53 |
| - self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) |
54 |
| - self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) |
55 |
| - self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) |
56 |
| - self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) |
57 |
| - self.authentication_policy = kwargs.get("authentication_policy") |
| 53 | + def _configure( |
| 54 | + self, |
| 55 | + **kwargs: Any |
| 56 | + ): |
| 57 | + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) |
| 58 | + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) |
| 59 | + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) |
| 60 | + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) |
| 61 | + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) |
| 62 | + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) |
| 63 | + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) |
| 64 | + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) |
| 65 | + self.authentication_policy = kwargs.get('authentication_policy') |
58 | 66 | if self.credential and not self.authentication_policy:
|
59 |
| - self.authentication_policy = ARMChallengeAuthenticationPolicy( |
60 |
| - self.credential, *self.credential_scopes, **kwargs |
61 |
| - ) |
| 67 | + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) |
0 commit comments