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 HybridConnectivityMgmtClientConfiguration
1720from ._serialization import Deserializer , Serializer
18- from .operations import EndpointsOperations , Operations , ServiceConfigurationsOperations
21+ from .operations import (
22+ EndpointsOperations ,
23+ GenerateAwsTemplateOperations ,
24+ InventoryOperations ,
25+ Operations ,
26+ PublicCloudConnectorsOperations ,
27+ ServiceConfigurationsOperations ,
28+ SolutionConfigurationsOperations ,
29+ SolutionTypesOperations ,
30+ )
1931
2032if TYPE_CHECKING :
2133 # pylint: disable=unused-import,ungrouped-imports
2234 from azure .core .credentials import TokenCredential
2335
2436
25- class HybridConnectivityMgmtClient : # pylint: disable=client-accepts-api-version-keyword
26- """REST API for Hybrid Connectivity.
27-
37+ class HybridConnectivityMgmtClient : # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
38+ """REST API for public clouds.
39+
40+ :ivar solution_configurations: SolutionConfigurationsOperations operations
41+ :vartype solution_configurations:
42+ azure.mgmt.hybridconnectivity.operations.SolutionConfigurationsOperations
43+ :ivar inventory: InventoryOperations operations
44+ :vartype inventory: azure.mgmt.hybridconnectivity.operations.InventoryOperations
45+ :ivar generate_aws_template: GenerateAwsTemplateOperations operations
46+ :vartype generate_aws_template:
47+ azure.mgmt.hybridconnectivity.operations.GenerateAwsTemplateOperations
48+ :ivar public_cloud_connectors: PublicCloudConnectorsOperations operations
49+ :vartype public_cloud_connectors:
50+ azure.mgmt.hybridconnectivity.operations.PublicCloudConnectorsOperations
51+ :ivar solution_types: SolutionTypesOperations operations
52+ :vartype solution_types: azure.mgmt.hybridconnectivity.operations.SolutionTypesOperations
2853 :ivar operations: Operations operations
2954 :vartype operations: azure.mgmt.hybridconnectivity.operations.Operations
3055 :ivar endpoints: EndpointsOperations operations
@@ -34,30 +59,69 @@ class HybridConnectivityMgmtClient: # pylint: disable=client-accepts-api-versio
3459 azure.mgmt.hybridconnectivity.operations.ServiceConfigurationsOperations
3560 :param credential: Credential needed for the client to connect to Azure. Required.
3661 :type credential: ~azure.core.credentials.TokenCredential
62+ :param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
63+ :type subscription_id: str
3764 :param base_url: Service URL. Default value is "https://management.azure.com".
3865 :type base_url: str
39- :keyword api_version: Api Version. Default value is "2023-03-15 ". Note that overriding this
66+ :keyword api_version: Api Version. Default value is "2024-12-01 ". Note that overriding this
4067 default value may result in unsupported behavior.
4168 :paramtype api_version: str
69+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
70+ Retry-After header is present.
4271 """
4372
4473 def __init__ (
45- self , credential : "TokenCredential" , base_url : str = "https://management.azure.com" , ** kwargs : Any
74+ self ,
75+ credential : "TokenCredential" ,
76+ subscription_id : str ,
77+ base_url : str = "https://management.azure.com" ,
78+ ** kwargs : Any
4679 ) -> None :
47- self ._config = HybridConnectivityMgmtClientConfiguration (credential = credential , ** kwargs )
48- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
80+ self ._config = HybridConnectivityMgmtClientConfiguration (
81+ credential = credential , subscription_id = subscription_id , ** kwargs
82+ )
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 )
49102
50103 client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
51104 self ._serialize = Serializer (client_models )
52105 self ._deserialize = Deserializer (client_models )
53106 self ._serialize .client_side_validation = False
107+ self .solution_configurations = SolutionConfigurationsOperations (
108+ self ._client , self ._config , self ._serialize , self ._deserialize
109+ )
110+ self .inventory = InventoryOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
111+ self .generate_aws_template = GenerateAwsTemplateOperations (
112+ self ._client , self ._config , self ._serialize , self ._deserialize
113+ )
114+ self .public_cloud_connectors = PublicCloudConnectorsOperations (
115+ self ._client , self ._config , self ._serialize , self ._deserialize
116+ )
117+ self .solution_types = SolutionTypesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
54118 self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
55119 self .endpoints = EndpointsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
56120 self .service_configurations = ServiceConfigurationsOperations (
57121 self ._client , self ._config , self ._serialize , self ._deserialize
58122 )
59123
60- def _send_request (self , request : HttpRequest , ** kwargs : Any ) -> HttpResponse :
124+ def _send_request (self , request : HttpRequest , * , stream : bool = False , * *kwargs : Any ) -> HttpResponse :
61125 """Runs the network request through the client's chained policies.
62126
63127 >>> from azure.core.rest import HttpRequest
@@ -77,12 +141,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
77141
78142 request_copy = deepcopy (request )
79143 request_copy .url = self ._client .format_url (request_copy .url )
80- return self ._client .send_request (request_copy , ** kwargs )
144+ return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
81145
82146 def close (self ) -> None :
83147 self ._client .close ()
84148
85- def __enter__ (self ) -> "HybridConnectivityMgmtClient" :
149+ def __enter__ (self ) -> Self :
86150 self ._client .__enter__ ()
87151 return self
88152
0 commit comments