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
1213from azure .core .pipeline import policies
1314from azure .core .rest import HttpRequest , HttpResponse
1415from azure .mgmt .core import ARMPipelineClient
1516from azure .mgmt .core .policies import ARMAutoResourceProviderRegistrationPolicy
1617
17- from . import models as _models
1818from ._configuration import AppComplianceAutomationMgmtClientConfiguration
1919from ._serialization import Deserializer , Serializer
2020from .operations import (
2828)
2929
3030if TYPE_CHECKING :
31- # pylint: disable=unused-import,ungrouped-imports
3231 from azure .core .credentials import TokenCredential
3332
3433
35- class AppComplianceAutomationMgmtClient : # pylint: disable=client-accepts-api-version-keyword, too-many-instance-attributes
34+ class AppComplianceAutomationMgmtClient : # pylint: disable=too-many-instance-attributes
3635 """App Compliance Automation Tool for Microsoft 365 API spec.
3736
38- :ivar provider_actions: ProviderActionsOperations operations
39- :vartype provider_actions:
40- azure.mgmt.appcomplianceautomation.operations.ProviderActionsOperations
41- :ivar operations: Operations operations
42- :vartype operations: azure.mgmt.appcomplianceautomation.operations.Operations
4337 :ivar report: ReportOperations operations
4438 :vartype report: azure.mgmt.appcomplianceautomation.operations.ReportOperations
45- :ivar evidence: EvidenceOperations operations
46- :vartype evidence: azure.mgmt.appcomplianceautomation.operations.EvidenceOperations
39+ :ivar webhook: WebhookOperations operations
40+ :vartype webhook: azure.mgmt.appcomplianceautomation.operations.WebhookOperations
41+ :ivar snapshot: SnapshotOperations operations
42+ :vartype snapshot: azure.mgmt.appcomplianceautomation.operations.SnapshotOperations
4743 :ivar scoping_configuration: ScopingConfigurationOperations operations
4844 :vartype scoping_configuration:
4945 azure.mgmt.appcomplianceautomation.operations.ScopingConfigurationOperations
50- :ivar snapshot: SnapshotOperations operations
51- :vartype snapshot: azure.mgmt.appcomplianceautomation.operations.SnapshotOperations
52- :ivar webhook: WebhookOperations operations
53- :vartype webhook: azure.mgmt.appcomplianceautomation.operations.WebhookOperations
54- :param credential: Credential needed for the client to connect to Azure. Required.
46+ :ivar evidence: EvidenceOperations operations
47+ :vartype evidence: azure.mgmt.appcomplianceautomation.operations.EvidenceOperations
48+ :ivar operations: Operations operations
49+ :vartype operations: azure.mgmt.appcomplianceautomation.operations.Operations
50+ :ivar provider_actions: ProviderActionsOperations operations
51+ :vartype provider_actions:
52+ azure.mgmt.appcomplianceautomation.operations.ProviderActionsOperations
53+ :param credential: Credential used to authenticate requests to the service. Required.
5554 :type credential: ~azure.core.credentials.TokenCredential
56- :param base_url: Service URL . Default value is "https://management.azure.com".
55+ :param base_url: Service host . Default value is "https://management.azure.com".
5756 :type base_url: str
58- :keyword api_version: Api Version . Default value is "2024-06-27". Note that overriding this
59- default value may result in unsupported behavior.
57+ :keyword api_version: The API version to use for this operation . Default value is "2024-06-27".
58+ Note that overriding this default value may result in unsupported behavior.
6059 :paramtype api_version: str
6160 :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
6261 Retry-After header is present.
@@ -65,7 +64,10 @@ class AppComplianceAutomationMgmtClient: # pylint: disable=client-accepts-api-v
6564 def __init__ (
6665 self , credential : "TokenCredential" , base_url : str = "https://management.azure.com" , ** kwargs : Any
6766 ) -> None :
68- self ._config = AppComplianceAutomationMgmtClientConfiguration (credential = credential , ** kwargs )
67+ _endpoint = "{endpoint}"
68+ self ._config = AppComplianceAutomationMgmtClientConfiguration (
69+ credential = credential , base_url = base_url , ** kwargs
70+ )
6971 _policies = kwargs .pop ("policies" , None )
7072 if _policies is None :
7173 _policies = [
@@ -84,31 +86,30 @@ def __init__(
8486 policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
8587 self ._config .http_logging_policy ,
8688 ]
87- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
89+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = _endpoint , policies = _policies , ** kwargs )
8890
89- client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
90- self ._serialize = Serializer (client_models )
91- self ._deserialize = Deserializer (client_models )
91+ self ._serialize = Serializer ()
92+ self ._deserialize = Deserializer ()
9293 self ._serialize .client_side_validation = False
93- self .provider_actions = ProviderActionsOperations (
94+ self .report = ReportOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
95+ self .webhook = WebhookOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
96+ self .snapshot = SnapshotOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
97+ self .scoping_configuration = ScopingConfigurationOperations (
9498 self ._client , self ._config , self ._serialize , self ._deserialize
9599 )
96- self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
97- self .report = ReportOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
98100 self .evidence = EvidenceOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
99- self .scoping_configuration = ScopingConfigurationOperations (
101+ self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
102+ self .provider_actions = ProviderActionsOperations (
100103 self ._client , self ._config , self ._serialize , self ._deserialize
101104 )
102- self .snapshot = SnapshotOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
103- self .webhook = WebhookOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
104105
105- def _send_request (self , request : HttpRequest , * , stream : bool = False , ** kwargs : Any ) -> HttpResponse :
106+ def send_request (self , request : HttpRequest , * , stream : bool = False , ** kwargs : Any ) -> HttpResponse :
106107 """Runs the network request through the client's chained policies.
107108
108109 >>> from azure.core.rest import HttpRequest
109110 >>> request = HttpRequest("GET", "https://www.example.org/")
110111 <HttpRequest [GET], url: 'https://www.example.org/'>
111- >>> response = client._send_request (request)
112+ >>> response = client.send_request (request)
112113 <HttpResponse: 200 OK>
113114
114115 For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
@@ -121,13 +122,17 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
121122 """
122123
123124 request_copy = deepcopy (request )
124- request_copy .url = self ._client .format_url (request_copy .url )
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 )
125130 return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
126131
127132 def close (self ) -> None :
128133 self ._client .close ()
129134
130- def __enter__ (self ) -> "AppComplianceAutomationMgmtClient" :
135+ def __enter__ (self ) -> Self :
131136 self ._client .__enter__ ()
132137 return self
133138
0 commit comments