Skip to content

Commit 3585d46

Browse files
author
SDKAuto
committed
CodeGen from PR 34360 in Azure/azure-rest-api-specs
Merge 04a9ea21a193083f7717c4bfd891939151552d5b into b7df8126c6b5cab712e066204a3f28a2717b0a4d
1 parent b484b70 commit 3585d46

File tree

165 files changed

+29671
-23751
lines changed

Some content is hidden

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

165 files changed

+29671
-23751
lines changed

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

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

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

Lines changed: 3 additions & 6 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 Recoveryservicesdatareplication Management Client Library.
4-
This package has been tested with Python 3.7+.
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.7+ 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.
@@ -59,6 +59,3 @@ Code samples for this package can be found at:
5959
If you encounter any bugs or have suggestions, please file an issue in the
6060
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
6161
section of the project.
62-
63-
64-
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
{
2-
"commit": "82e7e30a6d46c095e0c3211f3ff7bafe82a362f1",
2+
"commit": "5fc84020a274d45cf5222bd7b013f0cf2306d418",
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/recoveryservicesdatareplication/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/recoveryservicesdatareplication/resource-manager/readme.md"
4+
"typespec_src": "specification/recoveryservicesdatareplication/DataReplication.Management",
5+
"@azure-tools/typespec-python": "0.44.1"
116
}

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

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

