Skip to content
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

[AutoPR azure-mgmt-sql] Adding folders and examples changes for Version 2024-05-01 preview version #7205

Closed
wants to merge 1 commit into from
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": "5dca9527a89918f2e3150b02af1a7b71d78cdaa7",
"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.13.19",
"@autorest/modelerfour@4.27.0"
],
"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/modelerfour@4.27.0 --version=3.9.7 --version-tolerant=False",
"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/python@6.13.19 --use=@autorest/modelerfour@4.27.0 --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
2 changes: 1 addition & 1 deletion sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -1441,7 +1441,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
10 changes: 5 additions & 5 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 @@ -483,8 +483,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 +596,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 +936,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 +1045,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 Down
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.0b17"
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 @@ -488,8 +488,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 +602,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 +942,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 +1051,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
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()
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import sys
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload

from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
Expand Down Expand Up @@ -37,6 +38,10 @@
build_update_request,
)

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

Expand Down Expand Up @@ -84,7 +89,7 @@ async def get(
:rtype: ~azure.mgmt.sql.models.BackupShortTermRetentionPolicy
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -138,7 +143,7 @@ async def _create_or_update_initial(
parameters: Union[_models.BackupShortTermRetentionPolicy, IO[bytes]],
**kwargs: Any
) -> Optional[_models.BackupShortTermRetentionPolicy]:
error_map = {
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -354,7 +359,7 @@ async def _update_initial(
parameters: Union[_models.BackupShortTermRetentionPolicy, IO[bytes]],
**kwargs: Any
) -> Optional[_models.BackupShortTermRetentionPolicy]:
error_map = {
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -586,7 +591,7 @@ def list_by_database(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview"))
cls: ClsType[_models.BackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None)

error_map = {
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, Callable, Dict, Optional, TypeVar, Union
import sys
from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union

from azure.core.exceptions import (
ClientAuthenticationError,
Expand All @@ -27,6 +28,10 @@
from ..._vendor import _convert_request
from ...operations._capabilities_operations import build_list_by_location_request

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

Expand Down Expand Up @@ -67,7 +72,7 @@ async def list_by_location(
:rtype: ~azure.mgmt.sql.models.LocationCapabilities
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
from typing import Any, Callable, Dict, IO, Literal, Optional, TypeVar, Union, overload
import sys
from typing import Any, Callable, Dict, IO, Literal, Optional, Type, TypeVar, Union, overload

from azure.core.exceptions import (
ClientAuthenticationError,
Expand All @@ -28,6 +29,10 @@
from ..._vendor import _convert_request
from ...operations._data_masking_policies_operations import build_create_or_update_request, build_get_request

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

Expand Down Expand Up @@ -136,7 +141,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.sql.models.DataMaskingPolicy
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -211,7 +216,7 @@ async def get(
:rtype: ~azure.mgmt.sql.models.DataMaskingPolicy
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
from typing import Any, AsyncIterable, Callable, Dict, IO, Literal, Optional, TypeVar, Union, overload
import sys
from typing import Any, AsyncIterable, Callable, Dict, IO, Literal, Optional, Type, TypeVar, Union, overload

from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
Expand All @@ -30,6 +31,10 @@
from ..._vendor import _convert_request
from ...operations._data_masking_rules_operations import build_create_or_update_request, build_list_by_database_request

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

Expand Down Expand Up @@ -149,7 +154,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.sql.models.DataMaskingRule
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -236,7 +241,7 @@ def list_by_database(
data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default")
cls: ClsType[_models.DataMaskingRuleListResult] = kwargs.pop("cls", None)

error_map = {
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union
import sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar, Union

from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
Expand All @@ -29,6 +30,10 @@
from ..._vendor import _convert_request
from ...operations._data_warehouse_user_activities_operations import build_get_request, build_list_by_database_request

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

Expand Down Expand Up @@ -78,7 +83,7 @@ async def get(
:rtype: ~azure.mgmt.sql.models.DataWarehouseUserActivities
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down Expand Up @@ -148,7 +153,7 @@ def list_by_database(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview"))
cls: ClsType[_models.DataWarehouseUserActivitiesListResult] = kwargs.pop("cls", None)

error_map = {
error_map: MutableMapping[int, Type[HttpResponseError]] = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
Expand Down
Loading