Skip to content

[AutoPR track2_azure-mgmt-dataprotection] Adding new api-version 2022-12-01 to Microsoft.DataProtection #2186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions sdk/dataprotection/azure-mgmt-dataprotection/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "692ab385680a72a987ad0aa4e98e64779185d1ce",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"use": [
"@autorest/python@6.1.9",
"@autorest/python@6.2.7",
"@autorest/[email protected]"
],
"commit": "33d5054122e52490eef9925d6cbe801f28b88e18",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/dataprotection/resource-manager/readme.md --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
"autorest_command": "autorest specification/dataprotection/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
"readme": "specification/dataprotection/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@

try:
from ._patch import __all__ as _patch_all
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
from ._patch import * # pylint: disable=unused-wildcard-import
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk

__all__ = ["DataProtectionClient"]
__all__ = [
"DataProtectionClient",
]
__all__.extend([p for p in _patch_all if p not in __all__])

_patch_sdk()
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

import sys
from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
Expand All @@ -14,6 +15,11 @@

from ._version import VERSION

if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
Expand All @@ -27,16 +33,16 @@ class DataProtectionClientConfiguration(Configuration): # pylint: disable=too-m

:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The subscription Id. Required.
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2022-09-01-preview". Note that overriding
this default value may result in unsupported behavior.
:keyword api_version: Api Version. Default value is "2022-12-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(DataProtectionClientConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop("api_version", "2022-09-01-preview") # type: str
api_version: Literal["2022-12-01"] = kwargs.pop("api_version", "2022-12-01")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand All @@ -50,10 +56,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
kwargs.setdefault("sdk_moniker", "mgmt-dataprotection/{}".format(VERSION))
self._configure(**kwargs)

def _configure(
self, **kwargs # type: Any
):
# type: (...) -> None
def _configure(self, **kwargs: Any) -> None:
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,17 @@
from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient

from . import models
from . import models as _models
from ._configuration import DataProtectionClientConfiguration
from ._serialization import Deserializer, Serializer
from .operations import (
BackupInstancesExtensionRoutingOperations,
BackupInstancesOperations,
BackupPoliciesOperations,
BackupVaultOperationResultsOperations,
BackupVaultsOperations,
DataProtectionOperations,
DataProtectionOperationsOperations,
DeletedBackupInstancesOperations,
DppResourceGuardProxyOperations,
ExportJobsOperationResultOperations,
ExportJobsOperations,
JobsOperations,
Expand Down Expand Up @@ -71,9 +69,6 @@ class DataProtectionClient: # pylint: disable=client-accepts-api-version-keywor
:vartype backup_policies: azure.mgmt.dataprotection.operations.BackupPoliciesOperations
:ivar backup_instances: BackupInstancesOperations operations
:vartype backup_instances: azure.mgmt.dataprotection.operations.BackupInstancesOperations
:ivar backup_instances_extension_routing: BackupInstancesExtensionRoutingOperations operations
:vartype backup_instances_extension_routing:
azure.mgmt.dataprotection.operations.BackupInstancesExtensionRoutingOperations
:ivar recovery_points: RecoveryPointsOperations operations
:vartype recovery_points: azure.mgmt.dataprotection.operations.RecoveryPointsOperations
:ivar jobs: JobsOperations operations
Expand All @@ -91,17 +86,14 @@ class DataProtectionClient: # pylint: disable=client-accepts-api-version-keywor
azure.mgmt.dataprotection.operations.DeletedBackupInstancesOperations
:ivar resource_guards: ResourceGuardsOperations operations
:vartype resource_guards: azure.mgmt.dataprotection.operations.ResourceGuardsOperations
:ivar dpp_resource_guard_proxy: DppResourceGuardProxyOperations operations
:vartype dpp_resource_guard_proxy:
azure.mgmt.dataprotection.operations.DppResourceGuardProxyOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The subscription Id. Required.
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2022-09-01-preview". Note that overriding
this default value may result in unsupported behavior.
:keyword api_version: Api Version. Default value is "2022-12-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
Expand All @@ -119,7 +111,7 @@ def __init__(
)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
Expand Down Expand Up @@ -147,9 +139,6 @@ def __init__(
self.backup_instances = BackupInstancesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.backup_instances_extension_routing = BackupInstancesExtensionRoutingOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.recovery_points = RecoveryPointsOperations(self._client, self._config, self._serialize, self._deserialize)
self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize)
self.restorable_time_ranges = RestorableTimeRangesOperations(
Expand All @@ -163,9 +152,6 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize
)
self.resource_guards = ResourceGuardsOperations(self._client, self._config, self._serialize, self._deserialize)
self.dpp_resource_guard_proxy = DppResourceGuardProxyOperations(
self._client, self._config, self._serialize, self._deserialize
)

def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.
Expand All @@ -189,15 +175,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
request_copy.url = self._client.format_url(request_copy.url)
return self._client.send_request(request_copy, **kwargs)

def close(self):
# type: () -> None
def close(self) -> None:
self._client.close()

def __enter__(self):
# type: () -> DataProtectionClient
def __enter__(self) -> "DataProtectionClient":
self._client.__enter__()
return self

def __exit__(self, *exc_details):
# type: (Any) -> None
def __exit__(self, *exc_details) -> None:
self._client.__exit__(*exc_details)
Loading