22# --------------------------------------------------------------------------
33# Copyright (c) Microsoft Corporation. All rights reserved.
44# Licensed under the MIT License. See License.txt in the project root for license information.
5- # Code generated by Microsoft (R) AutoRest Code Generator.
5+ # Code generated by Microsoft (R) Python Code Generator.
66# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77# --------------------------------------------------------------------------
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
15- from . import models as _models
1618from ._configuration import WorkloadsSapVirtualInstanceMgmtClientConfiguration
1719from ._serialization import Deserializer , Serializer
1820from .operations import (
19- Operations ,
2021 SAPApplicationServerInstancesOperations ,
21- SAPCentralInstancesOperations ,
22+ SAPCentralServerInstancesOperations ,
2223 SAPDatabaseInstancesOperations ,
2324 SAPVirtualInstancesOperations ,
24- WorkloadsSapVirtualInstanceMgmtClientOperationsMixin ,
2525)
2626
2727if TYPE_CHECKING :
28- # pylint: disable=unused-import,ungrouped-imports
2928 from azure .core .credentials import TokenCredential
3029
3130
32- class WorkloadsSapVirtualInstanceMgmtClient (
33- WorkloadsSapVirtualInstanceMgmtClientOperationsMixin
34- ): # pylint: disable=client-accepts-api-version-keyword
31+ class WorkloadsSapVirtualInstanceMgmtClient :
3532 """Workloads client provides access to various workload operations.
3633
3734 :ivar sap_virtual_instances: SAPVirtualInstancesOperations operations
3835 :vartype sap_virtual_instances:
3936 azure.mgmt.workloadssapvirtualinstance.operations.SAPVirtualInstancesOperations
40- :ivar sap_central_instances: SAPCentralInstancesOperations operations
41- :vartype sap_central_instances :
42- azure.mgmt.workloadssapvirtualinstance.operations.SAPCentralInstancesOperations
37+ :ivar sap_central_server_instances: SAPCentralServerInstancesOperations operations
38+ :vartype sap_central_server_instances :
39+ azure.mgmt.workloadssapvirtualinstance.operations.SAPCentralServerInstancesOperations
4340 :ivar sap_database_instances: SAPDatabaseInstancesOperations operations
4441 :vartype sap_database_instances:
4542 azure.mgmt.workloadssapvirtualinstance.operations.SAPDatabaseInstancesOperations
4643 :ivar sap_application_server_instances: SAPApplicationServerInstancesOperations operations
4744 :vartype sap_application_server_instances:
4845 azure.mgmt.workloadssapvirtualinstance.operations.SAPApplicationServerInstancesOperations
49- :ivar operations: Operations operations
50- :vartype operations: azure.mgmt.workloadssapvirtualinstance.operations.Operations
51- :param credential: Credential needed for the client to connect to Azure. Required.
46+ :param credential: Credential used to authenticate requests to the service. Required.
5247 :type credential: ~azure.core.credentials.TokenCredential
53- :param subscription_id: The ID of the target subscription. Required.
48+ :param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
5449 :type subscription_id: str
55- :param base_url: Service URL . Default value is "https://management.azure.com".
50+ :param base_url: Service host . Default value is "https://management.azure.com".
5651 :type base_url: str
57- :keyword api_version: Api Version . Default value is "2023-10 -01-preview". Note that overriding
58- this default value may result in unsupported behavior.
52+ :keyword api_version: The API version to use for this operation . Default value is "2024-09 -01".
53+ Note that overriding this default value may result in unsupported behavior.
5954 :paramtype api_version: str
6055 :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
6156 Retry-After header is present.
@@ -68,19 +63,37 @@ def __init__(
6863 base_url : str = "https://management.azure.com" ,
6964 ** kwargs : Any
7065 ) -> None :
66+ _endpoint = "{endpoint}"
7167 self ._config = WorkloadsSapVirtualInstanceMgmtClientConfiguration (
72- credential = credential , subscription_id = subscription_id , ** kwargs
68+ credential = credential , subscription_id = subscription_id , base_url = base_url , ** kwargs
7369 )
74- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
75-
76- client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
77- self ._serialize = Serializer (client_models )
78- self ._deserialize = Deserializer (client_models )
70+ _policies = kwargs .pop ("policies" , None )
71+ if _policies is None :
72+ _policies = [
73+ policies .RequestIdPolicy (** kwargs ),
74+ self ._config .headers_policy ,
75+ self ._config .user_agent_policy ,
76+ self ._config .proxy_policy ,
77+ policies .ContentDecodePolicy (** kwargs ),
78+ ARMAutoResourceProviderRegistrationPolicy (),
79+ self ._config .redirect_policy ,
80+ self ._config .retry_policy ,
81+ self ._config .authentication_policy ,
82+ self ._config .custom_hook_policy ,
83+ self ._config .logging_policy ,
84+ policies .DistributedTracingPolicy (** kwargs ),
85+ policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
86+ self ._config .http_logging_policy ,
87+ ]
88+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = _endpoint , policies = _policies , ** kwargs )
89+
90+ self ._serialize = Serializer ()
91+ self ._deserialize = Deserializer ()
7992 self ._serialize .client_side_validation = False
8093 self .sap_virtual_instances = SAPVirtualInstancesOperations (
8194 self ._client , self ._config , self ._serialize , self ._deserialize
8295 )
83- self .sap_central_instances = SAPCentralInstancesOperations (
96+ self .sap_central_server_instances = SAPCentralServerInstancesOperations (
8497 self ._client , self ._config , self ._serialize , self ._deserialize
8598 )
8699 self .sap_database_instances = SAPDatabaseInstancesOperations (
@@ -89,15 +102,14 @@ def __init__(
89102 self .sap_application_server_instances = SAPApplicationServerInstancesOperations (
90103 self ._client , self ._config , self ._serialize , self ._deserialize
91104 )
92- self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
93105
94- def _send_request (self , request : HttpRequest , ** kwargs : Any ) -> HttpResponse :
106+ def send_request (self , request : HttpRequest , * , stream : bool = False , ** kwargs : Any ) -> HttpResponse :
95107 """Runs the network request through the client's chained policies.
96108
97109 >>> from azure.core.rest import HttpRequest
98110 >>> request = HttpRequest("GET", "https://www.example.org/")
99111 <HttpRequest [GET], url: 'https://www.example.org/'>
100- >>> response = client._send_request (request)
112+ >>> response = client.send_request (request)
101113 <HttpResponse: 200 OK>
102114
103115 For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
@@ -110,13 +122,17 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
110122 """
111123
112124 request_copy = deepcopy (request )
113- request_copy .url = self ._client .format_url (request_copy .url )
114- return self ._client .send_request (request_copy , ** kwargs )
125+ path_format_arguments = {
126+ "endpoint" : self ._serialize .url ("self._config.base_url" , self ._config .base_url , "str" , skip_quote = True ),
127+ }
128+
129+ request_copy .url = self ._client .format_url (request_copy .url , ** path_format_arguments )
130+ return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
115131
116132 def close (self ) -> None :
117133 self ._client .close ()
118134
119- def __enter__ (self ) -> "WorkloadsSapVirtualInstanceMgmtClient" :
135+ def __enter__ (self ) -> Self :
120136 self ._client .__enter__ ()
121137 return self
122138
0 commit comments