66# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77# --------------------------------------------------------------------------
88
9- from typing import TYPE_CHECKING
9+ from copy import deepcopy
10+ from typing import Any , Optional , TYPE_CHECKING
1011
12+ from azure .core .rest import HttpRequest , HttpResponse
1113from azure .mgmt .core import ARMPipelineClient
1214from msrest import Deserializer , Serializer
1315
16+ from . import models
17+ from ._configuration import AzureStackManagementClientConfiguration
18+ from .operations import CloudManifestFileOperations , CustomerSubscriptionsOperations , LinkedSubscriptionsOperations , Operations , ProductsOperations , RegistrationsOperations
19+
1420if TYPE_CHECKING :
1521 # pylint: disable=unused-import,ungrouped-imports
16- from typing import Any , Optional
17-
1822 from azure .core .credentials import TokenCredential
1923
20- from ._configuration import AzureStackManagementClientConfiguration
21- from .operations import Operations
22- from .operations import CloudManifestFileOperations
23- from .operations import CustomerSubscriptionsOperations
24- from .operations import ProductsOperations
25- from .operations import RegistrationsOperations
26- from .operations import LinkedSubscriptionsOperations
27- from . import models
28-
29-
30- class AzureStackManagementClient (object ):
24+ class AzureStackManagementClient :
3125 """Azure Stack.
3226
3327 :ivar operations: Operations operations
3428 :vartype operations: azure.mgmt.azurestack.operations.Operations
3529 :ivar cloud_manifest_file: CloudManifestFileOperations operations
3630 :vartype cloud_manifest_file: azure.mgmt.azurestack.operations.CloudManifestFileOperations
3731 :ivar customer_subscriptions: CustomerSubscriptionsOperations operations
38- :vartype customer_subscriptions: azure.mgmt.azurestack.operations.CustomerSubscriptionsOperations
32+ :vartype customer_subscriptions:
33+ azure.mgmt.azurestack.operations.CustomerSubscriptionsOperations
3934 :ivar products: ProductsOperations operations
4035 :vartype products: azure.mgmt.azurestack.operations.ProductsOperations
4136 :ivar registrations: RegistrationsOperations operations
@@ -44,41 +39,60 @@ class AzureStackManagementClient(object):
4439 :vartype linked_subscriptions: azure.mgmt.azurestack.operations.LinkedSubscriptionsOperations
4540 :param credential: Credential needed for the client to connect to Azure.
4641 :type credential: ~azure.core.credentials.TokenCredential
47- :param subscription_id: Subscription credentials that uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
42+ :param subscription_id: Subscription credentials that uniquely identify Microsoft Azure
43+ subscription. The subscription ID forms part of the URI for every service call.
4844 :type subscription_id: str
49- :param str base_url: Service URL
45+ :param base_url: Service URL. Default value is 'https://management.azure.com'.
46+ :type base_url: str
5047 """
5148
5249 def __init__ (
5350 self ,
54- credential , # type: "TokenCredential"
55- subscription_id , # type: str
56- base_url = None , # type: Optional[str]
57- ** kwargs # type: Any
58- ):
59- # type: (...) -> None
60- if not base_url :
61- base_url = 'https://management.azure.com'
62- self ._config = AzureStackManagementClientConfiguration (credential , subscription_id , ** kwargs )
51+ credential : "TokenCredential" ,
52+ subscription_id : str ,
53+ base_url : str = "https://management.azure.com" ,
54+ ** kwargs : Any
55+ ) -> None :
56+ self ._config = AzureStackManagementClientConfiguration (credential = credential , subscription_id = subscription_id , ** kwargs )
6357 self ._client = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
6458
6559 client_models = {k : v for k , v in models .__dict__ .items () if isinstance (v , type )}
6660 self ._serialize = Serializer (client_models )
67- self ._serialize .client_side_validation = False
6861 self ._deserialize = Deserializer (client_models )
62+ self ._serialize .client_side_validation = False
63+ self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
64+ self .cloud_manifest_file = CloudManifestFileOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
65+ self .customer_subscriptions = CustomerSubscriptionsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
66+ self .products = ProductsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
67+ self .registrations = RegistrationsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
68+ self .linked_subscriptions = LinkedSubscriptionsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
69+
70+
71+ def _send_request (
72+ self ,
73+ request , # type: HttpRequest
74+ ** kwargs : Any
75+ ) -> HttpResponse :
76+ """Runs the network request through the client's chained policies.
77+
78+ >>> from azure.core.rest import HttpRequest
79+ >>> request = HttpRequest("GET", "https://www.example.org/")
80+ <HttpRequest [GET], url: 'https://www.example.org/'>
81+ >>> response = client._send_request(request)
82+ <HttpResponse: 200 OK>
83+
84+ For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
85+
86+ :param request: The network request you want to make. Required.
87+ :type request: ~azure.core.rest.HttpRequest
88+ :keyword bool stream: Whether the response payload will be streamed. Defaults to False.
89+ :return: The response of your network call. Does not do error handling on your response.
90+ :rtype: ~azure.core.rest.HttpResponse
91+ """
6992
70- self .operations = Operations (
71- self ._client , self ._config , self ._serialize , self ._deserialize )
72- self .cloud_manifest_file = CloudManifestFileOperations (
73- self ._client , self ._config , self ._serialize , self ._deserialize )
74- self .customer_subscriptions = CustomerSubscriptionsOperations (
75- self ._client , self ._config , self ._serialize , self ._deserialize )
76- self .products = ProductsOperations (
77- self ._client , self ._config , self ._serialize , self ._deserialize )
78- self .registrations = RegistrationsOperations (
79- self ._client , self ._config , self ._serialize , self ._deserialize )
80- self .linked_subscriptions = LinkedSubscriptionsOperations (
81- self ._client , self ._config , self ._serialize , self ._deserialize )
93+ request_copy = deepcopy (request )
94+ request_copy .url = self ._client .format_url (request_copy .url )
95+ return self ._client .send_request (request_copy , ** kwargs )
8296
8397 def close (self ):
8498 # type: () -> None
0 commit comments