Skip to content

Commit 150ec07

Browse files
author
SDKAuto
committed
CodeGen from PR 33498 in Azure/azure-rest-api-specs
Merge e15d27e5274e9e094a12d6bcd5a9c90186ca1d5e into 45924e49834c4e01c0713e6b7ca21f94be17e396
1 parent e16a937 commit 150ec07

File tree

71 files changed

+15636
-12363
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+15636
-12363
lines changed

sdk/appcomplianceautomation/azure-mgmt-appcomplianceautomation/CHANGELOG.md

Lines changed: 195 additions & 0 deletions
Large diffs are not rendered by default.

sdk/appcomplianceautomation/azure-mgmt-appcomplianceautomation/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pip install azure-identity
2424

2525
### Authentication
2626

27-
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.
2828

2929
- `AZURE_CLIENT_ID` for Azure client ID.
3030
- `AZURE_TENANT_ID` for Azure tenant ID.
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
{
2-
"commit": "43f10d3b8bacd5fc6b01254b5050c613f26c3573",
2+
"commit": "84d0c90f758ba042d3363af85d565daba581ffc3",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.10.2",
5-
"use": [
6-
"@autorest/[email protected]",
7-
"@autorest/[email protected]"
8-
],
9-
"autorest_command": "autorest specification/appcomplianceautomation/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
10-
"readme": "specification/appcomplianceautomation/resource-manager/readme.md"
4+
"typespec_src": "specification/appcomplianceautomation/AppComplianceAutomation.Management",
5+
"@azure-tools/typespec-python": "0.41.0"
116
}

sdk/appcomplianceautomation/azure-mgmt-appcomplianceautomation/apiview-properties.json

Lines changed: 130 additions & 0 deletions
Large diffs are not rendered by default.

sdk/appcomplianceautomation/azure-mgmt-appcomplianceautomation/azure/mgmt/appcomplianceautomation/__init__.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,31 @@
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
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
89

9-
from ._app_compliance_automation_mgmt_client import AppComplianceAutomationMgmtClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._client import AppComplianceAutomationMgmtClient # type: ignore
1016
from ._version import VERSION
1117

1218
__version__ = VERSION
1319

1420
try:
1521
from ._patch import __all__ as _patch_all
16-
from ._patch import * # pylint: disable=unused-wildcard-import
22+
from ._patch import *
1723
except ImportError:
1824
_patch_all = []
1925
from ._patch import patch_sdk as _patch_sdk
2026

2127
__all__ = [
2228
"AppComplianceAutomationMgmtClient",
2329
]
24-
__all__.extend([p for p in _patch_all if p not in __all__])
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2531

2632
_patch_sdk()
Lines changed: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
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

99
from copy import deepcopy
1010
from typing import Any, TYPE_CHECKING
11+
from typing_extensions import Self
1112

1213
from azure.core.pipeline import policies
1314
from azure.core.rest import HttpRequest, HttpResponse
1415
from azure.mgmt.core import ARMPipelineClient
1516
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
1617

17-
from . import models as _models
1818
from ._configuration import AppComplianceAutomationMgmtClientConfiguration
1919
from ._serialization import Deserializer, Serializer
2020
from .operations import (
@@ -28,35 +28,34 @@
2828
)
2929

3030
if 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

sdk/appcomplianceautomation/azure-mgmt-appcomplianceautomation/azure/mgmt/appcomplianceautomation/_configuration.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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

@@ -14,7 +14,6 @@
1414
from ._version import VERSION
1515

1616
if TYPE_CHECKING:
17-
# pylint: disable=unused-import,ungrouped-imports
1817
from azure.core.credentials import TokenCredential
1918

2019

@@ -24,20 +23,25 @@ class AppComplianceAutomationMgmtClientConfiguration: # pylint: disable=too-man
2423
Note that all parameters used to create this instance are saved as instance
2524
attributes.
2625
27-
:param credential: Credential needed for the client to connect to Azure. Required.
26+
:param credential: Credential used to authenticate requests to the service. Required.
2827
:type credential: ~azure.core.credentials.TokenCredential
29-
:keyword api_version: Api Version. Default value is "2024-06-27". Note that overriding this
30-
default value may result in unsupported behavior.
28+
:param base_url: Service host. Default value is "https://management.azure.com".
29+
:type base_url: str
30+
:keyword api_version: The API version to use for this operation. Default value is "2024-06-27".
31+
Note that overriding this default value may result in unsupported behavior.
3132
:paramtype api_version: str
3233
"""
3334

34-
def __init__(self, credential: "TokenCredential", **kwargs: Any) -> None:
35+
def __init__(
36+
self, credential: "TokenCredential", base_url: str = "https://management.azure.com", **kwargs: Any
37+
) -> None:
3538
api_version: str = kwargs.pop("api_version", "2024-06-27")
3639

3740
if credential is None:
3841
raise ValueError("Parameter 'credential' must not be None.")
3942

4043
self.credential = credential
44+
self.base_url = base_url
4145
self.api_version = api_version
4246
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
4347
kwargs.setdefault("sdk_moniker", "mgmt-appcomplianceautomation/{}".format(VERSION))

0 commit comments

Comments
 (0)