|
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 | # -------------------------------------------------------------------------- |
| 8 | + |
11 | 9 | from typing import Any, TYPE_CHECKING |
12 | 10 |
|
13 | 11 | from azure.core.pipeline import policies |
|
16 | 14 | from ._version import VERSION |
17 | 15 |
|
18 | 16 | if TYPE_CHECKING: |
19 | | - # pylint: disable=unused-import,ungrouped-imports |
20 | 17 | from azure.core.credentials import TokenCredential |
21 | 18 |
|
22 | 19 |
|
23 | | -class WebSiteManagementClientConfiguration: |
| 20 | +class WebSiteManagementClientConfiguration: # pylint: disable=too-many-instance-attributes |
24 | 21 | """Configuration for WebSiteManagementClient. |
25 | 22 |
|
26 | 23 | Note that all parameters used to create this instance are saved as instance |
27 | 24 | attributes. |
28 | 25 |
|
29 | 26 | :param credential: Credential needed for the client to connect to Azure. Required. |
30 | 27 | :type credential: ~azure.core.credentials.TokenCredential |
31 | | - :param subscription_id: Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). Required. |
| 28 | + :param subscription_id: Your Azure subscription ID. This is a GUID-formatted string (e.g. |
| 29 | + 00000000-0000-0000-0000-000000000000). Required. |
32 | 30 | :type subscription_id: str |
| 31 | + :keyword api_version: Api Version. Default value is "2024-11-01". Note that overriding this |
| 32 | + default value may result in unsupported behavior. |
| 33 | + :paramtype api_version: str |
33 | 34 | """ |
34 | 35 |
|
35 | | - def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any): |
| 36 | + def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: |
| 37 | + api_version: str = kwargs.pop("api_version", "2024-11-01") |
| 38 | + |
36 | 39 | if credential is None: |
37 | 40 | raise ValueError("Parameter 'credential' must not be None.") |
38 | 41 | if subscription_id is None: |
39 | 42 | raise ValueError("Parameter 'subscription_id' must not be None.") |
40 | 43 |
|
41 | 44 | self.credential = credential |
42 | 45 | self.subscription_id = subscription_id |
| 46 | + self.api_version = api_version |
43 | 47 | self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) |
44 | | - kwargs.setdefault("sdk_moniker", "azure-mgmt-web/{}".format(VERSION)) |
| 48 | + kwargs.setdefault("sdk_moniker", "mgmt-web/{}".format(VERSION)) |
45 | 49 | self.polling_interval = kwargs.get("polling_interval", 30) |
46 | 50 | self._configure(**kwargs) |
47 | 51 |
|
48 | | - def _configure(self, **kwargs: Any): |
| 52 | + def _configure(self, **kwargs: Any) -> None: |
49 | 53 | self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) |
50 | 54 | self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) |
51 | 55 | self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) |
52 | 56 | self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) |
53 | 57 | 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 | 58 | self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) |
56 | 59 | self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) |
| 60 | + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) |
57 | 61 | self.authentication_policy = kwargs.get("authentication_policy") |
58 | 62 | if self.credential and not self.authentication_policy: |
59 | 63 | self.authentication_policy = ARMChallengeAuthenticationPolicy( |
|
0 commit comments