sdk/recoveryservicesdatareplication/azure-mgmt-recoveryservicesdatareplication/azure/mgmt/recoveryservicesdatareplication/__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 ._recovery_services_data_replication_mgmt_client import RecoveryServicesDataReplicationMgmtClient
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 RecoveryServicesDataReplicationMgmtClient # 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
"RecoveryServicesDataReplicationMgmtClient",
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()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
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 RecoveryServicesDataReplicationMgmtClientConfiguration
21+
from ._utils.serialization import Deserializer, Serializer
22+
from .operations import (
23+
CheckNameAvailabilityOperations,
24+
DeploymentPreflightOperations,
25+
EmailConfigurationOperations,
26+
EventOperations,
27+
FabricAgentOperations,
28+
FabricOperations,
29+
JobOperations,
30+
LocationBasedOperationResultsOperations,
31+
OperationResultsOperations,
32+
Operations,
33+
PolicyOperations,
34+
PrivateEndpointConnectionProxiesOperations,
35+
PrivateEndpointConnectionsOperations,
36+
PrivateLinkResourcesOperations,
37+
ProtectedItemOperations,
38+
RecoveryPointOperations,
39+
ReplicationExtensionOperations,
40+
VaultOperations,
41+
)
42+
43+
if TYPE_CHECKING:
44+
from azure.core.credentials import TokenCredential
45+
46+
47+
class RecoveryServicesDataReplicationMgmtClient: # pylint: disable=too-many-instance-attributes,name-too-long
48+
"""A first party Azure service enabling the data replication.
49+
50+
:ivar operations: Operations operations
51+
:vartype operations: azure.mgmt.recoveryservicesdatareplication.operations.Operations
52+
:ivar email_configuration: EmailConfigurationOperations operations
53+
:vartype email_configuration:
54+
azure.mgmt.recoveryservicesdatareplication.operations.EmailConfigurationOperations
55+
:ivar vault: VaultOperations operations
56+
:vartype vault: azure.mgmt.recoveryservicesdatareplication.operations.VaultOperations
57+
:ivar event: EventOperations operations
58+
:vartype event: azure.mgmt.recoveryservicesdatareplication.operations.EventOperations
59+
:ivar fabric: FabricOperations operations
60+
:vartype fabric: azure.mgmt.recoveryservicesdatareplication.operations.FabricOperations
61+
:ivar fabric_agent: FabricAgentOperations operations
62+
:vartype fabric_agent:
63+
azure.mgmt.recoveryservicesdatareplication.operations.FabricAgentOperations
64+
:ivar job: JobOperations operations
65+
:vartype job: azure.mgmt.recoveryservicesdatareplication.operations.JobOperations
66+
:ivar policy: PolicyOperations operations
67+
:vartype policy: azure.mgmt.recoveryservicesdatareplication.operations.PolicyOperations
68+
:ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
69+
:vartype private_endpoint_connections:
70+
azure.mgmt.recoveryservicesdatareplication.operations.PrivateEndpointConnectionsOperations
71+
:ivar private_endpoint_connection_proxies: PrivateEndpointConnectionProxiesOperations
72+
operations
73+
:vartype private_endpoint_connection_proxies:
74+
azure.mgmt.recoveryservicesdatareplication.operations.PrivateEndpointConnectionProxiesOperations
75+
:ivar private_link_resources: PrivateLinkResourcesOperations operations
76+
:vartype private_link_resources:
77+
azure.mgmt.recoveryservicesdatareplication.operations.PrivateLinkResourcesOperations
78+
:ivar protected_item: ProtectedItemOperations operations
79+
:vartype protected_item:
80+
azure.mgmt.recoveryservicesdatareplication.operations.ProtectedItemOperations
81+
:ivar recovery_point: RecoveryPointOperations operations
82+
:vartype recovery_point:
83+
azure.mgmt.recoveryservicesdatareplication.operations.RecoveryPointOperations
84+
:ivar replication_extension: ReplicationExtensionOperations operations
85+
:vartype replication_extension:
86+
azure.mgmt.recoveryservicesdatareplication.operations.ReplicationExtensionOperations
87+
:ivar check_name_availability: CheckNameAvailabilityOperations operations
88+
:vartype check_name_availability:
89+
azure.mgmt.recoveryservicesdatareplication.operations.CheckNameAvailabilityOperations
90+
:ivar deployment_preflight: DeploymentPreflightOperations operations
91+
:vartype deployment_preflight:
92+
azure.mgmt.recoveryservicesdatareplication.operations.DeploymentPreflightOperations
93+
:ivar operation_results: OperationResultsOperations operations
94+
:vartype operation_results:
95+
azure.mgmt.recoveryservicesdatareplication.operations.OperationResultsOperations
96+
:ivar location_based_operation_results: LocationBasedOperationResultsOperations operations
97+
:vartype location_based_operation_results:
98+
azure.mgmt.recoveryservicesdatareplication.operations.LocationBasedOperationResultsOperations
99+
:param credential: Credential used to authenticate requests to the service. Required.
100+
:type credential: ~azure.core.credentials.TokenCredential
101+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
102+
:type subscription_id: str
103+
:param base_url: Service host. Default value is None.
104+
:type base_url: str
105+
:keyword api_version: The API version to use for this operation. Default value is "2024-09-01".
106+
Note that overriding this default value may result in unsupported behavior.
107+
:paramtype api_version: str
108+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
109+
Retry-After header is present.
110+
"""
111+
112+
def __init__(
113+
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
114+
) -> None:
115+
_endpoint = "{endpoint}"
116+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
117+
_endpoints = get_arm_endpoints(_cloud)
118+
if not base_url:
119+
base_url = _endpoints["resource_manager"]
120+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
121+
self._config = RecoveryServicesDataReplicationMgmtClientConfiguration(
122+
credential=credential,
123+
subscription_id=subscription_id,
124+
base_url=cast(str, base_url),
125+
credential_scopes=credential_scopes,
126+
**kwargs
127+
)
128+
129+
_policies = kwargs.pop("policies", None)
130+
if _policies is None:
131+
_policies = [
132+
policies.RequestIdPolicy(**kwargs),
133+
self._config.headers_policy,
134+
self._config.user_agent_policy,
135+
self._config.proxy_policy,
136+
policies.ContentDecodePolicy(**kwargs),
137+
ARMAutoResourceProviderRegistrationPolicy(),
138+
self._config.redirect_policy,
139+
self._config.retry_policy,
140+
self._config.authentication_policy,
141+
self._config.custom_hook_policy,
142+
self._config.logging_policy,
143+
policies.DistributedTracingPolicy(**kwargs),
144+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
145+
self._config.http_logging_policy,
146+
]
147+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs)
148+
149+
self._serialize = Serializer()
150+
self._deserialize = Deserializer()
151+
self._serialize.client_side_validation = False
152+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
153+
self.email_configuration = EmailConfigurationOperations(
154+
self._client, self._config, self._serialize, self._deserialize
155+
)
156+
self.vault = VaultOperations(self._client, self._config, self._serialize, self._deserialize)
157+
self.event = EventOperations(self._client, self._config, self._serialize, self._deserialize)
158+
self.fabric = FabricOperations(self._client, self._config, self._serialize, self._deserialize)
159+
self.fabric_agent = FabricAgentOperations(self._client, self._config, self._serialize, self._deserialize)
160+
self.job = JobOperations(self._client, self._config, self._serialize, self._deserialize)
161+
self.policy = PolicyOperations(self._client, self._config, self._serialize, self._deserialize)
162+
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(
163+
self._client, self._config, self._serialize, self._deserialize
164+
)
165+
self.private_endpoint_connection_proxies = PrivateEndpointConnectionProxiesOperations(
166+
self._client, self._config, self._serialize, self._deserialize
167+
)
168+
self.private_link_resources = PrivateLinkResourcesOperations(
169+
self._client, self._config, self._serialize, self._deserialize
170+
)
171+
self.protected_item = ProtectedItemOperations(self._client, self._config, self._serialize, self._deserialize)
172+
self.recovery_point = RecoveryPointOperations(self._client, self._config, self._serialize, self._deserialize)
173+
self.replication_extension = ReplicationExtensionOperations(
174+
self._client, self._config, self._serialize, self._deserialize
175+
)
176+
self.check_name_availability = CheckNameAvailabilityOperations(
177+
self._client, self._config, self._serialize, self._deserialize
178+
)
179+
self.deployment_preflight = DeploymentPreflightOperations(
180+
self._client, self._config, self._serialize, self._deserialize
181+
)
182+
self.operation_results = OperationResultsOperations(
183+
self._client, self._config, self._serialize, self._deserialize
184+
)
185+
self.location_based_operation_results = LocationBasedOperationResultsOperations(
186+
self._client, self._config, self._serialize, self._deserialize
187+
)
188+
189+
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
190+
"""Runs the network request through the client's chained policies.
191+
192+
>>> from azure.core.rest import HttpRequest
193+
>>> request = HttpRequest("GET", "https://www.example.org/")
194+
<HttpRequest [GET], url: 'https://www.example.org/'>
195+
>>> response = client.send_request(request)
196+
<HttpResponse: 200 OK>
197+
198+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
199+
200+
:param request: The network request you want to make. Required.
201+
:type request: ~azure.core.rest.HttpRequest
202+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
203+
:return: The response of your network call. Does not do error handling on your response.
204+
:rtype: ~azure.core.rest.HttpResponse
205+
"""
206+
207+
request_copy = deepcopy(request)
208+
path_format_arguments = {
209+
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
210+
}
211+
212+
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
213+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
214+
215+
def close(self) -> None:
216+
self._client.close()
217+
218+
def __enter__(self) -> Self:
219+
self._client.__enter__()
220+
return self
221+
222+
def __exit__(self, *exc_details: Any) -> None:
223+
self._client.__exit__(*exc_details)

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

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,48 @@
1+
# pylint: disable=line-too-long,useless-suppression
12
# coding=utf-8
23
# --------------------------------------------------------------------------
34
# Copyright (c) Microsoft Corporation. All rights reserved.
45
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Code generated by Microsoft (R) Python Code Generator.
67
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
78
# --------------------------------------------------------------------------
89

