Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions sdk/sql/azure-mgmt-sql/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "33c4457b1d13f83965f4fe3367dca4a6df898100",
"commit": "bcd9ab3fb9a666d48dd04397148acbd0cdb91fb2",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.7",
"autorest": "3.10.2",
"use": [
"@autorest/python@6.13.7",
"@autorest/python@6.15.0",
"@autorest/[email protected]"
],
"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/python@6.13.7 --use=@autorest/[email protected] --version=3.9.7 --version-tolerant=False",
"autorest_command": "autorest specification/sql/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.15.0 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
"readme": "specification/sql/resource-manager/readme.md"
}
1 change: 1 addition & 0 deletions sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#
# --------------------------------------------------------------------------


# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
Expand Down
4 changes: 3 additions & 1 deletion sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ def _json_attemp(data):
# context otherwise.
_LOGGER.critical("Wasn't XML not JSON, failing")
raise DeserializationError("XML is invalid") from err
elif content_type.startswith("text/"):
return data_as_str
raise DeserializationError("Cannot deserialize content-type: {}".format(content_type))

@classmethod
Expand Down Expand Up @@ -1441,7 +1443,7 @@ def _deserialize(self, target_obj, data):
elif isinstance(response, type) and issubclass(response, Enum):
return self.deserialize_enum(data, response)

if data is None:
if data is None or data is CoreNull:
return data
try:
attributes = response._attribute_map # type: ignore
Expand Down
13 changes: 7 additions & 6 deletions sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_sql_management_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from copy import deepcopy
from typing import Any, TYPE_CHECKING
from typing_extensions import Self

from azure.core.pipeline import policies
from azure.core.rest import HttpRequest, HttpResponse
Expand Down Expand Up @@ -483,8 +484,6 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword
ManagedInstanceAdvancedThreatProtectionSettingsOperations operations
:vartype managed_instance_advanced_threat_protection_settings:
azure.mgmt.sql.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations
:ivar replication_links: ReplicationLinksOperations operations
:vartype replication_links: azure.mgmt.sql.operations.ReplicationLinksOperations
:ivar managed_database_move_operations: ManagedDatabaseMoveOperationsOperations operations
:vartype managed_database_move_operations:
azure.mgmt.sql.operations.ManagedDatabaseMoveOperationsOperations
Expand Down Expand Up @@ -598,6 +597,8 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword
:vartype managed_instances: azure.mgmt.sql.operations.ManagedInstancesOperations
:ivar servers: ServersOperations operations
:vartype servers: azure.mgmt.sql.operations.ServersOperations
:ivar replication_links: ReplicationLinksOperations operations
:vartype replication_links: azure.mgmt.sql.operations.ReplicationLinksOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The subscription ID that identifies an Azure subscription. Required.
Expand Down Expand Up @@ -936,9 +937,6 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize
)
)
self.replication_links = ReplicationLinksOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.managed_database_move_operations = ManagedDatabaseMoveOperationsOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand Down Expand Up @@ -1048,6 +1046,9 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize
)
self.servers = ServersOperations(self._client, self._config, self._serialize, self._deserialize)
self.replication_links = ReplicationLinksOperations(
self._client, self._config, self._serialize, self._deserialize
)

def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.
Expand All @@ -1074,7 +1075,7 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
def close(self) -> None:
self._client.close()

def __enter__(self) -> "SqlManagementClient":
def __enter__(self) -> Self:
self._client.__enter__()
return self

Expand Down
16 changes: 0 additions & 16 deletions sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_vendor.py

This file was deleted.

2 changes: 1 addition & 1 deletion sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "4.0.0b18"
VERSION = "0.9.0"
1 change: 1 addition & 0 deletions sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#
# --------------------------------------------------------------------------


# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from copy import deepcopy
from typing import Any, Awaitable, TYPE_CHECKING
from typing_extensions import Self

from azure.core.pipeline import policies
from azure.core.rest import AsyncHttpResponse, HttpRequest
Expand Down Expand Up @@ -488,8 +489,6 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword
ManagedInstanceAdvancedThreatProtectionSettingsOperations operations
:vartype managed_instance_advanced_threat_protection_settings:
azure.mgmt.sql.aio.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations
:ivar replication_links: ReplicationLinksOperations operations
:vartype replication_links: azure.mgmt.sql.aio.operations.ReplicationLinksOperations
:ivar managed_database_move_operations: ManagedDatabaseMoveOperationsOperations operations
:vartype managed_database_move_operations:
azure.mgmt.sql.aio.operations.ManagedDatabaseMoveOperationsOperations
Expand Down Expand Up @@ -604,6 +603,8 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword
:vartype managed_instances: azure.mgmt.sql.aio.operations.ManagedInstancesOperations
:ivar servers: ServersOperations operations
:vartype servers: azure.mgmt.sql.aio.operations.ServersOperations
:ivar replication_links: ReplicationLinksOperations operations
:vartype replication_links: azure.mgmt.sql.aio.operations.ReplicationLinksOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The subscription ID that identifies an Azure subscription. Required.
Expand Down Expand Up @@ -942,9 +943,6 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize
)
)
self.replication_links = ReplicationLinksOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.managed_database_move_operations = ManagedDatabaseMoveOperationsOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand Down Expand Up @@ -1054,6 +1052,9 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize
)
self.servers = ServersOperations(self._client, self._config, self._serialize, self._deserialize)
self.replication_links = ReplicationLinksOperations(
self._client, self._config, self._serialize, self._deserialize
)

def _send_request(
self, request: HttpRequest, *, stream: bool = False, **kwargs: Any
Expand Down Expand Up @@ -1082,7 +1083,7 @@ def _send_request(
async def close(self) -> None:
await self._client.close()

async def __aenter__(self) -> "SqlManagementClient":
async def __aenter__(self) -> Self:
await self._client.__aenter__()
return self

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@
from ._managed_instance_advanced_threat_protection_settings_operations import (
ManagedInstanceAdvancedThreatProtectionSettingsOperations,
)
from ._replication_links_operations import ReplicationLinksOperations
from ._managed_database_move_operations_operations import ManagedDatabaseMoveOperationsOperations
from ._managed_instance_dtcs_operations import ManagedInstanceDtcsOperations
from ._synapse_link_workspaces_operations import SynapseLinkWorkspacesOperations
Expand Down Expand Up @@ -186,6 +185,7 @@
from ._long_term_retention_policies_operations import LongTermRetentionPoliciesOperations
from ._managed_instances_operations import ManagedInstancesOperations
from ._servers_operations import ServersOperations
from ._replication_links_operations import ReplicationLinksOperations

from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
Expand Down Expand Up @@ -304,7 +304,6 @@
"ManagedServerDnsAliasesOperations",
"ManagedDatabaseAdvancedThreatProtectionSettingsOperations",
"ManagedInstanceAdvancedThreatProtectionSettingsOperations",
"ReplicationLinksOperations",
"ManagedDatabaseMoveOperationsOperations",
"ManagedInstanceDtcsOperations",
"SynapseLinkWorkspacesOperations",
Expand Down Expand Up @@ -342,6 +341,7 @@
"LongTermRetentionPoliciesOperations",
"ManagedInstancesOperations",
"ServersOperations",
"ReplicationLinksOperations",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()
Loading