88
99from copy import deepcopy
1010from typing import Any , TYPE_CHECKING
11+ from typing_extensions import Self
1112
13+ from azure .core .pipeline import policies
1214from azure .core .rest import HttpRequest , HttpResponse
1315from azure .mgmt .core import ARMPipelineClient
16+ from azure .mgmt .core .policies import ARMAutoResourceProviderRegistrationPolicy
1417
1518from . import models as _models
1619from ._configuration import DashboardManagementClientConfiguration
1720from ._serialization import Deserializer , Serializer
1821from .operations import (
1922 GrafanaOperations ,
23+ IntegrationFabricsOperations ,
2024 ManagedPrivateEndpointsOperations ,
2125 Operations ,
2226 PrivateEndpointConnectionsOperations ,
2327 PrivateLinkResourcesOperations ,
2428)
2529
2630if TYPE_CHECKING :
27- # pylint: disable=unused-import,ungrouped-imports
2831 from azure .core .credentials import TokenCredential
2932
3033
31- class DashboardManagementClient : # pylint: disable=client-accepts-api-version-keyword
34+ class DashboardManagementClient :
3235 """The Microsoft.Dashboard Rest API spec.
3336
3437 :ivar operations: Operations operations
@@ -43,13 +46,15 @@ class DashboardManagementClient: # pylint: disable=client-accepts-api-version-k
4346 :ivar managed_private_endpoints: ManagedPrivateEndpointsOperations operations
4447 :vartype managed_private_endpoints:
4548 azure.mgmt.dashboard.operations.ManagedPrivateEndpointsOperations
49+ :ivar integration_fabrics: IntegrationFabricsOperations operations
50+ :vartype integration_fabrics: azure.mgmt.dashboard.operations.IntegrationFabricsOperations
4651 :param credential: Credential needed for the client to connect to Azure. Required.
4752 :type credential: ~azure.core.credentials.TokenCredential
4853 :param subscription_id: The ID of the target subscription. Required.
4954 :type subscription_id: str
5055 :param base_url: Service URL. Default value is "https://management.azure.com".
5156 :type base_url: str
52- :keyword api_version: Api Version. Default value is "2023-09 -01". Note that overriding this
57+ :keyword api_version: Api Version. Default value is "2024-10 -01". Note that overriding this
5358 default value may result in unsupported behavior.
5459 :paramtype api_version: str
5560 :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -66,7 +71,25 @@ def __init__(
6671 self ._config = DashboardManagementClientConfiguration (
6772 credential = credential , subscription_id = subscription_id , ** kwargs
6873 )
69- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
74+ _policies = kwargs .pop ("policies" , None )
75+ if _policies is None :
76+ _policies = [
77+ policies .RequestIdPolicy (** kwargs ),
78+ self ._config .headers_policy ,
79+ self ._config .user_agent_policy ,
80+ self ._config .proxy_policy ,
81+ policies .ContentDecodePolicy (** kwargs ),
82+ ARMAutoResourceProviderRegistrationPolicy (),
83+ self ._config .redirect_policy ,
84+ self ._config .retry_policy ,
85+ self ._config .authentication_policy ,
86+ self ._config .custom_hook_policy ,
87+ self ._config .logging_policy ,
88+ policies .DistributedTracingPolicy (** kwargs ),
89+ policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
90+ self ._config .http_logging_policy ,
91+ ]
92+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
7093
7194 client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
7295 self ._serialize = Serializer (client_models )
@@ -83,8 +106,11 @@ def __init__(
83106 self .managed_private_endpoints = ManagedPrivateEndpointsOperations (
84107 self ._client , self ._config , self ._serialize , self ._deserialize
85108 )
109+ self .integration_fabrics = IntegrationFabricsOperations (
110+ self ._client , self ._config , self ._serialize , self ._deserialize
111+ )
86112
87- def _send_request (self , request : HttpRequest , ** kwargs : Any ) -> HttpResponse :
113+ def _send_request (self , request : HttpRequest , * , stream : bool = False , * *kwargs : Any ) -> HttpResponse :
88114 """Runs the network request through the client's chained policies.
89115
90116 >>> from azure.core.rest import HttpRequest
@@ -104,12 +130,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
104130
105131 request_copy = deepcopy (request )
106132 request_copy .url = self ._client .format_url (request_copy .url )
107- return self ._client .send_request (request_copy , ** kwargs )
133+ return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
108134
109135 def close (self ) -> None :
110136 self ._client .close ()
111137
112- def __enter__ (self ) -> "DashboardManagementClient" :
138+ def __enter__ (self ) -> Self :
113139 self ._client .__enter__ ()
114140 return self
115141
0 commit comments