9
9
from copy import deepcopy
10
10
from typing import Any , TYPE_CHECKING
11
11
12
+ from azure .core .pipeline import policies
12
13
from azure .core .rest import HttpRequest , HttpResponse
13
14
from azure .mgmt .core import ARMPipelineClient
15
+ from azure .mgmt .core .policies import ARMAutoResourceProviderRegistrationPolicy
14
16
15
17
from . import models as _models
16
18
from ._configuration import SelfHelpMgmtClientConfiguration
17
19
from ._serialization import Deserializer , Serializer
18
20
from .operations import (
19
21
CheckNameAvailabilityOperations ,
20
22
DiagnosticsOperations ,
23
+ DiscoverySolutionNLPSubscriptionScopeOperations ,
24
+ DiscoverySolutionNLPTenantScopeOperations ,
21
25
DiscoverySolutionOperations ,
22
26
Operations ,
27
+ SimplifiedSolutionsOperations ,
23
28
SolutionOperations ,
29
+ SolutionSelfHelpOperations ,
24
30
TroubleshootersOperations ,
25
31
)
26
32
29
35
from azure .core .credentials import TokenCredential
30
36
31
37
32
- class SelfHelpMgmtClient : # pylint: disable=client-accepts-api-version-keyword
38
+ class SelfHelpMgmtClient : # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
33
39
"""Help RP provider.
34
40
35
41
:ivar operations: Operations operations
@@ -43,24 +49,59 @@ class SelfHelpMgmtClient: # pylint: disable=client-accepts-api-version-keyword
43
49
:vartype discovery_solution: azure.mgmt.selfhelp.operations.DiscoverySolutionOperations
44
50
:ivar solution: SolutionOperations operations
45
51
:vartype solution: azure.mgmt.selfhelp.operations.SolutionOperations
52
+ :ivar simplified_solutions: SimplifiedSolutionsOperations operations
53
+ :vartype simplified_solutions: azure.mgmt.selfhelp.operations.SimplifiedSolutionsOperations
46
54
:ivar troubleshooters: TroubleshootersOperations operations
47
55
:vartype troubleshooters: azure.mgmt.selfhelp.operations.TroubleshootersOperations
56
+ :ivar solution_self_help: SolutionSelfHelpOperations operations
57
+ :vartype solution_self_help: azure.mgmt.selfhelp.operations.SolutionSelfHelpOperations
58
+ :ivar discovery_solution_nlp_tenant_scope: DiscoverySolutionNLPTenantScopeOperations operations
59
+ :vartype discovery_solution_nlp_tenant_scope:
60
+ azure.mgmt.selfhelp.operations.DiscoverySolutionNLPTenantScopeOperations
61
+ :ivar discovery_solution_nlp_subscription_scope:
62
+ DiscoverySolutionNLPSubscriptionScopeOperations operations
63
+ :vartype discovery_solution_nlp_subscription_scope:
64
+ azure.mgmt.selfhelp.operations.DiscoverySolutionNLPSubscriptionScopeOperations
48
65
:param credential: Credential needed for the client to connect to Azure. Required.
49
66
:type credential: ~azure.core.credentials.TokenCredential
67
+ :param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
68
+ :type subscription_id: str
50
69
:param base_url: Service URL. Default value is "https://management.azure.com".
51
70
:type base_url: str
52
- :keyword api_version: Api Version. Default value is "2023-09 -01-preview". Note that overriding
71
+ :keyword api_version: Api Version. Default value is "2024-03 -01-preview". Note that overriding
53
72
this default value may result in unsupported behavior.
54
73
:paramtype api_version: str
55
74
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
56
75
Retry-After header is present.
57
76
"""
58
77
59
78
def __init__ (
60
- self , credential : "TokenCredential" , base_url : str = "https://management.azure.com" , ** kwargs : Any
79
+ self ,
80
+ credential : "TokenCredential" ,
81
+ subscription_id : str ,
82
+ base_url : str = "https://management.azure.com" ,
83
+ ** kwargs : Any
61
84
) -> None :
62
- self ._config = SelfHelpMgmtClientConfiguration (credential = credential , ** kwargs )
63
- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
85
+ self ._config = SelfHelpMgmtClientConfiguration (credential = credential , subscription_id = subscription_id , ** kwargs )
86
+ _policies = kwargs .pop ("policies" , None )
87
+ if _policies is None :
88
+ _policies = [
89
+ policies .RequestIdPolicy (** kwargs ),
90
+ self ._config .headers_policy ,
91
+ self ._config .user_agent_policy ,
92
+ self ._config .proxy_policy ,
93
+ policies .ContentDecodePolicy (** kwargs ),
94
+ ARMAutoResourceProviderRegistrationPolicy (),
95
+ self ._config .redirect_policy ,
96
+ self ._config .retry_policy ,
97
+ self ._config .authentication_policy ,
98
+ self ._config .custom_hook_policy ,
99
+ self ._config .logging_policy ,
100
+ policies .DistributedTracingPolicy (** kwargs ),
101
+ policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
102
+ self ._config .http_logging_policy ,
103
+ ]
104
+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
64
105
65
106
client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
66
107
self ._serialize = Serializer (client_models )
@@ -75,9 +116,21 @@ def __init__(
75
116
self ._client , self ._config , self ._serialize , self ._deserialize
76
117
)
77
118
self .solution = SolutionOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
119
+ self .simplified_solutions = SimplifiedSolutionsOperations (
120
+ self ._client , self ._config , self ._serialize , self ._deserialize
121
+ )
78
122
self .troubleshooters = TroubleshootersOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
123
+ self .solution_self_help = SolutionSelfHelpOperations (
124
+ self ._client , self ._config , self ._serialize , self ._deserialize
125
+ )
126
+ self .discovery_solution_nlp_tenant_scope = DiscoverySolutionNLPTenantScopeOperations (
127
+ self ._client , self ._config , self ._serialize , self ._deserialize
128
+ )
129
+ self .discovery_solution_nlp_subscription_scope = DiscoverySolutionNLPSubscriptionScopeOperations (
130
+ self ._client , self ._config , self ._serialize , self ._deserialize
131
+ )
79
132
80
- def _send_request (self , request : HttpRequest , ** kwargs : Any ) -> HttpResponse :
133
+ def _send_request (self , request : HttpRequest , * , stream : bool = False , * *kwargs : Any ) -> HttpResponse :
81
134
"""Runs the network request through the client's chained policies.
82
135
83
136
>>> from azure.core.rest import HttpRequest
@@ -97,7 +150,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
97
150
98
151
request_copy = deepcopy (request )
99
152
request_copy .url = self ._client .format_url (request_copy .url )
100
- return self ._client .send_request (request_copy , ** kwargs )
153
+ return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
101
154
102
155
def close (self ) -> None :
103
156
self ._client .close ()
0 commit comments