diff --git a/sdk/synapse/azure-mgmt-synapse/_meta.json b/sdk/synapse/azure-mgmt-synapse/_meta.json index c073ec24ff21..30696eb3beca 100644 --- a/sdk/synapse/azure-mgmt-synapse/_meta.json +++ b/sdk/synapse/azure-mgmt-synapse/_meta.json @@ -4,7 +4,7 @@ "@autorest/python@5.12.0", "@autorest/modelerfour@4.19.3" ], - "commit": "068f1ecdf3abb35a6a329a7b270c45df4d9c57a4", + "commit": "85eb3e7dbe23e025b9c838bef309f11a05768f10", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest_command": "autorest specification/synapse/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2", "readme": "specification/synapse/resource-manager/readme.md" diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/_metadata.json b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/_metadata.json index 1c66f72fa98c..115487d57d7b 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/_metadata.json +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/_metadata.json @@ -142,6 +142,7 @@ "workspace_managed_sql_server_encryption_protector": "WorkspaceManagedSqlServerEncryptionProtectorOperations", "workspace_managed_sql_server_usages": "WorkspaceManagedSqlServerUsagesOperations", "workspace_managed_sql_server_recoverable_sql_pools": "WorkspaceManagedSqlServerRecoverableSqlPoolsOperations", + "workspace_managed_sql_server_dedicated_sq_lminimal_tls_settings": "WorkspaceManagedSqlServerDedicatedSQLminimalTlsSettingsOperations", "workspaces": "WorkspacesOperations", "workspace_aad_admins": "WorkspaceAadAdminsOperations", "workspace_sql_aad_admins": "WorkspaceSqlAadAdminsOperations", diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/_synapse_management_client.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/_synapse_management_client.py index 850e2c2c5ff1..48ef3a175086 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/_synapse_management_client.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/_synapse_management_client.py @@ -15,7 +15,7 @@ from . import models from ._configuration import SynapseManagementClientConfiguration -from .operations import AzureADOnlyAuthenticationsOperations, BigDataPoolsOperations, DataMaskingPoliciesOperations, DataMaskingRulesOperations, ExtendedSqlPoolBlobAuditingPoliciesOperations, IntegrationRuntimeAuthKeysOperations, IntegrationRuntimeConnectionInfosOperations, IntegrationRuntimeCredentialsOperations, IntegrationRuntimeMonitoringDataOperations, IntegrationRuntimeNodeIpAddressOperations, IntegrationRuntimeNodesOperations, IntegrationRuntimeObjectMetadataOperations, IntegrationRuntimeStatusOperations, IntegrationRuntimesOperations, IpFirewallRulesOperations, KeysOperations, KustoOperationsOperations, KustoPoolAttachedDatabaseConfigurationsOperations, KustoPoolChildResourceOperations, KustoPoolDataConnectionsOperations, KustoPoolDatabasePrincipalAssignmentsOperations, KustoPoolDatabasesOperations, KustoPoolPrincipalAssignmentsOperations, KustoPoolsOperations, LibrariesOperations, LibraryOperations, Operations, PrivateEndpointConnectionsOperations, PrivateEndpointConnectionsPrivateLinkHubOperations, PrivateLinkHubPrivateLinkResourcesOperations, PrivateLinkHubsOperations, PrivateLinkResourcesOperations, RestorableDroppedSqlPoolsOperations, SparkConfigurationOperations, SparkConfigurationsOperations, SqlPoolBlobAuditingPoliciesOperations, SqlPoolColumnsOperations, SqlPoolConnectionPoliciesOperations, SqlPoolDataWarehouseUserActivitiesOperations, SqlPoolGeoBackupPoliciesOperations, SqlPoolMaintenanceWindowOptionsOperations, SqlPoolMaintenanceWindowsOperations, SqlPoolMetadataSyncConfigsOperations, SqlPoolOperationResultsOperations, SqlPoolOperationsOperations, SqlPoolRecommendedSensitivityLabelsOperations, SqlPoolReplicationLinksOperations, SqlPoolRestorePointsOperations, SqlPoolSchemasOperations, SqlPoolSecurityAlertPoliciesOperations, SqlPoolSensitivityLabelsOperations, SqlPoolTableColumnsOperations, SqlPoolTablesOperations, SqlPoolTransparentDataEncryptionsOperations, SqlPoolUsagesOperations, SqlPoolVulnerabilityAssessmentRuleBaselinesOperations, SqlPoolVulnerabilityAssessmentScansOperations, SqlPoolVulnerabilityAssessmentsOperations, SqlPoolWorkloadClassifierOperations, SqlPoolWorkloadGroupOperations, SqlPoolsOperations, WorkspaceAadAdminsOperations, WorkspaceManagedIdentitySqlControlSettingsOperations, WorkspaceManagedSqlServerBlobAuditingPoliciesOperations, WorkspaceManagedSqlServerEncryptionProtectorOperations, WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesOperations, WorkspaceManagedSqlServerRecoverableSqlPoolsOperations, WorkspaceManagedSqlServerSecurityAlertPolicyOperations, WorkspaceManagedSqlServerUsagesOperations, WorkspaceManagedSqlServerVulnerabilityAssessmentsOperations, WorkspaceSqlAadAdminsOperations, WorkspacesOperations +from .operations import AzureADOnlyAuthenticationsOperations, BigDataPoolsOperations, DataMaskingPoliciesOperations, DataMaskingRulesOperations, ExtendedSqlPoolBlobAuditingPoliciesOperations, IntegrationRuntimeAuthKeysOperations, IntegrationRuntimeConnectionInfosOperations, IntegrationRuntimeCredentialsOperations, IntegrationRuntimeMonitoringDataOperations, IntegrationRuntimeNodeIpAddressOperations, IntegrationRuntimeNodesOperations, IntegrationRuntimeObjectMetadataOperations, IntegrationRuntimeStatusOperations, IntegrationRuntimesOperations, IpFirewallRulesOperations, KeysOperations, KustoOperationsOperations, KustoPoolAttachedDatabaseConfigurationsOperations, KustoPoolChildResourceOperations, KustoPoolDataConnectionsOperations, KustoPoolDatabasePrincipalAssignmentsOperations, KustoPoolDatabasesOperations, KustoPoolPrincipalAssignmentsOperations, KustoPoolsOperations, LibrariesOperations, LibraryOperations, Operations, PrivateEndpointConnectionsOperations, PrivateEndpointConnectionsPrivateLinkHubOperations, PrivateLinkHubPrivateLinkResourcesOperations, PrivateLinkHubsOperations, PrivateLinkResourcesOperations, RestorableDroppedSqlPoolsOperations, SparkConfigurationOperations, SparkConfigurationsOperations, SqlPoolBlobAuditingPoliciesOperations, SqlPoolColumnsOperations, SqlPoolConnectionPoliciesOperations, SqlPoolDataWarehouseUserActivitiesOperations, SqlPoolGeoBackupPoliciesOperations, SqlPoolMaintenanceWindowOptionsOperations, SqlPoolMaintenanceWindowsOperations, SqlPoolMetadataSyncConfigsOperations, SqlPoolOperationResultsOperations, SqlPoolOperationsOperations, SqlPoolRecommendedSensitivityLabelsOperations, SqlPoolReplicationLinksOperations, SqlPoolRestorePointsOperations, SqlPoolSchemasOperations, SqlPoolSecurityAlertPoliciesOperations, SqlPoolSensitivityLabelsOperations, SqlPoolTableColumnsOperations, SqlPoolTablesOperations, SqlPoolTransparentDataEncryptionsOperations, SqlPoolUsagesOperations, SqlPoolVulnerabilityAssessmentRuleBaselinesOperations, SqlPoolVulnerabilityAssessmentScansOperations, SqlPoolVulnerabilityAssessmentsOperations, SqlPoolWorkloadClassifierOperations, SqlPoolWorkloadGroupOperations, SqlPoolsOperations, WorkspaceAadAdminsOperations, WorkspaceManagedIdentitySqlControlSettingsOperations, WorkspaceManagedSqlServerBlobAuditingPoliciesOperations, WorkspaceManagedSqlServerDedicatedSQLminimalTlsSettingsOperations, WorkspaceManagedSqlServerEncryptionProtectorOperations, WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesOperations, WorkspaceManagedSqlServerRecoverableSqlPoolsOperations, WorkspaceManagedSqlServerSecurityAlertPolicyOperations, WorkspaceManagedSqlServerUsagesOperations, WorkspaceManagedSqlServerVulnerabilityAssessmentsOperations, WorkspaceSqlAadAdminsOperations, WorkspacesOperations if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -157,6 +157,10 @@ class SynapseManagementClient: WorkspaceManagedSqlServerRecoverableSqlPoolsOperations operations :vartype workspace_managed_sql_server_recoverable_sql_pools: azure.mgmt.synapse.operations.WorkspaceManagedSqlServerRecoverableSqlPoolsOperations + :ivar workspace_managed_sql_server_dedicated_sq_lminimal_tls_settings: + WorkspaceManagedSqlServerDedicatedSQLminimalTlsSettingsOperations operations + :vartype workspace_managed_sql_server_dedicated_sq_lminimal_tls_settings: + azure.mgmt.synapse.operations.WorkspaceManagedSqlServerDedicatedSQLminimalTlsSettingsOperations :ivar workspaces: WorkspacesOperations operations :vartype workspaces: azure.mgmt.synapse.operations.WorkspacesOperations :ivar workspace_aad_admins: WorkspaceAadAdminsOperations operations @@ -302,6 +306,7 @@ def __init__( self.workspace_managed_sql_server_encryption_protector = WorkspaceManagedSqlServerEncryptionProtectorOperations(self._client, self._config, self._serialize, self._deserialize) self.workspace_managed_sql_server_usages = WorkspaceManagedSqlServerUsagesOperations(self._client, self._config, self._serialize, self._deserialize) self.workspace_managed_sql_server_recoverable_sql_pools = WorkspaceManagedSqlServerRecoverableSqlPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.workspace_managed_sql_server_dedicated_sq_lminimal_tls_settings = WorkspaceManagedSqlServerDedicatedSQLminimalTlsSettingsOperations(self._client, self._config, self._serialize, self._deserialize) self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) self.workspace_aad_admins = WorkspaceAadAdminsOperations(self._client, self._config, self._serialize, self._deserialize) self.workspace_sql_aad_admins = WorkspaceSqlAadAdminsOperations(self._client, self._config, self._serialize, self._deserialize) diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/_version.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/_version.py index becf96e81299..e5754a47ce68 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/_version.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.1.0b4" +VERSION = "1.0.0b1" diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/_synapse_management_client.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/_synapse_management_client.py index 491aa6fa1b91..0cd8db770442 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/_synapse_management_client.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/_synapse_management_client.py @@ -15,7 +15,7 @@ from .. import models from ._configuration import SynapseManagementClientConfiguration -from .operations import AzureADOnlyAuthenticationsOperations, BigDataPoolsOperations, DataMaskingPoliciesOperations, DataMaskingRulesOperations, ExtendedSqlPoolBlobAuditingPoliciesOperations, IntegrationRuntimeAuthKeysOperations, IntegrationRuntimeConnectionInfosOperations, IntegrationRuntimeCredentialsOperations, IntegrationRuntimeMonitoringDataOperations, IntegrationRuntimeNodeIpAddressOperations, IntegrationRuntimeNodesOperations, IntegrationRuntimeObjectMetadataOperations, IntegrationRuntimeStatusOperations, IntegrationRuntimesOperations, IpFirewallRulesOperations, KeysOperations, KustoOperationsOperations, KustoPoolAttachedDatabaseConfigurationsOperations, KustoPoolChildResourceOperations, KustoPoolDataConnectionsOperations, KustoPoolDatabasePrincipalAssignmentsOperations, KustoPoolDatabasesOperations, KustoPoolPrincipalAssignmentsOperations, KustoPoolsOperations, LibrariesOperations, LibraryOperations, Operations, PrivateEndpointConnectionsOperations, PrivateEndpointConnectionsPrivateLinkHubOperations, PrivateLinkHubPrivateLinkResourcesOperations, PrivateLinkHubsOperations, PrivateLinkResourcesOperations, RestorableDroppedSqlPoolsOperations, SparkConfigurationOperations, SparkConfigurationsOperations, SqlPoolBlobAuditingPoliciesOperations, SqlPoolColumnsOperations, SqlPoolConnectionPoliciesOperations, SqlPoolDataWarehouseUserActivitiesOperations, SqlPoolGeoBackupPoliciesOperations, SqlPoolMaintenanceWindowOptionsOperations, SqlPoolMaintenanceWindowsOperations, SqlPoolMetadataSyncConfigsOperations, SqlPoolOperationResultsOperations, SqlPoolOperationsOperations, SqlPoolRecommendedSensitivityLabelsOperations, SqlPoolReplicationLinksOperations, SqlPoolRestorePointsOperations, SqlPoolSchemasOperations, SqlPoolSecurityAlertPoliciesOperations, SqlPoolSensitivityLabelsOperations, SqlPoolTableColumnsOperations, SqlPoolTablesOperations, SqlPoolTransparentDataEncryptionsOperations, SqlPoolUsagesOperations, SqlPoolVulnerabilityAssessmentRuleBaselinesOperations, SqlPoolVulnerabilityAssessmentScansOperations, SqlPoolVulnerabilityAssessmentsOperations, SqlPoolWorkloadClassifierOperations, SqlPoolWorkloadGroupOperations, SqlPoolsOperations, WorkspaceAadAdminsOperations, WorkspaceManagedIdentitySqlControlSettingsOperations, WorkspaceManagedSqlServerBlobAuditingPoliciesOperations, WorkspaceManagedSqlServerEncryptionProtectorOperations, WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesOperations, WorkspaceManagedSqlServerRecoverableSqlPoolsOperations, WorkspaceManagedSqlServerSecurityAlertPolicyOperations, WorkspaceManagedSqlServerUsagesOperations, WorkspaceManagedSqlServerVulnerabilityAssessmentsOperations, WorkspaceSqlAadAdminsOperations, WorkspacesOperations +from .operations import AzureADOnlyAuthenticationsOperations, BigDataPoolsOperations, DataMaskingPoliciesOperations, DataMaskingRulesOperations, ExtendedSqlPoolBlobAuditingPoliciesOperations, IntegrationRuntimeAuthKeysOperations, IntegrationRuntimeConnectionInfosOperations, IntegrationRuntimeCredentialsOperations, IntegrationRuntimeMonitoringDataOperations, IntegrationRuntimeNodeIpAddressOperations, IntegrationRuntimeNodesOperations, IntegrationRuntimeObjectMetadataOperations, IntegrationRuntimeStatusOperations, IntegrationRuntimesOperations, IpFirewallRulesOperations, KeysOperations, KustoOperationsOperations, KustoPoolAttachedDatabaseConfigurationsOperations, KustoPoolChildResourceOperations, KustoPoolDataConnectionsOperations, KustoPoolDatabasePrincipalAssignmentsOperations, KustoPoolDatabasesOperations, KustoPoolPrincipalAssignmentsOperations, KustoPoolsOperations, LibrariesOperations, LibraryOperations, Operations, PrivateEndpointConnectionsOperations, PrivateEndpointConnectionsPrivateLinkHubOperations, PrivateLinkHubPrivateLinkResourcesOperations, PrivateLinkHubsOperations, PrivateLinkResourcesOperations, RestorableDroppedSqlPoolsOperations, SparkConfigurationOperations, SparkConfigurationsOperations, SqlPoolBlobAuditingPoliciesOperations, SqlPoolColumnsOperations, SqlPoolConnectionPoliciesOperations, SqlPoolDataWarehouseUserActivitiesOperations, SqlPoolGeoBackupPoliciesOperations, SqlPoolMaintenanceWindowOptionsOperations, SqlPoolMaintenanceWindowsOperations, SqlPoolMetadataSyncConfigsOperations, SqlPoolOperationResultsOperations, SqlPoolOperationsOperations, SqlPoolRecommendedSensitivityLabelsOperations, SqlPoolReplicationLinksOperations, SqlPoolRestorePointsOperations, SqlPoolSchemasOperations, SqlPoolSecurityAlertPoliciesOperations, SqlPoolSensitivityLabelsOperations, SqlPoolTableColumnsOperations, SqlPoolTablesOperations, SqlPoolTransparentDataEncryptionsOperations, SqlPoolUsagesOperations, SqlPoolVulnerabilityAssessmentRuleBaselinesOperations, SqlPoolVulnerabilityAssessmentScansOperations, SqlPoolVulnerabilityAssessmentsOperations, SqlPoolWorkloadClassifierOperations, SqlPoolWorkloadGroupOperations, SqlPoolsOperations, WorkspaceAadAdminsOperations, WorkspaceManagedIdentitySqlControlSettingsOperations, WorkspaceManagedSqlServerBlobAuditingPoliciesOperations, WorkspaceManagedSqlServerDedicatedSQLminimalTlsSettingsOperations, WorkspaceManagedSqlServerEncryptionProtectorOperations, WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesOperations, WorkspaceManagedSqlServerRecoverableSqlPoolsOperations, WorkspaceManagedSqlServerSecurityAlertPolicyOperations, WorkspaceManagedSqlServerUsagesOperations, WorkspaceManagedSqlServerVulnerabilityAssessmentsOperations, WorkspaceSqlAadAdminsOperations, WorkspacesOperations if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -161,6 +161,10 @@ class SynapseManagementClient: WorkspaceManagedSqlServerRecoverableSqlPoolsOperations operations :vartype workspace_managed_sql_server_recoverable_sql_pools: azure.mgmt.synapse.aio.operations.WorkspaceManagedSqlServerRecoverableSqlPoolsOperations + :ivar workspace_managed_sql_server_dedicated_sq_lminimal_tls_settings: + WorkspaceManagedSqlServerDedicatedSQLminimalTlsSettingsOperations operations + :vartype workspace_managed_sql_server_dedicated_sq_lminimal_tls_settings: + azure.mgmt.synapse.aio.operations.WorkspaceManagedSqlServerDedicatedSQLminimalTlsSettingsOperations :ivar workspaces: WorkspacesOperations operations :vartype workspaces: azure.mgmt.synapse.aio.operations.WorkspacesOperations :ivar workspace_aad_admins: WorkspaceAadAdminsOperations operations @@ -306,6 +310,7 @@ def __init__( self.workspace_managed_sql_server_encryption_protector = WorkspaceManagedSqlServerEncryptionProtectorOperations(self._client, self._config, self._serialize, self._deserialize) self.workspace_managed_sql_server_usages = WorkspaceManagedSqlServerUsagesOperations(self._client, self._config, self._serialize, self._deserialize) self.workspace_managed_sql_server_recoverable_sql_pools = WorkspaceManagedSqlServerRecoverableSqlPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.workspace_managed_sql_server_dedicated_sq_lminimal_tls_settings = WorkspaceManagedSqlServerDedicatedSQLminimalTlsSettingsOperations(self._client, self._config, self._serialize, self._deserialize) self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) self.workspace_aad_admins = WorkspaceAadAdminsOperations(self._client, self._config, self._serialize, self._deserialize) self.workspace_sql_aad_admins = WorkspaceSqlAadAdminsOperations(self._client, self._config, self._serialize, self._deserialize) diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/operations/__init__.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/operations/__init__.py index 4e5e7b165434..f848f5498cf6 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/operations/__init__.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/operations/__init__.py @@ -51,6 +51,7 @@ from ._workspace_managed_sql_server_encryption_protector_operations import WorkspaceManagedSqlServerEncryptionProtectorOperations from ._workspace_managed_sql_server_usages_operations import WorkspaceManagedSqlServerUsagesOperations from ._workspace_managed_sql_server_recoverable_sql_pools_operations import WorkspaceManagedSqlServerRecoverableSqlPoolsOperations +from ._workspace_managed_sql_server_dedicated_sq_lminimal_tls_settings_operations import WorkspaceManagedSqlServerDedicatedSQLminimalTlsSettingsOperations from ._workspaces_operations import WorkspacesOperations from ._workspace_aad_admins_operations import WorkspaceAadAdminsOperations from ._workspace_sql_aad_admins_operations import WorkspaceSqlAadAdminsOperations @@ -125,6 +126,7 @@ 'WorkspaceManagedSqlServerEncryptionProtectorOperations', 'WorkspaceManagedSqlServerUsagesOperations', 'WorkspaceManagedSqlServerRecoverableSqlPoolsOperations', + 'WorkspaceManagedSqlServerDedicatedSQLminimalTlsSettingsOperations', 'WorkspacesOperations', 'WorkspaceAadAdminsOperations', 'WorkspaceSqlAadAdminsOperations', diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/operations/_workspace_managed_sql_server_dedicated_sq_lminimal_tls_settings_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/operations/_workspace_managed_sql_server_dedicated_sq_lminimal_tls_settings_operations.py new file mode 100644 index 000000000000..055805d85068 --- /dev/null +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/aio/operations/_workspace_managed_sql_server_dedicated_sq_lminimal_tls_settings_operations.py @@ -0,0 +1,315 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._workspace_managed_sql_server_dedicated_sq_lminimal_tls_settings_operations import build_get_request, build_list_request, build_update_request_initial +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class WorkspaceManagedSqlServerDedicatedSQLminimalTlsSettingsOperations: + """WorkspaceManagedSqlServerDedicatedSQLminimalTlsSettingsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.synapse.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _update_initial( + self, + resource_group_name: str, + workspace_name: str, + dedicated_sq_lminimal_tls_settings_name: Union[str, "_models.DedicatedSQLMinimalTlsSettingsName"], + parameters: "_models.DedicatedSQLminimalTlsSettings", + **kwargs: Any + ) -> Optional["_models.DedicatedSQLminimalTlsSettings"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DedicatedSQLminimalTlsSettings"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'DedicatedSQLminimalTlsSettings') + + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + workspace_name=workspace_name, + dedicated_sq_lminimal_tls_settings_name=dedicated_sq_lminimal_tls_settings_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DedicatedSQLminimalTlsSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/dedicatedSQLminimalTlsSettings/{dedicatedSQLminimalTlsSettingsName}'} # type: ignore + + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + workspace_name: str, + dedicated_sq_lminimal_tls_settings_name: Union[str, "_models.DedicatedSQLMinimalTlsSettingsName"], + parameters: "_models.DedicatedSQLminimalTlsSettings", + **kwargs: Any + ) -> AsyncLROPoller["_models.DedicatedSQLminimalTlsSettings"]: + """Update server's tls settings. + + Update workspace managed sql server's minimal tls settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param dedicated_sq_lminimal_tls_settings_name: The name of the dedicated sql minimal tls + settings. + :type dedicated_sq_lminimal_tls_settings_name: str or + ~azure.mgmt.synapse.models.DedicatedSQLMinimalTlsSettingsName + :param parameters: minimal tls settings. + :type parameters: ~azure.mgmt.synapse.models.DedicatedSQLminimalTlsSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either DedicatedSQLminimalTlsSettings or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.synapse.models.DedicatedSQLminimalTlsSettings] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedSQLminimalTlsSettings"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + dedicated_sq_lminimal_tls_settings_name=dedicated_sq_lminimal_tls_settings_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('DedicatedSQLminimalTlsSettings', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/dedicatedSQLminimalTlsSettings/{dedicatedSQLminimalTlsSettingsName}'} # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + workspace_name: str, + dedicated_sq_lminimal_tls_settings_name: str, + **kwargs: Any + ) -> "_models.DedicatedSQLminimalTlsSettings": + """Get server's minimal tls settings. + + Get workspace managed sql server's minimal tls settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param dedicated_sq_lminimal_tls_settings_name: The name of the dedicated sql minimal tls + settings. + :type dedicated_sq_lminimal_tls_settings_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DedicatedSQLminimalTlsSettings, or the result of cls(response) + :rtype: ~azure.mgmt.synapse.models.DedicatedSQLminimalTlsSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedSQLminimalTlsSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + workspace_name=workspace_name, + dedicated_sq_lminimal_tls_settings_name=dedicated_sq_lminimal_tls_settings_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DedicatedSQLminimalTlsSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/dedicatedSQLminimalTlsSettings/{dedicatedSQLminimalTlsSettingsName}'} # type: ignore + + + @distributed_trace + def list( + self, + resource_group_name: str, + workspace_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.DedicatedSQLminimalTlsSettingsListResult"]: + """List workspace server's minimal tls settings. + + List workspace managed sql server's minimal tls settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DedicatedSQLminimalTlsSettingsListResult or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.synapse.models.DedicatedSQLminimalTlsSettingsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedSQLminimalTlsSettingsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + workspace_name=workspace_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + workspace_name=workspace_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("DedicatedSQLminimalTlsSettingsListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/dedicatedSQLminimalTlsSettings'} # type: ignore diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/__init__.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/__init__.py index bf6ae5539cd2..855a3f8aa0e1 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/__init__.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/__init__.py @@ -51,6 +51,9 @@ from ._models_py3 import DatabasePrincipalAssignmentCheckNameRequest from ._models_py3 import DatabasePrincipalAssignmentListResult from ._models_py3 import DatabaseStatistics +from ._models_py3 import DedicatedSQLminimalTlsSettings +from ._models_py3 import DedicatedSQLminimalTlsSettingsListResult +from ._models_py3 import DedicatedSQLminimalTlsSettingsPatchInfo from ._models_py3 import DynamicExecutorAllocation from ._models_py3 import EncryptionDetails from ._models_py3 import EncryptionProtector @@ -279,6 +282,7 @@ DataWarehouseUserActivityName, DatabasePrincipalRole, DayOfWeek, + DedicatedSQLMinimalTlsSettingsName, DefaultPrincipalsModificationKind, EncryptionProtectorName, EventGridDataFormat, @@ -389,6 +393,9 @@ 'DatabasePrincipalAssignmentCheckNameRequest', 'DatabasePrincipalAssignmentListResult', 'DatabaseStatistics', + 'DedicatedSQLminimalTlsSettings', + 'DedicatedSQLminimalTlsSettingsListResult', + 'DedicatedSQLminimalTlsSettingsPatchInfo', 'DynamicExecutorAllocation', 'EncryptionDetails', 'EncryptionProtector', @@ -614,6 +621,7 @@ 'DataWarehouseUserActivityName', 'DatabasePrincipalRole', 'DayOfWeek', + 'DedicatedSQLMinimalTlsSettingsName', 'DefaultPrincipalsModificationKind', 'EncryptionProtectorName', 'EventGridDataFormat', diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_models_py3.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_models_py3.py index 7aa3600422df..57539614f993 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_models_py3.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_models_py3.py @@ -2335,6 +2335,112 @@ def __init__( self.active_queries_count = None +class DedicatedSQLminimalTlsSettings(ProxyResource): + """Dedicated Sql Minimal Tls Settings Info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar location: Resource location. + :vartype location: str + :ivar minimal_tls_version: The minimal tls version of the sql server. + :vartype minimal_tls_version: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'minimal_tls_version': {'key': 'properties.minimalTlsVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + minimal_tls_version: Optional[str] = None, + **kwargs + ): + """ + :keyword minimal_tls_version: The minimal tls version of the sql server. + :paramtype minimal_tls_version: str + """ + super(DedicatedSQLminimalTlsSettings, self).__init__(**kwargs) + self.location = None + self.minimal_tls_version = minimal_tls_version + + +class DedicatedSQLminimalTlsSettingsListResult(msrest.serialization.Model): + """A list of the server's dedicated sql minimal tls settings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Array of results. + :vartype value: list[~azure.mgmt.synapse.models.DedicatedSQLminimalTlsSettings] + :ivar next_link: Link to retrieve next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DedicatedSQLminimalTlsSettings]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(DedicatedSQLminimalTlsSettingsListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class DedicatedSQLminimalTlsSettingsPatchInfo(msrest.serialization.Model): + """Dedicated SQL minimal tls settings patch info. + + :ivar minimal_tls_version: minimal tls version. + :vartype minimal_tls_version: str + """ + + _attribute_map = { + 'minimal_tls_version': {'key': 'minimalTlsVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + minimal_tls_version: Optional[str] = None, + **kwargs + ): + """ + :keyword minimal_tls_version: minimal tls version. + :paramtype minimal_tls_version: str + """ + super(DedicatedSQLminimalTlsSettingsPatchInfo, self).__init__(**kwargs) + self.minimal_tls_version = minimal_tls_version + + class DynamicExecutorAllocation(msrest.serialization.Model): """Dynamic Executor Allocation Properties. diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_synapse_management_client_enums.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_synapse_management_client_enums.py index d77efe5362a0..04fee4a1b20e 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_synapse_management_client_enums.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_synapse_management_client_enums.py @@ -208,6 +208,10 @@ class DayOfWeek(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): FRIDAY = "Friday" SATURDAY = "Saturday" +class DedicatedSQLMinimalTlsSettingsName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + DEFAULT = "default" + class DefaultPrincipalsModificationKind(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): """The default principals modification kind """ diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/__init__.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/__init__.py index 4e5e7b165434..f848f5498cf6 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/__init__.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/__init__.py @@ -51,6 +51,7 @@ from ._workspace_managed_sql_server_encryption_protector_operations import WorkspaceManagedSqlServerEncryptionProtectorOperations from ._workspace_managed_sql_server_usages_operations import WorkspaceManagedSqlServerUsagesOperations from ._workspace_managed_sql_server_recoverable_sql_pools_operations import WorkspaceManagedSqlServerRecoverableSqlPoolsOperations +from ._workspace_managed_sql_server_dedicated_sq_lminimal_tls_settings_operations import WorkspaceManagedSqlServerDedicatedSQLminimalTlsSettingsOperations from ._workspaces_operations import WorkspacesOperations from ._workspace_aad_admins_operations import WorkspaceAadAdminsOperations from ._workspace_sql_aad_admins_operations import WorkspaceSqlAadAdminsOperations @@ -125,6 +126,7 @@ 'WorkspaceManagedSqlServerEncryptionProtectorOperations', 'WorkspaceManagedSqlServerUsagesOperations', 'WorkspaceManagedSqlServerRecoverableSqlPoolsOperations', + 'WorkspaceManagedSqlServerDedicatedSQLminimalTlsSettingsOperations', 'WorkspacesOperations', 'WorkspaceAadAdminsOperations', 'WorkspaceSqlAadAdminsOperations', diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_sql_server_dedicated_sq_lminimal_tls_settings_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_sql_server_dedicated_sq_lminimal_tls_settings_operations.py new file mode 100644 index 000000000000..49a593588e71 --- /dev/null +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_sql_server_dedicated_sq_lminimal_tls_settings_operations.py @@ -0,0 +1,435 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools +from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling +from msrest import Serializer + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section +T = TypeVar('T') +JSONType = Any +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + +def build_update_request_initial( + subscription_id: str, + resource_group_name: str, + workspace_name: str, + dedicated_sq_lminimal_tls_settings_name: Union[str, "_models.DedicatedSQLMinimalTlsSettingsName"], + *, + json: JSONType = None, + content: Any = None, + **kwargs: Any +) -> HttpRequest: + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + api_version = "2021-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/dedicatedSQLminimalTlsSettings/{dedicatedSQLminimalTlsSettingsName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), + "dedicatedSQLminimalTlsSettingsName": _SERIALIZER.url("dedicated_sq_lminimal_tls_settings_name", dedicated_sq_lminimal_tls_settings_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=url, + params=query_parameters, + headers=header_parameters, + json=json, + content=content, + **kwargs + ) + + +def build_get_request( + subscription_id: str, + resource_group_name: str, + workspace_name: str, + dedicated_sq_lminimal_tls_settings_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/dedicatedSQLminimalTlsSettings/{dedicatedSQLminimalTlsSettingsName}') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), + "dedicatedSQLminimalTlsSettingsName": _SERIALIZER.url("dedicated_sq_lminimal_tls_settings_name", dedicated_sq_lminimal_tls_settings_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + + +def build_list_request( + subscription_id: str, + resource_group_name: str, + workspace_name: str, + **kwargs: Any +) -> HttpRequest: + api_version = "2021-06-01" + accept = "application/json" + # Construct URL + url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/dedicatedSQLminimalTlsSettings') + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), + } + + url = _format_url_section(url, **path_format_arguments) + + # Construct parameters + query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=url, + params=query_parameters, + headers=header_parameters, + **kwargs + ) + +class WorkspaceManagedSqlServerDedicatedSQLminimalTlsSettingsOperations(object): + """WorkspaceManagedSqlServerDedicatedSQLminimalTlsSettingsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.synapse.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _update_initial( + self, + resource_group_name: str, + workspace_name: str, + dedicated_sq_lminimal_tls_settings_name: Union[str, "_models.DedicatedSQLMinimalTlsSettingsName"], + parameters: "_models.DedicatedSQLminimalTlsSettings", + **kwargs: Any + ) -> Optional["_models.DedicatedSQLminimalTlsSettings"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DedicatedSQLminimalTlsSettings"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'DedicatedSQLminimalTlsSettings') + + request = build_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + workspace_name=workspace_name, + dedicated_sq_lminimal_tls_settings_name=dedicated_sq_lminimal_tls_settings_name, + content_type=content_type, + json=_json, + template_url=self._update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DedicatedSQLminimalTlsSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/dedicatedSQLminimalTlsSettings/{dedicatedSQLminimalTlsSettingsName}'} # type: ignore + + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + workspace_name: str, + dedicated_sq_lminimal_tls_settings_name: Union[str, "_models.DedicatedSQLMinimalTlsSettingsName"], + parameters: "_models.DedicatedSQLminimalTlsSettings", + **kwargs: Any + ) -> LROPoller["_models.DedicatedSQLminimalTlsSettings"]: + """Update server's tls settings. + + Update workspace managed sql server's minimal tls settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param dedicated_sq_lminimal_tls_settings_name: The name of the dedicated sql minimal tls + settings. + :type dedicated_sq_lminimal_tls_settings_name: str or + ~azure.mgmt.synapse.models.DedicatedSQLMinimalTlsSettingsName + :param parameters: minimal tls settings. + :type parameters: ~azure.mgmt.synapse.models.DedicatedSQLminimalTlsSettings + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either DedicatedSQLminimalTlsSettings or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.synapse.models.DedicatedSQLminimalTlsSettings] + :raises: ~azure.core.exceptions.HttpResponseError + """ + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedSQLminimalTlsSettings"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + dedicated_sq_lminimal_tls_settings_name=dedicated_sq_lminimal_tls_settings_name, + parameters=parameters, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('DedicatedSQLminimalTlsSettings', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/dedicatedSQLminimalTlsSettings/{dedicatedSQLminimalTlsSettingsName}'} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name: str, + workspace_name: str, + dedicated_sq_lminimal_tls_settings_name: str, + **kwargs: Any + ) -> "_models.DedicatedSQLminimalTlsSettings": + """Get server's minimal tls settings. + + Get workspace managed sql server's minimal tls settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param dedicated_sq_lminimal_tls_settings_name: The name of the dedicated sql minimal tls + settings. + :type dedicated_sq_lminimal_tls_settings_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DedicatedSQLminimalTlsSettings, or the result of cls(response) + :rtype: ~azure.mgmt.synapse.models.DedicatedSQLminimalTlsSettings + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedSQLminimalTlsSettings"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + workspace_name=workspace_name, + dedicated_sq_lminimal_tls_settings_name=dedicated_sq_lminimal_tls_settings_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DedicatedSQLminimalTlsSettings', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/dedicatedSQLminimalTlsSettings/{dedicatedSQLminimalTlsSettingsName}'} # type: ignore + + + @distributed_trace + def list( + self, + resource_group_name: str, + workspace_name: str, + **kwargs: Any + ) -> Iterable["_models.DedicatedSQLminimalTlsSettingsListResult"]: + """List workspace server's minimal tls settings. + + List workspace managed sql server's minimal tls settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either DedicatedSQLminimalTlsSettingsListResult or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.synapse.models.DedicatedSQLminimalTlsSettingsListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DedicatedSQLminimalTlsSettingsListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + workspace_name=workspace_name, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + workspace_name=workspace_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("DedicatedSQLminimalTlsSettingsListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/dedicatedSQLminimalTlsSettings'} # type: ignore