Skip to content

Commit 4a2c0ea

Browse files
author
SDKAuto
committed
CodeGen from PR 33973 in Azure/azure-rest-api-specs
Merge 0d2018961462f78b36e9d17b46a8fd542f0c4dac into 31869e6038974dbd20dd5028feaec2c402835cad
1 parent 35f6922 commit 4a2c0ea

File tree

179 files changed

+25330
-20176
lines changed

Some content is hidden

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

179 files changed

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

3+
## 1.0.0 (2025-04-25)
4+
5+
change log generation failed!!!
6+
37
## 1.0.0b1 (2024-03-21)
48

59
* Initial Release

sdk/workloads/azure-mgmt-workloadssapvirtualinstance/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 Workloadssapvirtualinstance 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": "9e025bcb77df66ed746a6e6c87745dc3abe11cde",
2+
"commit": "6359b6a6e8e07eb4236cf666214aa1fd8496731d",
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/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/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/workloads/resource-manager/Microsoft.Workloads/SAPVirtualInstance/readme.md"
4+
"typespec_src": "specification/workloads/Workloads.SAPVirtualInstance.Management",
5+
"@azure-tools/typespec-python": "0.44.1"
116
}

sdk/workloads/azure-mgmt-workloadssapvirtualinstance/apiview-properties.json

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

sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/__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 ._workloads_sap_virtual_instance_mgmt_client import WorkloadsSapVirtualInstanceMgmtClient
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 WorkloadsSapVirtualInstanceMgmtClient # 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
"WorkloadsSapVirtualInstanceMgmtClient",
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: 65 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,85 +2,110 @@
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
10-
from typing import Any, TYPE_CHECKING
10+
from typing import Any, Optional, TYPE_CHECKING, cast
11+
from typing_extensions import Self
1112

13+
from azure.core.pipeline import policies
1214
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.core.settings import settings
1316
from azure.mgmt.core import ARMPipelineClient
17+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
1419

15-
from . import models as _models
1620
from ._configuration import WorkloadsSapVirtualInstanceMgmtClientConfiguration
17-
from ._serialization import Deserializer, Serializer
21+
from ._utils.serialization import Deserializer, Serializer
1822
from .operations import (
1923
Operations,
2024
SAPApplicationServerInstancesOperations,
21-
SAPCentralInstancesOperations,
25+
SAPCentralServerInstancesOperations,
2226
SAPDatabaseInstancesOperations,
2327
SAPVirtualInstancesOperations,
24-
WorkloadsSapVirtualInstanceMgmtClientOperationsMixin,
2528
)
2629

2730
if TYPE_CHECKING:
28-
# pylint: disable=unused-import,ungrouped-imports
2931
from azure.core.credentials import TokenCredential
3032

3133

32-
class WorkloadsSapVirtualInstanceMgmtClient(
33-
WorkloadsSapVirtualInstanceMgmtClientOperationsMixin
34-
): # pylint: disable=client-accepts-api-version-keyword
34+
class WorkloadsSapVirtualInstanceMgmtClient:
3535
"""Workloads client provides access to various workload operations.
3636
37+
:ivar operations: Operations operations
38+
:vartype operations: azure.mgmt.workloadssapvirtualinstance.operations.Operations
3739
:ivar sap_virtual_instances: SAPVirtualInstancesOperations operations
3840
:vartype sap_virtual_instances:
3941
azure.mgmt.workloadssapvirtualinstance.operations.SAPVirtualInstancesOperations
40-
:ivar sap_central_instances: SAPCentralInstancesOperations operations
41-
:vartype sap_central_instances:
42-
azure.mgmt.workloadssapvirtualinstance.operations.SAPCentralInstancesOperations
42+
:ivar sap_central_server_instances: SAPCentralServerInstancesOperations operations
43+
:vartype sap_central_server_instances:
44+
azure.mgmt.workloadssapvirtualinstance.operations.SAPCentralServerInstancesOperations
4345
:ivar sap_database_instances: SAPDatabaseInstancesOperations operations
4446
:vartype sap_database_instances:
4547
azure.mgmt.workloadssapvirtualinstance.operations.SAPDatabaseInstancesOperations
4648
:ivar sap_application_server_instances: SAPApplicationServerInstancesOperations operations
4749
:vartype sap_application_server_instances:
4850
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.
51+
:param credential: Credential used to authenticate requests to the service. Required.
5252
:type credential: ~azure.core.credentials.TokenCredential
53-
:param subscription_id: The ID of the target subscription. Required.
53+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
5454
:type subscription_id: str
55-
:param base_url: Service URL. Default value is "https://management.azure.com".
55+
:param base_url: Service host. Default value is None.
5656
: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.
57+
:keyword api_version: The API version to use for this operation. Default value is "2024-09-01".
58+
Note that overriding this default value may result in unsupported behavior.
5959
:paramtype api_version: str
6060
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
6161
Retry-After header is present.
6262
"""
6363

