99from copy import deepcopy
1010from typing import Any , TYPE_CHECKING
1111
12+ from azure .core .pipeline import policies
1213from azure .core .rest import HttpRequest , HttpResponse
1314from azure .mgmt .core import ARMPipelineClient
15+ from azure .mgmt .core .policies import ARMAutoResourceProviderRegistrationPolicy
1416
1517from . import models as _models
1618from ._configuration import SelfHelpMgmtClientConfiguration
1719from ._serialization import Deserializer , Serializer
1820from .operations import (
1921 CheckNameAvailabilityOperations ,
2022 DiagnosticsOperations ,
23+ DiscoverySolutionNLPSubscriptionScopeOperations ,
24+ DiscoverySolutionNLPTenantScopeOperations ,
2125 DiscoverySolutionOperations ,
2226 Operations ,
27+ SimplifiedSolutionsOperations ,
2328 SolutionOperations ,
29+ SolutionSelfHelpOperations ,
2430 TroubleshootersOperations ,
2531)
2632
2935 from azure .core .credentials import TokenCredential
3036
3137
32- class SelfHelpMgmtClient : # pylint: disable=client-accepts-api-version-keyword
38+ class SelfHelpMgmtClient : # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
3339 """Help RP provider.
3440
3541 :ivar operations: Operations operations
@@ -43,24 +49,59 @@ class SelfHelpMgmtClient: # pylint: disable=client-accepts-api-version-keyword
4349 :vartype discovery_solution: azure.mgmt.selfhelp.operations.DiscoverySolutionOperations
4450 :ivar solution: SolutionOperations operations
4551 :vartype solution: azure.mgmt.selfhelp.operations.SolutionOperations
52+ :ivar simplified_solutions: SimplifiedSolutionsOperations operations
53+ :vartype simplified_solutions: azure.mgmt.selfhelp.operations.SimplifiedSolutionsOperations
4654 :ivar troubleshooters: TroubleshootersOperations operations
4755 :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
4865 :param credential: Credential needed for the client to connect to Azure. Required.
4966 :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
5069 :param base_url: Service URL. Default value is "https://management.azure.com".
5170 :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
5372 this default value may result in unsupported behavior.
5473 :paramtype api_version: str
5574 :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
5675 Retry-After header is present.
5776 """
5877
5978 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
6184 ) -> 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 )
64105
65106 client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
66107 self ._serialize = Serializer (client_models )
@@ -75,9 +116,21 @@ def __init__(
75116 self ._client , self ._config , self ._serialize , self ._deserialize
76117 )
77118 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+ )
78122 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+ )
79132
80- def _send_request (self , request : HttpRequest , ** kwargs : Any ) -> HttpResponse :
133+ def _send_request (self , request : HttpRequest , * , stream : bool = False , * *kwargs : Any ) -> HttpResponse :
81134 """Runs the network request through the client's chained policies.
82135
83136 >>> from azure.core.rest import HttpRequest
@@ -97,7 +150,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
97150
98151 request_copy = deepcopy (request )
99152 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
101154
102155 def close (self ) -> None :
103156 self ._client .close ()
0 commit comments