Skip to content

Commit

Permalink
CodeGen from PR 29316 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 08a92a0e84fd5a2b506934ca731f21e4eff6eb93 into f6f50c6388fd5836fa142384641b8353a99874ef
  • Loading branch information
SDKAuto committed Jun 5, 2024
1 parent 2ff9ddb commit 8d477bc
Show file tree
Hide file tree
Showing 357 changed files with 4,364 additions and 3,777 deletions.
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": "bf01996149405027c6599cea8030b2f84a3b565b",
"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.16",
"@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.16 --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
18 changes: 9 additions & 9 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 All @@ -504,6 +502,8 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword
azure.mgmt.sql.operations.DatabaseEncryptionProtectorsOperations
:ivar managed_databases: ManagedDatabasesOperations operations
:vartype managed_databases: azure.mgmt.sql.operations.ManagedDatabasesOperations
:ivar managed_instances: ManagedInstancesOperations operations
:vartype managed_instances: azure.mgmt.sql.operations.ManagedInstancesOperations
:ivar managed_ledger_digest_uploads: ManagedLedgerDigestUploadsOperations operations
:vartype managed_ledger_digest_uploads:
azure.mgmt.sql.operations.ManagedLedgerDigestUploadsOperations
Expand Down Expand Up @@ -594,10 +594,10 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword
:ivar long_term_retention_policies: LongTermRetentionPoliciesOperations operations
:vartype long_term_retention_policies:
azure.mgmt.sql.operations.LongTermRetentionPoliciesOperations
:ivar managed_instances: ManagedInstancesOperations operations
: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 All @@ -963,6 +960,9 @@ def __init__(
self.managed_databases = ManagedDatabasesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.managed_instances = ManagedInstancesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.managed_ledger_digest_uploads = ManagedLedgerDigestUploadsOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand Down Expand Up @@ -1044,10 +1044,10 @@ def __init__(
self.long_term_retention_policies = LongTermRetentionPoliciesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.managed_instances = ManagedInstancesOperations(
self.servers = ServersOperations(self._client, self._config, self._serialize, self._deserialize)
self.replication_links = ReplicationLinksOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.servers = ServersOperations(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 All @@ -510,6 +508,8 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword
azure.mgmt.sql.aio.operations.DatabaseEncryptionProtectorsOperations
:ivar managed_databases: ManagedDatabasesOperations operations
:vartype managed_databases: azure.mgmt.sql.aio.operations.ManagedDatabasesOperations
:ivar managed_instances: ManagedInstancesOperations operations
:vartype managed_instances: azure.mgmt.sql.aio.operations.ManagedInstancesOperations
:ivar managed_ledger_digest_uploads: ManagedLedgerDigestUploadsOperations operations
:vartype managed_ledger_digest_uploads:
azure.mgmt.sql.aio.operations.ManagedLedgerDigestUploadsOperations
Expand Down Expand Up @@ -600,10 +600,10 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword
:ivar long_term_retention_policies: LongTermRetentionPoliciesOperations operations
:vartype long_term_retention_policies:
azure.mgmt.sql.aio.operations.LongTermRetentionPoliciesOperations
:ivar managed_instances: ManagedInstancesOperations operations
: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 All @@ -969,6 +966,9 @@ def __init__(
self.managed_databases = ManagedDatabasesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.managed_instances = ManagedInstancesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.managed_ledger_digest_uploads = ManagedLedgerDigestUploadsOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand Down Expand Up @@ -1050,10 +1050,10 @@ def __init__(
self.long_term_retention_policies = LongTermRetentionPoliciesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.managed_instances = ManagedInstancesOperations(
self.servers = ServersOperations(self._client, self._config, self._serialize, self._deserialize)
self.replication_links = ReplicationLinksOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.servers = ServersOperations(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 All @@ -147,6 +146,7 @@
from ._managed_database_restore_details_operations import ManagedDatabaseRestoreDetailsOperations
from ._database_encryption_protectors_operations import DatabaseEncryptionProtectorsOperations
from ._managed_databases_operations import ManagedDatabasesOperations
from ._managed_instances_operations import ManagedInstancesOperations
from ._managed_ledger_digest_uploads_operations import ManagedLedgerDigestUploadsOperations
from ._recoverable_databases_operations import RecoverableDatabasesOperations
from ._restorable_dropped_databases_operations import RestorableDroppedDatabasesOperations
Expand Down Expand Up @@ -184,8 +184,8 @@
from ._instance_pools_operations import InstancePoolsOperations
from ._long_term_retention_backups_operations import LongTermRetentionBackupsOperations
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 All @@ -313,6 +312,7 @@
"ManagedDatabaseRestoreDetailsOperations",
"DatabaseEncryptionProtectorsOperations",
"ManagedDatabasesOperations",
"ManagedInstancesOperations",
"ManagedLedgerDigestUploadsOperations",
"RecoverableDatabasesOperations",
"RestorableDroppedDatabasesOperations",
Expand Down Expand Up @@ -340,8 +340,8 @@
"InstancePoolsOperations",
"LongTermRetentionBackupsOperations",
"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
Loading

0 comments on commit 8d477bc

Please sign in to comment.