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 , Any
9
+ from typing import TYPE_CHECKING
10
10
11
11
from azure .core .configuration import Configuration
12
12
from azure .core .pipeline import policies
16
16
17
17
if TYPE_CHECKING :
18
18
# pylint: disable=unused-import,ungrouped-imports
19
+ from typing import Any
20
+
19
21
from azure .core .credentials import TokenCredential
20
22
21
23
22
- class AzureMachineLearningServicesConfiguration (Configuration ): # pylint: disable=too-many-instance-attributes
23
- """Configuration for AzureMachineLearningServices .
24
+ class AzureMachineLearningWorkspacesConfiguration (Configuration ): # pylint: disable=too-many-instance-attributes
25
+ """Configuration for AzureMachineLearningWorkspaces .
24
26
25
27
Note that all parameters used to create this instance are saved as instance
26
28
attributes.
27
29
28
- :param credential: Credential needed for the client to connect to Azure. Required.
30
+ :param credential: Credential needed for the client to connect to Azure.
29
31
:type credential: ~azure.core.credentials.TokenCredential
30
- :param subscription_id: The ID of the target subscription. Required.
32
+ :param subscription_id: The ID of the target subscription.
31
33
:type subscription_id: str
32
- :keyword api_version: Api Version. Default value is "2023-08-01-preview". Note that overriding
33
- this default value may result in unsupported behavior.
34
+ :keyword api_version: Api Version. The default value is "2023-08-01-preview". Note that
35
+ overriding this default value may result in unsupported behavior.
34
36
:paramtype api_version: str
35
37
"""
36
38
37
- def __init__ (self , credential : "TokenCredential" , subscription_id : str , ** kwargs : Any ) -> None :
38
- super (AzureMachineLearningServicesConfiguration , self ).__init__ (** kwargs )
39
- api_version : str = kwargs .pop ("api_version" , "2023-08-01-preview" )
39
+ def __init__ (
40
+ self ,
41
+ credential , # type: "TokenCredential"
42
+ subscription_id , # type: str
43
+ ** kwargs # type: Any
44
+ ):
45
+ # type: (...) -> None
46
+ super (AzureMachineLearningWorkspacesConfiguration , self ).__init__ (** kwargs )
47
+ api_version = kwargs .pop ('api_version' , "2023-08-01-preview" ) # type: str
40
48
41
49
if credential is None :
42
50
raise ValueError ("Parameter 'credential' must not be None." )
@@ -46,21 +54,23 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
46
54
self .credential = credential
47
55
self .subscription_id = subscription_id
48
56
self .api_version = api_version
49
- self .credential_scopes = kwargs .pop (" credential_scopes" , [" https://management.azure.com/.default" ])
50
- kwargs .setdefault (" sdk_moniker" , " mgmt-machinelearningservices/{}" .format (VERSION ))
57
+ self .credential_scopes = kwargs .pop (' credential_scopes' , [' https://management.azure.com/.default' ])
58
+ kwargs .setdefault (' sdk_moniker' , ' mgmt-machinelearningservices/{}' .format (VERSION ))
51
59
self ._configure (** kwargs )
52
60
53
- def _configure (self , ** kwargs : Any ) -> None :
54
- self .user_agent_policy = kwargs .get ("user_agent_policy" ) or policies .UserAgentPolicy (** kwargs )
55
- self .headers_policy = kwargs .get ("headers_policy" ) or policies .HeadersPolicy (** kwargs )
56
- self .proxy_policy = kwargs .get ("proxy_policy" ) or policies .ProxyPolicy (** kwargs )
57
- self .logging_policy = kwargs .get ("logging_policy" ) or policies .NetworkTraceLoggingPolicy (** kwargs )
58
- self .http_logging_policy = kwargs .get ("http_logging_policy" ) or ARMHttpLoggingPolicy (** kwargs )
59
- self .retry_policy = kwargs .get ("retry_policy" ) or policies .RetryPolicy (** kwargs )
60
- self .custom_hook_policy = kwargs .get ("custom_hook_policy" ) or policies .CustomHookPolicy (** kwargs )
61
- self .redirect_policy = kwargs .get ("redirect_policy" ) or policies .RedirectPolicy (** kwargs )
62
- self .authentication_policy = kwargs .get ("authentication_policy" )
61
+ def _configure (
62
+ self ,
63
+ ** kwargs # type: Any
64
+ ):
65
+ # type: (...) -> None
66
+ self .user_agent_policy = kwargs .get ('user_agent_policy' ) or policies .UserAgentPolicy (** kwargs )
67
+ self .headers_policy = kwargs .get ('headers_policy' ) or policies .HeadersPolicy (** kwargs )
68
+ self .proxy_policy = kwargs .get ('proxy_policy' ) or policies .ProxyPolicy (** kwargs )
69
+ self .logging_policy = kwargs .get ('logging_policy' ) or policies .NetworkTraceLoggingPolicy (** kwargs )
70
+ self .http_logging_policy = kwargs .get ('http_logging_policy' ) or ARMHttpLoggingPolicy (** kwargs )
71
+ self .retry_policy = kwargs .get ('retry_policy' ) or policies .RetryPolicy (** kwargs )
72
+ self .custom_hook_policy = kwargs .get ('custom_hook_policy' ) or policies .CustomHookPolicy (** kwargs )
73
+ self .redirect_policy = kwargs .get ('redirect_policy' ) or policies .RedirectPolicy (** kwargs )
74
+ self .authentication_policy = kwargs .get ('authentication_policy' )
63
75
if self .credential and not self .authentication_policy :
64
- self .authentication_policy = ARMChallengeAuthenticationPolicy (
65
- self .credential , * self .credential_scopes , ** kwargs
66
- )
76
+ self .authentication_policy = ARMChallengeAuthenticationPolicy (self .credential , * self .credential_scopes , ** kwargs )
0 commit comments