|
19 | 19 | from azure.core.credentials import TokenCredential |
20 | 20 |
|
21 | 21 |
|
22 | | -class SignalRManagementClientConfiguration(Configuration): |
| 22 | +class SignalRManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes |
23 | 23 | """Configuration for SignalRManagementClient. |
24 | 24 |
|
25 | 25 | Note that all parameters used to create this instance are saved as instance |
26 | 26 | attributes. |
27 | 27 |
|
28 | | - :param credential: Credential needed for the client to connect to Azure. |
| 28 | + :param credential: Credential needed for the client to connect to Azure. Required. |
29 | 29 | :type credential: ~azure.core.credentials.TokenCredential |
30 | | - :param subscription_id: Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. |
| 30 | + :param subscription_id: Gets subscription Id which uniquely identify the Microsoft Azure |
| 31 | + subscription. The subscription ID forms part of the URI for every service call. Required. |
31 | 32 | :type subscription_id: str |
| 33 | + :keyword api_version: Api Version. Default value is "2022-08-01-preview". Note that overriding |
| 34 | + this default value may result in unsupported behavior. |
| 35 | + :paramtype api_version: str |
32 | 36 | """ |
33 | 37 |
|
34 | | - def __init__( |
35 | | - self, |
36 | | - credential: "TokenCredential", |
37 | | - subscription_id: str, |
38 | | - **kwargs: Any |
39 | | - ) -> None: |
| 38 | + def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: |
40 | 39 | super(SignalRManagementClientConfiguration, self).__init__(**kwargs) |
| 40 | + api_version = kwargs.pop("api_version", "2022-08-01-preview") # type: str |
| 41 | + |
41 | 42 | if credential is None: |
42 | 43 | raise ValueError("Parameter 'credential' must not be None.") |
43 | 44 | if subscription_id is None: |
44 | 45 | raise ValueError("Parameter 'subscription_id' must not be None.") |
45 | 46 |
|
46 | 47 | self.credential = credential |
47 | 48 | self.subscription_id = subscription_id |
48 | | - self.api_version = "2022-02-01" |
49 | | - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) |
50 | | - kwargs.setdefault('sdk_moniker', 'mgmt-signalr/{}'.format(VERSION)) |
| 49 | + self.api_version = api_version |
| 50 | + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) |
| 51 | + kwargs.setdefault("sdk_moniker", "mgmt-signalr/{}".format(VERSION)) |
51 | 52 | self._configure(**kwargs) |
52 | 53 |
|
53 | 54 | def _configure( |
54 | | - self, |
55 | | - **kwargs # type: Any |
| 55 | + self, **kwargs # type: Any |
56 | 56 | ): |
57 | 57 | # type: (...) -> None |
58 | | - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) |
59 | | - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) |
60 | | - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) |
61 | | - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) |
62 | | - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) |
63 | | - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) |
64 | | - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) |
65 | | - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) |
66 | | - self.authentication_policy = kwargs.get('authentication_policy') |
| 58 | + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) |
| 59 | + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) |
| 60 | + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) |
| 61 | + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) |
| 62 | + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) |
| 63 | + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) |
| 64 | + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) |
| 65 | + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) |
| 66 | + self.authentication_policy = kwargs.get("authentication_policy") |
67 | 67 | if self.credential and not self.authentication_policy: |
68 | | - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) |
| 68 | + self.authentication_policy = ARMChallengeAuthenticationPolicy( |
| 69 | + self.credential, *self.credential_scopes, **kwargs |
| 70 | + ) |
0 commit comments