6464
def __init__(
65-
self,
66-
credential: "TokenCredential",
67-
subscription_id: str,
68-
base_url: str = "https://management.azure.com",
69-
**kwargs: Any
65+
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
7066
) -> None:
67+
_endpoint = "{endpoint}"
68+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
69+
_endpoints = get_arm_endpoints(_cloud)
70+
if not base_url:
71+
base_url = _endpoints["resource_manager"]
72+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
7173
self._config = WorkloadsSapVirtualInstanceMgmtClientConfiguration(
72-
credential=credential, subscription_id=subscription_id, **kwargs
74+
credential=credential,
75+
subscription_id=subscription_id,
76+
base_url=cast(str, base_url),
77+
credential_scopes=credential_scopes,
78+
**kwargs
7379
)
74-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
7580

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)
81+
_policies = kwargs.pop("policies", None)
82+
if _policies is None:
83+
_policies = [
84+
policies.RequestIdPolicy(**kwargs),
85+
self._config.headers_policy,
86+
self._config.user_agent_policy,
87+
self._config.proxy_policy,
88+
policies.ContentDecodePolicy(**kwargs),
89+
ARMAutoResourceProviderRegistrationPolicy(),
90+
self._config.redirect_policy,
91+
self._config.retry_policy,
92+
self._config.authentication_policy,
93+
self._config.custom_hook_policy,
94+
self._config.logging_policy,
95+
policies.DistributedTracingPolicy(**kwargs),
96+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
97+
self._config.http_logging_policy,
98+
]
99+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs)
100+
101+
self._serialize = Serializer()
102+
self._deserialize = Deserializer()
79103
self._serialize.client_side_validation = False
104+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
80105
self.sap_virtual_instances = SAPVirtualInstancesOperations(
81106
self._client, self._config, self._serialize, self._deserialize
82107
)
83-
self.sap_central_instances = SAPCentralInstancesOperations(
108+
self.sap_central_server_instances = SAPCentralServerInstancesOperations(
84109
self._client, self._config, self._serialize, self._deserialize
85110
)
86111
self.sap_database_instances = SAPDatabaseInstancesOperations(
@@ -89,15 +114,14 @@ def __init__(
89114
self.sap_application_server_instances = SAPApplicationServerInstancesOperations(
90115
self._client, self._config, self._serialize, self._deserialize
91116
)
92-
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
93117

94-
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
118+
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
95119
"""Runs the network request through the client's chained policies.
96120
97121
>>> from azure.core.rest import HttpRequest
98122
>>> request = HttpRequest("GET", "https://www.example.org/")
99123
<HttpRequest [GET], url: 'https://www.example.org/'>
100-
>>> response = client._send_request(request)
124+
>>> response = client.send_request(request)
101125
<HttpResponse: 200 OK>
102126
103127
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
@@ -110,13 +134,17 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
110134
"""
111135

112136
request_copy = deepcopy(request)
113-
request_copy.url = self._client.format_url(request_copy.url)
114-
return self._client.send_request(request_copy, **kwargs)
137+
path_format_arguments = {
138+
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
139+
}
140+
141+
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
142+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
115143

116144
def close(self) -> None:
117145
self._client.close()
118146

119-
def __enter__(self) -> "WorkloadsSapVirtualInstanceMgmtClient":
147+
def __enter__(self) -> Self:
120148
self._client.__enter__()
121149
return self
122150

sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_configuration.py

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,46 @@
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 typing import Any, TYPE_CHECKING
1010

11-
from azure.core.configuration import Configuration
1211
from azure.core.pipeline import policies
1312
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1413

1514
from ._version import VERSION
1615

1716
if TYPE_CHECKING:
18-
# pylint: disable=unused-import,ungrouped-imports
1917
from azure.core.credentials import TokenCredential
2018

2119

22-
class WorkloadsSapVirtualInstanceMgmtClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
20+
class WorkloadsSapVirtualInstanceMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
2321
"""Configuration for WorkloadsSapVirtualInstanceMgmtClient.
2422
2523
Note that all parameters used to create this instance are saved as instance
2624
attributes.
2725
28-
:param credential: Credential needed for the client to connect to Azure. Required.
26+
:param credential: Credential used to authenticate requests to the service. Required.
2927
:type credential: ~azure.core.credentials.TokenCredential
30-
:param subscription_id: The ID of the target subscription. Required.
28+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3129
:type subscription_id: str
32-
:keyword api_version: Api Version. Default value is "2023-10-01-preview". Note that overriding
33-
this default value may result in unsupported behavior.
30+
:param base_url: Service host. Default value is "https://management.azure.com".
31+
:type base_url: str
32+
:keyword api_version: The API version to use for this operation. Default value is "2024-09-01".
33+
Note that overriding this default value may result in unsupported behavior.
3434
:paramtype api_version: str
3535
"""
3636

37-
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
38-
super(WorkloadsSapVirtualInstanceMgmtClientConfiguration, self).__init__(**kwargs)
39-
api_version: str = kwargs.pop("api_version", "2023-10-01-preview")
37+
def __init__(
38+
self,
39+
credential: "TokenCredential",
40+
subscription_id: str,
41+
base_url: str = "https://management.azure.com",
42+
**kwargs: Any
43+
) -> None:
44+
api_version: str = kwargs.pop("api_version", "2024-09-01")
4045

4146
if credential is None:
4247
raise ValueError("Parameter 'credential' must not be None.")
@@ -45,9 +50,11 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
4550

4651
self.credential = credential
4752
self.subscription_id = subscription_id
53+
self.base_url = base_url
4854
self.api_version = api_version
4955
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
5056
kwargs.setdefault("sdk_moniker", "mgmt-workloadssapvirtualinstance/{}".format(VERSION))
57+
self.polling_interval = kwargs.get("polling_interval", 30)
5158
self._configure(**kwargs)
5259

5360
def _configure(self, **kwargs: Any) -> None:
@@ -56,9 +63,9 @@ def _configure(self, **kwargs: Any) -> None:
5663
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
5764
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
5865
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
59-
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
6066
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
6167
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
68+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
6269
self.authentication_policy = kwargs.get("authentication_policy")
6370
if self.credential and not self.authentication_policy:
6471
self.authentication_policy = ARMChallengeAuthenticationPolicy(

sdk/workloads/azure-mgmt-workloadssapvirtualinstance/azure/mgmt/workloadssapvirtualinstance/_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)