Skip to content

Commit ccadf18

Browse files
author
SDKAuto
committed
CodeGen from PR 29200 in Azure/azure-rest-api-specs
Merge 9f137cc0981b37eab13dc29eade4660a14a36e79 into 9583ed6c26ce1f10bbea92346e28a46394a784b4
1 parent a642e74 commit ccadf18

File tree

335 files changed

+4174
-2871
lines changed

Some content is hidden

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

335 files changed

+4174
-2871
lines changed

sdk/sql/azure-mgmt-sql/_meta.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "33c4457b1d13f83965f4fe3367dca4a6df898100",
2+
"commit": "5dca9527a89918f2e3150b02af1a7b71d78cdaa7",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.7",
4+
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/[email protected].7",
6+
"@autorest/[email protected].19",
77
"@autorest/[email protected]"
88
],
9-
"autorest_command": "autorest specification/sql/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].7 --use=@autorest/[email protected] --version=3.9.7 --version-tolerant=False",
9+
"autorest_command": "autorest specification/sql/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].19 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/sql/resource-manager/readme.md"
1111
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#
2626
# --------------------------------------------------------------------------
2727

28+
2829
# This file is used for handwritten extensions to the generated code. Example:
2930
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
3031
def patch_sdk():

sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_serialization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1441,7 +1441,7 @@ def _deserialize(self, target_obj, data):
14411441
elif isinstance(response, type) and issubclass(response, Enum):
14421442
return self.deserialize_enum(data, response)
14431443

1444-
if data is None:
1444+
if data is None or data is CoreNull:
14451445
return data
14461446
try:
14471447
attributes = response._attribute_map # type: ignore

sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_sql_management_client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -483,8 +483,6 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword
483483
ManagedInstanceAdvancedThreatProtectionSettingsOperations operations
484484
:vartype managed_instance_advanced_threat_protection_settings:
485485
azure.mgmt.sql.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations
486-
:ivar replication_links: ReplicationLinksOperations operations
487-
:vartype replication_links: azure.mgmt.sql.operations.ReplicationLinksOperations
488486
:ivar managed_database_move_operations: ManagedDatabaseMoveOperationsOperations operations
489487
:vartype managed_database_move_operations:
490488
azure.mgmt.sql.operations.ManagedDatabaseMoveOperationsOperations
@@ -598,6 +596,8 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword
598596
:vartype managed_instances: azure.mgmt.sql.operations.ManagedInstancesOperations
599597
:ivar servers: ServersOperations operations
600598
:vartype servers: azure.mgmt.sql.operations.ServersOperations
599+
:ivar replication_links: ReplicationLinksOperations operations
600+
:vartype replication_links: azure.mgmt.sql.operations.ReplicationLinksOperations
601601
:param credential: Credential needed for the client to connect to Azure. Required.
602602
:type credential: ~azure.core.credentials.TokenCredential
603603
:param subscription_id: The subscription ID that identifies an Azure subscription. Required.
@@ -936,9 +936,6 @@ def __init__(
936936
self._client, self._config, self._serialize, self._deserialize
937937
)
938938
)
939-
self.replication_links = ReplicationLinksOperations(
940-
self._client, self._config, self._serialize, self._deserialize
941-
)
942939
self.managed_database_move_operations = ManagedDatabaseMoveOperationsOperations(
943940
self._client, self._config, self._serialize, self._deserialize
944941
)
@@ -1048,6 +1045,9 @@ def __init__(
10481045
self._client, self._config, self._serialize, self._deserialize
10491046
)
10501047
self.servers = ServersOperations(self._client, self._config, self._serialize, self._deserialize)
1048+
self.replication_links = ReplicationLinksOperations(
1049+
self._client, self._config, self._serialize, self._deserialize
1050+
)
10511051

