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
2835 from azure .core .credentials import TokenCredential
2936
3037
31- class ConfluentManagementClient : # pylint: disable=client-accepts-api-version-keyword
38+ class ConfluentManagementClient : # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
3239 """ConfluentManagementClient.
3340
3441 :ivar marketplace_agreements: MarketplaceAgreementsOperations operations
@@ -43,13 +50,21 @@ class ConfluentManagementClient: # pylint: disable=client-accepts-api-version-k
4350 :vartype validations: azure.mgmt.confluent.operations.ValidationsOperations
4451 :ivar access: AccessOperations operations
4552 :vartype access: azure.mgmt.confluent.operations.AccessOperations
53+ :ivar environment: EnvironmentOperations operations
54+ :vartype environment: azure.mgmt.confluent.operations.EnvironmentOperations
55+ :ivar cluster: ClusterOperations operations
56+ :vartype cluster: azure.mgmt.confluent.operations.ClusterOperations
57+ :ivar connector: ConnectorOperations operations
58+ :vartype connector: azure.mgmt.confluent.operations.ConnectorOperations
59+ :ivar topics: TopicsOperations operations
60+ :vartype topics: azure.mgmt.confluent.operations.TopicsOperations
4661 :param credential: Credential needed for the client to connect to Azure. Required.
4762 :type credential: ~azure.core.credentials.TokenCredential
4863 :param subscription_id: Microsoft Azure subscription id. Required.
4964 :type subscription_id: str
5065 :param base_url: Service URL. Default value is "https://management.azure.com".
5166 :type base_url: str
52- :keyword api_version: Api Version. Default value is "2024-02-13 ". Note that overriding this
67+ :keyword api_version: Api Version. Default value is "2024-07-01 ". Note that overriding this
5368 default value may result in unsupported behavior.
5469 :paramtype api_version: str
5570 :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -66,7 +81,25 @@ def __init__(
6681 self ._config = ConfluentManagementClientConfiguration (
6782 credential = credential , subscription_id = subscription_id , ** kwargs
6883 )
69- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
84+ _policies = kwargs .pop ("policies" , None )
85+ if _policies is None :
86+ _policies = [
87+ policies .RequestIdPolicy (** kwargs ),
88+ self ._config .headers_policy ,
89+ self ._config .user_agent_policy ,
90+ self ._config .proxy_policy ,
91+ policies .ContentDecodePolicy (** kwargs ),
92+ ARMAutoResourceProviderRegistrationPolicy (),
93+ self ._config .redirect_policy ,
94+ self ._config .retry_policy ,
95+ self ._config .authentication_policy ,
96+ self ._config .custom_hook_policy ,
97+ self ._config .logging_policy ,
98+ policies .DistributedTracingPolicy (** kwargs ),
99+ policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
100+ self ._config .http_logging_policy ,
101+ ]
102+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
70103
71104 client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
72105 self ._serialize = Serializer (client_models )
@@ -81,8 +114,12 @@ def __init__(
81114 self .organization = OrganizationOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
82115 self .validations = ValidationsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
83116 self .access = AccessOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
117+ self .environment = EnvironmentOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
118+ self .cluster = ClusterOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
119+ self .connector = ConnectorOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
120+ self .topics = TopicsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
84121
85- def _send_request (self , request : HttpRequest , ** kwargs : Any ) -> HttpResponse :
122+ def _send_request (self , request : HttpRequest , * , stream : bool = False , * *kwargs : Any ) -> HttpResponse :
86123 """Runs the network request through the client's chained policies.
87124
88125 >>> from azure.core.rest import HttpRequest
@@ -102,12 +139,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
102139
103140 request_copy = deepcopy (request )
104141 request_copy .url = self ._client .format_url (request_copy .url )
105- return self ._client .send_request (request_copy , ** kwargs )
142+ return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
106143
107144 def close (self ) -> None :
108145 self ._client .close ()
109146
110- def __enter__ (self ) -> "ConfluentManagementClient" :
147+ def __enter__ (self ) -> Self :
111148 self ._client .__enter__ ()
112149 return self
113150
0 commit comments