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 ConfluentManagementClientConfiguration
1720from ._serialization import Deserializer , Serializer
1821from .operations import (
1922 AccessOperations ,
23+ ClusterOperations ,
24+ ConnectorOperations ,
25+ EnvironmentOperations ,
2026 MarketplaceAgreementsOperations ,
2127 OrganizationOperations ,
2228 OrganizationOperationsOperations ,
29+ TopicsOperations ,
2330 ValidationsOperations ,
2431)
2532
2633if TYPE_CHECKING :
27- # pylint: disable=unused-import,ungrouped-imports
2834 from azure .core .credentials import TokenCredential
2935
3036
31- class ConfluentManagementClient : # pylint: disable=client-accepts-api-version-keyword
37+ class ConfluentManagementClient : # pylint: disable=too-many-instance-attributes
3238 """ConfluentManagementClient.
3339
3440 :ivar marketplace_agreements: MarketplaceAgreementsOperations operations
@@ -43,13 +49,21 @@ class ConfluentManagementClient: # pylint: disable=client-accepts-api-version-k
4349 :vartype validations: azure.mgmt.confluent.operations.ValidationsOperations
4450 :ivar access: AccessOperations operations
4551 :vartype access: azure.mgmt.confluent.operations.AccessOperations
52+ :ivar environment: EnvironmentOperations operations
53+ :vartype environment: azure.mgmt.confluent.operations.EnvironmentOperations
54+ :ivar cluster: ClusterOperations operations
55+ :vartype cluster: azure.mgmt.confluent.operations.ClusterOperations
56+ :ivar connector: ConnectorOperations operations
57+ :vartype connector: azure.mgmt.confluent.operations.ConnectorOperations
58+ :ivar topics: TopicsOperations operations
59+ :vartype topics: azure.mgmt.confluent.operations.TopicsOperations
4660 :param credential: Credential needed for the client to connect to Azure. Required.
4761 :type credential: ~azure.core.credentials.TokenCredential
4862 :param subscription_id: Microsoft Azure subscription id. Required.
4963 :type subscription_id: str
5064 :param base_url: Service URL. Default value is "https://management.azure.com".
5165 :type base_url: str
52- :keyword api_version: Api Version. Default value is "2024-02-13 ". Note that overriding this
66+ :keyword api_version: Api Version. Default value is "2024-07-01 ". Note that overriding this
5367 default value may result in unsupported behavior.
5468 :paramtype api_version: str
5569 :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -66,7 +80,25 @@ def __init__(
6680 self ._config = ConfluentManagementClientConfiguration (
6781 credential = credential , subscription_id = subscription_id , ** kwargs
6882 )
69- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
83+ _policies = kwargs .pop ("policies" , None )
84+ if _policies is None :
85+ _policies = [
86+ policies .RequestIdPolicy (** kwargs ),
87+ self ._config .headers_policy ,
88+ self ._config .user_agent_policy ,
89+ self ._config .proxy_policy ,
90+ policies .ContentDecodePolicy (** kwargs ),
91+ ARMAutoResourceProviderRegistrationPolicy (),
92+ self ._config .redirect_policy ,
93+ self ._config .retry_policy ,
94+ self ._config .authentication_policy ,
95+ self ._config .custom_hook_policy ,
96+ self ._config .logging_policy ,
97+ policies .DistributedTracingPolicy (** kwargs ),
98+ policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
99+ self ._config .http_logging_policy ,
100+ ]
101+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
70102
71103 client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
72104 self ._serialize = Serializer (client_models )
@@ -81,8 +113,12 @@ def __init__(
81113 self .organization = OrganizationOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
82114 self .validations = ValidationsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
83115 self .access = AccessOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
116+ self .environment = EnvironmentOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
117+ self .cluster = ClusterOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
118+ self .connector = ConnectorOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
119+ self .topics = TopicsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
84120
85- def _send_request (self , request : HttpRequest , ** kwargs : Any ) -> HttpResponse :
121+ def _send_request (self , request : HttpRequest , * , stream : bool = False , * *kwargs : Any ) -> HttpResponse :
86122 """Runs the network request through the client's chained policies.
87123
88124 >>> from azure.core.rest import HttpRequest
@@ -102,12 +138,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
102138
103139 request_copy = deepcopy (request )
104140 request_copy .url = self ._client .format_url (request_copy .url )
105- return self ._client .send_request (request_copy , ** kwargs )
141+ return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
106142
107143 def close (self ) -> None :
108144 self ._client .close ()
109145
110- def __enter__ (self ) -> "ConfluentManagementClient" :
146+ def __enter__ (self ) -> Self :
111147 self ._client .__enter__ ()
112148 return self
113149
0 commit comments