Skip to content

Commit b5f18cb

Browse files
author
SDKAuto
committed
CodeGen from PR 34347 in Azure/azure-rest-api-specs
Merge ef5a324ffeee700fd0d1e4008b141db5efeb4466 into 2b0c1e3f5205502176451676422b6be137b1e5e5
1 parent 6ac6107 commit b5f18cb

25 files changed

+499
-391
lines changed

sdk/computeschedule/azure-mgmt-computeschedule/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 Computeschedule 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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"commit": "b6075dbc2321933382ea91c787ee62c6bdb87e5d",
2+
"commit": "66dcdb6540666bfe79bdb9dafc2e232900641122",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"typespec_src": "specification/computeschedule/ComputeSchedule.Management",
5-
"@azure-tools/typespec-python": "0.37.3"
5+
"@azure-tools/typespec-python": "0.44.1"
66
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"CrossLanguagePackageId": "Microsoft.ComputeSchedule",
3+
"CrossLanguageDefinitionId": {
4+
"azure.mgmt.computeschedule.models.CancelOperationsRequest": "Microsoft.ComputeSchedule.CancelOperationsRequest",
5+
"azure.mgmt.computeschedule.models.CancelOperationsResponse": "Microsoft.ComputeSchedule.CancelOperationsResponse",
6+
"azure.mgmt.computeschedule.models.DeallocateResourceOperationResponse": "Microsoft.ComputeSchedule.DeallocateResourceOperationResponse",
7+
"azure.mgmt.computeschedule.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo",
8+
"azure.mgmt.computeschedule.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail",
9+
"azure.mgmt.computeschedule.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse",
10+
"azure.mgmt.computeschedule.models.ExecuteDeallocateRequest": "Microsoft.ComputeSchedule.ExecuteDeallocateRequest",
11+
"azure.mgmt.computeschedule.models.ExecuteHibernateRequest": "Microsoft.ComputeSchedule.ExecuteHibernateRequest",
12+
"azure.mgmt.computeschedule.models.ExecuteStartRequest": "Microsoft.ComputeSchedule.ExecuteStartRequest",
13+
"azure.mgmt.computeschedule.models.ExecutionParameters": "Microsoft.ComputeSchedule.ExecutionParameters",
14+
"azure.mgmt.computeschedule.models.GetOperationErrorsRequest": "Microsoft.ComputeSchedule.GetOperationErrorsRequest",
15+
"azure.mgmt.computeschedule.models.GetOperationErrorsResponse": "Microsoft.ComputeSchedule.GetOperationErrorsResponse",
16+
"azure.mgmt.computeschedule.models.GetOperationStatusRequest": "Microsoft.ComputeSchedule.GetOperationStatusRequest",
17+
"azure.mgmt.computeschedule.models.GetOperationStatusResponse": "Microsoft.ComputeSchedule.GetOperationStatusResponse",
18+
"azure.mgmt.computeschedule.models.HibernateResourceOperationResponse": "Microsoft.ComputeSchedule.HibernateResourceOperationResponse",
19+
"azure.mgmt.computeschedule.models.Operation": "Azure.ResourceManager.CommonTypes.Operation",
20+
"azure.mgmt.computeschedule.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay",
21+
"azure.mgmt.computeschedule.models.OperationErrorDetails": "Microsoft.ComputeSchedule.OperationErrorDetails",
22+
"azure.mgmt.computeschedule.models.OperationErrorsResult": "Microsoft.ComputeSchedule.OperationErrorsResult",
23+
"azure.mgmt.computeschedule.models.ResourceOperation": "Microsoft.ComputeSchedule.ResourceOperation",
24+
"azure.mgmt.computeschedule.models.ResourceOperationDetails": "Microsoft.ComputeSchedule.ResourceOperationDetails",
25+
"azure.mgmt.computeschedule.models.ResourceOperationError": "Microsoft.ComputeSchedule.ResourceOperationError",
26+
"azure.mgmt.computeschedule.models.Resources": "Microsoft.ComputeSchedule.Resources",
27+
"azure.mgmt.computeschedule.models.RetryPolicy": "Microsoft.ComputeSchedule.RetryPolicy",
28+
"azure.mgmt.computeschedule.models.Schedule": "Microsoft.ComputeSchedule.Schedule",
29+
"azure.mgmt.computeschedule.models.StartResourceOperationResponse": "Microsoft.ComputeSchedule.StartResourceOperationResponse",
30+
"azure.mgmt.computeschedule.models.SubmitDeallocateRequest": "Microsoft.ComputeSchedule.SubmitDeallocateRequest",
31+
"azure.mgmt.computeschedule.models.SubmitHibernateRequest": "Microsoft.ComputeSchedule.SubmitHibernateRequest",
32+
"azure.mgmt.computeschedule.models.SubmitStartRequest": "Microsoft.ComputeSchedule.SubmitStartRequest",
33+
"azure.mgmt.computeschedule.models.Origin": "Azure.ResourceManager.CommonTypes.Origin",
34+
"azure.mgmt.computeschedule.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType",
35+
"azure.mgmt.computeschedule.models.ResourceOperationType": "Microsoft.ComputeSchedule.ResourceOperationType",
36+
"azure.mgmt.computeschedule.models.DeadlineType": "Microsoft.ComputeSchedule.DeadlineType",
37+
"azure.mgmt.computeschedule.models.OperationState": "Microsoft.ComputeSchedule.OperationState",
38+
"azure.mgmt.computeschedule.models.OptimizationPreference": "Microsoft.ComputeSchedule.OptimizationPreference",
39+
"azure.mgmt.computeschedule.operations.Operations.list": "Azure.ResourceManager.Operations.list",
40+
"azure.mgmt.computeschedule.aio.operations.Operations.list": "Azure.ResourceManager.Operations.list",
41+
"azure.mgmt.computeschedule.operations.ScheduledActionsOperations.virtual_machines_submit_deallocate": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesSubmitDeallocate",
42+
"azure.mgmt.computeschedule.aio.operations.ScheduledActionsOperations.virtual_machines_submit_deallocate": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesSubmitDeallocate",
43+
"azure.mgmt.computeschedule.operations.ScheduledActionsOperations.virtual_machines_submit_hibernate": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesSubmitHibernate",
44+
"azure.mgmt.computeschedule.aio.operations.ScheduledActionsOperations.virtual_machines_submit_hibernate": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesSubmitHibernate",
45+
"azure.mgmt.computeschedule.operations.ScheduledActionsOperations.virtual_machines_submit_start": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesSubmitStart",
46+
"azure.mgmt.computeschedule.aio.operations.ScheduledActionsOperations.virtual_machines_submit_start": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesSubmitStart",
47+
"azure.mgmt.computeschedule.operations.ScheduledActionsOperations.virtual_machines_execute_deallocate": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesExecuteDeallocate",
48+
"azure.mgmt.computeschedule.aio.operations.ScheduledActionsOperations.virtual_machines_execute_deallocate": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesExecuteDeallocate",
49+
"azure.mgmt.computeschedule.operations.ScheduledActionsOperations.virtual_machines_execute_hibernate": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesExecuteHibernate",
50+
"azure.mgmt.computeschedule.aio.operations.ScheduledActionsOperations.virtual_machines_execute_hibernate": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesExecuteHibernate",
51+
"azure.mgmt.computeschedule.operations.ScheduledActionsOperations.virtual_machines_execute_start": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesExecuteStart",
52+
"azure.mgmt.computeschedule.aio.operations.ScheduledActionsOperations.virtual_machines_execute_start": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesExecuteStart",
53+
"azure.mgmt.computeschedule.operations.ScheduledActionsOperations.virtual_machines_get_operation_status": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesGetOperationStatus",
54+
"azure.mgmt.computeschedule.aio.operations.ScheduledActionsOperations.virtual_machines_get_operation_status": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesGetOperationStatus",
55+
"azure.mgmt.computeschedule.operations.ScheduledActionsOperations.virtual_machines_cancel_operations": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesCancelOperations",
56+
"azure.mgmt.computeschedule.aio.operations.ScheduledActionsOperations.virtual_machines_cancel_operations": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesCancelOperations",
57+
"azure.mgmt.computeschedule.operations.ScheduledActionsOperations.virtual_machines_get_operation_errors": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesGetOperationErrors",
58+
"azure.mgmt.computeschedule.aio.operations.ScheduledActionsOperations.virtual_machines_get_operation_errors": "Microsoft.ComputeSchedule.ScheduledActions.virtualMachinesGetOperationErrors"
59+
}
60+
}

sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_client.py

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,18 @@
77
# --------------------------------------------------------------------------
88

99
from copy import deepcopy
10-
from typing import Any, TYPE_CHECKING
10+
from typing import Any, Optional, TYPE_CHECKING, cast
1111
from typing_extensions import Self
1212

1313
from azure.core.pipeline import policies
1414
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.core.settings import settings
1516
from azure.mgmt.core import ARMPipelineClient
1617
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
1719

1820
from ._configuration import ComputeScheduleMgmtClientConfiguration
19-
from ._serialization import Deserializer, Serializer
21+
from ._utils.serialization import Deserializer, Serializer
2022
from .operations import Operations, ScheduledActionsOperations
2123

2224
if TYPE_CHECKING:
@@ -34,24 +36,30 @@ class ComputeScheduleMgmtClient:
3436
:type credential: ~azure.core.credentials.TokenCredential
3537
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3638
:type subscription_id: str
37-
:param base_url: Service host. Default value is "https://management.azure.com".
39+
:param base_url: Service host. Default value is None.
3840
:type base_url: str
3941
:keyword api_version: The API version to use for this operation. Default value is "2024-10-01".
4042
Note that overriding this default value may result in unsupported behavior.
4143
:paramtype api_version: str
4244
"""
4345

4446
def __init__(
45-
self,
46-
credential: "TokenCredential",
47-
subscription_id: str,
48-
base_url: str = "https://management.azure.com",
49-
**kwargs: Any
47+
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
5048
) -> None:
5149
_endpoint = "{endpoint}"
50+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
51+
_endpoints = get_arm_endpoints(_cloud)
52+
if not base_url:
53+
base_url = _endpoints["resource_manager"]
54+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
5255
self._config = ComputeScheduleMgmtClientConfiguration(
53-
credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs
56+
credential=credential,
57+
subscription_id=subscription_id,
58+
base_url=cast(str, base_url),
59+
credential_scopes=credential_scopes,
60+
**kwargs
5461
)
62+
5563
_policies = kwargs.pop("policies", None)
5664
if _policies is None:
5765
_policies = [
@@ -70,7 +78,7 @@ def __init__(
7078
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
7179
self._config.http_logging_policy,
7280
]
73-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs)
81+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs)
7482

7583
self._serialize = Serializer()
7684
self._deserialize = Deserializer()

sdk/computeschedule/azure-mgmt-computeschedule/azure/mgmt/computeschedule/_patch.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# ------------------------------------
2-
# Copyright (c) Microsoft Corporation.
3-
# Licensed under the MIT License.
4-
# ------------------------------------
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+
# --------------------------------------------------------------------------
56
"""Customize generated code here.
67
78
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
# Code generated by Microsoft (R) Python Code Generator.
5+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
6+
# --------------------------------------------------------------------------

0 commit comments

Comments
 (0)