910
from typing import Any, TYPE_CHECKING
1011

11-
from azure.core.configuration import Configuration
1212
from azure.core.pipeline import policies
1313
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1414

1515
from ._version import VERSION
1616

1717
if TYPE_CHECKING:
18-
# pylint: disable=unused-import,ungrouped-imports
1918
from azure.core.credentials import TokenCredential
2019

2120

22-
class RecoveryServicesDataReplicationMgmtClientConfiguration(
23-
Configuration
24-
): # pylint: disable=too-many-instance-attributes
21+
class RecoveryServicesDataReplicationMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
2522
"""Configuration for RecoveryServicesDataReplicationMgmtClient.
2623
2724
Note that all parameters used to create this instance are saved as instance
2825
attributes.
2926
30-
:param credential: Credential needed for the client to connect to Azure. Required.
27+
:param credential: Credential used to authenticate requests to the service. Required.
3128
:type credential: ~azure.core.credentials.TokenCredential
3229
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3330
:type subscription_id: str
34-
:keyword api_version: Api Version. Default value is "2021-02-16-preview". Note that overriding
35-
this default value may result in unsupported behavior.
31+
:param base_url: Service host. Default value is "https://management.azure.com".
32+
:type base_url: str
33+
:keyword api_version: The API version to use for this operation. Default value is "2024-09-01".
34+
Note that overriding this default value may result in unsupported behavior.
3635
:paramtype api_version: str
3736
"""
3837

39-
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
40-
super(RecoveryServicesDataReplicationMgmtClientConfiguration, self).__init__(**kwargs)
41-
api_version: str = kwargs.pop("api_version", "2021-02-16-preview")
38+
def __init__(
39+
self,
40+
credential: "TokenCredential",
41+
subscription_id: str,
42+
base_url: str = "https://management.azure.com",
43+
**kwargs: Any
44+
) -> None:
45+
api_version: str = kwargs.pop("api_version", "2024-09-01")
4246

4347
if credential is None:
4448
raise ValueError("Parameter 'credential' must not be None.")
@@ -47,9 +51,11 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
4751

4852
self.credential = credential
4953
self.subscription_id = subscription_id
54+
self.base_url = base_url
5055
self.api_version = api_version
5156
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
5257
kwargs.setdefault("sdk_moniker", "mgmt-recoveryservicesdatareplication/{}".format(VERSION))
58+
self.polling_interval = kwargs.get("polling_interval", 30)
5359
self._configure(**kwargs)
5460

5561
def _configure(self, **kwargs: Any) -> None:
@@ -58,9 +64,9 @@ def _configure(self, **kwargs: Any) -> None:
5864
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
5965
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
6066
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
61-
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
6267
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
6368
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
69+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
6470
self.authentication_policy = kwargs.get("authentication_policy")
6571
if self.credential and not self.authentication_policy:
6672
self.authentication_policy = ARMChallengeAuthenticationPolicy(

0 commit comments

Comments
 (0)