Skip to content

Commit 7773e6c

Browse files
author
SDKAuto
committed
CodeGen from PR 34496 in Azure/azure-rest-api-specs
Merge 387d3629387c2a0665b0d26fc3b9ce60ac255a7f into 477d250a0be7659d4c27a6f704b3216c7e549930
1 parent 9194780 commit 7773e6c

File tree

120 files changed

+15549
-11240
lines changed

Some content is hidden

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

120 files changed

+15549
-11240
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Release History
22

3+
## 2.2.0b3 (2025-05-12)
4+
5+
change log generation failed!!!
6+
37
## 2.2.0b2 (2024-05-20)
48

59
### Features Added

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Maintenance Management Client Library.
4-
This package has been tested with Python 3.8+.
4+
This package has been tested with Python 3.9+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
@@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
1212

1313
### Prerequisites
1414

15-
- Python 3.8+ is required to use this package.
15+
- Python 3.9+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package
@@ -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": "f8b7c60c9839bc32fa19eb3d1d13069b70ba345d",
2+
"commit": "3107f700d4367a8e554e706fd6a83da00c750a1d",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.7",
5-
"use": [
6-
"@autorest/[email protected]",
7-
"@autorest/[email protected]"
8-
],
9-
"autorest_command": "autorest specification/maintenance/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.9.7 --version-tolerant=False",
10-
"readme": "specification/maintenance/resource-manager/readme.md"
4+
"typespec_src": "specification/maintenance/Maintenance.Management",
5+
"@azure-tools/typespec-python": "0.44.2"
116
}

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

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

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