10521052
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
10531053
"""Runs the network request through the client's chained policies.

sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "4.0.0b17"
9+
VERSION = "0.9.0"

sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_patch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#
2626
# --------------------------------------------------------------------------
2727

28+
2829
# This file is used for handwritten extensions to the generated code. Example:
2930
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
3031
def patch_sdk():

sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_sql_management_client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -488,8 +488,6 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword
488488
ManagedInstanceAdvancedThreatProtectionSettingsOperations operations
489489
:vartype managed_instance_advanced_threat_protection_settings:
490490
azure.mgmt.sql.aio.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations
491-
:ivar replication_links: ReplicationLinksOperations operations
492-
:vartype replication_links: azure.mgmt.sql.aio.operations.ReplicationLinksOperations
493491
:ivar managed_database_move_operations: ManagedDatabaseMoveOperationsOperations operations
494492
:vartype managed_database_move_operations:
495493
azure.mgmt.sql.aio.operations.ManagedDatabaseMoveOperationsOperations
@@ -604,6 +602,8 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword
604602
:vartype managed_instances: azure.mgmt.sql.aio.operations.ManagedInstancesOperations
605603
:ivar servers: ServersOperations operations
606604
:vartype servers: azure.mgmt.sql.aio.operations.ServersOperations
605+
:ivar replication_links: ReplicationLinksOperations operations
606+
:vartype replication_links: azure.mgmt.sql.aio.operations.ReplicationLinksOperations
607607
:param credential: Credential needed for the client to connect to Azure. Required.
608608
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
609609
:param subscription_id: The subscription ID that identifies an Azure subscription. Required.
@@ -942,9 +942,6 @@ def __init__(
942942
self._client, self._config, self._serialize, self._deserialize
943943
)
944944
)
945-
self.replication_links = ReplicationLinksOperations(
946-
self._client, self._config, self._serialize, self._deserialize
947-
)
948945
self.managed_database_move_operations = ManagedDatabaseMoveOperationsOperations(
949946
self._client, self._config, self._serialize, self._deserialize
950947
)
@@ -1054,6 +1051,9 @@ def __init__(
10541051
self._client, self._config, self._serialize, self._deserialize
10551052
)
10561053
self.servers = ServersOperations(self._client, self._config, self._serialize, self._deserialize)
1054+
self.replication_links = ReplicationLinksOperations(
1055+
self._client, self._config, self._serialize, self._deserialize
1056+
)
10571057

10581058
def _send_request(
10591059
self, request: HttpRequest, *, stream: bool = False, **kwargs: Any

sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@
138138
from ._managed_instance_advanced_threat_protection_settings_operations import (
139139
ManagedInstanceAdvancedThreatProtectionSettingsOperations,
140140
)
141-
from ._replication_links_operations import ReplicationLinksOperations
142141
from ._managed_database_move_operations_operations import ManagedDatabaseMoveOperationsOperations
143142
from ._managed_instance_dtcs_operations import ManagedInstanceDtcsOperations
144143
from ._synapse_link_workspaces_operations import SynapseLinkWorkspacesOperations
@@ -186,6 +185,7 @@
186185
from ._long_term_retention_policies_operations import LongTermRetentionPoliciesOperations
187186
from ._managed_instances_operations import ManagedInstancesOperations
188187
from ._servers_operations import ServersOperations
188+
from ._replication_links_operations import ReplicationLinksOperations
189189

190190
from ._patch import __all__ as _patch_all
191191
from ._patch import * # pylint: disable=unused-wildcard-import
@@ -304,7 +304,6 @@
304304
"ManagedServerDnsAliasesOperations",
305305
"ManagedDatabaseAdvancedThreatProtectionSettingsOperations",
306306
"ManagedInstanceAdvancedThreatProtectionSettingsOperations",
307-
"ReplicationLinksOperations",
308307
"ManagedDatabaseMoveOperationsOperations",
309308
"ManagedInstanceDtcsOperations",
310309
"SynapseLinkWorkspacesOperations",
@@ -342,6 +341,7 @@
342341
"LongTermRetentionPoliciesOperations",
343342
"ManagedInstancesOperations",
344343
"ServersOperations",
344+
"ReplicationLinksOperations",
345345
]
346346
__all__.extend([p for p in _patch_all if p not in __all__])
347347
_patch_sdk()

sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_backup_short_term_retention_policies_operations.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
88
# --------------------------------------------------------------------------
99
from io import IOBase
10-
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
10+
import sys
11+
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload
1112

1213
from azure.core.async_paging import AsyncItemPaged, AsyncList
1314
from azure.core.exceptions import (
@@ -37,6 +38,10 @@
3738
build_update_request,
3839
)
3940

41+
if sys.version_info >= (3, 9):
42+
from collections.abc import MutableMapping
43+
else:
44+
from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
4045
T = TypeVar("T")
4146
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
4247

@@ -84,7 +89,7 @@ async def get(
8489
:rtype: ~azure.mgmt.sql.models.BackupShortTermRetentionPolicy
8590
:raises ~azure.core.exceptions.HttpResponseError:
8691
"""
87-
error_map = {
92+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
8893
401: ClientAuthenticationError,
8994
404: ResourceNotFoundError,
9095
409: ResourceExistsError,
@@ -138,7 +143,7 @@ async def _create_or_update_initial(
138143
parameters: Union[_models.BackupShortTermRetentionPolicy, IO[bytes]],
139144
**kwargs: Any
140145
) -> Optional[_models.BackupShortTermRetentionPolicy]:
141-
error_map = {
146+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
142147
401: ClientAuthenticationError,
143148
404: ResourceNotFoundError,
144149
409: ResourceExistsError,
@@ -354,7 +359,7 @@ async def _update_initial(
354359
parameters: Union[_models.BackupShortTermRetentionPolicy, IO[bytes]],
355360
**kwargs: Any
356361
) -> Optional[_models.BackupShortTermRetentionPolicy]:
357-
error_map = {
362+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
358363
401: ClientAuthenticationError,
359364
404: ResourceNotFoundError,
360365
409: ResourceExistsError,
@@ -586,7 +591,7 @@ def list_by_database(
586591
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview"))
587592
cls: ClsType[_models.BackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None)
588593

589-
error_map = {
594+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
590595
401: ClientAuthenticationError,
591596
404: ResourceNotFoundError,
592597
409: ResourceExistsError,

sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_capabilities_operations.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
# Code generated by Microsoft (R) AutoRest Code Generator.
77
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
88
# --------------------------------------------------------------------------
9-
from typing import Any, Callable, Dict, Optional, TypeVar, Union
9+
import sys
10+
from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union
1011

1112
from azure.core.exceptions import (
1213
ClientAuthenticationError,
@@ -27,6 +28,10 @@
2728
from ..._vendor import _convert_request
2829
from ...operations._capabilities_operations import build_list_by_location_request
2930

31+
if sys.version_info >= (3, 9):
32+
from collections.abc import MutableMapping
33+
else:
34+
from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
3035
T = TypeVar("T")
3136
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
3237

@@ -67,7 +72,7 @@ async def list_by_location(
6772
:rtype: ~azure.mgmt.sql.models.LocationCapabilities
6873
:raises ~azure.core.exceptions.HttpResponseError:
6974
"""
70-
error_map = {
75+
error_map: MutableMapping[int, Type[HttpResponseError]] = {
7176
401: ClientAuthenticationError,
7277
404: ResourceNotFoundError,
7378
409: ResourceExistsError,

0 commit comments

Comments
 (0)