6
6
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
# --------------------------------------------------------------------------
8
8
9
+ import sys
9
10
from typing import Any , TYPE_CHECKING
10
11
11
12
from azure .core .configuration import Configuration
14
15
15
16
from ._version import VERSION
16
17
18
+ if sys .version_info >= (3 , 8 ):
19
+ from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
20
+ else :
21
+ from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
22
+
17
23
if TYPE_CHECKING :
18
24
# pylint: disable=unused-import,ungrouped-imports
19
25
from azure .core .credentials import TokenCredential
@@ -25,43 +31,37 @@ class ServiceLinkerManagementClientConfiguration(Configuration): # pylint: disa
25
31
Note that all parameters used to create this instance are saved as instance
26
32
attributes.
27
33
28
- :param credential: Credential needed for the client to connect to Azure.
34
+ :param credential: Credential needed for the client to connect to Azure. Required.
29
35
:type credential: ~azure.core.credentials.TokenCredential
30
- :keyword api_version: Api Version. Default value is "2022-05 -01". Note that overriding this
31
- default value may result in unsupported behavior.
36
+ :keyword api_version: Api Version. Default value is "2022-11 -01-preview ". Note that overriding
37
+ this default value may result in unsupported behavior.
32
38
:paramtype api_version: str
33
39
"""
34
40
35
- def __init__ (
36
- self ,
37
- credential : "TokenCredential" ,
38
- ** kwargs : Any
39
- ) -> None :
41
+ def __init__ (self , credential : "TokenCredential" , ** kwargs : Any ) -> None :
40
42
super (ServiceLinkerManagementClientConfiguration , self ).__init__ (** kwargs )
41
- api_version = kwargs .pop (' api_version' , "2022-05 -01" ) # type: str
43
+ api_version : Literal [ "2022-11-01-preview" ] = kwargs .pop (" api_version" , "2022-11 -01-preview" )
42
44
43
45
if credential is None :
44
46
raise ValueError ("Parameter 'credential' must not be None." )
45
47
46
48
self .credential = credential
47
49
self .api_version = api_version
48
- self .credential_scopes = kwargs .pop (' credential_scopes' , [' https://management.azure.com/.default' ])
49
- kwargs .setdefault (' sdk_moniker' , ' mgmt-servicelinker/{}' .format (VERSION ))
50
+ self .credential_scopes = kwargs .pop (" credential_scopes" , [" https://management.azure.com/.default" ])
51
+ kwargs .setdefault (" sdk_moniker" , " mgmt-servicelinker/{}" .format (VERSION ))
50
52
self ._configure (** kwargs )
51
53
52
- def _configure (
53
- self ,
54
- ** kwargs # type: Any
55
- ):
56
- # type: (...) -> None
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' )
54
+ def _configure (self , ** kwargs : Any ) -> None :
55
+ self .user_agent_policy = kwargs .get ("user_agent_policy" ) or policies .UserAgentPolicy (** kwargs )
56
+ self .headers_policy = kwargs .get ("headers_policy" ) or policies .HeadersPolicy (** kwargs )
57
+ self .proxy_policy = kwargs .get ("proxy_policy" ) or policies .ProxyPolicy (** kwargs )
58
+ self .logging_policy = kwargs .get ("logging_policy" ) or policies .NetworkTraceLoggingPolicy (** kwargs )
59
+ self .http_logging_policy = kwargs .get ("http_logging_policy" ) or ARMHttpLoggingPolicy (** kwargs )
60
+ self .retry_policy = kwargs .get ("retry_policy" ) or policies .RetryPolicy (** kwargs )
61
+ self .custom_hook_policy = kwargs .get ("custom_hook_policy" ) or policies .CustomHookPolicy (** kwargs )
62
+ self .redirect_policy = kwargs .get ("redirect_policy" ) or policies .RedirectPolicy (** kwargs )
63
+ self .authentication_policy = kwargs .get ("authentication_policy" )
66
64
if self .credential and not self .authentication_policy :
67
- self .authentication_policy = ARMChallengeAuthenticationPolicy (self .credential , * self .credential_scopes , ** kwargs )
65
+ self .authentication_policy = ARMChallengeAuthenticationPolicy (
66
+ self .credential , * self .credential_scopes , ** kwargs
67
+ )
0 commit comments