6
6
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
# --------------------------------------------------------------------------
8
8
9
- from typing import TYPE_CHECKING
9
+ from typing import Any , TYPE_CHECKING
10
10
11
11
from azure .core .configuration import Configuration
12
12
from azure .core .pipeline import policies
13
- from azure .mgmt .core .policies import ARMHttpLoggingPolicy
13
+ from azure .mgmt .core .policies import ARMChallengeAuthenticationPolicy , ARMHttpLoggingPolicy
14
14
15
15
from ._version import VERSION
16
16
17
17
if TYPE_CHECKING :
18
18
# pylint: disable=unused-import,ungrouped-imports
19
- from typing import Any
20
-
21
19
from azure .core .credentials import TokenCredential
22
20
23
21
24
- class LogicManagementClientConfiguration (Configuration ):
22
+ class LogicManagementClientConfiguration (Configuration ): # pylint: disable=too-many-instance-attributes
25
23
"""Configuration for LogicManagementClient.
26
24
27
25
Note that all parameters used to create this instance are saved as instance
@@ -31,24 +29,28 @@ class LogicManagementClientConfiguration(Configuration):
31
29
:type credential: ~azure.core.credentials.TokenCredential
32
30
:param subscription_id: The subscription id.
33
31
:type subscription_id: str
32
+ :keyword api_version: Api Version. Default value is "2019-05-01". Note that overriding this
33
+ default value may result in unsupported behavior.
34
+ :paramtype api_version: str
34
35
"""
35
36
36
37
def __init__ (
37
38
self ,
38
- credential , # type: "TokenCredential"
39
- subscription_id , # type: str
40
- ** kwargs # type: Any
41
- ):
42
- # type: (...) -> None
39
+ credential : "TokenCredential" ,
40
+ subscription_id : str ,
41
+ ** kwargs : Any
42
+ ) -> None :
43
+ super (LogicManagementClientConfiguration , self ).__init__ (** kwargs )
44
+ api_version = kwargs .pop ('api_version' , "2019-05-01" ) # type: str
45
+
43
46
if credential is None :
44
47
raise ValueError ("Parameter 'credential' must not be None." )
45
48
if subscription_id is None :
46
49
raise ValueError ("Parameter 'subscription_id' must not be None." )
47
- super (LogicManagementClientConfiguration , self ).__init__ (** kwargs )
48
50
49
51
self .credential = credential
50
52
self .subscription_id = subscription_id
51
- self .api_version = "2019-05-01"
53
+ self .api_version = api_version
52
54
self .credential_scopes = kwargs .pop ('credential_scopes' , ['https://management.azure.com/.default' ])
53
55
kwargs .setdefault ('sdk_moniker' , 'mgmt-logic/{}' .format (VERSION ))
54
56
self ._configure (** kwargs )
@@ -68,4 +70,4 @@ def _configure(
68
70
self .redirect_policy = kwargs .get ('redirect_policy' ) or policies .RedirectPolicy (** kwargs )
69
71
self .authentication_policy = kwargs .get ('authentication_policy' )
70
72
if self .credential and not self .authentication_policy :
71
- self .authentication_policy = policies . BearerTokenCredentialPolicy (self .credential , * self .credential_scopes , ** kwargs )
73
+ self .authentication_policy = ARMChallengeAuthenticationPolicy (self .credential , * self .credential_scopes , ** kwargs )
0 commit comments