Lines changed: 11 additions & 5 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 ._maintenance_management_client import MaintenanceManagementClient
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 MaintenanceClient # 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__ = [
22-
"MaintenanceManagementClient",
28+
"MaintenanceClient",
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: 276 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,276 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) Python Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from copy import deepcopy
10+
from typing import Any, Optional, TYPE_CHECKING, cast
11+
from typing_extensions import Self
12+
13+
from azure.core.pipeline import policies
14+
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.core.settings import settings
16+
from azure.mgmt.core import ARMPipelineClient
17+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
19+
20+
from ._configuration import MaintenanceClientConfiguration
21+
from ._utils.serialization import Deserializer, Serializer
22+
from .operations import (
23+
ApplyUpdateForResourceGroupOperationGroupOperations,
24+
ApplyUpdateOperationGroupOperations,
25+
ApplyUpdateOperationGroupOpsOperations,
26+
ApplyUpdateOpsOperations,
27+
ApplyUpdatesOperationGroupOperations,
28+
ApplyUpdatesOperations,
29+
ConfigurationAssignmentForResourceGroupOperationGroupOperations,
30+
ConfigurationAssignmentOperationGroupOperations,
31+
ConfigurationAssignmentOperationGroupOpsOperations,
32+
ConfigurationAssignmentOpsOperations,
33+
ConfigurationAssignmentsForResourceGroupOperations,
34+
ConfigurationAssignmentsForResourceGroupOpsOperations,
35+
ConfigurationAssignmentsForSubscriptionOpsOperations,
36+
ConfigurationAssignmentsForSubscriptionsOperations,
37+
ConfigurationAssignmentsOperations,
38+
MaintenanceConfigurationOperationGroupOperations,
39+
MaintenanceConfigurationOperationGroupOpsOperations,
40+
MaintenanceConfigurationOpsOperations,
41+
MaintenanceConfigurationsOperations,
42+
Operations,
43+
ScheduledEventOperationGroupOperations,
44+
UpdatesOperationGroupOperations,
45+
)
46+
47+
if TYPE_CHECKING:
48+
from azure.core.credentials import TokenCredential
49+
50+
51+
class MaintenanceClient: # pylint: disable=too-many-instance-attributes
52+
"""Azure Maintenance Management Client.
53+
54+
:ivar operations: Operations operations
55+
:vartype operations: azure.mgmt.maintenance.operations.Operations
56+
:ivar maintenance_configuration_ops: MaintenanceConfigurationOpsOperations operations
57+
:vartype maintenance_configuration_ops:
58+
azure.mgmt.maintenance.operations.MaintenanceConfigurationOpsOperations
59+
:ivar maintenance_configurations: MaintenanceConfigurationsOperations operations
60+
:vartype maintenance_configurations:
61+
azure.mgmt.maintenance.operations.MaintenanceConfigurationsOperations
62+
:ivar maintenance_configuration_operation_group_ops:
63+
MaintenanceConfigurationOperationGroupOpsOperations operations
64+
:vartype maintenance_configuration_operation_group_ops:
65+
azure.mgmt.maintenance.operations.MaintenanceConfigurationOperationGroupOpsOperations
66+
:ivar maintenance_configuration_operation_group:
67+
MaintenanceConfigurationOperationGroupOperations operations
68+
:vartype maintenance_configuration_operation_group:
69+
azure.mgmt.maintenance.operations.MaintenanceConfigurationOperationGroupOperations
70+
:ivar apply_update_ops: ApplyUpdateOpsOperations operations
71+
:vartype apply_update_ops: azure.mgmt.maintenance.operations.ApplyUpdateOpsOperations
72+
:ivar apply_updates: ApplyUpdatesOperations operations
73+
:vartype apply_updates: azure.mgmt.maintenance.operations.ApplyUpdatesOperations
74+
:ivar apply_update_operation_group_ops: ApplyUpdateOperationGroupOpsOperations operations
75+
:vartype apply_update_operation_group_ops:
76+
azure.mgmt.maintenance.operations.ApplyUpdateOperationGroupOpsOperations
77+
:ivar apply_update_operation_group: ApplyUpdateOperationGroupOperations operations
78+
:vartype apply_update_operation_group:
79+
azure.mgmt.maintenance.operations.ApplyUpdateOperationGroupOperations
80+
:ivar configuration_assignment_ops: ConfigurationAssignmentOpsOperations operations
81+
:vartype configuration_assignment_ops:
82+
azure.mgmt.maintenance.operations.ConfigurationAssignmentOpsOperations
83+
:ivar configuration_assignments: ConfigurationAssignmentsOperations operations
84+
:vartype configuration_assignments:
85+
azure.mgmt.maintenance.operations.ConfigurationAssignmentsOperations
86+
:ivar configuration_assignment_operation_group_ops:
87+
ConfigurationAssignmentOperationGroupOpsOperations operations
88+
:vartype configuration_assignment_operation_group_ops:
89+
azure.mgmt.maintenance.operations.ConfigurationAssignmentOperationGroupOpsOperations
90+
:ivar configuration_assignment_operation_group: ConfigurationAssignmentOperationGroupOperations
91+
operations
92+
:vartype configuration_assignment_operation_group:
93+
azure.mgmt.maintenance.operations.ConfigurationAssignmentOperationGroupOperations
94+
:ivar configuration_assignments_for_subscription_ops:
95+
ConfigurationAssignmentsForSubscriptionOpsOperations operations
96+
:vartype configuration_assignments_for_subscription_ops:
97+
azure.mgmt.maintenance.operations.ConfigurationAssignmentsForSubscriptionOpsOperations
98+
:ivar configuration_assignments_for_subscriptions:
99+
ConfigurationAssignmentsForSubscriptionsOperations operations
100+
:vartype configuration_assignments_for_subscriptions:
101+
azure.mgmt.maintenance.operations.ConfigurationAssignmentsForSubscriptionsOperations
102+
:ivar configuration_assignments_for_resource_group_ops:
103+
ConfigurationAssignmentsForResourceGroupOpsOperations operations
104+
:vartype configuration_assignments_for_resource_group_ops:
105+
azure.mgmt.maintenance.operations.ConfigurationAssignmentsForResourceGroupOpsOperations
106+
:ivar configuration_assignments_for_resource_group:
107+
ConfigurationAssignmentsForResourceGroupOperations operations
108+
:vartype configuration_assignments_for_resource_group:
109+
azure.mgmt.maintenance.operations.ConfigurationAssignmentsForResourceGroupOperations
110+
:ivar scheduled_event_operation_group: ScheduledEventOperationGroupOperations operations
111+
:vartype scheduled_event_operation_group:
112+
azure.mgmt.maintenance.operations.ScheduledEventOperationGroupOperations
113+
:ivar apply_updates_operation_group: ApplyUpdatesOperationGroupOperations operations
114+
:vartype apply_updates_operation_group:
115+
azure.mgmt.maintenance.operations.ApplyUpdatesOperationGroupOperations
116+
:ivar apply_update_for_resource_group_operation_group:
117+
ApplyUpdateForResourceGroupOperationGroupOperations operations
118+
:vartype apply_update_for_resource_group_operation_group:
119+
azure.mgmt.maintenance.operations.ApplyUpdateForResourceGroupOperationGroupOperations
120+
:ivar configuration_assignment_for_resource_group_operation_group:
121+
ConfigurationAssignmentForResourceGroupOperationGroupOperations operations
122+
:vartype configuration_assignment_for_resource_group_operation_group:
123+
azure.mgmt.maintenance.operations.ConfigurationAssignmentForResourceGroupOperationGroupOperations
124+
:ivar updates_operation_group: UpdatesOperationGroupOperations operations
125+
:vartype updates_operation_group:
126+
azure.mgmt.maintenance.operations.UpdatesOperationGroupOperations
127+
:param credential: Credential used to authenticate requests to the service. Required.
128+
:type credential: ~azure.core.credentials.TokenCredential
129+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
130+
:type subscription_id: str
131+
:param base_url: Service host. Default value is None.
132+
:type base_url: str
133+
:keyword api_version: The API version to use for this operation. Default value is
134+
"2023-10-01-preview". Note that overriding this default value may result in unsupported
135+
behavior.
136+
:paramtype api_version: str
137+
"""
138+
139+
def __init__(
140+
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
141+
) -> None:
142+
_endpoint = "{endpoint}"
143+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
144+
_endpoints = get_arm_endpoints(_cloud)
145+
if not base_url:
146+
base_url = _endpoints["resource_manager"]
147+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
148+
self._config = MaintenanceClientConfiguration(
149+
credential=credential,
150+
subscription_id=subscription_id,
151+
base_url=cast(str, base_url),
152+
credential_scopes=credential_scopes,
153+
**kwargs
154+
)
155+
156+
_policies = kwargs.pop("policies", None)
157+
if _policies is None:
158+
_policies = [
159+
policies.RequestIdPolicy(**kwargs),
160+
self._config.headers_policy,
161+
self._config.user_agent_policy,
162+
self._config.proxy_policy,
163+
policies.ContentDecodePolicy(**kwargs),
164+
ARMAutoResourceProviderRegistrationPolicy(),
165+
self._config.redirect_policy,
166+
self._config.retry_policy,
167+
self._config.authentication_policy,
168+
self._config.custom_hook_policy,
169+
self._config.logging_policy,
170+
policies.DistributedTracingPolicy(**kwargs),
171+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
172+
self._config.http_logging_policy,
173+
]
174+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs)
175+
176+
self._serialize = Serializer()
177+
self._deserialize = Deserializer()
178+
self._serialize.client_side_validation = False
179+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
180+
self.maintenance_configuration_ops = MaintenanceConfigurationOpsOperations(
181+
self._client, self._config, self._serialize, self._deserialize
182+
)
183+
self.maintenance_configurations = MaintenanceConfigurationsOperations(
184+
self._client, self._config, self._serialize, self._deserialize
185+
)
186+
self.maintenance_configuration_operation_group_ops = MaintenanceConfigurationOperationGroupOpsOperations(
187+
self._client, self._config, self._serialize, self._deserialize
188+
)
189+
self.maintenance_configuration_operation_group = MaintenanceConfigurationOperationGroupOperations(
190+
self._client, self._config, self._serialize, self._deserialize
191+
)
192+
self.apply_update_ops = ApplyUpdateOpsOperations(self._client, self._config, self._serialize, self._deserialize)
193+
self.apply_updates = ApplyUpdatesOperations(self._client, self._config, self._serialize, self._deserialize)
194+
self.apply_update_operation_group_ops = ApplyUpdateOperationGroupOpsOperations(
195+
self._client, self._config, self._serialize, self._deserialize
196+
)
197+
self.apply_update_operation_group = ApplyUpdateOperationGroupOperations(
198+
self._client, self._config, self._serialize, self._deserialize
199+
)
200+
self.configuration_assignment_ops = ConfigurationAssignmentOpsOperations(
201+
self._client, self._config, self._serialize, self._deserialize
202+
)
203+
self.configuration_assignments = ConfigurationAssignmentsOperations(
204+
self._client, self._config, self._serialize, self._deserialize
205+
)
206+
self.configuration_assignment_operation_group_ops = ConfigurationAssignmentOperationGroupOpsOperations(
207+
self._client, self._config, self._serialize, self._deserialize
208+
)
209+
self.configuration_assignment_operation_group = ConfigurationAssignmentOperationGroupOperations(
210+
self._client, self._config, self._serialize, self._deserialize
211+
)
212+
self.configuration_assignments_for_subscription_ops = ConfigurationAssignmentsForSubscriptionOpsOperations(
213+
self._client, self._config, self._serialize, self._deserialize
214+
)
215+
self.configuration_assignments_for_subscriptions = ConfigurationAssignmentsForSubscriptionsOperations(
216+
self._client, self._config, self._serialize, self._deserialize
217+
)
218+
self.configuration_assignments_for_resource_group_ops = ConfigurationAssignmentsForResourceGroupOpsOperations(
219+
self._client, self._config, self._serialize, self._deserialize
220+
)
221+
self.configuration_assignments_for_resource_group = ConfigurationAssignmentsForResourceGroupOperations(
222+
self._client, self._config, self._serialize, self._deserialize
223+
)
224+
self.scheduled_event_operation_group = ScheduledEventOperationGroupOperations(
225+
self._client, self._config, self._serialize, self._deserialize
226+
)
227+
self.apply_updates_operation_group = ApplyUpdatesOperationGroupOperations(
228+
self._client, self._config, self._serialize, self._deserialize
229+
)
230+
self.apply_update_for_resource_group_operation_group = ApplyUpdateForResourceGroupOperationGroupOperations(
231+
self._client, self._config, self._serialize, self._deserialize
232+
)
233+
self.configuration_assignment_for_resource_group_operation_group = (
234+
ConfigurationAssignmentForResourceGroupOperationGroupOperations(
235+
self._client, self._config, self._serialize, self._deserialize
236+
)
237+
)
238+
self.updates_operation_group = UpdatesOperationGroupOperations(
239+
self._client, self._config, self._serialize, self._deserialize
240+
)
241+
242+
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
243+
"""Runs the network request through the client's chained policies.
244+
245+
>>> from azure.core.rest import HttpRequest
246+
>>> request = HttpRequest("GET", "https://www.example.org/")
247+
<HttpRequest [GET], url: 'https://www.example.org/'>
248+
>>> response = client.send_request(request)
249+
<HttpResponse: 200 OK>
250+
251+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
252+
253+
:param request: The network request you want to make. Required.
254+
:type request: ~azure.core.rest.HttpRequest
255+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
256+
:return: The response of your network call. Does not do error handling on your response.
257+
:rtype: ~azure.core.rest.HttpResponse
258+
"""
259+
260+
request_copy = deepcopy(request)
261+
path_format_arguments = {
262+
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
263+
}
264+
265+
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
266+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
267+
268+
def close(self) -> None:
269+
self._client.close()
270+
271+
def __enter__(self) -> Self:
272+
self._client.__enter__()
273+
return self
274+
275+
def __exit__(self, *exc_details: Any) -> None:
276+
self._client.__exit__(*exc_details)

0 commit comments

Comments
 (0)