From 25e6010ac1db22670f4b85d90fdd39e66a3ef77e Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Thu, 5 Nov 2020 12:28:29 +0000 Subject: [PATCH] Generated from 332f2486690584eb6f7812d1032c022aeb2ef566 --- sdk/synapse/mgmt-v2019_06_01_preview/pom.xml | 6 +- .../AzureEntityResource.java | 3 +- .../BabylonConfiguration.java | 43 ++ .../BigDataPoolResourceInfo.java | 96 ++- .../CustomerManagedKeyDetails.java | 58 ++ .../DataMaskingFunction.java | 65 ++ .../DataMaskingPolicies.java | 31 + .../DataMaskingPolicy.java | 155 +++++ .../v2019_06_01_preview/DataMaskingRule.java | 374 +++++++++++ .../DataMaskingRuleState.java | 53 ++ .../v2019_06_01_preview/DataMaskingRules.java | 31 + .../v2019_06_01_preview/DataMaskingState.java | 53 ++ .../EncryptionDetails.java | 58 ++ .../v2019_06_01_preview/ErrorContract.java | 44 ++ .../ErrorContractException.java | 44 ++ .../v2019_06_01_preview/ErrorResponse.java | 5 +- .../ExtendedSqlPoolBlobAuditingPolicies.java | 42 ++ .../ExtendedSqlPoolBlobAuditingPolicy.java | 483 ++++++++++++++ .../IntegrationRuntimeMonitoringDatas.java | 2 +- .../IntegrationRuntimeObjectMetadatas.java | 2 +- .../IntegrationRuntimes.java | 11 + .../synapse/v2019_06_01_preview/Key.java | 146 +++++ .../synapse/v2019_06_01_preview/Keys.java | 53 ++ .../v2019_06_01_preview/LibraryInfo.java | 179 ++++++ .../v2019_06_01_preview/ManagedIdentity.java | 5 +- .../ManagedVirtualNetworkSettings.java | 96 +++ .../MetadataSyncConfig.java | 5 + .../synapse/v2019_06_01_preview/NodeSize.java | 3 + .../OperationResource.java | 63 ++ .../v2019_06_01_preview/Operations.java | 14 +- .../PrivateEndpointConnection.java | 52 +- ...teEndpointConnectionForPrivateLinkHub.java | 50 ++ ...pointConnectionForPrivateLinkHubBasic.java | 101 +++ .../PrivateEndpointConnections.java | 6 +- ...ateEndpointConnectionsPrivateLinkHubs.java | 29 + .../v2019_06_01_preview/PrivateLinkHub.java | 34 +- .../PrivateLinkServiceConnectionState.java | 7 +- .../v2019_06_01_preview/ReplicationLink.java | 4 +- .../RestorableDroppedSqlPool.java | 83 +++ .../RestorableDroppedSqlPools.java | 40 ++ .../v2019_06_01_preview/RestorePoint.java | 4 +- .../SelfHostedIntegrationRuntime.java | 6 +- .../SelfHostedIntegrationRuntimeStatus.java | 15 + .../SensitivityLabelSource.java | 53 ++ .../SensitivityLabels.java | 3 +- .../SqlPoolBlobAuditingPolicies.java | 11 + .../v2019_06_01_preview/SqlPoolColumns.java | 33 + .../SqlPoolGeoBackupPolicies.java | 12 + .../SqlPoolMetadataSyncConfigs.java | 4 +- .../SqlPoolReplicationLinks.java | 13 + .../SqlPoolRestorePoints.java | 25 + .../v2019_06_01_preview/SqlPoolSchema.java | 4 +- .../v2019_06_01_preview/SqlPoolSchemas.java | 12 + .../SqlPoolSecurityAlertPolicies.java | 12 + .../SqlPoolSensitivityLabels.java | 17 +- .../v2019_06_01_preview/SqlPoolTable.java | 4 +- .../SqlPoolTableColumns.java | 2 +- .../v2019_06_01_preview/SqlPoolTables.java | 13 + ...olVulnerabilityAssessmentRuleBaseline.java | 3 +- ...lVulnerabilityAssessmentRuleBaselines.java | 14 + .../SqlPoolVulnerabilityAssessmentScans.java | 12 + ...leSchemaSqlPoolWorkspaceSqlPoolColumn.java | 40 ++ ...emaSqlPoolWorkspaceSqlPoolColumnModel.java | 42 ++ .../VulnerabilityAssessmentScanRecord.java | 4 +- .../v2019_06_01_preview/Workspace.java | 85 ++- .../WorkspaceKeyDetails.java | 69 ++ .../WorkspacePatchInfo.java | 52 ++ .../WorkspaceSqlAadAdmins.java | 52 ++ .../BigDataPoolResourceInfoImpl.java | 35 + .../BigDataPoolResourceInfoInner.java | 86 ++- .../implementation/BigDataPoolsInner.java | 60 +- .../DataMaskingPoliciesImpl.java | 59 ++ .../DataMaskingPoliciesInner.java | 263 ++++++++ .../implementation/DataMaskingPolicyImpl.java | 138 ++++ .../DataMaskingPolicyInner.java | 138 ++++ .../implementation/DataMaskingRuleImpl.java | 235 +++++++ .../implementation/DataMaskingRuleInner.java | 367 +++++++++++ .../implementation/DataMaskingRulesImpl.java | 62 ++ .../implementation/DataMaskingRulesInner.java | 277 ++++++++ ...tendedSqlPoolBlobAuditingPoliciesImpl.java | 78 +++ ...endedSqlPoolBlobAuditingPoliciesInner.java | 520 +++++++++++++++ ...ExtendedSqlPoolBlobAuditingPolicyImpl.java | 208 ++++++ ...xtendedSqlPoolBlobAuditingPolicyInner.java | 503 +++++++++++++++ .../IntegrationRuntimeInner.java | 2 - ...IntegrationRuntimeMonitoringDatasImpl.java | 4 +- ...ntegrationRuntimeMonitoringDatasInner.java | 24 +- ...IntegrationRuntimeObjectMetadatasImpl.java | 4 +- ...ntegrationRuntimeObjectMetadatasInner.java | 138 +++- .../IntegrationRuntimesImpl.java | 6 + .../IntegrationRuntimesInner.java | 367 ++++++++++- .../implementation/IpFirewallRulesInner.java | 60 +- .../implementation/KeyImpl.java | 116 ++++ .../implementation/KeyInner.java | 72 +++ .../implementation/KeysImpl.java | 85 +++ .../implementation/KeysInner.java | 608 ++++++++++++++++++ .../MetadataSyncConfigImpl.java | 5 + .../MetadataSyncConfigInner.java | 26 + .../implementation/OperationResourceImpl.java | 86 +++ .../implementation/OperationsImpl.java | 31 +- .../implementation/OperationsInner.java | 61 +- .../implementation/PageImpl1.java | 75 +++ ...dpointConnectionForPrivateLinkHubImpl.java | 62 ++ ...pointConnectionForPrivateLinkHubInner.java | 70 ++ .../PrivateEndpointConnectionImpl.java | 16 +- .../PrivateEndpointConnectionsInner.java | 150 +++-- ...ndpointConnectionsPrivateLinkHubsImpl.java | 53 ++ ...dpointConnectionsPrivateLinkHubsInner.java | 303 +++++++++ .../implementation/PrivateLinkHubImpl.java | 13 + .../implementation/PrivateLinkHubInner.java | 35 +- .../implementation/PrivateLinkHubsInner.java | 201 ++++-- .../PrivateLinkResourcesInner.java | 26 +- .../implementation/ReplicationLinkImpl.java | 21 +- .../RestorableDroppedSqlPoolImpl.java | 104 +++ .../RestorableDroppedSqlPoolInner.java | 156 +++++ .../RestorableDroppedSqlPoolsImpl.java | 69 ++ .../RestorableDroppedSqlPoolsInner.java | 249 +++++++ .../implementation/RestorePointImpl.java | 21 +- .../implementation/SensitivityLabelsImpl.java | 2 +- .../SqlPoolBlobAuditingPoliciesImpl.java | 19 + .../SqlPoolBlobAuditingPoliciesInner.java | 256 ++++++++ .../implementation/SqlPoolColumnsImpl.java | 50 ++ .../implementation/SqlPoolColumnsInner.java | 174 +++++ .../SqlPoolConnectionPoliciesInner.java | 10 +- .../SqlPoolGeoBackupPoliciesImpl.java | 19 + .../SqlPoolGeoBackupPoliciesInner.java | 117 +++- .../SqlPoolMetadataSyncConfigsImpl.java | 4 +- .../SqlPoolMetadataSyncConfigsInner.java | 141 +--- .../SqlPoolOperationResultsInner.java | 11 +- .../SqlPoolReplicationLinksImpl.java | 16 + .../SqlPoolReplicationLinksInner.java | 127 +++- .../SqlPoolRestorePointsImpl.java | 34 +- .../SqlPoolRestorePointsInner.java | 225 ++++++- .../implementation/SqlPoolSchemaImpl.java | 21 +- .../implementation/SqlPoolSchemasImpl.java | 16 + .../implementation/SqlPoolSchemasInner.java | 105 +++ .../SqlPoolSecurityAlertPoliciesImpl.java | 19 + .../SqlPoolSecurityAlertPoliciesInner.java | 266 ++++++++ .../SqlPoolSensitivityLabelsImpl.java | 17 + .../SqlPoolSensitivityLabelsInner.java | 146 ++++- .../SqlPoolTableColumnsImpl.java | 12 +- .../implementation/SqlPoolTableImpl.java | 23 +- .../implementation/SqlPoolTablesImpl.java | 16 + .../implementation/SqlPoolTablesInner.java | 112 ++++ ...qlPoolTransparentDataEncryptionsInner.java | 20 +- .../implementation/SqlPoolUsagesInner.java | 18 +- ...lnerabilityAssessmentRuleBaselineImpl.java | 6 +- ...nerabilityAssessmentRuleBaselinesImpl.java | 30 +- ...erabilityAssessmentRuleBaselinesInner.java | 114 ++++ ...lPoolVulnerabilityAssessmentScansImpl.java | 16 + ...PoolVulnerabilityAssessmentScansInner.java | 105 +++ .../SqlPoolVulnerabilityAssessmentsInner.java | 1 + .../implementation/SqlPoolsInner.java | 74 +-- .../SynapseManagementClientImpl.java | 112 ++++ .../implementation/SynapseManager.java | 96 +++ ...hemaSqlPoolWorkspaceSqlPoolColumnImpl.java | 51 ++ ...qlPoolWorkspaceSqlPoolColumnModelImpl.java | 70 ++ ...VulnerabilityAssessmentScanRecordImpl.java | 21 +- .../WorkspaceAadAdminsInner.java | 31 +- .../implementation/WorkspaceImpl.java | 50 ++ .../implementation/WorkspaceInner.java | 97 +++ ...anagedIdentitySqlControlSettingsInner.java | 19 +- .../WorkspaceSqlAadAdminsImpl.java | 61 ++ .../WorkspaceSqlAadAdminsInner.java | 494 ++++++++++++++ .../implementation/WorkspacesInner.java | 72 +-- 164 files changed, 12456 insertions(+), 653 deletions(-) create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/BabylonConfiguration.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/CustomerManagedKeyDetails.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/DataMaskingFunction.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/DataMaskingPolicies.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/DataMaskingPolicy.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/DataMaskingRule.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/DataMaskingRuleState.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/DataMaskingRules.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/DataMaskingState.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/EncryptionDetails.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ErrorContract.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ErrorContractException.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ExtendedSqlPoolBlobAuditingPolicies.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ExtendedSqlPoolBlobAuditingPolicy.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/Key.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/Keys.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/LibraryInfo.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ManagedVirtualNetworkSettings.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/OperationResource.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/PrivateEndpointConnectionForPrivateLinkHub.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/PrivateEndpointConnectionForPrivateLinkHubBasic.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/PrivateEndpointConnectionsPrivateLinkHubs.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/RestorableDroppedSqlPool.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/RestorableDroppedSqlPools.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SensitivityLabelSource.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolColumns.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/TableSchemaSqlPoolWorkspaceSqlPoolColumn.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/TableSchemaSqlPoolWorkspaceSqlPoolColumnModel.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/WorkspaceKeyDetails.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/WorkspaceSqlAadAdmins.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingPoliciesImpl.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingPoliciesInner.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingPolicyImpl.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingPolicyInner.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingRuleImpl.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingRuleInner.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingRulesImpl.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingRulesInner.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/ExtendedSqlPoolBlobAuditingPoliciesImpl.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/ExtendedSqlPoolBlobAuditingPoliciesInner.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/ExtendedSqlPoolBlobAuditingPolicyImpl.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/ExtendedSqlPoolBlobAuditingPolicyInner.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/KeyImpl.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/KeyInner.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/KeysImpl.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/KeysInner.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/OperationResourceImpl.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PageImpl1.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateEndpointConnectionForPrivateLinkHubImpl.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateEndpointConnectionForPrivateLinkHubInner.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateEndpointConnectionsPrivateLinkHubsImpl.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateEndpointConnectionsPrivateLinkHubsInner.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/RestorableDroppedSqlPoolImpl.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/RestorableDroppedSqlPoolInner.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/RestorableDroppedSqlPoolsImpl.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/RestorableDroppedSqlPoolsInner.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolColumnsImpl.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolColumnsInner.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/TableSchemaSqlPoolWorkspaceSqlPoolColumnImpl.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/TableSchemaSqlPoolWorkspaceSqlPoolColumnModelImpl.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/WorkspaceSqlAadAdminsImpl.java create mode 100644 sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/WorkspaceSqlAadAdminsInner.java diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/pom.xml b/sdk/synapse/mgmt-v2019_06_01_preview/pom.xml index efa10135119b9..4ca5aa6816ebe 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/pom.xml +++ b/sdk/synapse/mgmt-v2019_06_01_preview/pom.xml @@ -11,11 +11,11 @@ com.microsoft.azure azure-arm-parent - 1.3.2 - ../../parents/azure-arm-parent/pom.xml + 1.1.0 + ../../../pom.management.xml azure-mgmt-synapse - 1.0.0-beta-3 + 1.0.0-beta jar Microsoft Azure SDK for Synapse Management This package contains Microsoft Synapse Management SDK. diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/AzureEntityResource.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/AzureEntityResource.java index 3192800bcec6b..53d42dbd20c13 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/AzureEntityResource.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/AzureEntityResource.java @@ -12,7 +12,8 @@ import com.microsoft.azure.ProxyResource; /** - * The resource model definition for a Azure Resource Manager resource with an + * Entity Resource. + * The resource model definition for an Azure Resource Manager resource with an * etag. */ public class AzureEntityResource extends ProxyResource { diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/BabylonConfiguration.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/BabylonConfiguration.java new file mode 100644 index 0000000000000..ae1f361375e4b --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/BabylonConfiguration.java @@ -0,0 +1,43 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Babylon Configuration. + */ +public class BabylonConfiguration { + /** + * Babylon Resource ID. + */ + @JsonProperty(value = "babylonResourceId") + private String babylonResourceId; + + /** + * Get babylon Resource ID. + * + * @return the babylonResourceId value + */ + public String babylonResourceId() { + return this.babylonResourceId; + } + + /** + * Set babylon Resource ID. + * + * @param babylonResourceId the babylonResourceId value to set + * @return the BabylonConfiguration object itself. + */ + public BabylonConfiguration withBabylonResourceId(String babylonResourceId) { + this.babylonResourceId = babylonResourceId; + return this; + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/BigDataPoolResourceInfo.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/BigDataPoolResourceInfo.java index 7e958a968b169..77685d96bc83a 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/BigDataPoolResourceInfo.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/BigDataPoolResourceInfo.java @@ -19,6 +19,7 @@ import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.SynapseManager; import java.util.Map; import org.joda.time.DateTime; +import java.util.List; /** * Type representing BigDataPoolResourceInfo. @@ -39,6 +40,11 @@ public interface BigDataPoolResourceInfo extends HasInner customLibraries(); + /** * @return the defaultSparkLogFolder value. */ @@ -89,6 +95,16 @@ public interface BigDataPoolResourceInfo extends HasInner customLibraries); + } + /** * The stage of the bigdatapoolresourceinfo definition allowing to specify DefaultSparkLogFolder. */ @@ -252,7 +280,7 @@ interface WithNodeCount { interface WithNodeSize { /** * Specifies nodeSize. - * @param nodeSize The level of compute power that each node in the Big Data pool has. Possible values include: 'None', 'Small', 'Medium', 'Large', 'XLarge', 'XXLarge' + * @param nodeSize The level of compute power that each node in the Big Data pool has. Possible values include: 'None', 'Small', 'Medium', 'Large', 'XLarge', 'XXLarge', 'XXXLarge' * @return the next definition stage */ WithCreate withNodeSize(NodeSize nodeSize); @@ -282,6 +310,30 @@ interface WithProvisioningState { WithCreate withProvisioningState(String provisioningState); } + /** + * The stage of the bigdatapoolresourceinfo definition allowing to specify SessionLevelPackagesEnabled. + */ + interface WithSessionLevelPackagesEnabled { + /** + * Specifies sessionLevelPackagesEnabled. + * @param sessionLevelPackagesEnabled Whether session level library/package management is enabled or not + * @return the next definition stage + */ + WithCreate withSessionLevelPackagesEnabled(Boolean sessionLevelPackagesEnabled); + } + + /** + * The stage of the bigdatapoolresourceinfo definition allowing to specify SparkConfigProperties. + */ + interface WithSparkConfigProperties { + /** + * Specifies sparkConfigProperties. + * @param sparkConfigProperties Spark configuration file to specify additional properties + * @return the next definition stage + */ + WithCreate withSparkConfigProperties(LibraryRequirements sparkConfigProperties); + } + /** * The stage of the bigdatapoolresourceinfo definition allowing to specify SparkEventsFolder. */ @@ -323,13 +375,13 @@ interface WithTags { * the resource to be created (via {@link WithCreate#create()}), but also allows * for any other optional settings to be specified. */ - interface WithCreate extends Creatable, DefinitionStages.WithAutoPause, DefinitionStages.WithAutoScale, DefinitionStages.WithCreationDate, DefinitionStages.WithDefaultSparkLogFolder, DefinitionStages.WithIsComputeIsolationEnabled, DefinitionStages.WithLibraryRequirements, DefinitionStages.WithNodeCount, DefinitionStages.WithNodeSize, DefinitionStages.WithNodeSizeFamily, DefinitionStages.WithProvisioningState, DefinitionStages.WithSparkEventsFolder, DefinitionStages.WithSparkVersion, DefinitionStages.WithTags { + interface WithCreate extends Creatable, DefinitionStages.WithAutoPause, DefinitionStages.WithAutoScale, DefinitionStages.WithCreationDate, DefinitionStages.WithCustomLibraries, DefinitionStages.WithDefaultSparkLogFolder, DefinitionStages.WithIsComputeIsolationEnabled, DefinitionStages.WithLibraryRequirements, DefinitionStages.WithNodeCount, DefinitionStages.WithNodeSize, DefinitionStages.WithNodeSizeFamily, DefinitionStages.WithProvisioningState, DefinitionStages.WithSessionLevelPackagesEnabled, DefinitionStages.WithSparkConfigProperties, DefinitionStages.WithSparkEventsFolder, DefinitionStages.WithSparkVersion, DefinitionStages.WithTags { } } /** * The template for a BigDataPoolResourceInfo update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, UpdateStages.WithForce, UpdateStages.WithAutoPause, UpdateStages.WithAutoScale, UpdateStages.WithCreationDate, UpdateStages.WithDefaultSparkLogFolder, UpdateStages.WithIsComputeIsolationEnabled, UpdateStages.WithLibraryRequirements, UpdateStages.WithNodeCount, UpdateStages.WithNodeSize, UpdateStages.WithNodeSizeFamily, UpdateStages.WithProvisioningState, UpdateStages.WithSparkEventsFolder, UpdateStages.WithSparkVersion, UpdateStages.WithTags { + interface Update extends Appliable, UpdateStages.WithForce, UpdateStages.WithAutoPause, UpdateStages.WithAutoScale, UpdateStages.WithCreationDate, UpdateStages.WithCustomLibraries, UpdateStages.WithDefaultSparkLogFolder, UpdateStages.WithIsComputeIsolationEnabled, UpdateStages.WithLibraryRequirements, UpdateStages.WithNodeCount, UpdateStages.WithNodeSize, UpdateStages.WithNodeSizeFamily, UpdateStages.WithProvisioningState, UpdateStages.WithSessionLevelPackagesEnabled, UpdateStages.WithSparkConfigProperties, UpdateStages.WithSparkEventsFolder, UpdateStages.WithSparkVersion, UpdateStages.WithTags { } /** @@ -384,6 +436,18 @@ interface WithCreationDate { Update withCreationDate(DateTime creationDate); } + /** + * The stage of the bigdatapoolresourceinfo update allowing to specify CustomLibraries. + */ + interface WithCustomLibraries { + /** + * Specifies customLibraries. + * @param customLibraries List of custom libraries/packages associated with the spark pool + * @return the next update stage + */ + Update withCustomLibraries(List customLibraries); + } + /** * The stage of the bigdatapoolresourceinfo update allowing to specify DefaultSparkLogFolder. */ @@ -438,7 +502,7 @@ interface WithNodeCount { interface WithNodeSize { /** * Specifies nodeSize. - * @param nodeSize The level of compute power that each node in the Big Data pool has. Possible values include: 'None', 'Small', 'Medium', 'Large', 'XLarge', 'XXLarge' + * @param nodeSize The level of compute power that each node in the Big Data pool has. Possible values include: 'None', 'Small', 'Medium', 'Large', 'XLarge', 'XXLarge', 'XXXLarge' * @return the next update stage */ Update withNodeSize(NodeSize nodeSize); @@ -468,6 +532,30 @@ interface WithProvisioningState { Update withProvisioningState(String provisioningState); } + /** + * The stage of the bigdatapoolresourceinfo update allowing to specify SessionLevelPackagesEnabled. + */ + interface WithSessionLevelPackagesEnabled { + /** + * Specifies sessionLevelPackagesEnabled. + * @param sessionLevelPackagesEnabled Whether session level library/package management is enabled or not + * @return the next update stage + */ + Update withSessionLevelPackagesEnabled(Boolean sessionLevelPackagesEnabled); + } + + /** + * The stage of the bigdatapoolresourceinfo update allowing to specify SparkConfigProperties. + */ + interface WithSparkConfigProperties { + /** + * Specifies sparkConfigProperties. + * @param sparkConfigProperties Spark configuration file to specify additional properties + * @return the next update stage + */ + Update withSparkConfigProperties(LibraryRequirements sparkConfigProperties); + } + /** * The stage of the bigdatapoolresourceinfo update allowing to specify SparkEventsFolder. */ diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/CustomerManagedKeyDetails.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/CustomerManagedKeyDetails.java new file mode 100644 index 0000000000000..bd6a85141d374 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/CustomerManagedKeyDetails.java @@ -0,0 +1,58 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details of the customer managed key associated with the workspace. + */ +public class CustomerManagedKeyDetails { + /** + * The customer managed key status on the workspace. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** + * The key object of the workspace. + */ + @JsonProperty(value = "key") + private WorkspaceKeyDetails key; + + /** + * Get the customer managed key status on the workspace. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Get the key object of the workspace. + * + * @return the key value + */ + public WorkspaceKeyDetails key() { + return this.key; + } + + /** + * Set the key object of the workspace. + * + * @param key the key value to set + * @return the CustomerManagedKeyDetails object itself. + */ + public CustomerManagedKeyDetails withKey(WorkspaceKeyDetails key) { + this.key = key; + return this; + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/DataMaskingFunction.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/DataMaskingFunction.java new file mode 100644 index 0000000000000..4a6e9b73d450e --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/DataMaskingFunction.java @@ -0,0 +1,65 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DataMaskingFunction. + */ +public enum DataMaskingFunction { + /** Enum value Default. */ + DEFAULT("Default"), + + /** Enum value CCN. */ + CCN("CCN"), + + /** Enum value Email. */ + EMAIL("Email"), + + /** Enum value Number. */ + NUMBER("Number"), + + /** Enum value SSN. */ + SSN("SSN"), + + /** Enum value Text. */ + TEXT("Text"); + + /** The actual serialized value for a DataMaskingFunction instance. */ + private String value; + + DataMaskingFunction(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DataMaskingFunction instance. + * + * @param value the serialized value to parse. + * @return the parsed DataMaskingFunction object, or null if unable to parse. + */ + @JsonCreator + public static DataMaskingFunction fromString(String value) { + DataMaskingFunction[] items = DataMaskingFunction.values(); + for (DataMaskingFunction item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/DataMaskingPolicies.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/DataMaskingPolicies.java new file mode 100644 index 0000000000000..cee7cad759a4e --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/DataMaskingPolicies.java @@ -0,0 +1,31 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Observable; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.DataMaskingPoliciesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing DataMaskingPolicies. + */ +public interface DataMaskingPolicies extends SupportsCreating, HasInner { + /** + * Gets a Sql pool data masking policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String workspaceName, String sqlPoolName); + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/DataMaskingPolicy.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/DataMaskingPolicy.java new file mode 100644 index 0000000000000..20c967f605ad8 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/DataMaskingPolicy.java @@ -0,0 +1,155 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.DataMaskingPolicyInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.SynapseManager; + +/** + * Type representing DataMaskingPolicy. + */ +public interface DataMaskingPolicy extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the applicationPrincipals value. + */ + String applicationPrincipals(); + + /** + * @return the dataMaskingState value. + */ + DataMaskingState dataMaskingState(); + + /** + * @return the exemptPrincipals value. + */ + String exemptPrincipals(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the kind value. + */ + String kind(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the maskingLevel value. + */ + String maskingLevel(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the DataMaskingPolicy definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithSqlPool, DefinitionStages.WithDataMaskingState, DefinitionStages.WithCreate { + } + + /** + * Grouping of DataMaskingPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DataMaskingPolicy definition. + */ + interface Blank extends WithSqlPool { + } + + /** + * The stage of the datamaskingpolicy definition allowing to specify SqlPool. + */ + interface WithSqlPool { + /** + * Specifies resourceGroupName, workspaceName, sqlPoolName. + * @param resourceGroupName The name of the resource group. The name is case insensitive + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @return the next definition stage + */ + WithDataMaskingState withExistingSqlPool(String resourceGroupName, String workspaceName, String sqlPoolName); + } + + /** + * The stage of the datamaskingpolicy definition allowing to specify DataMaskingState. + */ + interface WithDataMaskingState { + /** + * Specifies dataMaskingState. + * @param dataMaskingState The state of the data masking policy. Possible values include: 'Disabled', 'Enabled' + * @return the next definition stage + */ + WithCreate withDataMaskingState(DataMaskingState dataMaskingState); + } + + /** + * The stage of the datamaskingpolicy definition allowing to specify ExemptPrincipals. + */ + interface WithExemptPrincipals { + /** + * Specifies exemptPrincipals. + * @param exemptPrincipals The list of the exempt principals. Specifies the semicolon-separated list of database users for which the data masking policy does not apply. The specified users receive data results without masking for all of the database queries + * @return the next definition stage + */ + WithCreate withExemptPrincipals(String exemptPrincipals); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithExemptPrincipals { + } + } + /** + * The template for a DataMaskingPolicy update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithExemptPrincipals { + } + + /** + * Grouping of DataMaskingPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the datamaskingpolicy update allowing to specify ExemptPrincipals. + */ + interface WithExemptPrincipals { + /** + * Specifies exemptPrincipals. + * @param exemptPrincipals The list of the exempt principals. Specifies the semicolon-separated list of database users for which the data masking policy does not apply. The specified users receive data results without masking for all of the database queries + * @return the next update stage + */ + Update withExemptPrincipals(String exemptPrincipals); + } + + } +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/DataMaskingRule.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/DataMaskingRule.java new file mode 100644 index 0000000000000..17ab0aa74e1a1 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/DataMaskingRule.java @@ -0,0 +1,374 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.DataMaskingRuleInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.SynapseManager; + +/** + * Type representing DataMaskingRule. + */ +public interface DataMaskingRule extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the aliasName value. + */ + String aliasName(); + + /** + * @return the columnName value. + */ + String columnName(); + + /** + * @return the dataMaskingRuleId value. + */ + String dataMaskingRuleId(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the kind value. + */ + String kind(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the maskingFunction value. + */ + DataMaskingFunction maskingFunction(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the numberFrom value. + */ + String numberFrom(); + + /** + * @return the numberTo value. + */ + String numberTo(); + + /** + * @return the prefixSize value. + */ + String prefixSize(); + + /** + * @return the replacementString value. + */ + String replacementString(); + + /** + * @return the ruleState value. + */ + DataMaskingRuleState ruleState(); + + /** + * @return the schemaName value. + */ + String schemaName(); + + /** + * @return the suffixSize value. + */ + String suffixSize(); + + /** + * @return the tableName value. + */ + String tableName(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the DataMaskingRule definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDataMaskingPolicy, DefinitionStages.WithColumnName, DefinitionStages.WithMaskingFunction, DefinitionStages.WithSchemaName, DefinitionStages.WithTableName, DefinitionStages.WithCreate { + } + + /** + * Grouping of DataMaskingRule definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DataMaskingRule definition. + */ + interface Blank extends WithDataMaskingPolicy { + } + + /** + * The stage of the datamaskingrule definition allowing to specify DataMaskingPolicy. + */ + interface WithDataMaskingPolicy { + /** + * Specifies resourceGroupName, workspaceName, sqlPoolName. + * @param resourceGroupName The name of the resource group. The name is case insensitive + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @return the next definition stage + */ + WithColumnName withExistingDataMaskingPolicy(String resourceGroupName, String workspaceName, String sqlPoolName); + } + + /** + * The stage of the datamaskingrule definition allowing to specify ColumnName. + */ + interface WithColumnName { + /** + * Specifies columnName. + * @param columnName The column name on which the data masking rule is applied + * @return the next definition stage + */ + WithMaskingFunction withColumnName(String columnName); + } + + /** + * The stage of the datamaskingrule definition allowing to specify MaskingFunction. + */ + interface WithMaskingFunction { + /** + * Specifies maskingFunction. + * @param maskingFunction The masking function that is used for the data masking rule. Possible values include: 'Default', 'CCN', 'Email', 'Number', 'SSN', 'Text' + * @return the next definition stage + */ + WithSchemaName withMaskingFunction(DataMaskingFunction maskingFunction); + } + + /** + * The stage of the datamaskingrule definition allowing to specify SchemaName. + */ + interface WithSchemaName { + /** + * Specifies schemaName. + * @param schemaName The schema name on which the data masking rule is applied + * @return the next definition stage + */ + WithTableName withSchemaName(String schemaName); + } + + /** + * The stage of the datamaskingrule definition allowing to specify TableName. + */ + interface WithTableName { + /** + * Specifies tableName. + * @param tableName The table name on which the data masking rule is applied + * @return the next definition stage + */ + WithCreate withTableName(String tableName); + } + + /** + * The stage of the datamaskingrule definition allowing to specify AliasName. + */ + interface WithAliasName { + /** + * Specifies aliasName. + * @param aliasName The alias name. This is a legacy parameter and is no longer used + * @return the next definition stage + */ + WithCreate withAliasName(String aliasName); + } + + /** + * The stage of the datamaskingrule definition allowing to specify NumberFrom. + */ + interface WithNumberFrom { + /** + * Specifies numberFrom. + * @param numberFrom The numberFrom property of the masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored + * @return the next definition stage + */ + WithCreate withNumberFrom(String numberFrom); + } + + /** + * The stage of the datamaskingrule definition allowing to specify NumberTo. + */ + interface WithNumberTo { + /** + * Specifies numberTo. + * @param numberTo The numberTo property of the data masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored + * @return the next definition stage + */ + WithCreate withNumberTo(String numberTo); + } + + /** + * The stage of the datamaskingrule definition allowing to specify PrefixSize. + */ + interface WithPrefixSize { + /** + * Specifies prefixSize. + * @param prefixSize If maskingFunction is set to Text, the number of characters to show unmasked in the beginning of the string. Otherwise, this parameter will be ignored + * @return the next definition stage + */ + WithCreate withPrefixSize(String prefixSize); + } + + /** + * The stage of the datamaskingrule definition allowing to specify ReplacementString. + */ + interface WithReplacementString { + /** + * Specifies replacementString. + * @param replacementString If maskingFunction is set to Text, the character to use for masking the unexposed part of the string. Otherwise, this parameter will be ignored + * @return the next definition stage + */ + WithCreate withReplacementString(String replacementString); + } + + /** + * The stage of the datamaskingrule definition allowing to specify RuleState. + */ + interface WithRuleState { + /** + * Specifies ruleState. + * @param ruleState The rule state. Used to delete a rule. To delete an existing rule, specify the schemaName, tableName, columnName, maskingFunction, and specify ruleState as disabled. However, if the rule doesn't already exist, the rule will be created with ruleState set to enabled, regardless of the provided value of ruleState. Possible values include: 'Disabled', 'Enabled' + * @return the next definition stage + */ + WithCreate withRuleState(DataMaskingRuleState ruleState); + } + + /** + * The stage of the datamaskingrule definition allowing to specify SuffixSize. + */ + interface WithSuffixSize { + /** + * Specifies suffixSize. + * @param suffixSize If maskingFunction is set to Text, the number of characters to show unmasked at the end of the string. Otherwise, this parameter will be ignored + * @return the next definition stage + */ + WithCreate withSuffixSize(String suffixSize); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAliasName, DefinitionStages.WithNumberFrom, DefinitionStages.WithNumberTo, DefinitionStages.WithPrefixSize, DefinitionStages.WithReplacementString, DefinitionStages.WithRuleState, DefinitionStages.WithSuffixSize { + } + } + /** + * The template for a DataMaskingRule update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAliasName, UpdateStages.WithNumberFrom, UpdateStages.WithNumberTo, UpdateStages.WithPrefixSize, UpdateStages.WithReplacementString, UpdateStages.WithRuleState, UpdateStages.WithSuffixSize { + } + + /** + * Grouping of DataMaskingRule update stages. + */ + interface UpdateStages { + /** + * The stage of the datamaskingrule update allowing to specify AliasName. + */ + interface WithAliasName { + /** + * Specifies aliasName. + * @param aliasName The alias name. This is a legacy parameter and is no longer used + * @return the next update stage + */ + Update withAliasName(String aliasName); + } + + /** + * The stage of the datamaskingrule update allowing to specify NumberFrom. + */ + interface WithNumberFrom { + /** + * Specifies numberFrom. + * @param numberFrom The numberFrom property of the masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored + * @return the next update stage + */ + Update withNumberFrom(String numberFrom); + } + + /** + * The stage of the datamaskingrule update allowing to specify NumberTo. + */ + interface WithNumberTo { + /** + * Specifies numberTo. + * @param numberTo The numberTo property of the data masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored + * @return the next update stage + */ + Update withNumberTo(String numberTo); + } + + /** + * The stage of the datamaskingrule update allowing to specify PrefixSize. + */ + interface WithPrefixSize { + /** + * Specifies prefixSize. + * @param prefixSize If maskingFunction is set to Text, the number of characters to show unmasked in the beginning of the string. Otherwise, this parameter will be ignored + * @return the next update stage + */ + Update withPrefixSize(String prefixSize); + } + + /** + * The stage of the datamaskingrule update allowing to specify ReplacementString. + */ + interface WithReplacementString { + /** + * Specifies replacementString. + * @param replacementString If maskingFunction is set to Text, the character to use for masking the unexposed part of the string. Otherwise, this parameter will be ignored + * @return the next update stage + */ + Update withReplacementString(String replacementString); + } + + /** + * The stage of the datamaskingrule update allowing to specify RuleState. + */ + interface WithRuleState { + /** + * Specifies ruleState. + * @param ruleState The rule state. Used to delete a rule. To delete an existing rule, specify the schemaName, tableName, columnName, maskingFunction, and specify ruleState as disabled. However, if the rule doesn't already exist, the rule will be created with ruleState set to enabled, regardless of the provided value of ruleState. Possible values include: 'Disabled', 'Enabled' + * @return the next update stage + */ + Update withRuleState(DataMaskingRuleState ruleState); + } + + /** + * The stage of the datamaskingrule update allowing to specify SuffixSize. + */ + interface WithSuffixSize { + /** + * Specifies suffixSize. + * @param suffixSize If maskingFunction is set to Text, the number of characters to show unmasked at the end of the string. Otherwise, this parameter will be ignored + * @return the next update stage + */ + Update withSuffixSize(String suffixSize); + } + + } +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/DataMaskingRuleState.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/DataMaskingRuleState.java new file mode 100644 index 0000000000000..1674271be5901 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/DataMaskingRuleState.java @@ -0,0 +1,53 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DataMaskingRuleState. + */ +public enum DataMaskingRuleState { + /** Enum value Disabled. */ + DISABLED("Disabled"), + + /** Enum value Enabled. */ + ENABLED("Enabled"); + + /** The actual serialized value for a DataMaskingRuleState instance. */ + private String value; + + DataMaskingRuleState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DataMaskingRuleState instance. + * + * @param value the serialized value to parse. + * @return the parsed DataMaskingRuleState object, or null if unable to parse. + */ + @JsonCreator + public static DataMaskingRuleState fromString(String value) { + DataMaskingRuleState[] items = DataMaskingRuleState.values(); + for (DataMaskingRuleState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/DataMaskingRules.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/DataMaskingRules.java new file mode 100644 index 0000000000000..ccd46e38a907b --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/DataMaskingRules.java @@ -0,0 +1,31 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Observable; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.DataMaskingRulesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing DataMaskingRules. + */ +public interface DataMaskingRules extends SupportsCreating, HasInner { + /** + * Gets a list of Sql pool data masking rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listBySqlPoolAsync(String resourceGroupName, String workspaceName, String sqlPoolName); + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/DataMaskingState.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/DataMaskingState.java new file mode 100644 index 0000000000000..66372800542a8 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/DataMaskingState.java @@ -0,0 +1,53 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DataMaskingState. + */ +public enum DataMaskingState { + /** Enum value Disabled. */ + DISABLED("Disabled"), + + /** Enum value Enabled. */ + ENABLED("Enabled"); + + /** The actual serialized value for a DataMaskingState instance. */ + private String value; + + DataMaskingState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DataMaskingState instance. + * + * @param value the serialized value to parse. + * @return the parsed DataMaskingState object, or null if unable to parse. + */ + @JsonCreator + public static DataMaskingState fromString(String value) { + DataMaskingState[] items = DataMaskingState.values(); + for (DataMaskingState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/EncryptionDetails.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/EncryptionDetails.java new file mode 100644 index 0000000000000..71abf41034401 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/EncryptionDetails.java @@ -0,0 +1,58 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details of the encryption associated with the workspace. + */ +public class EncryptionDetails { + /** + * Double Encryption enabled. + */ + @JsonProperty(value = "doubleEncryptionEnabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean doubleEncryptionEnabled; + + /** + * Customer Managed Key Details. + */ + @JsonProperty(value = "cmk") + private CustomerManagedKeyDetails cmk; + + /** + * Get double Encryption enabled. + * + * @return the doubleEncryptionEnabled value + */ + public Boolean doubleEncryptionEnabled() { + return this.doubleEncryptionEnabled; + } + + /** + * Get customer Managed Key Details. + * + * @return the cmk value + */ + public CustomerManagedKeyDetails cmk() { + return this.cmk; + } + + /** + * Set customer Managed Key Details. + * + * @param cmk the cmk value to set + * @return the EncryptionDetails object itself. + */ + public EncryptionDetails withCmk(CustomerManagedKeyDetails cmk) { + this.cmk = cmk; + return this; + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ErrorContract.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ErrorContract.java new file mode 100644 index 0000000000000..287868d63e8cb --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ErrorContract.java @@ -0,0 +1,44 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error details. + * Contains details when the response code indicates an error. + */ +public class ErrorContract { + /** + * The error details. + */ + @JsonProperty(value = "error") + private ErrorResponse error; + + /** + * Get the error details. + * + * @return the error value + */ + public ErrorResponse error() { + return this.error; + } + + /** + * Set the error details. + * + * @param error the error value to set + * @return the ErrorContract object itself. + */ + public ErrorContract withError(ErrorResponse error) { + this.error = error; + return this; + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ErrorContractException.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ErrorContractException.java new file mode 100644 index 0000000000000..187d49c20de71 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ErrorContractException.java @@ -0,0 +1,44 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorContract information. + */ +public class ErrorContractException extends RestException { + /** + * Initializes a new instance of the ErrorContractException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorContractException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorContractException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorContractException(final String message, final Response response, final ErrorContract body) { + super(message, response, body); + } + + @Override + public ErrorContract body() { + return (ErrorContract) super.body(); + } +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ErrorResponse.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ErrorResponse.java index 2a28ac9492eb7..3d16e168a0822 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ErrorResponse.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ErrorResponse.java @@ -12,7 +12,10 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The resource management error response. + * Error Response. + * Common error response for all Azure Resource Manager APIs to return error + * details for failed operations. (This also follows the OData error response + * format.). */ public class ErrorResponse { /** diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ExtendedSqlPoolBlobAuditingPolicies.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ExtendedSqlPoolBlobAuditingPolicies.java new file mode 100644 index 0000000000000..c6f441c78a601 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ExtendedSqlPoolBlobAuditingPolicies.java @@ -0,0 +1,42 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Observable; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.ExtendedSqlPoolBlobAuditingPoliciesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ExtendedSqlPoolBlobAuditingPolicies. + */ +public interface ExtendedSqlPoolBlobAuditingPolicies extends SupportsCreating, HasInner { + /** + * Gets an extended Sql pool's blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Lists extended auditing settings of a Sql pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listBySqlPoolAsync(final String resourceGroupName, final String workspaceName, final String sqlPoolName); + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ExtendedSqlPoolBlobAuditingPolicy.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ExtendedSqlPoolBlobAuditingPolicy.java new file mode 100644 index 0000000000000..8baed87a7cc58 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ExtendedSqlPoolBlobAuditingPolicy.java @@ -0,0 +1,483 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.ExtendedSqlPoolBlobAuditingPolicyInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.SynapseManager; +import java.util.List; +import java.util.UUID; + +/** + * Type representing ExtendedSqlPoolBlobAuditingPolicy. + */ +public interface ExtendedSqlPoolBlobAuditingPolicy extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the auditActionsAndGroups value. + */ + List auditActionsAndGroups(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the isAzureMonitorTargetEnabled value. + */ + Boolean isAzureMonitorTargetEnabled(); + + /** + * @return the isStorageSecondaryKeyInUse value. + */ + Boolean isStorageSecondaryKeyInUse(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the predicateExpression value. + */ + String predicateExpression(); + + /** + * @return the queueDelayMs value. + */ + Integer queueDelayMs(); + + /** + * @return the retentionDays value. + */ + Integer retentionDays(); + + /** + * @return the state value. + */ + BlobAuditingPolicyState state(); + + /** + * @return the storageAccountAccessKey value. + */ + String storageAccountAccessKey(); + + /** + * @return the storageAccountSubscriptionId value. + */ + UUID storageAccountSubscriptionId(); + + /** + * @return the storageEndpoint value. + */ + String storageEndpoint(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the ExtendedSqlPoolBlobAuditingPolicy definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithSqlPool, DefinitionStages.WithState, DefinitionStages.WithCreate { + } + + /** + * Grouping of ExtendedSqlPoolBlobAuditingPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ExtendedSqlPoolBlobAuditingPolicy definition. + */ + interface Blank extends WithSqlPool { + } + + /** + * The stage of the extendedsqlpoolblobauditingpolicy definition allowing to specify SqlPool. + */ + interface WithSqlPool { + /** + * Specifies resourceGroupName, workspaceName, sqlPoolName. + * @param resourceGroupName The name of the resource group. The name is case insensitive + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @return the next definition stage + */ + WithState withExistingSqlPool(String resourceGroupName, String workspaceName, String sqlPoolName); + } + + /** + * The stage of the extendedsqlpoolblobauditingpolicy definition allowing to specify State. + */ + interface WithState { + /** + * Specifies state. + * @param state Specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'Enabled', 'Disabled' + * @return the next definition stage + */ + WithCreate withState(BlobAuditingPolicyState state); + } + + /** + * The stage of the extendedsqlpoolblobauditingpolicy definition allowing to specify AuditActionsAndGroups. + */ + interface WithAuditActionsAndGroups { + /** + * Specifies auditActionsAndGroups. + * @param auditActionsAndGroups Specifies the Actions-Groups and Actions to audit. + The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins: + BATCH_COMPLETED_GROUP, + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, + FAILED_DATABASE_AUTHENTICATION_GROUP. + This above combination is also the set that is configured by default when enabling auditing from the Azure portal. + The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records): + APPLICATION_ROLE_CHANGE_PASSWORD_GROUP + BACKUP_RESTORE_GROUP + DATABASE_LOGOUT_GROUP + DATABASE_OBJECT_CHANGE_GROUP + DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP + DATABASE_OBJECT_PERMISSION_CHANGE_GROUP + DATABASE_OPERATION_GROUP + DATABASE_PERMISSION_CHANGE_GROUP + DATABASE_PRINCIPAL_CHANGE_GROUP + DATABASE_PRINCIPAL_IMPERSONATION_GROUP + DATABASE_ROLE_MEMBER_CHANGE_GROUP + FAILED_DATABASE_AUTHENTICATION_GROUP + SCHEMA_OBJECT_ACCESS_GROUP + SCHEMA_OBJECT_CHANGE_GROUP + SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP + SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP + USER_CHANGE_PASSWORD_GROUP + BATCH_STARTED_GROUP + BATCH_COMPLETED_GROUP + These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. + For more information, see [Database-Level Audit Action Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). + For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are: + SELECT + UPDATE + INSERT + DELETE + EXECUTE + RECEIVE + REFERENCES + The general form for defining an action to be audited is: + {action} ON {object} BY {principal} + Note that <object> in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively. + For example: + SELECT on dbo.myTable by public + SELECT on DATABASE::myDatabase by public + SELECT on SCHEMA::mySchema by public + For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) + * @return the next definition stage + */ + WithCreate withAuditActionsAndGroups(List auditActionsAndGroups); + } + + /** + * The stage of the extendedsqlpoolblobauditingpolicy definition allowing to specify IsAzureMonitorTargetEnabled. + */ + interface WithIsAzureMonitorTargetEnabled { + /** + * Specifies isAzureMonitorTargetEnabled. + * @param isAzureMonitorTargetEnabled Specifies whether audit events are sent to Azure Monitor. + In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true. + When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. + Note that for server level audit you should use the 'master' database as {databaseName}. + Diagnostic Settings URI format: + PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview + For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207) + or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043) + * @return the next definition stage + */ + WithCreate withIsAzureMonitorTargetEnabled(Boolean isAzureMonitorTargetEnabled); + } + + /** + * The stage of the extendedsqlpoolblobauditingpolicy definition allowing to specify IsStorageSecondaryKeyInUse. + */ + interface WithIsStorageSecondaryKeyInUse { + /** + * Specifies isStorageSecondaryKeyInUse. + * @param isStorageSecondaryKeyInUse Specifies whether storageAccountAccessKey value is the storage's secondary key + * @return the next definition stage + */ + WithCreate withIsStorageSecondaryKeyInUse(Boolean isStorageSecondaryKeyInUse); + } + + /** + * The stage of the extendedsqlpoolblobauditingpolicy definition allowing to specify PredicateExpression. + */ + interface WithPredicateExpression { + /** + * Specifies predicateExpression. + * @param predicateExpression Specifies condition of where clause when creating an audit + * @return the next definition stage + */ + WithCreate withPredicateExpression(String predicateExpression); + } + + /** + * The stage of the extendedsqlpoolblobauditingpolicy definition allowing to specify QueueDelayMs. + */ + interface WithQueueDelayMs { + /** + * Specifies queueDelayMs. + * @param queueDelayMs Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed. + The default minimum value is 1000 (1 second). The maximum is 2,147,483,647 + * @return the next definition stage + */ + WithCreate withQueueDelayMs(Integer queueDelayMs); + } + + /** + * The stage of the extendedsqlpoolblobauditingpolicy definition allowing to specify RetentionDays. + */ + interface WithRetentionDays { + /** + * Specifies retentionDays. + * @param retentionDays Specifies the number of days to keep in the audit logs in the storage account + * @return the next definition stage + */ + WithCreate withRetentionDays(Integer retentionDays); + } + + /** + * The stage of the extendedsqlpoolblobauditingpolicy definition allowing to specify StorageAccountAccessKey. + */ + interface WithStorageAccountAccessKey { + /** + * Specifies storageAccountAccessKey. + * @param storageAccountAccessKey Specifies the identifier key of the auditing storage account. + If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage. + Prerequisites for using managed identity authentication: + 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). + 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity. + For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355) + * @return the next definition stage + */ + WithCreate withStorageAccountAccessKey(String storageAccountAccessKey); + } + + /** + * The stage of the extendedsqlpoolblobauditingpolicy definition allowing to specify StorageAccountSubscriptionId. + */ + interface WithStorageAccountSubscriptionId { + /** + * Specifies storageAccountSubscriptionId. + * @param storageAccountSubscriptionId Specifies the blob storage subscription Id + * @return the next definition stage + */ + WithCreate withStorageAccountSubscriptionId(UUID storageAccountSubscriptionId); + } + + /** + * The stage of the extendedsqlpoolblobauditingpolicy definition allowing to specify StorageEndpoint. + */ + interface WithStorageEndpoint { + /** + * Specifies storageEndpoint. + * @param storageEndpoint Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required + * @return the next definition stage + */ + WithCreate withStorageEndpoint(String storageEndpoint); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithAuditActionsAndGroups, DefinitionStages.WithIsAzureMonitorTargetEnabled, DefinitionStages.WithIsStorageSecondaryKeyInUse, DefinitionStages.WithPredicateExpression, DefinitionStages.WithQueueDelayMs, DefinitionStages.WithRetentionDays, DefinitionStages.WithStorageAccountAccessKey, DefinitionStages.WithStorageAccountSubscriptionId, DefinitionStages.WithStorageEndpoint { + } + } + /** + * The template for a ExtendedSqlPoolBlobAuditingPolicy update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAuditActionsAndGroups, UpdateStages.WithIsAzureMonitorTargetEnabled, UpdateStages.WithIsStorageSecondaryKeyInUse, UpdateStages.WithPredicateExpression, UpdateStages.WithQueueDelayMs, UpdateStages.WithRetentionDays, UpdateStages.WithStorageAccountAccessKey, UpdateStages.WithStorageAccountSubscriptionId, UpdateStages.WithStorageEndpoint { + } + + /** + * Grouping of ExtendedSqlPoolBlobAuditingPolicy update stages. + */ + interface UpdateStages { + /** + * The stage of the extendedsqlpoolblobauditingpolicy update allowing to specify AuditActionsAndGroups. + */ + interface WithAuditActionsAndGroups { + /** + * Specifies auditActionsAndGroups. + * @param auditActionsAndGroups Specifies the Actions-Groups and Actions to audit. + The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins: + BATCH_COMPLETED_GROUP, + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, + FAILED_DATABASE_AUTHENTICATION_GROUP. + This above combination is also the set that is configured by default when enabling auditing from the Azure portal. + The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records): + APPLICATION_ROLE_CHANGE_PASSWORD_GROUP + BACKUP_RESTORE_GROUP + DATABASE_LOGOUT_GROUP + DATABASE_OBJECT_CHANGE_GROUP + DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP + DATABASE_OBJECT_PERMISSION_CHANGE_GROUP + DATABASE_OPERATION_GROUP + DATABASE_PERMISSION_CHANGE_GROUP + DATABASE_PRINCIPAL_CHANGE_GROUP + DATABASE_PRINCIPAL_IMPERSONATION_GROUP + DATABASE_ROLE_MEMBER_CHANGE_GROUP + FAILED_DATABASE_AUTHENTICATION_GROUP + SCHEMA_OBJECT_ACCESS_GROUP + SCHEMA_OBJECT_CHANGE_GROUP + SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP + SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP + USER_CHANGE_PASSWORD_GROUP + BATCH_STARTED_GROUP + BATCH_COMPLETED_GROUP + These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. + For more information, see [Database-Level Audit Action Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). + For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are: + SELECT + UPDATE + INSERT + DELETE + EXECUTE + RECEIVE + REFERENCES + The general form for defining an action to be audited is: + {action} ON {object} BY {principal} + Note that <object> in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively. + For example: + SELECT on dbo.myTable by public + SELECT on DATABASE::myDatabase by public + SELECT on SCHEMA::mySchema by public + For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) + * @return the next update stage + */ + Update withAuditActionsAndGroups(List auditActionsAndGroups); + } + + /** + * The stage of the extendedsqlpoolblobauditingpolicy update allowing to specify IsAzureMonitorTargetEnabled. + */ + interface WithIsAzureMonitorTargetEnabled { + /** + * Specifies isAzureMonitorTargetEnabled. + * @param isAzureMonitorTargetEnabled Specifies whether audit events are sent to Azure Monitor. + In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true. + When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. + Note that for server level audit you should use the 'master' database as {databaseName}. + Diagnostic Settings URI format: + PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview + For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207) + or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043) + * @return the next update stage + */ + Update withIsAzureMonitorTargetEnabled(Boolean isAzureMonitorTargetEnabled); + } + + /** + * The stage of the extendedsqlpoolblobauditingpolicy update allowing to specify IsStorageSecondaryKeyInUse. + */ + interface WithIsStorageSecondaryKeyInUse { + /** + * Specifies isStorageSecondaryKeyInUse. + * @param isStorageSecondaryKeyInUse Specifies whether storageAccountAccessKey value is the storage's secondary key + * @return the next update stage + */ + Update withIsStorageSecondaryKeyInUse(Boolean isStorageSecondaryKeyInUse); + } + + /** + * The stage of the extendedsqlpoolblobauditingpolicy update allowing to specify PredicateExpression. + */ + interface WithPredicateExpression { + /** + * Specifies predicateExpression. + * @param predicateExpression Specifies condition of where clause when creating an audit + * @return the next update stage + */ + Update withPredicateExpression(String predicateExpression); + } + + /** + * The stage of the extendedsqlpoolblobauditingpolicy update allowing to specify QueueDelayMs. + */ + interface WithQueueDelayMs { + /** + * Specifies queueDelayMs. + * @param queueDelayMs Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed. + The default minimum value is 1000 (1 second). The maximum is 2,147,483,647 + * @return the next update stage + */ + Update withQueueDelayMs(Integer queueDelayMs); + } + + /** + * The stage of the extendedsqlpoolblobauditingpolicy update allowing to specify RetentionDays. + */ + interface WithRetentionDays { + /** + * Specifies retentionDays. + * @param retentionDays Specifies the number of days to keep in the audit logs in the storage account + * @return the next update stage + */ + Update withRetentionDays(Integer retentionDays); + } + + /** + * The stage of the extendedsqlpoolblobauditingpolicy update allowing to specify StorageAccountAccessKey. + */ + interface WithStorageAccountAccessKey { + /** + * Specifies storageAccountAccessKey. + * @param storageAccountAccessKey Specifies the identifier key of the auditing storage account. + If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage. + Prerequisites for using managed identity authentication: + 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). + 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity. + For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355) + * @return the next update stage + */ + Update withStorageAccountAccessKey(String storageAccountAccessKey); + } + + /** + * The stage of the extendedsqlpoolblobauditingpolicy update allowing to specify StorageAccountSubscriptionId. + */ + interface WithStorageAccountSubscriptionId { + /** + * Specifies storageAccountSubscriptionId. + * @param storageAccountSubscriptionId Specifies the blob storage subscription Id + * @return the next update stage + */ + Update withStorageAccountSubscriptionId(UUID storageAccountSubscriptionId); + } + + /** + * The stage of the extendedsqlpoolblobauditingpolicy update allowing to specify StorageEndpoint. + */ + interface WithStorageEndpoint { + /** + * Specifies storageEndpoint. + * @param storageEndpoint Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required + * @return the next update stage + */ + Update withStorageEndpoint(String storageEndpoint); + } + + } +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/IntegrationRuntimeMonitoringDatas.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/IntegrationRuntimeMonitoringDatas.java index 0638af0132321..b9e5ff36edabb 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/IntegrationRuntimeMonitoringDatas.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/IntegrationRuntimeMonitoringDatas.java @@ -26,6 +26,6 @@ public interface IntegrationRuntimeMonitoringDatas extends HasInner getAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName); + Observable listAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName); } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/IntegrationRuntimeObjectMetadatas.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/IntegrationRuntimeObjectMetadatas.java index e32dfdd70fb9e..79c93884a76c6 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/IntegrationRuntimeObjectMetadatas.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/IntegrationRuntimeObjectMetadatas.java @@ -26,7 +26,7 @@ public interface IntegrationRuntimeObjectMetadatas extends HasInner getAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName); + Observable listAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName); /** * Refresh integration runtime object metadata. diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/IntegrationRuntimes.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/IntegrationRuntimes.java index 7c369128b4143..354d4d4b325af 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/IntegrationRuntimes.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/IntegrationRuntimes.java @@ -54,6 +54,17 @@ public interface IntegrationRuntimes extends SupportsCreating, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the isActiveCMK value. + */ + Boolean isActiveCMK(); + + /** + * @return the keyVaultUrl value. + */ + String keyVaultUrl(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Key definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithWorkspace, DefinitionStages.WithCreate { + } + + /** + * Grouping of Key definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Key definition. + */ + interface Blank extends WithWorkspace { + } + + /** + * The stage of the key definition allowing to specify Workspace. + */ + interface WithWorkspace { + /** + * Specifies resourceGroupName, workspaceName. + * @param resourceGroupName The name of the resource group. The name is case insensitive + * @param workspaceName The name of the workspace + * @return the next definition stage + */ + WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName); + } + + /** + * The stage of the key definition allowing to specify IsActiveCMK. + */ + interface WithIsActiveCMK { + /** + * Specifies isActiveCMK. + * @param isActiveCMK Used to activate the workspace after a customer managed key is provided + * @return the next definition stage + */ + WithCreate withIsActiveCMK(Boolean isActiveCMK); + } + + /** + * The stage of the key definition allowing to specify KeyVaultUrl. + */ + interface WithKeyVaultUrl { + /** + * Specifies keyVaultUrl. + * @param keyVaultUrl The Key Vault Url of the workspace key + * @return the next definition stage + */ + WithCreate withKeyVaultUrl(String keyVaultUrl); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithIsActiveCMK, DefinitionStages.WithKeyVaultUrl { + } + } + /** + * The template for a Key update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithIsActiveCMK, UpdateStages.WithKeyVaultUrl { + } + + /** + * Grouping of Key update stages. + */ + interface UpdateStages { + /** + * The stage of the key update allowing to specify IsActiveCMK. + */ + interface WithIsActiveCMK { + /** + * Specifies isActiveCMK. + * @param isActiveCMK Used to activate the workspace after a customer managed key is provided + * @return the next update stage + */ + Update withIsActiveCMK(Boolean isActiveCMK); + } + + /** + * The stage of the key update allowing to specify KeyVaultUrl. + */ + interface WithKeyVaultUrl { + /** + * Specifies keyVaultUrl. + * @param keyVaultUrl The Key Vault Url of the workspace key + * @return the next update stage + */ + Update withKeyVaultUrl(String keyVaultUrl); + } + + } +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/Keys.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/Keys.java new file mode 100644 index 0000000000000..5c91e9f4a6269 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/Keys.java @@ -0,0 +1,53 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.KeysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Keys. + */ +public interface Keys extends SupportsCreating, HasInner { + /** + * Gets a workspace key. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param keyName The name of the workspace key + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String workspaceName, String keyName); + + /** + * Returns a list of keys in a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByWorkspaceAsync(final String resourceGroupName, final String workspaceName); + + /** + * Deletes a workspace key. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param keyName The name of the workspace key + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String workspaceName, String keyName); + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/LibraryInfo.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/LibraryInfo.java new file mode 100644 index 0000000000000..9f9a8dc03133e --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/LibraryInfo.java @@ -0,0 +1,179 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Information about a library/package created at the workspace level. + * Library/package information of a Big Data pool powered by Apache Spark. + */ +public class LibraryInfo { + /** + * Name of the library. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Storage blob path of library. + */ + @JsonProperty(value = "path") + private String path; + + /** + * Storage blob container name. + */ + @JsonProperty(value = "containerName") + private String containerName; + + /** + * The last update time of the library. + */ + @JsonProperty(value = "uploadedTimestamp") + private DateTime uploadedTimestamp; + + /** + * Type of the library. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Provisioning status of the library/package. + */ + @JsonProperty(value = "provisioningStatus", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningStatus; + + /** + * Creator Id of the library/package. + */ + @JsonProperty(value = "creatorId", access = JsonProperty.Access.WRITE_ONLY) + private String creatorId; + + /** + * Get name of the library. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the library. + * + * @param name the name value to set + * @return the LibraryInfo object itself. + */ + public LibraryInfo withName(String name) { + this.name = name; + return this; + } + + /** + * Get storage blob path of library. + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set storage blob path of library. + * + * @param path the path value to set + * @return the LibraryInfo object itself. + */ + public LibraryInfo withPath(String path) { + this.path = path; + return this; + } + + /** + * Get storage blob container name. + * + * @return the containerName value + */ + public String containerName() { + return this.containerName; + } + + /** + * Set storage blob container name. + * + * @param containerName the containerName value to set + * @return the LibraryInfo object itself. + */ + public LibraryInfo withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the last update time of the library. + * + * @return the uploadedTimestamp value + */ + public DateTime uploadedTimestamp() { + return this.uploadedTimestamp; + } + + /** + * Set the last update time of the library. + * + * @param uploadedTimestamp the uploadedTimestamp value to set + * @return the LibraryInfo object itself. + */ + public LibraryInfo withUploadedTimestamp(DateTime uploadedTimestamp) { + this.uploadedTimestamp = uploadedTimestamp; + return this; + } + + /** + * Get type of the library. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set type of the library. + * + * @param type the type value to set + * @return the LibraryInfo object itself. + */ + public LibraryInfo withType(String type) { + this.type = type; + return this; + } + + /** + * Get provisioning status of the library/package. + * + * @return the provisioningStatus value + */ + public String provisioningStatus() { + return this.provisioningStatus; + } + + /** + * Get creator Id of the library/package. + * + * @return the creatorId value + */ + public String creatorId() { + return this.creatorId; + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ManagedIdentity.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ManagedIdentity.java index 1943857a966fa..12cd7529ea578 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ManagedIdentity.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ManagedIdentity.java @@ -8,6 +8,7 @@ package com.microsoft.azure.management.synapse.v2019_06_01_preview; +import java.util.UUID; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -24,7 +25,7 @@ public class ManagedIdentity { * The tenant ID of the workspace managed identity. */ @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) - private String tenantId; + private UUID tenantId; /** * The type of managed identity for the workspace. Possible values include: @@ -47,7 +48,7 @@ public String principalId() { * * @return the tenantId value */ - public String tenantId() { + public UUID tenantId() { return this.tenantId; } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ManagedVirtualNetworkSettings.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ManagedVirtualNetworkSettings.java new file mode 100644 index 0000000000000..7026bf83a2e07 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ManagedVirtualNetworkSettings.java @@ -0,0 +1,96 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Managed Virtual Network Settings. + */ +public class ManagedVirtualNetworkSettings { + /** + * Prevent Data Exfiltration. + */ + @JsonProperty(value = "preventDataExfiltration") + private Boolean preventDataExfiltration; + + /** + * Linked Access Check On Target Resource. + */ + @JsonProperty(value = "linkedAccessCheckOnTargetResource") + private Boolean linkedAccessCheckOnTargetResource; + + /** + * Allowed Aad Tenant Ids For Linking. + */ + @JsonProperty(value = "allowedAadTenantIdsForLinking") + private List allowedAadTenantIdsForLinking; + + /** + * Get prevent Data Exfiltration. + * + * @return the preventDataExfiltration value + */ + public Boolean preventDataExfiltration() { + return this.preventDataExfiltration; + } + + /** + * Set prevent Data Exfiltration. + * + * @param preventDataExfiltration the preventDataExfiltration value to set + * @return the ManagedVirtualNetworkSettings object itself. + */ + public ManagedVirtualNetworkSettings withPreventDataExfiltration(Boolean preventDataExfiltration) { + this.preventDataExfiltration = preventDataExfiltration; + return this; + } + + /** + * Get linked Access Check On Target Resource. + * + * @return the linkedAccessCheckOnTargetResource value + */ + public Boolean linkedAccessCheckOnTargetResource() { + return this.linkedAccessCheckOnTargetResource; + } + + /** + * Set linked Access Check On Target Resource. + * + * @param linkedAccessCheckOnTargetResource the linkedAccessCheckOnTargetResource value to set + * @return the ManagedVirtualNetworkSettings object itself. + */ + public ManagedVirtualNetworkSettings withLinkedAccessCheckOnTargetResource(Boolean linkedAccessCheckOnTargetResource) { + this.linkedAccessCheckOnTargetResource = linkedAccessCheckOnTargetResource; + return this; + } + + /** + * Get allowed Aad Tenant Ids For Linking. + * + * @return the allowedAadTenantIdsForLinking value + */ + public List allowedAadTenantIdsForLinking() { + return this.allowedAadTenantIdsForLinking; + } + + /** + * Set allowed Aad Tenant Ids For Linking. + * + * @param allowedAadTenantIdsForLinking the allowedAadTenantIdsForLinking value to set + * @return the ManagedVirtualNetworkSettings object itself. + */ + public ManagedVirtualNetworkSettings withAllowedAadTenantIdsForLinking(List allowedAadTenantIdsForLinking) { + this.allowedAadTenantIdsForLinking = allowedAadTenantIdsForLinking; + return this; + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/MetadataSyncConfig.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/MetadataSyncConfig.java index c783f99492df6..1450e8a7a92f5 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/MetadataSyncConfig.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/MetadataSyncConfig.java @@ -32,6 +32,11 @@ public interface MetadataSyncConfig extends HasInner, H */ String name(); + /** + * @return the syncIntervalInMinutes value. + */ + Integer syncIntervalInMinutes(); + /** * @return the type value. */ diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/NodeSize.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/NodeSize.java index cb6f27c30786a..7d6ac544e88eb 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/NodeSize.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/NodeSize.java @@ -34,6 +34,9 @@ public final class NodeSize extends ExpandableStringEnum { /** Static value XXLarge for NodeSize. */ public static final NodeSize XXLARGE = fromString("XXLarge"); + /** Static value XXXLarge for NodeSize. */ + public static final NodeSize XXXLARGE = fromString("XXXLarge"); + /** * Creates or finds a NodeSize from its string representation. * @param name a name to look for diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/OperationResource.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/OperationResource.java new file mode 100644 index 0000000000000..cdb8aa72e68d3 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/OperationResource.java @@ -0,0 +1,63 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.OperationResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.SynapseManager; +import org.joda.time.DateTime; + +/** + * Type representing OperationResource. + */ +public interface OperationResource extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the endTime value. + */ + DateTime endTime(); + + /** + * @return the error value. + */ + ErrorDetail error(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the percentComplete value. + */ + Double percentComplete(); + + /** + * @return the properties value. + */ + Object properties(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + + /** + * @return the status value. + */ + OperationStatus status(); + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/Operations.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/Operations.java index 597bcb8889200..a2e09baf1e353 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/Operations.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/Operations.java @@ -8,18 +8,18 @@ package com.microsoft.azure.management.synapse.v2019_06_01_preview; -import rx.Completable; import rx.Observable; import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.OperationsInner; import com.microsoft.azure.arm.model.HasInner; +import rx.Completable; /** * Type representing Operations. */ public interface Operations extends HasInner { /** - * Get operation result. - * Get the result of an operation. + * Get operation status. + * Get the status of an operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace @@ -27,11 +27,11 @@ public interface Operations extends HasInner { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - Completable getLocationHeaderResultAsync(String resourceGroupName, String workspaceName, String operationId); + Observable getAzureAsyncHeaderResultAsync(String resourceGroupName, String workspaceName, String operationId); /** - * Get operation status. - * Get the status of an operation. + * Get operation result. + * Get the result of an operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace @@ -39,7 +39,7 @@ public interface Operations extends HasInner { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - Observable getAzureAsyncHeaderResultAsync(String resourceGroupName, String workspaceName, String operationId); + Completable getLocationHeaderResultAsync(String resourceGroupName, String workspaceName, String operationId); /** * Check name availability. diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/PrivateEndpointConnection.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/PrivateEndpointConnection.java index 7b5533899b9e1..15785b7bf5d58 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/PrivateEndpointConnection.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/PrivateEndpointConnection.java @@ -81,23 +81,71 @@ interface WithWorkspace { WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName); } + /** + * The stage of the privateendpointconnection definition allowing to specify PrivateEndpoint. + */ + interface WithPrivateEndpoint { + /** + * Specifies privateEndpoint. + * @param privateEndpoint The private endpoint which the connection belongs to + * @return the next definition stage + */ + WithCreate withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + + /** + * The stage of the privateendpointconnection definition allowing to specify PrivateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies privateLinkServiceConnectionState. + * @param privateLinkServiceConnectionState Connection state of the private endpoint connection + * @return the next definition stage + */ + WithCreate withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + /** * The stage of the definition which contains all the minimum required inputs for * the resource to be created (via {@link WithCreate#create()}), but also allows * for any other optional settings to be specified. */ - interface WithCreate extends Creatable { + interface WithCreate extends Creatable, DefinitionStages.WithPrivateEndpoint, DefinitionStages.WithPrivateLinkServiceConnectionState { } } /** * The template for a PrivateEndpointConnection update operation, containing all the settings that can be modified. */ - interface Update extends Appliable { + interface Update extends Appliable, UpdateStages.WithPrivateEndpoint, UpdateStages.WithPrivateLinkServiceConnectionState { } /** * Grouping of PrivateEndpointConnection update stages. */ interface UpdateStages { + /** + * The stage of the privateendpointconnection update allowing to specify PrivateEndpoint. + */ + interface WithPrivateEndpoint { + /** + * Specifies privateEndpoint. + * @param privateEndpoint The private endpoint which the connection belongs to + * @return the next update stage + */ + Update withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + + /** + * The stage of the privateendpointconnection update allowing to specify PrivateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies privateLinkServiceConnectionState. + * @param privateLinkServiceConnectionState Connection state of the private endpoint connection + * @return the next update stage + */ + Update withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + } } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/PrivateEndpointConnectionForPrivateLinkHub.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/PrivateEndpointConnectionForPrivateLinkHub.java new file mode 100644 index 0000000000000..9f0c284a5d553 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/PrivateEndpointConnectionForPrivateLinkHub.java @@ -0,0 +1,50 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.PrivateEndpointConnectionForPrivateLinkHubInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.SynapseManager; + +/** + * Type representing PrivateEndpointConnectionForPrivateLinkHub. + */ +public interface PrivateEndpointConnectionForPrivateLinkHub extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/PrivateEndpointConnectionForPrivateLinkHubBasic.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/PrivateEndpointConnectionForPrivateLinkHubBasic.java new file mode 100644 index 0000000000000..f081ce06d75ae --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/PrivateEndpointConnectionForPrivateLinkHubBasic.java @@ -0,0 +1,101 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Private Endpoint Connection For Private Link Hub - Basic. + */ +@JsonFlatten +public class PrivateEndpointConnectionForPrivateLinkHubBasic { + /** + * identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The private endpoint which the connection belongs to. + */ + @JsonProperty(value = "properties.privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /** + * Connection state of the private endpoint connection. + */ + @JsonProperty(value = "properties.privateLinkServiceConnectionState") + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /** + * Provisioning state of the private endpoint connection. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the private endpoint which the connection belongs to. + * + * @return the privateEndpoint value + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the private endpoint which the connection belongs to. + * + * @param privateEndpoint the privateEndpoint value to set + * @return the PrivateEndpointConnectionForPrivateLinkHubBasic object itself. + */ + public PrivateEndpointConnectionForPrivateLinkHubBasic withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get connection state of the private endpoint connection. + * + * @return the privateLinkServiceConnectionState value + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set connection state of the private endpoint connection. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set + * @return the PrivateEndpointConnectionForPrivateLinkHubBasic object itself. + */ + public PrivateEndpointConnectionForPrivateLinkHubBasic withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get provisioning state of the private endpoint connection. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/PrivateEndpointConnections.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/PrivateEndpointConnections.java index cacca47712439..c06d3e8c503d2 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/PrivateEndpointConnections.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/PrivateEndpointConnections.java @@ -22,7 +22,7 @@ public interface PrivateEndpointConnections extends SupportsCreating { + /** + * Get all PrivateEndpointConnections in the PrivateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String privateLinkHubName); + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/PrivateLinkHub.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/PrivateLinkHub.java index f6e25ca9ad078..f588e598bddff 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/PrivateLinkHub.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/PrivateLinkHub.java @@ -18,12 +18,18 @@ import com.microsoft.azure.arm.model.Creatable; import com.microsoft.azure.arm.resources.models.HasManager; import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.SynapseManager; +import java.util.List; import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.PrivateLinkHubInner; /** * Type representing PrivateLinkHub. */ public interface PrivateLinkHub extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + /** * @return the provisioningState value. */ @@ -51,23 +57,47 @@ interface Blank extends GroupableResourceCore.DefinitionWithRegion { interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { } + /** + * The stage of the privatelinkhub definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState PrivateLinkHub provisioning state + * @return the next definition stage + */ + WithCreate withProvisioningState(String provisioningState); + } + /** * The stage of the definition which contains all the minimum required inputs for * the resource to be created (via {@link WithCreate#create()}), but also allows * for any other optional settings to be specified. */ - interface WithCreate extends Creatable, Resource.DefinitionWithTags { + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithProvisioningState { } } /** * The template for a PrivateLinkHub update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, Resource.UpdateWithTags { + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithProvisioningState { } /** * Grouping of PrivateLinkHub update stages. */ interface UpdateStages { + /** + * The stage of the privatelinkhub update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState PrivateLinkHub provisioning state + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + } } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/PrivateLinkServiceConnectionState.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/PrivateLinkServiceConnectionState.java index b116211c768de..517ac0f0483b7 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/PrivateLinkServiceConnectionState.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/PrivateLinkServiceConnectionState.java @@ -15,8 +15,7 @@ */ public class PrivateLinkServiceConnectionState { /** - * The private link service connection status. Possible values include: - * 'Approved', 'Pending', 'Rejected', 'Disconnected'. + * The private link service connection status. */ @JsonProperty(value = "status") private String status; @@ -34,7 +33,7 @@ public class PrivateLinkServiceConnectionState { private String actionsRequired; /** - * Get the private link service connection status. Possible values include: 'Approved', 'Pending', 'Rejected', 'Disconnected'. + * Get the private link service connection status. * * @return the status value */ @@ -43,7 +42,7 @@ public String status() { } /** - * Set the private link service connection status. Possible values include: 'Approved', 'Pending', 'Rejected', 'Disconnected'. + * Set the private link service connection status. * * @param status the status value to set * @return the PrivateLinkServiceConnectionState object itself. diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ReplicationLink.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ReplicationLink.java index b63fceb5f9f72..2d8ad5b484a88 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ReplicationLink.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/ReplicationLink.java @@ -10,6 +10,8 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.ReplicationLinkInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; import com.microsoft.azure.arm.resources.models.HasManager; import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.SynapseManager; import org.joda.time.DateTime; @@ -17,7 +19,7 @@ /** * Type representing ReplicationLink. */ -public interface ReplicationLink extends HasInner, HasManager { +public interface ReplicationLink extends HasInner, Indexable, Refreshable, HasManager { /** * @return the id value. */ diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/RestorableDroppedSqlPool.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/RestorableDroppedSqlPool.java new file mode 100644 index 0000000000000..71f520166aa5a --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/RestorableDroppedSqlPool.java @@ -0,0 +1,83 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.RestorableDroppedSqlPoolInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.SynapseManager; +import org.joda.time.DateTime; + +/** + * Type representing RestorableDroppedSqlPool. + */ +public interface RestorableDroppedSqlPool extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the creationDate value. + */ + DateTime creationDate(); + + /** + * @return the databaseName value. + */ + String databaseName(); + + /** + * @return the deletionDate value. + */ + DateTime deletionDate(); + + /** + * @return the earliestRestoreDate value. + */ + DateTime earliestRestoreDate(); + + /** + * @return the edition value. + */ + String edition(); + + /** + * @return the elasticPoolName value. + */ + String elasticPoolName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the maxSizeBytes value. + */ + String maxSizeBytes(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the serviceLevelObjective value. + */ + String serviceLevelObjective(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/RestorableDroppedSqlPools.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/RestorableDroppedSqlPools.java new file mode 100644 index 0000000000000..11a266791b410 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/RestorableDroppedSqlPools.java @@ -0,0 +1,40 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.RestorableDroppedSqlPoolsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing RestorableDroppedSqlPools. + */ +public interface RestorableDroppedSqlPools extends HasInner { + /** + * Gets a deleted sql pool that can be restored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param restorableDroppedSqlPoolId The id of the deleted Sql Pool in the form of sqlPoolName,deletionTimeInFileTimeFormat + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String workspaceName, String restorableDroppedSqlPoolId); + + /** + * Gets a list of deleted Sql pools that can be restored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByWorkspaceAsync(String resourceGroupName, String workspaceName); + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/RestorePoint.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/RestorePoint.java index 3ff9a4bcab863..d099fb10d3096 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/RestorePoint.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/RestorePoint.java @@ -10,6 +10,8 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.RestorePointInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; import com.microsoft.azure.arm.resources.models.HasManager; import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.SynapseManager; import org.joda.time.DateTime; @@ -17,7 +19,7 @@ /** * Type representing RestorePoint. */ -public interface RestorePoint extends HasInner, HasManager { +public interface RestorePoint extends HasInner, Indexable, Refreshable, HasManager { /** * @return the earliestRestoreDate value. */ diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SelfHostedIntegrationRuntime.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SelfHostedIntegrationRuntime.java index 61782101fce75..f2f0962da01c6 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SelfHostedIntegrationRuntime.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SelfHostedIntegrationRuntime.java @@ -22,13 +22,13 @@ @JsonFlatten public class SelfHostedIntegrationRuntime extends IntegrationRuntimeInner { /** - * The linkedInfo property. + * Linked integration runtime type from data factory. */ @JsonProperty(value = "typeProperties.linkedInfo") private LinkedIntegrationRuntimeType linkedInfo; /** - * Get the linkedInfo value. + * Get linked integration runtime type from data factory. * * @return the linkedInfo value */ @@ -37,7 +37,7 @@ public LinkedIntegrationRuntimeType linkedInfo() { } /** - * Set the linkedInfo value. + * Set linked integration runtime type from data factory. * * @param linkedInfo the linkedInfo value to set * @return the SelfHostedIntegrationRuntime object itself. diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SelfHostedIntegrationRuntimeStatus.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SelfHostedIntegrationRuntimeStatus.java index c645847f185f9..8a763f7055920 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SelfHostedIntegrationRuntimeStatus.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SelfHostedIntegrationRuntimeStatus.java @@ -37,6 +37,12 @@ public class SelfHostedIntegrationRuntimeStatus extends IntegrationRuntimeStatus @JsonProperty(value = "typeProperties.taskQueueId", access = JsonProperty.Access.WRITE_ONLY) private String taskQueueId; + /** + * The node communication Channel encryption mode. + */ + @JsonProperty(value = "typeProperties.nodeCommunicationChannelEncryptionMode", access = JsonProperty.Access.WRITE_ONLY) + private String nodeCommunicationChannelEncryptionMode; + /** * It is used to set the encryption mode for node-node communication * channel (when more than 2 self-hosted integration runtime nodes exist). @@ -147,6 +153,15 @@ public String taskQueueId() { return this.taskQueueId; } + /** + * Get the node communication Channel encryption mode. + * + * @return the nodeCommunicationChannelEncryptionMode value + */ + public String nodeCommunicationChannelEncryptionMode() { + return this.nodeCommunicationChannelEncryptionMode; + } + /** * Get it is used to set the encryption mode for node-node communication channel (when more than 2 self-hosted integration runtime nodes exist). Possible values include: 'NotSet', 'SslEncrypted', 'NotEncrypted'. * diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SensitivityLabelSource.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SensitivityLabelSource.java new file mode 100644 index 0000000000000..95defd3060171 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SensitivityLabelSource.java @@ -0,0 +1,53 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for SensitivityLabelSource. + */ +public enum SensitivityLabelSource { + /** Enum value current. */ + CURRENT("current"), + + /** Enum value recommended. */ + RECOMMENDED("recommended"); + + /** The actual serialized value for a SensitivityLabelSource instance. */ + private String value; + + SensitivityLabelSource(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SensitivityLabelSource instance. + * + * @param value the serialized value to parse. + * @return the parsed SensitivityLabelSource object, or null if unable to parse. + */ + @JsonCreator + public static SensitivityLabelSource fromString(String value) { + SensitivityLabelSource[] items = SensitivityLabelSource.values(); + for (SensitivityLabelSource item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SensitivityLabels.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SensitivityLabels.java index 9245e242026a8..e9376e8bdcc09 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SensitivityLabels.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SensitivityLabels.java @@ -11,6 +11,7 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.SensitivityLabelInner; import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; import com.microsoft.azure.arm.model.Updatable; import com.microsoft.azure.arm.model.Appliable; import com.microsoft.azure.arm.model.Creatable; @@ -20,7 +21,7 @@ /** * Type representing SensitivityLabels. */ -public interface SensitivityLabels extends HasInner, Indexable, Updatable, HasManager { +public interface SensitivityLabels extends HasInner, Indexable, Refreshable, Updatable, HasManager { /** * @return the id value. */ diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolBlobAuditingPolicies.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolBlobAuditingPolicies.java index 5cef8463147af..8558c68c4627a 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolBlobAuditingPolicies.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolBlobAuditingPolicies.java @@ -29,4 +29,15 @@ public interface SqlPoolBlobAuditingPolicies extends SupportsCreating getAsync(String resourceGroupName, String workspaceName, String sqlPoolName); + /** + * Lists auditing settings of a Sql pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listBySqlPoolAsync(final String resourceGroupName, final String workspaceName, final String sqlPoolName); + } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolColumns.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolColumns.java new file mode 100644 index 0000000000000..f39101599fb1d --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolColumns.java @@ -0,0 +1,33 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.SqlPoolColumnsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing SqlPoolColumns. + */ +public interface SqlPoolColumns extends HasInner { + /** + * Get Sql pool column. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName, String columnName); + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolGeoBackupPolicies.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolGeoBackupPolicies.java index be115db17272b..9e375e8c45647 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolGeoBackupPolicies.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolGeoBackupPolicies.java @@ -28,4 +28,16 @@ public interface SqlPoolGeoBackupPolicies extends HasInner getAsync(String resourceGroupName, String workspaceName, String sqlPoolName); + /** + * List SQL pool geo backup policies. + * Get list of SQL pool geo backup policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String workspaceName, String sqlPoolName); + } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolMetadataSyncConfigs.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolMetadataSyncConfigs.java index ffc84546f2181..c0742a14541be 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolMetadataSyncConfigs.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolMetadataSyncConfigs.java @@ -9,6 +9,7 @@ package com.microsoft.azure.management.synapse.v2019_06_01_preview; import rx.Observable; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.MetadataSyncConfigInner; import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.SqlPoolMetadataSyncConfigsInner; import com.microsoft.azure.arm.model.HasInner; @@ -35,9 +36,10 @@ public interface SqlPoolMetadataSyncConfigs extends HasInner createAsync(String resourceGroupName, String workspaceName, String sqlPoolName); + Observable createAsync(String resourceGroupName, String workspaceName, String sqlPoolName, MetadataSyncConfigInner metadataSyncConfiguration); } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolReplicationLinks.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolReplicationLinks.java index 2c32107921f81..f9b1f7a1cc65e 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolReplicationLinks.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolReplicationLinks.java @@ -16,6 +16,19 @@ * Type representing SqlPoolReplicationLinks. */ public interface SqlPoolReplicationLinks extends HasInner { + /** + * Get SQL pool replication link by name. + * Get SQL pool replication link by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param linkId The ID of the replication link. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByNameAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String linkId); + /** * Get SQL pool replication links. * Lists a Sql pool's replication links. diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolRestorePoints.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolRestorePoints.java index b716e5c93ad9e..510a094dd9e86 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolRestorePoints.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolRestorePoints.java @@ -10,11 +10,24 @@ import rx.Observable; import com.microsoft.azure.management.synapse.v2019_06_01_preview.RestorePoint; +import rx.Completable; /** * Type representing SqlPoolRestorePoints. */ public interface SqlPoolRestorePoints { + /** + * Gets a restore point. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName); + /** * Get SQL pool backup. * Get SQL pool backup information. @@ -27,6 +40,18 @@ public interface SqlPoolRestorePoints { */ Observable listAsync(final String resourceGroupName, final String workspaceName, final String sqlPoolName); + /** + * Deletes a restore point. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName); + /** * Creates a restore point for a data warehouse. * diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolSchema.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolSchema.java index 6504d98fc769e..8e1d9d94a91d9 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolSchema.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolSchema.java @@ -10,13 +10,15 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.SqlPoolSchemaInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; import com.microsoft.azure.arm.resources.models.HasManager; import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.SynapseManager; /** * Type representing SqlPoolSchema. */ -public interface SqlPoolSchema extends HasInner, HasManager { +public interface SqlPoolSchema extends HasInner, Indexable, Refreshable, HasManager { /** * @return the id value. */ diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolSchemas.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolSchemas.java index 305216acd02fb..37d5652b58ddc 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolSchemas.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolSchemas.java @@ -16,6 +16,18 @@ * Type representing SqlPoolSchemas. */ public interface SqlPoolSchemas extends HasInner { + /** + * Get Sql Pool schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param schemaName The name of the schema. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName); + /** * Gets schemas of a given SQL pool. * Gets schemas of a given SQL pool. diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolSecurityAlertPolicies.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolSecurityAlertPolicies.java index 441b5e7755a84..68c2d873b81b3 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolSecurityAlertPolicies.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolSecurityAlertPolicies.java @@ -29,4 +29,16 @@ public interface SqlPoolSecurityAlertPolicies extends SupportsCreating getAsync(String resourceGroupName, String workspaceName, String sqlPoolName); + /** + * List Sql pool's security alert policies. + * Get a list of Sql pool's security alert policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String workspaceName, final String sqlPoolName); + } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolSensitivityLabels.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolSensitivityLabels.java index d10e7f9a5ac2e..758869545dbd2 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolSensitivityLabels.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolSensitivityLabels.java @@ -10,9 +10,9 @@ import com.microsoft.azure.arm.collection.SupportsCreating; import rx.Completable; +import rx.Observable; import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.SqlPoolSensitivityLabelsInner; import com.microsoft.azure.arm.model.HasInner; -import rx.Observable; import com.microsoft.azure.management.synapse.v2019_06_01_preview.CurrentSensitivityLabels; import com.microsoft.azure.management.synapse.v2019_06_01_preview.RecommendedSensitivityLabels; @@ -48,6 +48,21 @@ public interface SqlPoolSensitivityLabels extends SupportsCreating getAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName, String columnName, SensitivityLabelSource sensitivityLabelSource); + /** * Deletes the sensitivity label of a given column in a Sql pool. * diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolTable.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolTable.java index d0d429e92af5a..9eaaf9284bfd1 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolTable.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolTable.java @@ -10,13 +10,15 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.SqlPoolTableInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; import com.microsoft.azure.arm.resources.models.HasManager; import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.SynapseManager; /** * Type representing SqlPoolTable. */ -public interface SqlPoolTable extends HasInner, HasManager { +public interface SqlPoolTable extends HasInner, Indexable, Refreshable, HasManager { /** * @return the id value. */ diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolTableColumns.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolTableColumns.java index 538b1aae524d7..63bf4ea697ff7 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolTableColumns.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolTableColumns.java @@ -28,6 +28,6 @@ public interface SqlPoolTableColumns extends HasInner * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - Observable listByTableNameAsync(final String resourceGroupName, final String workspaceName, final String sqlPoolName, final String schemaName, final String tableName); + Observable listByTableNameAsync(final String resourceGroupName, final String workspaceName, final String sqlPoolName, final String schemaName, final String tableName); } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolTables.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolTables.java index 932c57ffdb3fc..01bc67c3f5dc5 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolTables.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolTables.java @@ -16,6 +16,19 @@ * Type representing SqlPoolTables. */ public interface SqlPoolTables extends HasInner { + /** + * Get Sql pool table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param schemaName The name of the schema. + * @param tableName The name of the table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName); + /** * Gets tables of a given schema in a SQL pool. * Gets tables of a given schema in a SQL pool. diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolVulnerabilityAssessmentRuleBaseline.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolVulnerabilityAssessmentRuleBaseline.java index 1af51739a8923..0f6d09f407b78 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolVulnerabilityAssessmentRuleBaseline.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolVulnerabilityAssessmentRuleBaseline.java @@ -11,6 +11,7 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.SqlPoolVulnerabilityAssessmentRuleBaselineInner; import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; import com.microsoft.azure.arm.model.Updatable; import com.microsoft.azure.arm.model.Appliable; import com.microsoft.azure.arm.model.Creatable; @@ -21,7 +22,7 @@ /** * Type representing SqlPoolVulnerabilityAssessmentRuleBaseline. */ -public interface SqlPoolVulnerabilityAssessmentRuleBaseline extends HasInner, Indexable, Updatable, HasManager { +public interface SqlPoolVulnerabilityAssessmentRuleBaseline extends HasInner, Indexable, Refreshable, Updatable, HasManager { /** * @return the baselineResults value. */ diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolVulnerabilityAssessmentRuleBaselines.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolVulnerabilityAssessmentRuleBaselines.java index df4dc73346a49..1ecd8289edf4f 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolVulnerabilityAssessmentRuleBaselines.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolVulnerabilityAssessmentRuleBaselines.java @@ -8,6 +8,7 @@ package com.microsoft.azure.management.synapse.v2019_06_01_preview; +import rx.Observable; import rx.Completable; /** @@ -21,6 +22,19 @@ public interface SqlPoolVulnerabilityAssessmentRuleBaselines { */ SqlPoolVulnerabilityAssessmentRuleBaseline.DefinitionStages.Blank defineBaseline(String name); + /** + * Gets a SqlPool's vulnerability assessment rule baseline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param ruleId The vulnerability assessment rule ID. + * @param baselineName The name of the vulnerability assessment rule baseline (default implies a baseline on a Sql pool level rule and master for server level rule). Possible values include: 'master', 'default' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String ruleId, VulnerabilityAssessmentPolicyBaselineName baselineName); + /** * Removes the database's vulnerability assessment rule baseline. * diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolVulnerabilityAssessmentScans.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolVulnerabilityAssessmentScans.java index 0e9b8628b379d..33be3673d5f6d 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolVulnerabilityAssessmentScans.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/SqlPoolVulnerabilityAssessmentScans.java @@ -41,6 +41,18 @@ public interface SqlPoolVulnerabilityAssessmentScans extends HasInner exportAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String scanId); + /** + * Gets a vulnerability assessment scan record of a Sql pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String scanId); + /** * Lists the vulnerability assessment scans of a SQL pool. * Lists the vulnerability assessment scans of a SQL pool. diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/TableSchemaSqlPoolWorkspaceSqlPoolColumn.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/TableSchemaSqlPoolWorkspaceSqlPoolColumn.java new file mode 100644 index 0000000000000..13723f6bc94a9 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/TableSchemaSqlPoolWorkspaceSqlPoolColumn.java @@ -0,0 +1,40 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.SqlPoolColumnInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.SynapseManager; + +/** + * Type representing TableSchemaSqlPoolWorkspaceSqlPoolColumn. + */ +public interface TableSchemaSqlPoolWorkspaceSqlPoolColumn extends HasInner, HasManager { + /** + * @return the columnType value. + */ + ColumnDataType columnType(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/TableSchemaSqlPoolWorkspaceSqlPoolColumnModel.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/TableSchemaSqlPoolWorkspaceSqlPoolColumnModel.java new file mode 100644 index 0000000000000..8e8f640a5a5b2 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/TableSchemaSqlPoolWorkspaceSqlPoolColumnModel.java @@ -0,0 +1,42 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.SqlPoolColumnInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.SynapseManager; + +/** + * Type representing TableSchemaSqlPoolWorkspaceSqlPoolColumnModel. + */ +public interface TableSchemaSqlPoolWorkspaceSqlPoolColumnModel extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the columnType value. + */ + ColumnDataType columnType(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/VulnerabilityAssessmentScanRecord.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/VulnerabilityAssessmentScanRecord.java index f9aab1299fc62..49f0852256a08 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/VulnerabilityAssessmentScanRecord.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/VulnerabilityAssessmentScanRecord.java @@ -10,6 +10,8 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.VulnerabilityAssessmentScanRecordInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; import com.microsoft.azure.arm.resources.models.HasManager; import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.SynapseManager; import org.joda.time.DateTime; @@ -18,7 +20,7 @@ /** * Type representing VulnerabilityAssessmentScanRecord. */ -public interface VulnerabilityAssessmentScanRecord extends HasInner, HasManager { +public interface VulnerabilityAssessmentScanRecord extends HasInner, Indexable, Refreshable, HasManager { /** * @return the endTime value. */ diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/Workspace.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/Workspace.java index 9b0311acc36d4..5d8e5960c2ba2 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/Workspace.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/Workspace.java @@ -20,6 +20,7 @@ import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.SynapseManager; import java.util.Map; import java.util.List; +import java.util.UUID; import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.PrivateEndpointConnectionInner; import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.WorkspaceInner; @@ -27,6 +28,11 @@ * Type representing Workspace. */ public interface Workspace extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the babylonConfiguration value. + */ + BabylonConfiguration babylonConfiguration(); + /** * @return the connectivityEndpoints value. */ @@ -37,6 +43,11 @@ public interface Workspace extends HasInner, Resource, Groupable */ DataLakeStorageAccountDetails defaultDataLakeStorage(); + /** + * @return the encryption value. + */ + EncryptionDetails encryption(); + /** * @return the extraProperties value. */ @@ -57,6 +68,11 @@ public interface Workspace extends HasInner, Resource, Groupable */ String managedVirtualNetwork(); + /** + * @return the managedVirtualNetworkSettings value. + */ + ManagedVirtualNetworkSettings managedVirtualNetworkSettings(); + /** * @return the privateEndpointConnections value. */ @@ -82,6 +98,11 @@ public interface Workspace extends HasInner, Resource, Groupable */ VirtualNetworkProfile virtualNetworkProfile(); + /** + * @return the workspaceUID value. + */ + UUID workspaceUID(); + /** * The entirety of the Workspace definition. */ @@ -104,6 +125,18 @@ interface Blank extends GroupableResourceCore.DefinitionWithRegion { interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { } + /** + * The stage of the workspace definition allowing to specify BabylonConfiguration. + */ + interface WithBabylonConfiguration { + /** + * Specifies babylonConfiguration. + * @param babylonConfiguration Babylon Configuration + * @return the next definition stage + */ + WithCreate withBabylonConfiguration(BabylonConfiguration babylonConfiguration); + } + /** * The stage of the workspace definition allowing to specify ConnectivityEndpoints. */ @@ -128,6 +161,18 @@ interface WithDefaultDataLakeStorage { WithCreate withDefaultDataLakeStorage(DataLakeStorageAccountDetails defaultDataLakeStorage); } + /** + * The stage of the workspace definition allowing to specify Encryption. + */ + interface WithEncryption { + /** + * Specifies encryption. + * @param encryption The encryption details of the workspace + * @return the next definition stage + */ + WithCreate withEncryption(EncryptionDetails encryption); + } + /** * The stage of the workspace definition allowing to specify Identity. */ @@ -164,6 +209,18 @@ interface WithManagedVirtualNetwork { WithCreate withManagedVirtualNetwork(String managedVirtualNetwork); } + /** + * The stage of the workspace definition allowing to specify ManagedVirtualNetworkSettings. + */ + interface WithManagedVirtualNetworkSettings { + /** + * Specifies managedVirtualNetworkSettings. + * @param managedVirtualNetworkSettings Managed Virtual Network Settings + * @return the next definition stage + */ + WithCreate withManagedVirtualNetworkSettings(ManagedVirtualNetworkSettings managedVirtualNetworkSettings); + } + /** * The stage of the workspace definition allowing to specify PrivateEndpointConnections. */ @@ -217,19 +274,31 @@ interface WithVirtualNetworkProfile { * the resource to be created (via {@link WithCreate#create()}), but also allows * for any other optional settings to be specified. */ - interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithConnectivityEndpoints, DefinitionStages.WithDefaultDataLakeStorage, DefinitionStages.WithIdentity, DefinitionStages.WithManagedResourceGroupName, DefinitionStages.WithManagedVirtualNetwork, DefinitionStages.WithPrivateEndpointConnections, DefinitionStages.WithSqlAdministratorLogin, DefinitionStages.WithSqlAdministratorLoginPassword, DefinitionStages.WithVirtualNetworkProfile { + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithBabylonConfiguration, DefinitionStages.WithConnectivityEndpoints, DefinitionStages.WithDefaultDataLakeStorage, DefinitionStages.WithEncryption, DefinitionStages.WithIdentity, DefinitionStages.WithManagedResourceGroupName, DefinitionStages.WithManagedVirtualNetwork, DefinitionStages.WithManagedVirtualNetworkSettings, DefinitionStages.WithPrivateEndpointConnections, DefinitionStages.WithSqlAdministratorLogin, DefinitionStages.WithSqlAdministratorLoginPassword, DefinitionStages.WithVirtualNetworkProfile { } } /** * The template for a Workspace update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithIdentity, UpdateStages.WithSqlAdministratorLoginPassword { + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithBabylonConfiguration, UpdateStages.WithIdentity, UpdateStages.WithManagedVirtualNetworkSettings, UpdateStages.WithSqlAdministratorLoginPassword { } /** * Grouping of Workspace update stages. */ interface UpdateStages { + /** + * The stage of the workspace update allowing to specify BabylonConfiguration. + */ + interface WithBabylonConfiguration { + /** + * Specifies babylonConfiguration. + * @param babylonConfiguration Babylon Configuration + * @return the next update stage + */ + Update withBabylonConfiguration(BabylonConfiguration babylonConfiguration); + } + /** * The stage of the workspace update allowing to specify Identity. */ @@ -242,6 +311,18 @@ interface WithIdentity { Update withIdentity(ManagedIdentity identity); } + /** + * The stage of the workspace update allowing to specify ManagedVirtualNetworkSettings. + */ + interface WithManagedVirtualNetworkSettings { + /** + * Specifies managedVirtualNetworkSettings. + * @param managedVirtualNetworkSettings Managed Virtual Network Settings + * @return the next update stage + */ + Update withManagedVirtualNetworkSettings(ManagedVirtualNetworkSettings managedVirtualNetworkSettings); + } + /** * The stage of the workspace update allowing to specify SqlAdministratorLoginPassword. */ diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/WorkspaceKeyDetails.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/WorkspaceKeyDetails.java new file mode 100644 index 0000000000000..f6ff614e6f429 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/WorkspaceKeyDetails.java @@ -0,0 +1,69 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Details of the customer managed key associated with the workspace. + */ +public class WorkspaceKeyDetails { + /** + * Workspace Key sub-resource name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Workspace Key sub-resource key vault url. + */ + @JsonProperty(value = "keyVaultUrl") + private String keyVaultUrl; + + /** + * Get workspace Key sub-resource name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set workspace Key sub-resource name. + * + * @param name the name value to set + * @return the WorkspaceKeyDetails object itself. + */ + public WorkspaceKeyDetails withName(String name) { + this.name = name; + return this; + } + + /** + * Get workspace Key sub-resource key vault url. + * + * @return the keyVaultUrl value + */ + public String keyVaultUrl() { + return this.keyVaultUrl; + } + + /** + * Set workspace Key sub-resource key vault url. + * + * @param keyVaultUrl the keyVaultUrl value to set + * @return the WorkspaceKeyDetails object itself. + */ + public WorkspaceKeyDetails withKeyVaultUrl(String keyVaultUrl) { + this.keyVaultUrl = keyVaultUrl; + return this; + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/WorkspacePatchInfo.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/WorkspacePatchInfo.java index 4d89adbee0290..2bd4e1312ad3b 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/WorkspacePatchInfo.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/WorkspacePatchInfo.java @@ -35,6 +35,18 @@ public class WorkspacePatchInfo { @JsonProperty(value = "properties.sqlAdministratorLoginPassword") private String sqlAdministratorLoginPassword; + /** + * Managed Virtual Network Settings. + */ + @JsonProperty(value = "properties.managedVirtualNetworkSettings") + private ManagedVirtualNetworkSettings managedVirtualNetworkSettings; + + /** + * Babylon Configuration. + */ + @JsonProperty(value = "properties.babylonConfiguration") + private BabylonConfiguration babylonConfiguration; + /** * Resource provisioning state. */ @@ -101,6 +113,46 @@ public WorkspacePatchInfo withSqlAdministratorLoginPassword(String sqlAdministra return this; } + /** + * Get managed Virtual Network Settings. + * + * @return the managedVirtualNetworkSettings value + */ + public ManagedVirtualNetworkSettings managedVirtualNetworkSettings() { + return this.managedVirtualNetworkSettings; + } + + /** + * Set managed Virtual Network Settings. + * + * @param managedVirtualNetworkSettings the managedVirtualNetworkSettings value to set + * @return the WorkspacePatchInfo object itself. + */ + public WorkspacePatchInfo withManagedVirtualNetworkSettings(ManagedVirtualNetworkSettings managedVirtualNetworkSettings) { + this.managedVirtualNetworkSettings = managedVirtualNetworkSettings; + return this; + } + + /** + * Get babylon Configuration. + * + * @return the babylonConfiguration value + */ + public BabylonConfiguration babylonConfiguration() { + return this.babylonConfiguration; + } + + /** + * Set babylon Configuration. + * + * @param babylonConfiguration the babylonConfiguration value to set + * @return the WorkspacePatchInfo object itself. + */ + public WorkspacePatchInfo withBabylonConfiguration(BabylonConfiguration babylonConfiguration) { + this.babylonConfiguration = babylonConfiguration; + return this; + } + /** * Get resource provisioning state. * diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/WorkspaceSqlAadAdmins.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/WorkspaceSqlAadAdmins.java new file mode 100644 index 0000000000000..3283847c4681b --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/WorkspaceSqlAadAdmins.java @@ -0,0 +1,52 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview; + +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.WorkspaceAadAdminInfoInner; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation.WorkspaceSqlAadAdminsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing WorkspaceSqlAadAdmins. + */ +public interface WorkspaceSqlAadAdmins extends HasInner { + /** + * Gets a workspace SQL active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String workspaceName); + + /** + * Creates or updates a workspace SQL active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param aadAdminInfo Workspace active directory administrator properties + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable createOrUpdateAsync(String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo); + + /** + * Deletes a workspace SQL active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String workspaceName); + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/BigDataPoolResourceInfoImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/BigDataPoolResourceInfoImpl.java index 25d7df094440b..bb1157e5b36d4 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/BigDataPoolResourceInfoImpl.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/BigDataPoolResourceInfoImpl.java @@ -16,6 +16,8 @@ import org.joda.time.DateTime; import com.microsoft.azure.management.synapse.v2019_06_01_preview.AutoPauseProperties; import com.microsoft.azure.management.synapse.v2019_06_01_preview.LibraryRequirements; +import java.util.List; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.LibraryInfo; import com.microsoft.azure.management.synapse.v2019_06_01_preview.NodeSize; import com.microsoft.azure.management.synapse.v2019_06_01_preview.NodeSizeFamily; @@ -93,6 +95,11 @@ public DateTime creationDate() { return this.inner().creationDate(); } + @Override + public List customLibraries() { + return this.inner().customLibraries(); + } + @Override public String defaultSparkLogFolder() { return this.inner().defaultSparkLogFolder(); @@ -143,6 +150,16 @@ public String provisioningState() { return this.inner().provisioningState(); } + @Override + public Boolean sessionLevelPackagesEnabled() { + return this.inner().sessionLevelPackagesEnabled(); + } + + @Override + public LibraryRequirements sparkConfigProperties() { + return this.inner().sparkConfigProperties(); + } + @Override public String sparkEventsFolder() { return this.inner().sparkEventsFolder(); @@ -204,6 +221,12 @@ public BigDataPoolResourceInfoImpl withCreationDate(DateTime creationDate) { return this; } + @Override + public BigDataPoolResourceInfoImpl withCustomLibraries(List customLibraries) { + this.inner().withCustomLibraries(customLibraries); + return this; + } + @Override public BigDataPoolResourceInfoImpl withDefaultSparkLogFolder(String defaultSparkLogFolder) { this.inner().withDefaultSparkLogFolder(defaultSparkLogFolder); @@ -246,6 +269,18 @@ public BigDataPoolResourceInfoImpl withProvisioningState(String provisioningStat return this; } + @Override + public BigDataPoolResourceInfoImpl withSessionLevelPackagesEnabled(Boolean sessionLevelPackagesEnabled) { + this.inner().withSessionLevelPackagesEnabled(sessionLevelPackagesEnabled); + return this; + } + + @Override + public BigDataPoolResourceInfoImpl withSparkConfigProperties(LibraryRequirements sparkConfigProperties) { + this.inner().withSparkConfigProperties(sparkConfigProperties); + return this; + } + @Override public BigDataPoolResourceInfoImpl withSparkEventsFolder(String sparkEventsFolder) { this.inner().withSparkEventsFolder(sparkEventsFolder); diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/BigDataPoolResourceInfoInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/BigDataPoolResourceInfoInner.java index cb2304be4b50b..16dd827f4f403 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/BigDataPoolResourceInfoInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/BigDataPoolResourceInfoInner.java @@ -12,6 +12,8 @@ import org.joda.time.DateTime; import com.microsoft.azure.management.synapse.v2019_06_01_preview.AutoPauseProperties; import com.microsoft.azure.management.synapse.v2019_06_01_preview.LibraryRequirements; +import java.util.List; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.LibraryInfo; import com.microsoft.azure.management.synapse.v2019_06_01_preview.NodeSize; import com.microsoft.azure.management.synapse.v2019_06_01_preview.NodeSizeFamily; import com.fasterxml.jackson.annotation.JsonProperty; @@ -54,6 +56,12 @@ public class BigDataPoolResourceInfoInner extends Resource { @JsonProperty(value = "properties.isComputeIsolationEnabled") private Boolean isComputeIsolationEnabled; + /** + * Whether session level library/package management is enabled or not. + */ + @JsonProperty(value = "properties.sessionLevelPackagesEnabled") + private Boolean sessionLevelPackagesEnabled; + /** * The Spark events folder. */ @@ -72,6 +80,18 @@ public class BigDataPoolResourceInfoInner extends Resource { @JsonProperty(value = "properties.libraryRequirements") private LibraryRequirements libraryRequirements; + /** + * List of custom libraries/packages associated with the spark pool. + */ + @JsonProperty(value = "properties.customLibraries") + private List customLibraries; + + /** + * Spark configuration file to specify additional properties. + */ + @JsonProperty(value = "properties.sparkConfigProperties") + private LibraryRequirements sparkConfigProperties; + /** * The Apache Spark version. */ @@ -87,7 +107,7 @@ public class BigDataPoolResourceInfoInner extends Resource { /** * The level of compute power that each node in the Big Data pool has. * Possible values include: 'None', 'Small', 'Medium', 'Large', 'XLarge', - * 'XXLarge'. + * 'XXLarge', 'XXXLarge'. */ @JsonProperty(value = "properties.nodeSize") private NodeSize nodeSize; @@ -199,6 +219,26 @@ public BigDataPoolResourceInfoInner withIsComputeIsolationEnabled(Boolean isComp return this; } + /** + * Get whether session level library/package management is enabled or not. + * + * @return the sessionLevelPackagesEnabled value + */ + public Boolean sessionLevelPackagesEnabled() { + return this.sessionLevelPackagesEnabled; + } + + /** + * Set whether session level library/package management is enabled or not. + * + * @param sessionLevelPackagesEnabled the sessionLevelPackagesEnabled value to set + * @return the BigDataPoolResourceInfoInner object itself. + */ + public BigDataPoolResourceInfoInner withSessionLevelPackagesEnabled(Boolean sessionLevelPackagesEnabled) { + this.sessionLevelPackagesEnabled = sessionLevelPackagesEnabled; + return this; + } + /** * Get the Spark events folder. * @@ -259,6 +299,46 @@ public BigDataPoolResourceInfoInner withLibraryRequirements(LibraryRequirements return this; } + /** + * Get list of custom libraries/packages associated with the spark pool. + * + * @return the customLibraries value + */ + public List customLibraries() { + return this.customLibraries; + } + + /** + * Set list of custom libraries/packages associated with the spark pool. + * + * @param customLibraries the customLibraries value to set + * @return the BigDataPoolResourceInfoInner object itself. + */ + public BigDataPoolResourceInfoInner withCustomLibraries(List customLibraries) { + this.customLibraries = customLibraries; + return this; + } + + /** + * Get spark configuration file to specify additional properties. + * + * @return the sparkConfigProperties value + */ + public LibraryRequirements sparkConfigProperties() { + return this.sparkConfigProperties; + } + + /** + * Set spark configuration file to specify additional properties. + * + * @param sparkConfigProperties the sparkConfigProperties value to set + * @return the BigDataPoolResourceInfoInner object itself. + */ + public BigDataPoolResourceInfoInner withSparkConfigProperties(LibraryRequirements sparkConfigProperties) { + this.sparkConfigProperties = sparkConfigProperties; + return this; + } + /** * Get the Apache Spark version. * @@ -300,7 +380,7 @@ public BigDataPoolResourceInfoInner withDefaultSparkLogFolder(String defaultSpar } /** - * Get the level of compute power that each node in the Big Data pool has. Possible values include: 'None', 'Small', 'Medium', 'Large', 'XLarge', 'XXLarge'. + * Get the level of compute power that each node in the Big Data pool has. Possible values include: 'None', 'Small', 'Medium', 'Large', 'XLarge', 'XXLarge', 'XXXLarge'. * * @return the nodeSize value */ @@ -309,7 +389,7 @@ public NodeSize nodeSize() { } /** - * Set the level of compute power that each node in the Big Data pool has. Possible values include: 'None', 'Small', 'Medium', 'Large', 'XLarge', 'XXLarge'. + * Set the level of compute power that each node in the Big Data pool has. Possible values include: 'None', 'Small', 'Medium', 'Large', 'XLarge', 'XXLarge', 'XXXLarge'. * * @param nodeSize the nodeSize value to set * @return the BigDataPoolResourceInfoInner object itself. diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/BigDataPoolsInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/BigDataPoolsInner.java index d3aa835fdc10a..99c1df696f526 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/BigDataPoolsInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/BigDataPoolsInner.java @@ -11,9 +11,9 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; import com.microsoft.azure.AzureServiceFuture; -import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; import com.microsoft.azure.management.synapse.v2019_06_01_preview.BigDataPoolPatchInfo; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ErrorContractException; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -106,7 +106,7 @@ interface BigDataPoolsService { * @param workspaceName The name of the workspace * @param bigDataPoolName Big Data pool name * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the BigDataPoolResourceInfoInner object if successful. */ @@ -188,10 +188,10 @@ public Observable> call(Response getDelegate(Response response) throws ErrorContractInnerException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(ErrorContractInnerException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -203,7 +203,7 @@ private ServiceResponse getDelegate(Response> call(Response> call(Response updateDelegate(Response response) throws ErrorContractInnerException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse updateDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(ErrorContractInnerException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -401,7 +401,7 @@ private ServiceResponse updateDelegate(Response> createOrUpdateW * @param bigDataPoolInfo The Big Data pool to create. * @param force Whether to stop any running jobs in the Big Data pool * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the BigDataPoolResourceInfoInner object if successful. */ @@ -581,7 +581,7 @@ public Observable> createOrUpdateW * @param bigDataPoolName Big Data pool name * @param bigDataPoolInfo The Big Data pool to create. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the BigDataPoolResourceInfoInner object if successful. */ @@ -681,7 +681,7 @@ public Observable> call(Response> call(Response beginCreateOrUpdateDelegate(Response response) throws ErrorContractInnerException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) - .registerError(ErrorContractInnerException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -789,7 +789,7 @@ private ServiceResponse beginCreateOrUpdateDelegat * @param workspaceName The name of the workspace * @param bigDataPoolName Big Data pool name * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the Object object if successful. */ @@ -869,7 +869,7 @@ public Observable> deleteWithServiceResponseAsync(String * @param workspaceName The name of the workspace * @param bigDataPoolName Big Data pool name * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the Object object if successful. */ @@ -951,12 +951,12 @@ public Observable> call(Response response) }); } - private ServiceResponse beginDeleteDelegate(Response response) throws ErrorContractInnerException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) .register(204, new TypeToken() { }.getType()) - .registerError(ErrorContractInnerException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -967,7 +967,7 @@ private ServiceResponse beginDeleteDelegate(Response respo * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<BigDataPoolResourceInfoInner> object if successful. */ @@ -1081,10 +1081,10 @@ public Observable>> call(Resp }); } - private ServiceResponse> listByWorkspaceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listByWorkspaceDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -1094,7 +1094,7 @@ private ServiceResponse> listByWorkspaceD * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<BigDataPoolResourceInfoInner> object if successful. */ @@ -1197,10 +1197,10 @@ public Observable>> call(Resp }); } - private ServiceResponse> listByWorkspaceNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listByWorkspaceNextDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingPoliciesImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingPoliciesImpl.java new file mode 100644 index 0000000000000..75102c3fb46b8 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingPoliciesImpl.java @@ -0,0 +1,59 @@ +/** + * 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. + * + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.DataMaskingPolicies; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.DataMaskingPolicy; + +class DataMaskingPoliciesImpl extends WrapperImpl implements DataMaskingPolicies { + private final SynapseManager manager; + + DataMaskingPoliciesImpl(SynapseManager manager) { + super(manager.inner().dataMaskingPolicies()); + this.manager = manager; + } + + public SynapseManager manager() { + return this.manager; + } + + @Override + public DataMaskingPolicyImpl define(String name) { + return wrapModel(name); + } + + private DataMaskingPolicyImpl wrapModel(DataMaskingPolicyInner inner) { + return new DataMaskingPolicyImpl(inner, manager()); + } + + private DataMaskingPolicyImpl wrapModel(String name) { + return new DataMaskingPolicyImpl(name, this.manager()); + } + + @Override + public Observable getAsync(String resourceGroupName, String workspaceName, String sqlPoolName) { + DataMaskingPoliciesInner client = this.inner(); + return client.getAsync(resourceGroupName, workspaceName, sqlPoolName) + .flatMap(new Func1>() { + @Override + public Observable call(DataMaskingPolicyInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((DataMaskingPolicy)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingPoliciesInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingPoliciesInner.java new file mode 100644 index 0000000000000..4f7dfd016c3a9 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingPoliciesInner.java @@ -0,0 +1,263 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in DataMaskingPolicies. + */ +public class DataMaskingPoliciesInner { + /** The Retrofit service to perform REST calls. */ + private DataMaskingPoliciesService service; + /** The service client containing this operation class. */ + private SynapseManagementClientImpl client; + + /** + * Initializes an instance of DataMaskingPoliciesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DataMaskingPoliciesInner(Retrofit retrofit, SynapseManagementClientImpl client) { + this.service = retrofit.create(DataMaskingPoliciesService.class); + this.client = client; + } + + /** + * The interface defining all the services for DataMaskingPolicies to be + * used by Retrofit to perform actually REST calls. + */ + interface DataMaskingPoliciesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.DataMaskingPolicies createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/dataMaskingPolicies/{dataMaskingPolicyName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Path("dataMaskingPolicyName") String dataMaskingPolicyName, @Query("api-version") String apiVersion, @Body DataMaskingPolicyInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.DataMaskingPolicies get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/dataMaskingPolicies/{dataMaskingPolicyName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Path("dataMaskingPolicyName") String dataMaskingPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates or updates a Sql pool data masking policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param parameters Parameters for creating or updating a data masking policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataMaskingPolicyInner object if successful. + */ + public DataMaskingPolicyInner createOrUpdate(String resourceGroupName, String workspaceName, String sqlPoolName, DataMaskingPolicyInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a Sql pool data masking policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param parameters Parameters for creating or updating a data masking policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String workspaceName, String sqlPoolName, DataMaskingPolicyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, parameters), serviceCallback); + } + + /** + * Creates or updates a Sql pool data masking policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param parameters Parameters for creating or updating a data masking policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataMaskingPolicyInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String workspaceName, String sqlPoolName, DataMaskingPolicyInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, parameters).map(new Func1, DataMaskingPolicyInner>() { + @Override + public DataMaskingPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Sql pool data masking policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param parameters Parameters for creating or updating a data masking policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataMaskingPolicyInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String workspaceName, String sqlPoolName, DataMaskingPolicyInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (sqlPoolName == null) { + throw new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String dataMaskingPolicyName = "Default"; + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, workspaceName, sqlPoolName, dataMaskingPolicyName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a Sql pool data masking policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataMaskingPolicyInner object if successful. + */ + public DataMaskingPolicyInner get(String resourceGroupName, String workspaceName, String sqlPoolName) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName).toBlocking().single().body(); + } + + /** + * Gets a Sql pool data masking policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String workspaceName, String sqlPoolName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName), serviceCallback); + } + + /** + * Gets a Sql pool data masking policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataMaskingPolicyInner object + */ + public Observable getAsync(String resourceGroupName, String workspaceName, String sqlPoolName) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName).map(new Func1, DataMaskingPolicyInner>() { + @Override + public DataMaskingPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a Sql pool data masking policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataMaskingPolicyInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String workspaceName, String sqlPoolName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (sqlPoolName == null) { + throw new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String dataMaskingPolicyName = "Default"; + return service.get(this.client.subscriptionId(), resourceGroupName, workspaceName, sqlPoolName, dataMaskingPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingPolicyImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingPolicyImpl.java new file mode 100644 index 0000000000000..624a00aed06fb --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingPolicyImpl.java @@ -0,0 +1,138 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import com.microsoft.azure.management.synapse.v2019_06_01_preview.DataMaskingPolicy; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.DataMaskingState; + +class DataMaskingPolicyImpl extends CreatableUpdatableImpl implements DataMaskingPolicy, DataMaskingPolicy.Definition, DataMaskingPolicy.Update { + private final SynapseManager manager; + private String resourceGroupName; + private String workspaceName; + private String sqlPoolName; + + DataMaskingPolicyImpl(String name, SynapseManager manager) { + super(name, new DataMaskingPolicyInner()); + this.manager = manager; + // Set resource name + this.sqlPoolName = name; + // + } + + DataMaskingPolicyImpl(DataMaskingPolicyInner inner, SynapseManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.sqlPoolName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.workspaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "workspaces"); + this.sqlPoolName = IdParsingUtils.getValueFromIdByName(inner.id(), "sqlPools"); + // + } + + @Override + public SynapseManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + DataMaskingPoliciesInner client = this.manager().inner().dataMaskingPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName, this.workspaceName, this.sqlPoolName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DataMaskingPoliciesInner client = this.manager().inner().dataMaskingPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName, this.workspaceName, this.sqlPoolName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DataMaskingPoliciesInner client = this.manager().inner().dataMaskingPolicies(); + return client.getAsync(this.resourceGroupName, this.workspaceName, this.sqlPoolName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String applicationPrincipals() { + return this.inner().applicationPrincipals(); + } + + @Override + public DataMaskingState dataMaskingState() { + return this.inner().dataMaskingState(); + } + + @Override + public String exemptPrincipals() { + return this.inner().exemptPrincipals(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String kind() { + return this.inner().kind(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String maskingLevel() { + return this.inner().maskingLevel(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public DataMaskingPolicyImpl withExistingSqlPool(String resourceGroupName, String workspaceName, String sqlPoolName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + this.sqlPoolName = sqlPoolName; + return this; + } + + @Override + public DataMaskingPolicyImpl withDataMaskingState(DataMaskingState dataMaskingState) { + this.inner().withDataMaskingState(dataMaskingState); + return this; + } + + @Override + public DataMaskingPolicyImpl withExemptPrincipals(String exemptPrincipals) { + this.inner().withExemptPrincipals(exemptPrincipals); + return this; + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingPolicyInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingPolicyInner.java new file mode 100644 index 0000000000000..21c1a3420e62a --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingPolicyInner.java @@ -0,0 +1,138 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import com.microsoft.azure.management.synapse.v2019_06_01_preview.DataMaskingState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Represents a database data masking policy. + */ +@JsonFlatten +public class DataMaskingPolicyInner extends ProxyResource { + /** + * The state of the data masking policy. Possible values include: + * 'Disabled', 'Enabled'. + */ + @JsonProperty(value = "properties.dataMaskingState", required = true) + private DataMaskingState dataMaskingState; + + /** + * The list of the exempt principals. Specifies the semicolon-separated + * list of database users for which the data masking policy does not apply. + * The specified users receive data results without masking for all of the + * database queries. + */ + @JsonProperty(value = "properties.exemptPrincipals") + private String exemptPrincipals; + + /** + * The list of the application principals. This is a legacy parameter and + * is no longer used. + */ + @JsonProperty(value = "properties.applicationPrincipals", access = JsonProperty.Access.WRITE_ONLY) + private String applicationPrincipals; + + /** + * The masking level. This is a legacy parameter and is no longer used. + */ + @JsonProperty(value = "properties.maskingLevel", access = JsonProperty.Access.WRITE_ONLY) + private String maskingLevel; + + /** + * The location of the data masking policy. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /** + * The kind of data masking policy. Metadata, used for Azure portal. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private String kind; + + /** + * Get the state of the data masking policy. Possible values include: 'Disabled', 'Enabled'. + * + * @return the dataMaskingState value + */ + public DataMaskingState dataMaskingState() { + return this.dataMaskingState; + } + + /** + * Set the state of the data masking policy. Possible values include: 'Disabled', 'Enabled'. + * + * @param dataMaskingState the dataMaskingState value to set + * @return the DataMaskingPolicyInner object itself. + */ + public DataMaskingPolicyInner withDataMaskingState(DataMaskingState dataMaskingState) { + this.dataMaskingState = dataMaskingState; + return this; + } + + /** + * Get the list of the exempt principals. Specifies the semicolon-separated list of database users for which the data masking policy does not apply. The specified users receive data results without masking for all of the database queries. + * + * @return the exemptPrincipals value + */ + public String exemptPrincipals() { + return this.exemptPrincipals; + } + + /** + * Set the list of the exempt principals. Specifies the semicolon-separated list of database users for which the data masking policy does not apply. The specified users receive data results without masking for all of the database queries. + * + * @param exemptPrincipals the exemptPrincipals value to set + * @return the DataMaskingPolicyInner object itself. + */ + public DataMaskingPolicyInner withExemptPrincipals(String exemptPrincipals) { + this.exemptPrincipals = exemptPrincipals; + return this; + } + + /** + * Get the list of the application principals. This is a legacy parameter and is no longer used. + * + * @return the applicationPrincipals value + */ + public String applicationPrincipals() { + return this.applicationPrincipals; + } + + /** + * Get the masking level. This is a legacy parameter and is no longer used. + * + * @return the maskingLevel value + */ + public String maskingLevel() { + return this.maskingLevel; + } + + /** + * Get the location of the data masking policy. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Get the kind of data masking policy. Metadata, used for Azure portal. + * + * @return the kind value + */ + public String kind() { + return this.kind; + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingRuleImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingRuleImpl.java new file mode 100644 index 0000000000000..cb18e69218b06 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingRuleImpl.java @@ -0,0 +1,235 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import com.microsoft.azure.management.synapse.v2019_06_01_preview.DataMaskingRule; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.DataMaskingRuleState; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.DataMaskingFunction; + +class DataMaskingRuleImpl extends CreatableUpdatableImpl implements DataMaskingRule, DataMaskingRule.Definition, DataMaskingRule.Update { + private final SynapseManager manager; + private String resourceGroupName; + private String workspaceName; + private String sqlPoolName; + private String dataMaskingRuleName; + + DataMaskingRuleImpl(String name, SynapseManager manager) { + super(name, new DataMaskingRuleInner()); + this.manager = manager; + // Set resource name + this.dataMaskingRuleName = name; + // + } + + DataMaskingRuleImpl(DataMaskingRuleInner inner, SynapseManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.dataMaskingRuleName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.workspaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "workspaces"); + this.sqlPoolName = IdParsingUtils.getValueFromIdByName(inner.id(), "sqlPools"); + this.dataMaskingRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "rules"); + // + } + + @Override + public SynapseManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + DataMaskingRulesInner client = this.manager().inner().dataMaskingRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.workspaceName, this.sqlPoolName, this.dataMaskingRuleName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DataMaskingRulesInner client = this.manager().inner().dataMaskingRules(); + return client.createOrUpdateAsync(this.resourceGroupName, this.workspaceName, this.sqlPoolName, this.dataMaskingRuleName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DataMaskingRulesInner client = this.manager().inner().dataMaskingRules(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String aliasName() { + return this.inner().aliasName(); + } + + @Override + public String columnName() { + return this.inner().columnName(); + } + + @Override + public String dataMaskingRuleId() { + return this.inner().dataMaskingRuleId(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String kind() { + return this.inner().kind(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public DataMaskingFunction maskingFunction() { + return this.inner().maskingFunction(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String numberFrom() { + return this.inner().numberFrom(); + } + + @Override + public String numberTo() { + return this.inner().numberTo(); + } + + @Override + public String prefixSize() { + return this.inner().prefixSize(); + } + + @Override + public String replacementString() { + return this.inner().replacementString(); + } + + @Override + public DataMaskingRuleState ruleState() { + return this.inner().ruleState(); + } + + @Override + public String schemaName() { + return this.inner().schemaName(); + } + + @Override + public String suffixSize() { + return this.inner().suffixSize(); + } + + @Override + public String tableName() { + return this.inner().tableName(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public DataMaskingRuleImpl withExistingDataMaskingPolicy(String resourceGroupName, String workspaceName, String sqlPoolName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + this.sqlPoolName = sqlPoolName; + return this; + } + + @Override + public DataMaskingRuleImpl withColumnName(String columnName) { + this.inner().withColumnName(columnName); + return this; + } + + @Override + public DataMaskingRuleImpl withMaskingFunction(DataMaskingFunction maskingFunction) { + this.inner().withMaskingFunction(maskingFunction); + return this; + } + + @Override + public DataMaskingRuleImpl withSchemaName(String schemaName) { + this.inner().withSchemaName(schemaName); + return this; + } + + @Override + public DataMaskingRuleImpl withTableName(String tableName) { + this.inner().withTableName(tableName); + return this; + } + + @Override + public DataMaskingRuleImpl withAliasName(String aliasName) { + this.inner().withAliasName(aliasName); + return this; + } + + @Override + public DataMaskingRuleImpl withNumberFrom(String numberFrom) { + this.inner().withNumberFrom(numberFrom); + return this; + } + + @Override + public DataMaskingRuleImpl withNumberTo(String numberTo) { + this.inner().withNumberTo(numberTo); + return this; + } + + @Override + public DataMaskingRuleImpl withPrefixSize(String prefixSize) { + this.inner().withPrefixSize(prefixSize); + return this; + } + + @Override + public DataMaskingRuleImpl withReplacementString(String replacementString) { + this.inner().withReplacementString(replacementString); + return this; + } + + @Override + public DataMaskingRuleImpl withRuleState(DataMaskingRuleState ruleState) { + this.inner().withRuleState(ruleState); + return this; + } + + @Override + public DataMaskingRuleImpl withSuffixSize(String suffixSize) { + this.inner().withSuffixSize(suffixSize); + return this; + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingRuleInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingRuleInner.java new file mode 100644 index 0000000000000..514478245595e --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingRuleInner.java @@ -0,0 +1,367 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import com.microsoft.azure.management.synapse.v2019_06_01_preview.DataMaskingRuleState; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.DataMaskingFunction; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Represents a Sql pool data masking rule. + */ +@JsonFlatten +public class DataMaskingRuleInner extends ProxyResource { + /** + * The rule Id. + */ + @JsonProperty(value = "properties.id", access = JsonProperty.Access.WRITE_ONLY) + private String dataMaskingRuleId; + + /** + * The alias name. This is a legacy parameter and is no longer used. + */ + @JsonProperty(value = "properties.aliasName") + private String aliasName; + + /** + * The rule state. Used to delete a rule. To delete an existing rule, + * specify the schemaName, tableName, columnName, maskingFunction, and + * specify ruleState as disabled. However, if the rule doesn't already + * exist, the rule will be created with ruleState set to enabled, + * regardless of the provided value of ruleState. Possible values include: + * 'Disabled', 'Enabled'. + */ + @JsonProperty(value = "properties.ruleState") + private DataMaskingRuleState ruleState; + + /** + * The schema name on which the data masking rule is applied. + */ + @JsonProperty(value = "properties.schemaName", required = true) + private String schemaName; + + /** + * The table name on which the data masking rule is applied. + */ + @JsonProperty(value = "properties.tableName", required = true) + private String tableName; + + /** + * The column name on which the data masking rule is applied. + */ + @JsonProperty(value = "properties.columnName", required = true) + private String columnName; + + /** + * The masking function that is used for the data masking rule. Possible + * values include: 'Default', 'CCN', 'Email', 'Number', 'SSN', 'Text'. + */ + @JsonProperty(value = "properties.maskingFunction", required = true) + private DataMaskingFunction maskingFunction; + + /** + * The numberFrom property of the masking rule. Required if maskingFunction + * is set to Number, otherwise this parameter will be ignored. + */ + @JsonProperty(value = "properties.numberFrom") + private String numberFrom; + + /** + * The numberTo property of the data masking rule. Required if + * maskingFunction is set to Number, otherwise this parameter will be + * ignored. + */ + @JsonProperty(value = "properties.numberTo") + private String numberTo; + + /** + * If maskingFunction is set to Text, the number of characters to show + * unmasked in the beginning of the string. Otherwise, this parameter will + * be ignored. + */ + @JsonProperty(value = "properties.prefixSize") + private String prefixSize; + + /** + * If maskingFunction is set to Text, the number of characters to show + * unmasked at the end of the string. Otherwise, this parameter will be + * ignored. + */ + @JsonProperty(value = "properties.suffixSize") + private String suffixSize; + + /** + * If maskingFunction is set to Text, the character to use for masking the + * unexposed part of the string. Otherwise, this parameter will be ignored. + */ + @JsonProperty(value = "properties.replacementString") + private String replacementString; + + /** + * The location of the data masking rule. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /** + * The kind of Data Masking Rule. Metadata, used for Azure portal. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private String kind; + + /** + * Get the rule Id. + * + * @return the dataMaskingRuleId value + */ + public String dataMaskingRuleId() { + return this.dataMaskingRuleId; + } + + /** + * Get the alias name. This is a legacy parameter and is no longer used. + * + * @return the aliasName value + */ + public String aliasName() { + return this.aliasName; + } + + /** + * Set the alias name. This is a legacy parameter and is no longer used. + * + * @param aliasName the aliasName value to set + * @return the DataMaskingRuleInner object itself. + */ + public DataMaskingRuleInner withAliasName(String aliasName) { + this.aliasName = aliasName; + return this; + } + + /** + * Get the rule state. Used to delete a rule. To delete an existing rule, specify the schemaName, tableName, columnName, maskingFunction, and specify ruleState as disabled. However, if the rule doesn't already exist, the rule will be created with ruleState set to enabled, regardless of the provided value of ruleState. Possible values include: 'Disabled', 'Enabled'. + * + * @return the ruleState value + */ + public DataMaskingRuleState ruleState() { + return this.ruleState; + } + + /** + * Set the rule state. Used to delete a rule. To delete an existing rule, specify the schemaName, tableName, columnName, maskingFunction, and specify ruleState as disabled. However, if the rule doesn't already exist, the rule will be created with ruleState set to enabled, regardless of the provided value of ruleState. Possible values include: 'Disabled', 'Enabled'. + * + * @param ruleState the ruleState value to set + * @return the DataMaskingRuleInner object itself. + */ + public DataMaskingRuleInner withRuleState(DataMaskingRuleState ruleState) { + this.ruleState = ruleState; + return this; + } + + /** + * Get the schema name on which the data masking rule is applied. + * + * @return the schemaName value + */ + public String schemaName() { + return this.schemaName; + } + + /** + * Set the schema name on which the data masking rule is applied. + * + * @param schemaName the schemaName value to set + * @return the DataMaskingRuleInner object itself. + */ + public DataMaskingRuleInner withSchemaName(String schemaName) { + this.schemaName = schemaName; + return this; + } + + /** + * Get the table name on which the data masking rule is applied. + * + * @return the tableName value + */ + public String tableName() { + return this.tableName; + } + + /** + * Set the table name on which the data masking rule is applied. + * + * @param tableName the tableName value to set + * @return the DataMaskingRuleInner object itself. + */ + public DataMaskingRuleInner withTableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Get the column name on which the data masking rule is applied. + * + * @return the columnName value + */ + public String columnName() { + return this.columnName; + } + + /** + * Set the column name on which the data masking rule is applied. + * + * @param columnName the columnName value to set + * @return the DataMaskingRuleInner object itself. + */ + public DataMaskingRuleInner withColumnName(String columnName) { + this.columnName = columnName; + return this; + } + + /** + * Get the masking function that is used for the data masking rule. Possible values include: 'Default', 'CCN', 'Email', 'Number', 'SSN', 'Text'. + * + * @return the maskingFunction value + */ + public DataMaskingFunction maskingFunction() { + return this.maskingFunction; + } + + /** + * Set the masking function that is used for the data masking rule. Possible values include: 'Default', 'CCN', 'Email', 'Number', 'SSN', 'Text'. + * + * @param maskingFunction the maskingFunction value to set + * @return the DataMaskingRuleInner object itself. + */ + public DataMaskingRuleInner withMaskingFunction(DataMaskingFunction maskingFunction) { + this.maskingFunction = maskingFunction; + return this; + } + + /** + * Get the numberFrom property of the masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored. + * + * @return the numberFrom value + */ + public String numberFrom() { + return this.numberFrom; + } + + /** + * Set the numberFrom property of the masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored. + * + * @param numberFrom the numberFrom value to set + * @return the DataMaskingRuleInner object itself. + */ + public DataMaskingRuleInner withNumberFrom(String numberFrom) { + this.numberFrom = numberFrom; + return this; + } + + /** + * Get the numberTo property of the data masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored. + * + * @return the numberTo value + */ + public String numberTo() { + return this.numberTo; + } + + /** + * Set the numberTo property of the data masking rule. Required if maskingFunction is set to Number, otherwise this parameter will be ignored. + * + * @param numberTo the numberTo value to set + * @return the DataMaskingRuleInner object itself. + */ + public DataMaskingRuleInner withNumberTo(String numberTo) { + this.numberTo = numberTo; + return this; + } + + /** + * Get if maskingFunction is set to Text, the number of characters to show unmasked in the beginning of the string. Otherwise, this parameter will be ignored. + * + * @return the prefixSize value + */ + public String prefixSize() { + return this.prefixSize; + } + + /** + * Set if maskingFunction is set to Text, the number of characters to show unmasked in the beginning of the string. Otherwise, this parameter will be ignored. + * + * @param prefixSize the prefixSize value to set + * @return the DataMaskingRuleInner object itself. + */ + public DataMaskingRuleInner withPrefixSize(String prefixSize) { + this.prefixSize = prefixSize; + return this; + } + + /** + * Get if maskingFunction is set to Text, the number of characters to show unmasked at the end of the string. Otherwise, this parameter will be ignored. + * + * @return the suffixSize value + */ + public String suffixSize() { + return this.suffixSize; + } + + /** + * Set if maskingFunction is set to Text, the number of characters to show unmasked at the end of the string. Otherwise, this parameter will be ignored. + * + * @param suffixSize the suffixSize value to set + * @return the DataMaskingRuleInner object itself. + */ + public DataMaskingRuleInner withSuffixSize(String suffixSize) { + this.suffixSize = suffixSize; + return this; + } + + /** + * Get if maskingFunction is set to Text, the character to use for masking the unexposed part of the string. Otherwise, this parameter will be ignored. + * + * @return the replacementString value + */ + public String replacementString() { + return this.replacementString; + } + + /** + * Set if maskingFunction is set to Text, the character to use for masking the unexposed part of the string. Otherwise, this parameter will be ignored. + * + * @param replacementString the replacementString value to set + * @return the DataMaskingRuleInner object itself. + */ + public DataMaskingRuleInner withReplacementString(String replacementString) { + this.replacementString = replacementString; + return this; + } + + /** + * Get the location of the data masking rule. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Get the kind of Data Masking Rule. Metadata, used for Azure portal. + * + * @return the kind value + */ + public String kind() { + return this.kind; + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingRulesImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingRulesImpl.java new file mode 100644 index 0000000000000..128f510b81e62 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingRulesImpl.java @@ -0,0 +1,62 @@ +/** + * 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. + * + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.DataMaskingRules; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.DataMaskingRule; + +class DataMaskingRulesImpl extends WrapperImpl implements DataMaskingRules { + private final SynapseManager manager; + + DataMaskingRulesImpl(SynapseManager manager) { + super(manager.inner().dataMaskingRules()); + this.manager = manager; + } + + public SynapseManager manager() { + return this.manager; + } + + @Override + public DataMaskingRuleImpl define(String name) { + return wrapModel(name); + } + + private DataMaskingRuleImpl wrapModel(DataMaskingRuleInner inner) { + return new DataMaskingRuleImpl(inner, manager()); + } + + private DataMaskingRuleImpl wrapModel(String name) { + return new DataMaskingRuleImpl(name, this.manager()); + } + + @Override + public Observable listBySqlPoolAsync(String resourceGroupName, String workspaceName, String sqlPoolName) { + DataMaskingRulesInner client = this.inner(); + return client.listBySqlPoolAsync(resourceGroupName, workspaceName, sqlPoolName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public DataMaskingRule call(DataMaskingRuleInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingRulesInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingRulesInner.java new file mode 100644 index 0000000000000..384361ba05ecf --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/DataMaskingRulesInner.java @@ -0,0 +1,277 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in DataMaskingRules. + */ +public class DataMaskingRulesInner { + /** The Retrofit service to perform REST calls. */ + private DataMaskingRulesService service; + /** The service client containing this operation class. */ + private SynapseManagementClientImpl client; + + /** + * Initializes an instance of DataMaskingRulesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DataMaskingRulesInner(Retrofit retrofit, SynapseManagementClientImpl client) { + this.service = retrofit.create(DataMaskingRulesService.class); + this.client = client; + } + + /** + * The interface defining all the services for DataMaskingRules to be + * used by Retrofit to perform actually REST calls. + */ + interface DataMaskingRulesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.DataMaskingRules createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules/{dataMaskingRuleName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Path("dataMaskingPolicyName") String dataMaskingPolicyName, @Path("dataMaskingRuleName") String dataMaskingRuleName, @Query("api-version") String apiVersion, @Body DataMaskingRuleInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.DataMaskingRules listBySqlPool" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules") + Observable> listBySqlPool(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Path("dataMaskingPolicyName") String dataMaskingPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates or updates a Sql pool data masking rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param dataMaskingRuleName The name of the data masking rule. + * @param parameters The required parameters for creating or updating a data masking rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataMaskingRuleInner object if successful. + */ + public DataMaskingRuleInner createOrUpdate(String resourceGroupName, String workspaceName, String sqlPoolName, String dataMaskingRuleName, DataMaskingRuleInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, dataMaskingRuleName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a Sql pool data masking rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param dataMaskingRuleName The name of the data masking rule. + * @param parameters The required parameters for creating or updating a data masking rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String dataMaskingRuleName, DataMaskingRuleInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, dataMaskingRuleName, parameters), serviceCallback); + } + + /** + * Creates or updates a Sql pool data masking rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param dataMaskingRuleName The name of the data masking rule. + * @param parameters The required parameters for creating or updating a data masking rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataMaskingRuleInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String dataMaskingRuleName, DataMaskingRuleInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, dataMaskingRuleName, parameters).map(new Func1, DataMaskingRuleInner>() { + @Override + public DataMaskingRuleInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a Sql pool data masking rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param dataMaskingRuleName The name of the data masking rule. + * @param parameters The required parameters for creating or updating a data masking rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataMaskingRuleInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String dataMaskingRuleName, DataMaskingRuleInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (sqlPoolName == null) { + throw new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null."); + } + if (dataMaskingRuleName == null) { + throw new IllegalArgumentException("Parameter dataMaskingRuleName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String dataMaskingPolicyName = "Default"; + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, workspaceName, sqlPoolName, dataMaskingPolicyName, dataMaskingRuleName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of Sql pool data masking rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<DataMaskingRuleInner> object if successful. + */ + public List listBySqlPool(String resourceGroupName, String workspaceName, String sqlPoolName) { + return listBySqlPoolWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName).toBlocking().single().body(); + } + + /** + * Gets a list of Sql pool data masking rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listBySqlPoolAsync(String resourceGroupName, String workspaceName, String sqlPoolName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listBySqlPoolWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName), serviceCallback); + } + + /** + * Gets a list of Sql pool data masking rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DataMaskingRuleInner> object + */ + public Observable> listBySqlPoolAsync(String resourceGroupName, String workspaceName, String sqlPoolName) { + return listBySqlPoolWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of Sql pool data masking rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DataMaskingRuleInner> object + */ + public Observable>> listBySqlPoolWithServiceResponseAsync(String resourceGroupName, String workspaceName, String sqlPoolName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (sqlPoolName == null) { + throw new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String dataMaskingPolicyName = "Default"; + return service.listBySqlPool(this.client.subscriptionId(), resourceGroupName, workspaceName, sqlPoolName, dataMaskingPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listBySqlPoolDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listBySqlPoolDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/ExtendedSqlPoolBlobAuditingPoliciesImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/ExtendedSqlPoolBlobAuditingPoliciesImpl.java new file mode 100644 index 0000000000000..d6a6f11199d38 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/ExtendedSqlPoolBlobAuditingPoliciesImpl.java @@ -0,0 +1,78 @@ +/** + * 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. + * + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ExtendedSqlPoolBlobAuditingPolicies; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ExtendedSqlPoolBlobAuditingPolicy; + +class ExtendedSqlPoolBlobAuditingPoliciesImpl extends WrapperImpl implements ExtendedSqlPoolBlobAuditingPolicies { + private final SynapseManager manager; + + ExtendedSqlPoolBlobAuditingPoliciesImpl(SynapseManager manager) { + super(manager.inner().extendedSqlPoolBlobAuditingPolicies()); + this.manager = manager; + } + + public SynapseManager manager() { + return this.manager; + } + + @Override + public ExtendedSqlPoolBlobAuditingPolicyImpl define(String name) { + return wrapModel(name); + } + + private ExtendedSqlPoolBlobAuditingPolicyImpl wrapModel(ExtendedSqlPoolBlobAuditingPolicyInner inner) { + return new ExtendedSqlPoolBlobAuditingPolicyImpl(inner, manager()); + } + + private ExtendedSqlPoolBlobAuditingPolicyImpl wrapModel(String name) { + return new ExtendedSqlPoolBlobAuditingPolicyImpl(name, this.manager()); + } + + @Override + public Observable listBySqlPoolAsync(final String resourceGroupName, final String workspaceName, final String sqlPoolName) { + ExtendedSqlPoolBlobAuditingPoliciesInner client = this.inner(); + return client.listBySqlPoolAsync(resourceGroupName, workspaceName, sqlPoolName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ExtendedSqlPoolBlobAuditingPolicy call(ExtendedSqlPoolBlobAuditingPolicyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String workspaceName, String sqlPoolName) { + ExtendedSqlPoolBlobAuditingPoliciesInner client = this.inner(); + return client.getAsync(resourceGroupName, workspaceName, sqlPoolName) + .flatMap(new Func1>() { + @Override + public Observable call(ExtendedSqlPoolBlobAuditingPolicyInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((ExtendedSqlPoolBlobAuditingPolicy)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/ExtendedSqlPoolBlobAuditingPoliciesInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/ExtendedSqlPoolBlobAuditingPoliciesInner.java new file mode 100644 index 0000000000000..a1331b28c6d05 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/ExtendedSqlPoolBlobAuditingPoliciesInner.java @@ -0,0 +1,520 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ExtendedSqlPoolBlobAuditingPolicies. + */ +public class ExtendedSqlPoolBlobAuditingPoliciesInner { + /** The Retrofit service to perform REST calls. */ + private ExtendedSqlPoolBlobAuditingPoliciesService service; + /** The service client containing this operation class. */ + private SynapseManagementClientImpl client; + + /** + * Initializes an instance of ExtendedSqlPoolBlobAuditingPoliciesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExtendedSqlPoolBlobAuditingPoliciesInner(Retrofit retrofit, SynapseManagementClientImpl client) { + this.service = retrofit.create(ExtendedSqlPoolBlobAuditingPoliciesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ExtendedSqlPoolBlobAuditingPolicies to be + * used by Retrofit to perform actually REST calls. + */ + interface ExtendedSqlPoolBlobAuditingPoliciesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.ExtendedSqlPoolBlobAuditingPolicies get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/extendedAuditingSettings/{blobAuditingPolicyName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Path("blobAuditingPolicyName") String blobAuditingPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.ExtendedSqlPoolBlobAuditingPolicies createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/extendedAuditingSettings/{blobAuditingPolicyName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Path("blobAuditingPolicyName") String blobAuditingPolicyName, @Query("api-version") String apiVersion, @Body ExtendedSqlPoolBlobAuditingPolicyInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.ExtendedSqlPoolBlobAuditingPolicies listBySqlPool" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/extendedAuditingSettings") + Observable> listBySqlPool(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.ExtendedSqlPoolBlobAuditingPolicies listBySqlPoolNext" }) + @GET + Observable> listBySqlPoolNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets an extended Sql pool's blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExtendedSqlPoolBlobAuditingPolicyInner object if successful. + */ + public ExtendedSqlPoolBlobAuditingPolicyInner get(String resourceGroupName, String workspaceName, String sqlPoolName) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName).toBlocking().single().body(); + } + + /** + * Gets an extended Sql pool's blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String workspaceName, String sqlPoolName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName), serviceCallback); + } + + /** + * Gets an extended Sql pool's blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExtendedSqlPoolBlobAuditingPolicyInner object + */ + public Observable getAsync(String resourceGroupName, String workspaceName, String sqlPoolName) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName).map(new Func1, ExtendedSqlPoolBlobAuditingPolicyInner>() { + @Override + public ExtendedSqlPoolBlobAuditingPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets an extended Sql pool's blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExtendedSqlPoolBlobAuditingPolicyInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String workspaceName, String sqlPoolName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (sqlPoolName == null) { + throw new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String blobAuditingPolicyName = "default"; + return service.get(this.client.subscriptionId(), resourceGroupName, workspaceName, sqlPoolName, blobAuditingPolicyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates an extended Sql pool's blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param parameters The extended Sql pool blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ExtendedSqlPoolBlobAuditingPolicyInner object if successful. + */ + public ExtendedSqlPoolBlobAuditingPolicyInner createOrUpdate(String resourceGroupName, String workspaceName, String sqlPoolName, ExtendedSqlPoolBlobAuditingPolicyInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates an extended Sql pool's blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param parameters The extended Sql pool blob auditing policy. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String workspaceName, String sqlPoolName, ExtendedSqlPoolBlobAuditingPolicyInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, parameters), serviceCallback); + } + + /** + * Creates or updates an extended Sql pool's blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param parameters The extended Sql pool blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExtendedSqlPoolBlobAuditingPolicyInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String workspaceName, String sqlPoolName, ExtendedSqlPoolBlobAuditingPolicyInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, parameters).map(new Func1, ExtendedSqlPoolBlobAuditingPolicyInner>() { + @Override + public ExtendedSqlPoolBlobAuditingPolicyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an extended Sql pool's blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param parameters The extended Sql pool blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ExtendedSqlPoolBlobAuditingPolicyInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String workspaceName, String sqlPoolName, ExtendedSqlPoolBlobAuditingPolicyInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (sqlPoolName == null) { + throw new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String blobAuditingPolicyName = "default"; + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, workspaceName, sqlPoolName, blobAuditingPolicyName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists extended auditing settings of a Sql pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExtendedSqlPoolBlobAuditingPolicyInner> object if successful. + */ + public PagedList listBySqlPool(final String resourceGroupName, final String workspaceName, final String sqlPoolName) { + ServiceResponse> response = listBySqlPoolSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listBySqlPoolNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists extended auditing settings of a Sql pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listBySqlPoolAsync(final String resourceGroupName, final String workspaceName, final String sqlPoolName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listBySqlPoolSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listBySqlPoolNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists extended auditing settings of a Sql pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExtendedSqlPoolBlobAuditingPolicyInner> object + */ + public Observable> listBySqlPoolAsync(final String resourceGroupName, final String workspaceName, final String sqlPoolName) { + return listBySqlPoolWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists extended auditing settings of a Sql pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExtendedSqlPoolBlobAuditingPolicyInner> object + */ + public Observable>> listBySqlPoolWithServiceResponseAsync(final String resourceGroupName, final String workspaceName, final String sqlPoolName) { + return listBySqlPoolSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listBySqlPoolNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists extended auditing settings of a Sql pool. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param workspaceName The name of the workspace + ServiceResponse> * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExtendedSqlPoolBlobAuditingPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listBySqlPoolSinglePageAsync(final String resourceGroupName, final String workspaceName, final String sqlPoolName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (sqlPoolName == null) { + throw new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listBySqlPool(this.client.subscriptionId(), resourceGroupName, workspaceName, sqlPoolName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listBySqlPoolDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listBySqlPoolDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists extended auditing settings of a Sql pool. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ExtendedSqlPoolBlobAuditingPolicyInner> object if successful. + */ + public PagedList listBySqlPoolNext(final String nextPageLink) { + ServiceResponse> response = listBySqlPoolNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listBySqlPoolNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists extended auditing settings of a Sql pool. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listBySqlPoolNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listBySqlPoolNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listBySqlPoolNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists extended auditing settings of a Sql pool. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExtendedSqlPoolBlobAuditingPolicyInner> object + */ + public Observable> listBySqlPoolNextAsync(final String nextPageLink) { + return listBySqlPoolNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists extended auditing settings of a Sql pool. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ExtendedSqlPoolBlobAuditingPolicyInner> object + */ + public Observable>> listBySqlPoolNextWithServiceResponseAsync(final String nextPageLink) { + return listBySqlPoolNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listBySqlPoolNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists extended auditing settings of a Sql pool. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ExtendedSqlPoolBlobAuditingPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listBySqlPoolNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listBySqlPoolNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listBySqlPoolNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listBySqlPoolNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/ExtendedSqlPoolBlobAuditingPolicyImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/ExtendedSqlPoolBlobAuditingPolicyImpl.java new file mode 100644 index 0000000000000..e25e4303a72f6 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/ExtendedSqlPoolBlobAuditingPolicyImpl.java @@ -0,0 +1,208 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ExtendedSqlPoolBlobAuditingPolicy; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.BlobAuditingPolicyState; +import java.util.List; +import java.util.UUID; + +class ExtendedSqlPoolBlobAuditingPolicyImpl extends CreatableUpdatableImpl implements ExtendedSqlPoolBlobAuditingPolicy, ExtendedSqlPoolBlobAuditingPolicy.Definition, ExtendedSqlPoolBlobAuditingPolicy.Update { + private final SynapseManager manager; + private String resourceGroupName; + private String workspaceName; + private String sqlPoolName; + + ExtendedSqlPoolBlobAuditingPolicyImpl(String name, SynapseManager manager) { + super(name, new ExtendedSqlPoolBlobAuditingPolicyInner()); + this.manager = manager; + // Set resource name + this.sqlPoolName = name; + // + } + + ExtendedSqlPoolBlobAuditingPolicyImpl(ExtendedSqlPoolBlobAuditingPolicyInner inner, SynapseManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.sqlPoolName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.workspaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "workspaces"); + this.sqlPoolName = IdParsingUtils.getValueFromIdByName(inner.id(), "sqlPools"); + // + } + + @Override + public SynapseManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ExtendedSqlPoolBlobAuditingPoliciesInner client = this.manager().inner().extendedSqlPoolBlobAuditingPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName, this.workspaceName, this.sqlPoolName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ExtendedSqlPoolBlobAuditingPoliciesInner client = this.manager().inner().extendedSqlPoolBlobAuditingPolicies(); + return client.createOrUpdateAsync(this.resourceGroupName, this.workspaceName, this.sqlPoolName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ExtendedSqlPoolBlobAuditingPoliciesInner client = this.manager().inner().extendedSqlPoolBlobAuditingPolicies(); + return client.getAsync(this.resourceGroupName, this.workspaceName, this.sqlPoolName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List auditActionsAndGroups() { + return this.inner().auditActionsAndGroups(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Boolean isAzureMonitorTargetEnabled() { + return this.inner().isAzureMonitorTargetEnabled(); + } + + @Override + public Boolean isStorageSecondaryKeyInUse() { + return this.inner().isStorageSecondaryKeyInUse(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String predicateExpression() { + return this.inner().predicateExpression(); + } + + @Override + public Integer queueDelayMs() { + return this.inner().queueDelayMs(); + } + + @Override + public Integer retentionDays() { + return this.inner().retentionDays(); + } + + @Override + public BlobAuditingPolicyState state() { + return this.inner().state(); + } + + @Override + public String storageAccountAccessKey() { + return this.inner().storageAccountAccessKey(); + } + + @Override + public UUID storageAccountSubscriptionId() { + return this.inner().storageAccountSubscriptionId(); + } + + @Override + public String storageEndpoint() { + return this.inner().storageEndpoint(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ExtendedSqlPoolBlobAuditingPolicyImpl withExistingSqlPool(String resourceGroupName, String workspaceName, String sqlPoolName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + this.sqlPoolName = sqlPoolName; + return this; + } + + @Override + public ExtendedSqlPoolBlobAuditingPolicyImpl withState(BlobAuditingPolicyState state) { + this.inner().withState(state); + return this; + } + + @Override + public ExtendedSqlPoolBlobAuditingPolicyImpl withAuditActionsAndGroups(List auditActionsAndGroups) { + this.inner().withAuditActionsAndGroups(auditActionsAndGroups); + return this; + } + + @Override + public ExtendedSqlPoolBlobAuditingPolicyImpl withIsAzureMonitorTargetEnabled(Boolean isAzureMonitorTargetEnabled) { + this.inner().withIsAzureMonitorTargetEnabled(isAzureMonitorTargetEnabled); + return this; + } + + @Override + public ExtendedSqlPoolBlobAuditingPolicyImpl withIsStorageSecondaryKeyInUse(Boolean isStorageSecondaryKeyInUse) { + this.inner().withIsStorageSecondaryKeyInUse(isStorageSecondaryKeyInUse); + return this; + } + + @Override + public ExtendedSqlPoolBlobAuditingPolicyImpl withPredicateExpression(String predicateExpression) { + this.inner().withPredicateExpression(predicateExpression); + return this; + } + + @Override + public ExtendedSqlPoolBlobAuditingPolicyImpl withQueueDelayMs(Integer queueDelayMs) { + this.inner().withQueueDelayMs(queueDelayMs); + return this; + } + + @Override + public ExtendedSqlPoolBlobAuditingPolicyImpl withRetentionDays(Integer retentionDays) { + this.inner().withRetentionDays(retentionDays); + return this; + } + + @Override + public ExtendedSqlPoolBlobAuditingPolicyImpl withStorageAccountAccessKey(String storageAccountAccessKey) { + this.inner().withStorageAccountAccessKey(storageAccountAccessKey); + return this; + } + + @Override + public ExtendedSqlPoolBlobAuditingPolicyImpl withStorageAccountSubscriptionId(UUID storageAccountSubscriptionId) { + this.inner().withStorageAccountSubscriptionId(storageAccountSubscriptionId); + return this; + } + + @Override + public ExtendedSqlPoolBlobAuditingPolicyImpl withStorageEndpoint(String storageEndpoint) { + this.inner().withStorageEndpoint(storageEndpoint); + return this; + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/ExtendedSqlPoolBlobAuditingPolicyInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/ExtendedSqlPoolBlobAuditingPolicyInner.java new file mode 100644 index 0000000000000..ce1de50e87b6d --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/ExtendedSqlPoolBlobAuditingPolicyInner.java @@ -0,0 +1,503 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import com.microsoft.azure.management.synapse.v2019_06_01_preview.BlobAuditingPolicyState; +import java.util.List; +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * An extended Sql pool blob auditing policy. + */ +@JsonFlatten +public class ExtendedSqlPoolBlobAuditingPolicyInner extends ProxyResource { + /** + * Specifies condition of where clause when creating an audit. + */ + @JsonProperty(value = "properties.predicateExpression") + private String predicateExpression; + + /** + * Specifies the state of the policy. If state is Enabled, storageEndpoint + * or isAzureMonitorTargetEnabled are required. Possible values include: + * 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.state", required = true) + private BlobAuditingPolicyState state; + + /** + * Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). If state is Enabled, + * storageEndpoint or isAzureMonitorTargetEnabled is required. + */ + @JsonProperty(value = "properties.storageEndpoint") + private String storageEndpoint; + + /** + * Specifies the identifier key of the auditing storage account. + * If state is Enabled and storageEndpoint is specified, not specifying the + * storageAccountAccessKey will use SQL server system-assigned managed + * identity to access the storage. + * Prerequisites for using managed identity authentication: + * 1. Assign SQL Server a system-assigned managed identity in Azure Active + * Directory (AAD). + * 2. Grant SQL Server identity access to the storage account by adding + * 'Storage Blob Data Contributor' RBAC role to the server identity. + * For more information, see [Auditing to storage using Managed Identity + * authentication](https://go.microsoft.com/fwlink/?linkid=2114355). + */ + @JsonProperty(value = "properties.storageAccountAccessKey") + private String storageAccountAccessKey; + + /** + * Specifies the number of days to keep in the audit logs in the storage + * account. + */ + @JsonProperty(value = "properties.retentionDays") + private Integer retentionDays; + + /** + * Specifies the Actions-Groups and Actions to audit. + * + * The recommended set of action groups to use is the following combination + * - this will audit all the queries and stored procedures executed against + * the database, as well as successful and failed logins: + * + * BATCH_COMPLETED_GROUP, + * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, + * FAILED_DATABASE_AUTHENTICATION_GROUP. + * + * This above combination is also the set that is configured by default + * when enabling auditing from the Azure portal. + * + * The supported action groups to audit are (note: choose only specific + * groups that cover your auditing needs. Using unnecessary groups could + * lead to very large quantities of audit records): + * + * APPLICATION_ROLE_CHANGE_PASSWORD_GROUP + * BACKUP_RESTORE_GROUP + * DATABASE_LOGOUT_GROUP + * DATABASE_OBJECT_CHANGE_GROUP + * DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP + * DATABASE_OBJECT_PERMISSION_CHANGE_GROUP + * DATABASE_OPERATION_GROUP + * DATABASE_PERMISSION_CHANGE_GROUP + * DATABASE_PRINCIPAL_CHANGE_GROUP + * DATABASE_PRINCIPAL_IMPERSONATION_GROUP + * DATABASE_ROLE_MEMBER_CHANGE_GROUP + * FAILED_DATABASE_AUTHENTICATION_GROUP + * SCHEMA_OBJECT_ACCESS_GROUP + * SCHEMA_OBJECT_CHANGE_GROUP + * SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP + * SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP + * SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP + * USER_CHANGE_PASSWORD_GROUP + * BATCH_STARTED_GROUP + * BATCH_COMPLETED_GROUP + * + * These are groups that cover all sql statements and stored procedures + * executed against the database, and should not be used in combination + * with other groups as this will result in duplicate audit logs. + * + * For more information, see [Database-Level Audit Action + * Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). + * + * For Database auditing policy, specific Actions can also be specified + * (note that Actions cannot be specified for Server auditing policy). The + * supported actions to audit are: + * SELECT + * UPDATE + * INSERT + * DELETE + * EXECUTE + * RECEIVE + * REFERENCES + * + * The general form for defining an action to be audited is: + * {action} ON {object} BY {principal} + * + * Note that <object> in the above format can refer to an object like + * a table, view, or stored procedure, or an entire database or schema. For + * the latter cases, the forms DATABASE::{db_name} and + * SCHEMA::{schema_name} are used, respectively. + * + * For example: + * SELECT on dbo.myTable by public + * SELECT on DATABASE::myDatabase by public + * SELECT on SCHEMA::mySchema by public + * + * For more information, see [Database-Level Audit + * Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions). + */ + @JsonProperty(value = "properties.auditActionsAndGroups") + private List auditActionsAndGroups; + + /** + * Specifies the blob storage subscription Id. + */ + @JsonProperty(value = "properties.storageAccountSubscriptionId") + private UUID storageAccountSubscriptionId; + + /** + * Specifies whether storageAccountAccessKey value is the storage's + * secondary key. + */ + @JsonProperty(value = "properties.isStorageSecondaryKeyInUse") + private Boolean isStorageSecondaryKeyInUse; + + /** + * Specifies whether audit events are sent to Azure Monitor. + * In order to send the events to Azure Monitor, specify 'state' as + * 'Enabled' and 'isAzureMonitorTargetEnabled' as true. + * + * When using REST API to configure auditing, Diagnostic Settings with + * 'SQLSecurityAuditEvents' diagnostic logs category on the database should + * be also created. + * Note that for server level audit you should use the 'master' database as + * {databaseName}. + * + * Diagnostic Settings URI format: + * PUT + * https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview + * + * For more information, see [Diagnostic Settings REST + * API](https://go.microsoft.com/fwlink/?linkid=2033207) + * or [Diagnostic Settings + * PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043). + */ + @JsonProperty(value = "properties.isAzureMonitorTargetEnabled") + private Boolean isAzureMonitorTargetEnabled; + + /** + * Specifies the amount of time in milliseconds that can elapse before + * audit actions are forced to be processed. + * The default minimum value is 1000 (1 second). The maximum is + * 2,147,483,647. + */ + @JsonProperty(value = "properties.queueDelayMs") + private Integer queueDelayMs; + + /** + * Get specifies condition of where clause when creating an audit. + * + * @return the predicateExpression value + */ + public String predicateExpression() { + return this.predicateExpression; + } + + /** + * Set specifies condition of where clause when creating an audit. + * + * @param predicateExpression the predicateExpression value to set + * @return the ExtendedSqlPoolBlobAuditingPolicyInner object itself. + */ + public ExtendedSqlPoolBlobAuditingPolicyInner withPredicateExpression(String predicateExpression) { + this.predicateExpression = predicateExpression; + return this; + } + + /** + * Get specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'Enabled', 'Disabled'. + * + * @return the state value + */ + public BlobAuditingPolicyState state() { + return this.state; + } + + /** + * Set specifies the state of the policy. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. Possible values include: 'Enabled', 'Disabled'. + * + * @param state the state value to set + * @return the ExtendedSqlPoolBlobAuditingPolicyInner object itself. + */ + public ExtendedSqlPoolBlobAuditingPolicyInner withState(BlobAuditingPolicyState state) { + this.state = state; + return this; + } + + /** + * Get specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required. + * + * @return the storageEndpoint value + */ + public String storageEndpoint() { + return this.storageEndpoint; + } + + /** + * Set specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required. + * + * @param storageEndpoint the storageEndpoint value to set + * @return the ExtendedSqlPoolBlobAuditingPolicyInner object itself. + */ + public ExtendedSqlPoolBlobAuditingPolicyInner withStorageEndpoint(String storageEndpoint) { + this.storageEndpoint = storageEndpoint; + return this; + } + + /** + * Get specifies the identifier key of the auditing storage account. + If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage. + Prerequisites for using managed identity authentication: + 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). + 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity. + For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355). + * + * @return the storageAccountAccessKey value + */ + public String storageAccountAccessKey() { + return this.storageAccountAccessKey; + } + + /** + * Set specifies the identifier key of the auditing storage account. + If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage. + Prerequisites for using managed identity authentication: + 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). + 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity. + For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355). + * + * @param storageAccountAccessKey the storageAccountAccessKey value to set + * @return the ExtendedSqlPoolBlobAuditingPolicyInner object itself. + */ + public ExtendedSqlPoolBlobAuditingPolicyInner withStorageAccountAccessKey(String storageAccountAccessKey) { + this.storageAccountAccessKey = storageAccountAccessKey; + return this; + } + + /** + * Get specifies the number of days to keep in the audit logs in the storage account. + * + * @return the retentionDays value + */ + public Integer retentionDays() { + return this.retentionDays; + } + + /** + * Set specifies the number of days to keep in the audit logs in the storage account. + * + * @param retentionDays the retentionDays value to set + * @return the ExtendedSqlPoolBlobAuditingPolicyInner object itself. + */ + public ExtendedSqlPoolBlobAuditingPolicyInner withRetentionDays(Integer retentionDays) { + this.retentionDays = retentionDays; + return this; + } + + /** + * Get specifies the Actions-Groups and Actions to audit. + The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins: + BATCH_COMPLETED_GROUP, + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, + FAILED_DATABASE_AUTHENTICATION_GROUP. + This above combination is also the set that is configured by default when enabling auditing from the Azure portal. + The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records): + APPLICATION_ROLE_CHANGE_PASSWORD_GROUP + BACKUP_RESTORE_GROUP + DATABASE_LOGOUT_GROUP + DATABASE_OBJECT_CHANGE_GROUP + DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP + DATABASE_OBJECT_PERMISSION_CHANGE_GROUP + DATABASE_OPERATION_GROUP + DATABASE_PERMISSION_CHANGE_GROUP + DATABASE_PRINCIPAL_CHANGE_GROUP + DATABASE_PRINCIPAL_IMPERSONATION_GROUP + DATABASE_ROLE_MEMBER_CHANGE_GROUP + FAILED_DATABASE_AUTHENTICATION_GROUP + SCHEMA_OBJECT_ACCESS_GROUP + SCHEMA_OBJECT_CHANGE_GROUP + SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP + SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP + USER_CHANGE_PASSWORD_GROUP + BATCH_STARTED_GROUP + BATCH_COMPLETED_GROUP + These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. + For more information, see [Database-Level Audit Action Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). + For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are: + SELECT + UPDATE + INSERT + DELETE + EXECUTE + RECEIVE + REFERENCES + The general form for defining an action to be audited is: + {action} ON {object} BY {principal} + Note that <object> in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively. + For example: + SELECT on dbo.myTable by public + SELECT on DATABASE::myDatabase by public + SELECT on SCHEMA::mySchema by public + For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions). + * + * @return the auditActionsAndGroups value + */ + public List auditActionsAndGroups() { + return this.auditActionsAndGroups; + } + + /** + * Set specifies the Actions-Groups and Actions to audit. + The recommended set of action groups to use is the following combination - this will audit all the queries and stored procedures executed against the database, as well as successful and failed logins: + BATCH_COMPLETED_GROUP, + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, + FAILED_DATABASE_AUTHENTICATION_GROUP. + This above combination is also the set that is configured by default when enabling auditing from the Azure portal. + The supported action groups to audit are (note: choose only specific groups that cover your auditing needs. Using unnecessary groups could lead to very large quantities of audit records): + APPLICATION_ROLE_CHANGE_PASSWORD_GROUP + BACKUP_RESTORE_GROUP + DATABASE_LOGOUT_GROUP + DATABASE_OBJECT_CHANGE_GROUP + DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP + DATABASE_OBJECT_PERMISSION_CHANGE_GROUP + DATABASE_OPERATION_GROUP + DATABASE_PERMISSION_CHANGE_GROUP + DATABASE_PRINCIPAL_CHANGE_GROUP + DATABASE_PRINCIPAL_IMPERSONATION_GROUP + DATABASE_ROLE_MEMBER_CHANGE_GROUP + FAILED_DATABASE_AUTHENTICATION_GROUP + SCHEMA_OBJECT_ACCESS_GROUP + SCHEMA_OBJECT_CHANGE_GROUP + SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP + SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP + USER_CHANGE_PASSWORD_GROUP + BATCH_STARTED_GROUP + BATCH_COMPLETED_GROUP + These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. + For more information, see [Database-Level Audit Action Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). + For Database auditing policy, specific Actions can also be specified (note that Actions cannot be specified for Server auditing policy). The supported actions to audit are: + SELECT + UPDATE + INSERT + DELETE + EXECUTE + RECEIVE + REFERENCES + The general form for defining an action to be audited is: + {action} ON {object} BY {principal} + Note that <object> in the above format can refer to an object like a table, view, or stored procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively. + For example: + SELECT on dbo.myTable by public + SELECT on DATABASE::myDatabase by public + SELECT on SCHEMA::mySchema by public + For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions). + * + * @param auditActionsAndGroups the auditActionsAndGroups value to set + * @return the ExtendedSqlPoolBlobAuditingPolicyInner object itself. + */ + public ExtendedSqlPoolBlobAuditingPolicyInner withAuditActionsAndGroups(List auditActionsAndGroups) { + this.auditActionsAndGroups = auditActionsAndGroups; + return this; + } + + /** + * Get specifies the blob storage subscription Id. + * + * @return the storageAccountSubscriptionId value + */ + public UUID storageAccountSubscriptionId() { + return this.storageAccountSubscriptionId; + } + + /** + * Set specifies the blob storage subscription Id. + * + * @param storageAccountSubscriptionId the storageAccountSubscriptionId value to set + * @return the ExtendedSqlPoolBlobAuditingPolicyInner object itself. + */ + public ExtendedSqlPoolBlobAuditingPolicyInner withStorageAccountSubscriptionId(UUID storageAccountSubscriptionId) { + this.storageAccountSubscriptionId = storageAccountSubscriptionId; + return this; + } + + /** + * Get specifies whether storageAccountAccessKey value is the storage's secondary key. + * + * @return the isStorageSecondaryKeyInUse value + */ + public Boolean isStorageSecondaryKeyInUse() { + return this.isStorageSecondaryKeyInUse; + } + + /** + * Set specifies whether storageAccountAccessKey value is the storage's secondary key. + * + * @param isStorageSecondaryKeyInUse the isStorageSecondaryKeyInUse value to set + * @return the ExtendedSqlPoolBlobAuditingPolicyInner object itself. + */ + public ExtendedSqlPoolBlobAuditingPolicyInner withIsStorageSecondaryKeyInUse(Boolean isStorageSecondaryKeyInUse) { + this.isStorageSecondaryKeyInUse = isStorageSecondaryKeyInUse; + return this; + } + + /** + * Get specifies whether audit events are sent to Azure Monitor. + In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true. + When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. + Note that for server level audit you should use the 'master' database as {databaseName}. + Diagnostic Settings URI format: + PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview + For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207) + or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043). + * + * @return the isAzureMonitorTargetEnabled value + */ + public Boolean isAzureMonitorTargetEnabled() { + return this.isAzureMonitorTargetEnabled; + } + + /** + * Set specifies whether audit events are sent to Azure Monitor. + In order to send the events to Azure Monitor, specify 'state' as 'Enabled' and 'isAzureMonitorTargetEnabled' as true. + When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. + Note that for server level audit you should use the 'master' database as {databaseName}. + Diagnostic Settings URI format: + PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview + For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207) + or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043). + * + * @param isAzureMonitorTargetEnabled the isAzureMonitorTargetEnabled value to set + * @return the ExtendedSqlPoolBlobAuditingPolicyInner object itself. + */ + public ExtendedSqlPoolBlobAuditingPolicyInner withIsAzureMonitorTargetEnabled(Boolean isAzureMonitorTargetEnabled) { + this.isAzureMonitorTargetEnabled = isAzureMonitorTargetEnabled; + return this; + } + + /** + * Get specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed. + The default minimum value is 1000 (1 second). The maximum is 2,147,483,647. + * + * @return the queueDelayMs value + */ + public Integer queueDelayMs() { + return this.queueDelayMs; + } + + /** + * Set specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed. + The default minimum value is 1000 (1 second). The maximum is 2,147,483,647. + * + * @param queueDelayMs the queueDelayMs value to set + * @return the ExtendedSqlPoolBlobAuditingPolicyInner object itself. + */ + public ExtendedSqlPoolBlobAuditingPolicyInner withQueueDelayMs(Integer queueDelayMs) { + this.queueDelayMs = queueDelayMs; + return this; + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IntegrationRuntimeInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IntegrationRuntimeInner.java index b52baaba387a8..f05ebd3908001 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IntegrationRuntimeInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IntegrationRuntimeInner.java @@ -13,8 +13,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.microsoft.azure.management.synapse.v2019_06_01_preview.ManagedIntegrationRuntime; -import com.microsoft.azure.management.synapse.v2019_06_01_preview.SelfHostedIntegrationRuntime; /** * Azure Synapse nested object which serves as a compute resource for diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IntegrationRuntimeMonitoringDatasImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IntegrationRuntimeMonitoringDatasImpl.java index 0436c26bdf48f..023e3250f4c94 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IntegrationRuntimeMonitoringDatasImpl.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IntegrationRuntimeMonitoringDatasImpl.java @@ -28,9 +28,9 @@ public SynapseManager manager() { } @Override - public Observable getAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + public Observable listAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { IntegrationRuntimeMonitoringDatasInner client = this.inner(); - return client.getAsync(resourceGroupName, workspaceName, integrationRuntimeName) + return client.listAsync(resourceGroupName, workspaceName, integrationRuntimeName) .map(new Func1() { @Override public IntegrationRuntimeMonitoringData call(IntegrationRuntimeMonitoringDataInner inner) { diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IntegrationRuntimeMonitoringDatasInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IntegrationRuntimeMonitoringDatasInner.java index e7bd92c6016fb..7ddd17403e5bd 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IntegrationRuntimeMonitoringDatasInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IntegrationRuntimeMonitoringDatasInner.java @@ -51,9 +51,9 @@ public IntegrationRuntimeMonitoringDatasInner(Retrofit retrofit, SynapseManageme * used by Retrofit to perform actually REST calls. */ interface IntegrationRuntimeMonitoringDatasService { - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.IntegrationRuntimeMonitoringDatas get" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.IntegrationRuntimeMonitoringDatas list" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/monitoringData") - Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("integrationRuntimeName") String integrationRuntimeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("integrationRuntimeName") String integrationRuntimeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); } @@ -69,8 +69,8 @@ interface IntegrationRuntimeMonitoringDatasService { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the IntegrationRuntimeMonitoringDataInner object if successful. */ - public IntegrationRuntimeMonitoringDataInner get(String resourceGroupName, String workspaceName, String integrationRuntimeName) { - return getWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName).toBlocking().single().body(); + public IntegrationRuntimeMonitoringDataInner list(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return listWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName).toBlocking().single().body(); } /** @@ -84,8 +84,8 @@ public IntegrationRuntimeMonitoringDataInner get(String resourceGroupName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture getAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName), serviceCallback); + public ServiceFuture listAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName), serviceCallback); } /** @@ -98,8 +98,8 @@ public ServiceFuture getAsync(String reso * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the IntegrationRuntimeMonitoringDataInner object */ - public Observable getAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { - return getWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName).map(new Func1, IntegrationRuntimeMonitoringDataInner>() { + public Observable listAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return listWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName).map(new Func1, IntegrationRuntimeMonitoringDataInner>() { @Override public IntegrationRuntimeMonitoringDataInner call(ServiceResponse response) { return response.body(); @@ -117,7 +117,7 @@ public IntegrationRuntimeMonitoringDataInner call(ServiceResponse> getWithServiceResponseAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + public Observable> listWithServiceResponseAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -133,12 +133,12 @@ public Observable> getWit if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - return service.get(this.client.subscriptionId(), resourceGroupName, workspaceName, integrationRuntimeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + return service.list(this.client.subscriptionId(), resourceGroupName, workspaceName, integrationRuntimeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = getDelegate(response); + ServiceResponse clientResponse = listDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -147,7 +147,7 @@ public Observable> call(R }); } - private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IntegrationRuntimeObjectMetadatasImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IntegrationRuntimeObjectMetadatasImpl.java index 5d9eacd6d6c9e..4ae9f4b982048 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IntegrationRuntimeObjectMetadatasImpl.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IntegrationRuntimeObjectMetadatasImpl.java @@ -29,9 +29,9 @@ public SynapseManager manager() { } @Override - public Observable getAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + public Observable listAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { IntegrationRuntimeObjectMetadatasInner client = this.inner(); - return client.getAsync(resourceGroupName, workspaceName, integrationRuntimeName) + return client.listAsync(resourceGroupName, workspaceName, integrationRuntimeName) .map(new Func1() { @Override public SsisObjectMetadataListResponse call(SsisObjectMetadataListResponseInner inner) { diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IntegrationRuntimeObjectMetadatasInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IntegrationRuntimeObjectMetadatasInner.java index f499bf425075b..f268acbf8b2c2 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IntegrationRuntimeObjectMetadatasInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IntegrationRuntimeObjectMetadatasInner.java @@ -53,14 +53,18 @@ public IntegrationRuntimeObjectMetadatasInner(Retrofit retrofit, SynapseManageme * used by Retrofit to perform actually REST calls. */ interface IntegrationRuntimeObjectMetadatasService { - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.IntegrationRuntimeObjectMetadatas get" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.IntegrationRuntimeObjectMetadatas list" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/getObjectMetadata") - Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("integrationRuntimeName") String integrationRuntimeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body GetSsisObjectMetadataRequest getMetadataRequest, @Header("User-Agent") String userAgent); + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("integrationRuntimeName") String integrationRuntimeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body GetSsisObjectMetadataRequest getMetadataRequest, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.IntegrationRuntimeObjectMetadatas refresh" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/refreshObjectMetadata") Observable> refresh(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("integrationRuntimeName") String integrationRuntimeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.IntegrationRuntimeObjectMetadatas beginRefresh" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/refreshObjectMetadata") + Observable> beginRefresh(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("integrationRuntimeName") String integrationRuntimeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + } /** @@ -75,8 +79,8 @@ interface IntegrationRuntimeObjectMetadatasService { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the SsisObjectMetadataListResponseInner object if successful. */ - public SsisObjectMetadataListResponseInner get(String resourceGroupName, String workspaceName, String integrationRuntimeName) { - return getWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName).toBlocking().single().body(); + public SsisObjectMetadataListResponseInner list(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return listWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName).toBlocking().single().body(); } /** @@ -90,8 +94,8 @@ public SsisObjectMetadataListResponseInner get(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture getAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName), serviceCallback); + public ServiceFuture listAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName), serviceCallback); } /** @@ -104,8 +108,8 @@ public ServiceFuture getAsync(String resour * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the SsisObjectMetadataListResponseInner object */ - public Observable getAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { - return getWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName).map(new Func1, SsisObjectMetadataListResponseInner>() { + public Observable listAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return listWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName).map(new Func1, SsisObjectMetadataListResponseInner>() { @Override public SsisObjectMetadataListResponseInner call(ServiceResponse response) { return response.body(); @@ -123,7 +127,7 @@ public SsisObjectMetadataListResponseInner call(ServiceResponse> getWithServiceResponseAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + public Observable> listWithServiceResponseAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -142,12 +146,12 @@ public Observable> getWithS final String metadataPath = null; GetSsisObjectMetadataRequest getMetadataRequest = new GetSsisObjectMetadataRequest(); getMetadataRequest.withMetadataPath(null); - return service.get(this.client.subscriptionId(), resourceGroupName, workspaceName, integrationRuntimeName, this.client.apiVersion(), this.client.acceptLanguage(), getMetadataRequest, this.client.userAgent()) + return service.list(this.client.subscriptionId(), resourceGroupName, workspaceName, integrationRuntimeName, this.client.apiVersion(), this.client.acceptLanguage(), getMetadataRequest, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = getDelegate(response); + ServiceResponse clientResponse = listDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -169,8 +173,8 @@ public Observable> call(Res * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the SsisObjectMetadataListResponseInner object if successful. */ - public SsisObjectMetadataListResponseInner get(String resourceGroupName, String workspaceName, String integrationRuntimeName, String metadataPath) { - return getWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName, metadataPath).toBlocking().single().body(); + public SsisObjectMetadataListResponseInner list(String resourceGroupName, String workspaceName, String integrationRuntimeName, String metadataPath) { + return listWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName, metadataPath).toBlocking().single().body(); } /** @@ -185,8 +189,8 @@ public SsisObjectMetadataListResponseInner get(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture getAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName, String metadataPath, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName, metadataPath), serviceCallback); + public ServiceFuture listAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName, String metadataPath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName, metadataPath), serviceCallback); } /** @@ -200,8 +204,8 @@ public ServiceFuture getAsync(String resour * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the SsisObjectMetadataListResponseInner object */ - public Observable getAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName, String metadataPath) { - return getWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName, metadataPath).map(new Func1, SsisObjectMetadataListResponseInner>() { + public Observable listAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName, String metadataPath) { + return listWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName, metadataPath).map(new Func1, SsisObjectMetadataListResponseInner>() { @Override public SsisObjectMetadataListResponseInner call(ServiceResponse response) { return response.body(); @@ -220,7 +224,7 @@ public SsisObjectMetadataListResponseInner call(ServiceResponse> getWithServiceResponseAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName, String metadataPath) { + public Observable> listWithServiceResponseAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName, String metadataPath) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -241,12 +245,12 @@ public Observable> getWithS getMetadataRequest = new GetSsisObjectMetadataRequest(); getMetadataRequest.withMetadataPath(metadataPath); } - return service.get(this.client.subscriptionId(), resourceGroupName, workspaceName, integrationRuntimeName, this.client.apiVersion(), this.client.acceptLanguage(), getMetadataRequest, this.client.userAgent()) + return service.list(this.client.subscriptionId(), resourceGroupName, workspaceName, integrationRuntimeName, this.client.apiVersion(), this.client.acceptLanguage(), getMetadataRequest, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = getDelegate(response); + ServiceResponse clientResponse = listDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -255,7 +259,7 @@ public Observable> call(Res }); } - private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) @@ -275,7 +279,7 @@ private ServiceResponse getDelegate(Respons * @return the SsisObjectMetadataStatusResponseInner object if successful. */ public SsisObjectMetadataStatusResponseInner refresh(String resourceGroupName, String workspaceName, String integrationRuntimeName) { - return refreshWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName).toBlocking().single().body(); + return refreshWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName).toBlocking().last().body(); } /** @@ -301,7 +305,7 @@ public ServiceFuture refreshAsync(String * @param workspaceName The name of the workspace * @param integrationRuntimeName Integration runtime name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SsisObjectMetadataStatusResponseInner object + * @return the observable for the request */ public Observable refreshAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { return refreshWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName).map(new Func1, SsisObjectMetadataStatusResponseInner>() { @@ -320,7 +324,7 @@ public SsisObjectMetadataStatusResponseInner call(ServiceResponse> refreshWithServiceResponseAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { if (this.client.subscriptionId() == null) { @@ -338,12 +342,92 @@ public Observable> refres if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - return service.refresh(this.client.subscriptionId(), resourceGroupName, workspaceName, integrationRuntimeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + Observable> observable = service.refresh(this.client.subscriptionId(), resourceGroupName, workspaceName, integrationRuntimeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Refresh integration runtime object metadata. + * Refresh the object metadata in an integration runtime. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param integrationRuntimeName Integration runtime name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SsisObjectMetadataStatusResponseInner object if successful. + */ + public SsisObjectMetadataStatusResponseInner beginRefresh(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return beginRefreshWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName).toBlocking().single().body(); + } + + /** + * Refresh integration runtime object metadata. + * Refresh the object metadata in an integration runtime. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param integrationRuntimeName Integration runtime name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginRefreshAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginRefreshWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName), serviceCallback); + } + + /** + * Refresh integration runtime object metadata. + * Refresh the object metadata in an integration runtime. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param integrationRuntimeName Integration runtime name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SsisObjectMetadataStatusResponseInner object + */ + public Observable beginRefreshAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return beginRefreshWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName).map(new Func1, SsisObjectMetadataStatusResponseInner>() { + @Override + public SsisObjectMetadataStatusResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Refresh integration runtime object metadata. + * Refresh the object metadata in an integration runtime. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param integrationRuntimeName Integration runtime name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SsisObjectMetadataStatusResponseInner object + */ + public Observable> beginRefreshWithServiceResponseAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (integrationRuntimeName == null) { + throw new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginRefresh(this.client.subscriptionId(), resourceGroupName, workspaceName, integrationRuntimeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = refreshDelegate(response); + ServiceResponse clientResponse = beginRefreshDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -352,7 +436,7 @@ public Observable> call(R }); } - private ServiceResponse refreshDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse beginRefreshDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IntegrationRuntimesImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IntegrationRuntimesImpl.java index ca1f08733a8c6..3a4b3cc9d09dd 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IntegrationRuntimesImpl.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IntegrationRuntimesImpl.java @@ -67,6 +67,12 @@ public Completable stopAsync(String resourceGroupName, String workspaceName, Str return client.stopAsync(resourceGroupName, workspaceName, integrationRuntimeName).toCompletable(); } + @Override + public Completable enableInteractiveQueryAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + IntegrationRuntimesInner client = this.inner(); + return client.enableInteractiveQueryAsync(resourceGroupName, workspaceName, integrationRuntimeName).toCompletable(); + } + @Override public Observable listByWorkspaceAsync(final String resourceGroupName, final String workspaceName) { IntegrationRuntimesInner client = this.inner(); diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IntegrationRuntimesInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IntegrationRuntimesInner.java index ae0b2572a514d..ee48a851d4cac 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IntegrationRuntimesInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IntegrationRuntimesInner.java @@ -100,10 +100,26 @@ interface IntegrationRuntimesService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/start") Observable> start(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("integrationRuntimeName") String integrationRuntimeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.IntegrationRuntimes beginStart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/start") + Observable> beginStart(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("integrationRuntimeName") String integrationRuntimeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.IntegrationRuntimes stop" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/stop") Observable> stop(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("integrationRuntimeName") String integrationRuntimeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.IntegrationRuntimes beginStop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/stop") + Observable> beginStop(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("integrationRuntimeName") String integrationRuntimeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.IntegrationRuntimes enableInteractiveQuery" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/enableInteractiveQuery") + Observable> enableInteractiveQuery(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("integrationRuntimeName") String integrationRuntimeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.IntegrationRuntimes beginEnableInteractiveQuery" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/enableInteractiveQuery") + Observable> beginEnableInteractiveQuery(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("integrationRuntimeName") String integrationRuntimeName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.IntegrationRuntimes listByWorkspaceNext" }) @GET Observable> listByWorkspaceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -1219,7 +1235,7 @@ private ServiceResponse> listByWorkspa * @return the IntegrationRuntimeStatusResponseInner object if successful. */ public IntegrationRuntimeStatusResponseInner start(String resourceGroupName, String workspaceName, String integrationRuntimeName) { - return startWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName).toBlocking().single().body(); + return startWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName).toBlocking().last().body(); } /** @@ -1245,7 +1261,7 @@ public ServiceFuture startAsync(String re * @param workspaceName The name of the workspace * @param integrationRuntimeName Integration runtime name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the IntegrationRuntimeStatusResponseInner object + * @return the observable for the request */ public Observable startAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { return startWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName).map(new Func1, IntegrationRuntimeStatusResponseInner>() { @@ -1264,7 +1280,7 @@ public IntegrationRuntimeStatusResponseInner call(ServiceResponse> startWithServiceResponseAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { if (this.client.subscriptionId() == null) { @@ -1282,12 +1298,92 @@ public Observable> startW if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - return service.start(this.client.subscriptionId(), resourceGroupName, workspaceName, integrationRuntimeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + Observable> observable = service.start(this.client.subscriptionId(), resourceGroupName, workspaceName, integrationRuntimeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Start integration runtime. + * Start an integration runtime. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param integrationRuntimeName Integration runtime name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IntegrationRuntimeStatusResponseInner object if successful. + */ + public IntegrationRuntimeStatusResponseInner beginStart(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return beginStartWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName).toBlocking().single().body(); + } + + /** + * Start integration runtime. + * Start an integration runtime. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param integrationRuntimeName Integration runtime name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStartAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName), serviceCallback); + } + + /** + * Start integration runtime. + * Start an integration runtime. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param integrationRuntimeName Integration runtime name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IntegrationRuntimeStatusResponseInner object + */ + public Observable beginStartAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return beginStartWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName).map(new Func1, IntegrationRuntimeStatusResponseInner>() { + @Override + public IntegrationRuntimeStatusResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Start integration runtime. + * Start an integration runtime. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param integrationRuntimeName Integration runtime name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IntegrationRuntimeStatusResponseInner object + */ + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (integrationRuntimeName == null) { + throw new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginStart(this.client.subscriptionId(), resourceGroupName, workspaceName, integrationRuntimeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = startDelegate(response); + ServiceResponse clientResponse = beginStartDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1296,7 +1392,7 @@ public Observable> call(R }); } - private ServiceResponse startDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse beginStartDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) @@ -1316,7 +1412,7 @@ private ServiceResponse startDelegate(Res * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ public void stop(String resourceGroupName, String workspaceName, String integrationRuntimeName) { - stopWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName).toBlocking().single().body(); + stopWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName).toBlocking().last().body(); } /** @@ -1342,7 +1438,7 @@ public ServiceFuture stopAsync(String resourceGroupName, String workspaceN * @param workspaceName The name of the workspace * @param integrationRuntimeName Integration runtime name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable for the request */ public Observable stopAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { return stopWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName).map(new Func1, Void>() { @@ -1361,7 +1457,7 @@ public Void call(ServiceResponse response) { * @param workspaceName The name of the workspace * @param integrationRuntimeName Integration runtime name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable for the request */ public Observable> stopWithServiceResponseAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { if (this.client.subscriptionId() == null) { @@ -1379,12 +1475,259 @@ public Observable> stopWithServiceResponseAsync(String res if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - return service.stop(this.client.subscriptionId(), resourceGroupName, workspaceName, integrationRuntimeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + Observable> observable = service.stop(this.client.subscriptionId(), resourceGroupName, workspaceName, integrationRuntimeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Stop integration runtime. + * Stop an integration runtime. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param integrationRuntimeName Integration runtime name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStop(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + beginStopWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName).toBlocking().single().body(); + } + + /** + * Stop integration runtime. + * Stop an integration runtime. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param integrationRuntimeName Integration runtime name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStopAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStopWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName), serviceCallback); + } + + /** + * Stop integration runtime. + * Stop an integration runtime. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param integrationRuntimeName Integration runtime name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStopAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return beginStopWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stop integration runtime. + * Stop an integration runtime. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param integrationRuntimeName Integration runtime name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (integrationRuntimeName == null) { + throw new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginStop(this.client.subscriptionId(), resourceGroupName, workspaceName, integrationRuntimeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStopDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Enable interactive query in integration runtime. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param integrationRuntimeName Integration runtime name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void enableInteractiveQuery(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + enableInteractiveQueryWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName).toBlocking().last().body(); + } + + /** + * Enable interactive query in integration runtime. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param integrationRuntimeName Integration runtime name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture enableInteractiveQueryAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(enableInteractiveQueryWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName), serviceCallback); + } + + /** + * Enable interactive query in integration runtime. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param integrationRuntimeName Integration runtime name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable enableInteractiveQueryAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return enableInteractiveQueryWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Enable interactive query in integration runtime. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param integrationRuntimeName Integration runtime name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> enableInteractiveQueryWithServiceResponseAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (integrationRuntimeName == null) { + throw new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.enableInteractiveQuery(this.client.subscriptionId(), resourceGroupName, workspaceName, integrationRuntimeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Enable interactive query in integration runtime. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param integrationRuntimeName Integration runtime name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginEnableInteractiveQuery(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + beginEnableInteractiveQueryWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName).toBlocking().single().body(); + } + + /** + * Enable interactive query in integration runtime. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param integrationRuntimeName Integration runtime name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginEnableInteractiveQueryAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginEnableInteractiveQueryWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName), serviceCallback); + } + + /** + * Enable interactive query in integration runtime. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param integrationRuntimeName Integration runtime name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginEnableInteractiveQueryAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return beginEnableInteractiveQueryWithServiceResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Enable interactive query in integration runtime. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param integrationRuntimeName Integration runtime name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginEnableInteractiveQueryWithServiceResponseAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (integrationRuntimeName == null) { + throw new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginEnableInteractiveQuery(this.client.subscriptionId(), resourceGroupName, workspaceName, integrationRuntimeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = stopDelegate(response); + ServiceResponse clientResponse = beginEnableInteractiveQueryDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1393,7 +1736,7 @@ public Observable> call(Response response) { }); } - private ServiceResponse stopDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + private ServiceResponse beginEnableInteractiveQueryDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IpFirewallRulesInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IpFirewallRulesInner.java index 0ce7fd879fe47..e9d6b7f702157 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IpFirewallRulesInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/IpFirewallRulesInner.java @@ -11,8 +11,8 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; import com.microsoft.azure.AzureServiceFuture; -import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ErrorContractException; import com.microsoft.azure.management.synapse.v2019_06_01_preview.IpFirewallRuleProperties; import com.microsoft.azure.management.synapse.v2019_06_01_preview.ReplaceAllIpFirewallRulesRequest; import com.microsoft.azure.Page; @@ -111,7 +111,7 @@ interface IpFirewallRulesService { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<IpFirewallRuleInfoInner> object if successful. */ @@ -221,10 +221,10 @@ public Observable>> call(Response< }); } - private ServiceResponse> listByWorkspaceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listByWorkspaceDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -236,7 +236,7 @@ private ServiceResponse> listByWorkspaceDelega * @param ruleName The IP firewall rule name * @param ipFirewallRuleInfo IP firewall rule properties * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the IpFirewallRuleInfoInner object if successful. */ @@ -320,7 +320,7 @@ public Observable> createOrUpdateWithSe * @param ruleName The IP firewall rule name * @param ipFirewallRuleInfo IP firewall rule properties * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the IpFirewallRuleInfoInner object if successful. */ @@ -406,11 +406,11 @@ public Observable> call(Response beginCreateOrUpdateDelegate(Response response) throws ErrorContractInnerException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(201, new TypeToken() { }.getType()) - .registerError(ErrorContractInnerException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -421,7 +421,7 @@ private ServiceResponse beginCreateOrUpdateDelegate(Res * @param workspaceName The name of the workspace * @param ruleName The IP firewall rule name * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the Object object if successful. */ @@ -497,7 +497,7 @@ public Observable> deleteWithServiceResponseAsync(String * @param workspaceName The name of the workspace * @param ruleName The IP firewall rule name * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the Object object if successful. */ @@ -576,12 +576,12 @@ public Observable> call(Response response) }); } - private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) .register(204, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -592,7 +592,7 @@ private ServiceResponse beginDeleteDelegate(Response respo * @param workspaceName The name of the workspace * @param ruleName The IP firewall rule name * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the IpFirewallRuleInfoInner object if successful. */ @@ -671,10 +671,10 @@ public Observable> call(Response getDelegate(Response response) throws ErrorContractInnerException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(ErrorContractInnerException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -684,7 +684,7 @@ private ServiceResponse getDelegate(Response * @param workspaceName The name of the workspace * @param ipFirewallRules IP firewall rule properties * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ReplaceAllFirewallRulesOperationResponseInner object if successful. */ @@ -831,7 +831,7 @@ public Observable * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ReplaceAllFirewallRulesOperationResponseInner object if successful. */ @@ -914,7 +914,7 @@ public Observable * @param workspaceName The name of the workspace * @param ipFirewallRules IP firewall rule properties * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ReplaceAllFirewallRulesOperationResponseInner object if successful. */ @@ -993,11 +993,11 @@ public Observable }); } - private ServiceResponse beginReplaceAllDelegate(Response response) throws ErrorContractInnerException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginReplaceAllDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) - .registerError(ErrorContractInnerException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -1006,7 +1006,7 @@ private ServiceResponse beginRepl * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<IpFirewallRuleInfoInner> object if successful. */ @@ -1105,10 +1105,10 @@ public Observable>> call(Response< }); } - private ServiceResponse> listByWorkspaceNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listByWorkspaceNextDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/KeyImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/KeyImpl.java new file mode 100644 index 0000000000000..82a65b0493e68 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/KeyImpl.java @@ -0,0 +1,116 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import com.microsoft.azure.management.synapse.v2019_06_01_preview.Key; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; + +class KeyImpl extends CreatableUpdatableImpl implements Key, Key.Definition, Key.Update { + private final SynapseManager manager; + private String resourceGroupName; + private String workspaceName; + private String keyName; + + KeyImpl(String name, SynapseManager manager) { + super(name, new KeyInner()); + this.manager = manager; + // Set resource name + this.keyName = name; + // + } + + KeyImpl(KeyInner inner, SynapseManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.keyName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.workspaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "workspaces"); + this.keyName = IdParsingUtils.getValueFromIdByName(inner.id(), "keys"); + // + } + + @Override + public SynapseManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + KeysInner client = this.manager().inner().keys(); + return client.createOrUpdateAsync(this.resourceGroupName, this.workspaceName, this.keyName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + KeysInner client = this.manager().inner().keys(); + return client.createOrUpdateAsync(this.resourceGroupName, this.workspaceName, this.keyName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + KeysInner client = this.manager().inner().keys(); + return client.getAsync(this.resourceGroupName, this.workspaceName, this.keyName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Boolean isActiveCMK() { + return this.inner().isActiveCMK(); + } + + @Override + public String keyVaultUrl() { + return this.inner().keyVaultUrl(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public KeyImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + @Override + public KeyImpl withIsActiveCMK(Boolean isActiveCMK) { + this.inner().withIsActiveCMK(isActiveCMK); + return this; + } + + @Override + public KeyImpl withKeyVaultUrl(String keyVaultUrl) { + this.inner().withKeyVaultUrl(keyVaultUrl); + return this; + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/KeyInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/KeyInner.java new file mode 100644 index 0000000000000..70d9b844c2f60 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/KeyInner.java @@ -0,0 +1,72 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A workspace key. + */ +@JsonFlatten +public class KeyInner extends ProxyResource { + /** + * Used to activate the workspace after a customer managed key is provided. + */ + @JsonProperty(value = "properties.isActiveCMK") + private Boolean isActiveCMK; + + /** + * The Key Vault Url of the workspace key. + */ + @JsonProperty(value = "properties.keyVaultUrl") + private String keyVaultUrl; + + /** + * Get used to activate the workspace after a customer managed key is provided. + * + * @return the isActiveCMK value + */ + public Boolean isActiveCMK() { + return this.isActiveCMK; + } + + /** + * Set used to activate the workspace after a customer managed key is provided. + * + * @param isActiveCMK the isActiveCMK value to set + * @return the KeyInner object itself. + */ + public KeyInner withIsActiveCMK(Boolean isActiveCMK) { + this.isActiveCMK = isActiveCMK; + return this; + } + + /** + * Get the Key Vault Url of the workspace key. + * + * @return the keyVaultUrl value + */ + public String keyVaultUrl() { + return this.keyVaultUrl; + } + + /** + * Set the Key Vault Url of the workspace key. + * + * @param keyVaultUrl the keyVaultUrl value to set + * @return the KeyInner object itself. + */ + public KeyInner withKeyVaultUrl(String keyVaultUrl) { + this.keyVaultUrl = keyVaultUrl; + return this; + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/KeysImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/KeysImpl.java new file mode 100644 index 0000000000000..b834c6fa4e2be --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/KeysImpl.java @@ -0,0 +1,85 @@ +/** + * 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. + * + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.Keys; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.Key; + +class KeysImpl extends WrapperImpl implements Keys { + private final SynapseManager manager; + + KeysImpl(SynapseManager manager) { + super(manager.inner().keys()); + this.manager = manager; + } + + public SynapseManager manager() { + return this.manager; + } + + @Override + public KeyImpl define(String name) { + return wrapModel(name); + } + + private KeyImpl wrapModel(KeyInner inner) { + return new KeyImpl(inner, manager()); + } + + private KeyImpl wrapModel(String name) { + return new KeyImpl(name, this.manager()); + } + + @Override + public Observable listByWorkspaceAsync(final String resourceGroupName, final String workspaceName) { + KeysInner client = this.inner(); + return client.listByWorkspaceAsync(resourceGroupName, workspaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Key call(KeyInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String workspaceName, String keyName) { + KeysInner client = this.inner(); + return client.getAsync(resourceGroupName, workspaceName, keyName) + .flatMap(new Func1>() { + @Override + public Observable call(KeyInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Key)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String workspaceName, String keyName) { + KeysInner client = this.inner(); + return client.deleteAsync(resourceGroupName, workspaceName, keyName).toCompletable(); + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/KeysInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/KeysInner.java new file mode 100644 index 0000000000000..d7c15da5426f3 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/KeysInner.java @@ -0,0 +1,608 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ErrorContractException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Keys. + */ +public class KeysInner { + /** The Retrofit service to perform REST calls. */ + private KeysService service; + /** The service client containing this operation class. */ + private SynapseManagementClientImpl client; + + /** + * Initializes an instance of KeysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public KeysInner(Retrofit retrofit, SynapseManagementClientImpl client) { + this.service = retrofit.create(KeysService.class); + this.client = client; + } + + /** + * The interface defining all the services for Keys to be + * used by Retrofit to perform actually REST calls. + */ + interface KeysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.Keys listByWorkspace" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/keys") + Observable> listByWorkspace(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.Keys get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/keys/{keyName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("keyName") String keyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.Keys createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/keys/{keyName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("keyName") String keyName, @Query("api-version") String apiVersion, @Body KeyInner keyProperties, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.Keys delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/keys/{keyName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("keyName") String keyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.Keys listByWorkspaceNext" }) + @GET + Observable> listByWorkspaceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Returns a list of keys in a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorContractException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<KeyInner> object if successful. + */ + public PagedList listByWorkspace(final String resourceGroupName, final String workspaceName) { + ServiceResponse> response = listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByWorkspaceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Returns a list of keys in a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByWorkspaceAsync(final String resourceGroupName, final String workspaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByWorkspaceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Returns a list of keys in a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyInner> object + */ + public Observable> listByWorkspaceAsync(final String resourceGroupName, final String workspaceName) { + return listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns a list of keys in a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyInner> object + */ + public Observable>> listByWorkspaceWithServiceResponseAsync(final String resourceGroupName, final String workspaceName) { + return listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByWorkspaceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Returns a list of keys in a workspace. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param workspaceName The name of the workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<KeyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByWorkspaceSinglePageAsync(final String resourceGroupName, final String workspaceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByWorkspace(this.client.subscriptionId(), resourceGroupName, workspaceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByWorkspaceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByWorkspaceDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorContractException.class) + .build(response); + } + + /** + * Gets a workspace key. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param keyName The name of the workspace key + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorContractException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyInner object if successful. + */ + public KeyInner get(String resourceGroupName, String workspaceName, String keyName) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, keyName).toBlocking().single().body(); + } + + /** + * Gets a workspace key. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param keyName The name of the workspace key + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String workspaceName, String keyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, workspaceName, keyName), serviceCallback); + } + + /** + * Gets a workspace key. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param keyName The name of the workspace key + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyInner object + */ + public Observable getAsync(String resourceGroupName, String workspaceName, String keyName) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, keyName).map(new Func1, KeyInner>() { + @Override + public KeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a workspace key. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param keyName The name of the workspace key + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String workspaceName, String keyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, workspaceName, keyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorContractException.class) + .build(response); + } + + /** + * Creates or updates a workspace key. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param keyName The name of the workspace key + * @param keyProperties Key put request properties + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorContractException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyInner object if successful. + */ + public KeyInner createOrUpdate(String resourceGroupName, String workspaceName, String keyName, KeyInner keyProperties) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, keyName, keyProperties).toBlocking().single().body(); + } + + /** + * Creates or updates a workspace key. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param keyName The name of the workspace key + * @param keyProperties Key put request properties + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String workspaceName, String keyName, KeyInner keyProperties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, keyName, keyProperties), serviceCallback); + } + + /** + * Creates or updates a workspace key. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param keyName The name of the workspace key + * @param keyProperties Key put request properties + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String workspaceName, String keyName, KeyInner keyProperties) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, keyName, keyProperties).map(new Func1, KeyInner>() { + @Override + public KeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a workspace key. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param keyName The name of the workspace key + * @param keyProperties Key put request properties + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String workspaceName, String keyName, KeyInner keyProperties) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (keyProperties == null) { + throw new IllegalArgumentException("Parameter keyProperties is required and cannot be null."); + } + Validator.validate(keyProperties); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, workspaceName, keyName, this.client.apiVersion(), keyProperties, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorContractException.class) + .build(response); + } + + /** + * Deletes a workspace key. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param keyName The name of the workspace key + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorContractException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the KeyInner object if successful. + */ + public KeyInner delete(String resourceGroupName, String workspaceName, String keyName) { + return deleteWithServiceResponseAsync(resourceGroupName, workspaceName, keyName).toBlocking().single().body(); + } + + /** + * Deletes a workspace key. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param keyName The name of the workspace key + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String workspaceName, String keyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, workspaceName, keyName), serviceCallback); + } + + /** + * Deletes a workspace key. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param keyName The name of the workspace key + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyInner object + */ + public Observable deleteAsync(String resourceGroupName, String workspaceName, String keyName) { + return deleteWithServiceResponseAsync(resourceGroupName, workspaceName, keyName).map(new Func1, KeyInner>() { + @Override + public KeyInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a workspace key. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param keyName The name of the workspace key + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the KeyInner object + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String workspaceName, String keyName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, workspaceName, keyName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorContractException.class) + .build(response); + } + + /** + * Returns a list of keys in a workspace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorContractException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<KeyInner> object if successful. + */ + public PagedList listByWorkspaceNext(final String nextPageLink) { + ServiceResponse> response = listByWorkspaceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByWorkspaceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Returns a list of keys in a workspace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByWorkspaceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByWorkspaceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByWorkspaceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Returns a list of keys in a workspace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyInner> object + */ + public Observable> listByWorkspaceNextAsync(final String nextPageLink) { + return listByWorkspaceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns a list of keys in a workspace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<KeyInner> object + */ + public Observable>> listByWorkspaceNextWithServiceResponseAsync(final String nextPageLink) { + return listByWorkspaceNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByWorkspaceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Returns a list of keys in a workspace. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<KeyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByWorkspaceNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByWorkspaceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByWorkspaceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByWorkspaceNextDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorContractException.class) + .build(response); + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/MetadataSyncConfigImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/MetadataSyncConfigImpl.java index 69b798a6843b6..17ce91fd8d12f 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/MetadataSyncConfigImpl.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/MetadataSyncConfigImpl.java @@ -38,6 +38,11 @@ public String name() { return this.inner().name(); } + @Override + public Integer syncIntervalInMinutes() { + return this.inner().syncIntervalInMinutes(); + } + @Override public String type() { return this.inner().type(); diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/MetadataSyncConfigInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/MetadataSyncConfigInner.java index 28d6f325d09a8..f5a2de6f74c92 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/MetadataSyncConfigInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/MetadataSyncConfigInner.java @@ -24,6 +24,12 @@ public class MetadataSyncConfigInner extends ProxyResource { @JsonProperty(value = "properties.enabled") private Boolean enabled; + /** + * The Sync Interval in minutes. + */ + @JsonProperty(value = "properties.syncIntervalInMinutes") + private Integer syncIntervalInMinutes; + /** * Get indicates whether the metadata sync is enabled or disabled. * @@ -44,4 +50,24 @@ public MetadataSyncConfigInner withEnabled(Boolean enabled) { return this; } + /** + * Get the Sync Interval in minutes. + * + * @return the syncIntervalInMinutes value + */ + public Integer syncIntervalInMinutes() { + return this.syncIntervalInMinutes; + } + + /** + * Set the Sync Interval in minutes. + * + * @param syncIntervalInMinutes the syncIntervalInMinutes value to set + * @return the MetadataSyncConfigInner object itself. + */ + public MetadataSyncConfigInner withSyncIntervalInMinutes(Integer syncIntervalInMinutes) { + this.syncIntervalInMinutes = syncIntervalInMinutes; + return this; + } + } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/OperationResourceImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/OperationResourceImpl.java new file mode 100644 index 0000000000000..6b5e747a5093c --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/OperationResourceImpl.java @@ -0,0 +1,86 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import com.microsoft.azure.management.synapse.v2019_06_01_preview.OperationResource; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ErrorDetail; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.OperationStatus; + +class OperationResourceImpl extends IndexableRefreshableWrapperImpl implements OperationResource { + private final SynapseManager manager; + private String resourceGroupName; + private String workspaceName; + private String operationId; + + OperationResourceImpl(OperationResourceInner inner, SynapseManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.workspaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "workspaces"); + this.operationId = IdParsingUtils.getValueFromIdByName(inner.id(), "operationStatuses"); + } + + @Override + public SynapseManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + OperationsInner client = this.manager().inner().operations(); + return client.getAzureAsyncHeaderResultAsync(this.resourceGroupName, this.workspaceName, this.operationId); + } + + + + @Override + public DateTime endTime() { + return this.inner().endTime(); + } + + @Override + public ErrorDetail error() { + return this.inner().error(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Double percentComplete() { + return this.inner().percentComplete(); + } + + @Override + public Object properties() { + return this.inner().properties(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + + @Override + public OperationStatus status() { + return this.inner().status(); + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/OperationsImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/OperationsImpl.java index 9ad33808076f4..b77d70b22006e 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/OperationsImpl.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/OperationsImpl.java @@ -4,16 +4,17 @@ * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * abc + * */ package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; import com.microsoft.azure.arm.model.implementation.WrapperImpl; import com.microsoft.azure.management.synapse.v2019_06_01_preview.Operations; -import rx.Completable; -import rx.functions.Func1; import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.OperationResource; +import rx.Completable; import java.util.List; import com.microsoft.azure.management.synapse.v2019_06_01_preview.CheckNameAvailabilityResponse; import com.microsoft.azure.management.synapse.v2019_06_01_preview.AvailableRpOperation; @@ -31,17 +32,31 @@ public SynapseManager manager() { return this.manager; } + private OperationResourceImpl wrapModel(OperationResourceInner inner) { + return new OperationResourceImpl(inner, manager()); + } + @Override - public Completable getLocationHeaderResultAsync(String resourceGroupName, String workspaceName, String operationId) { + public Observable getAzureAsyncHeaderResultAsync(String resourceGroupName, String workspaceName, String operationId) { OperationsInner client = this.inner(); - return client.getLocationHeaderResultAsync(resourceGroupName, workspaceName, operationId).toCompletable(); + return client.getAzureAsyncHeaderResultAsync(resourceGroupName, workspaceName, operationId) + .flatMap(new Func1>() { + @Override + public Observable call(OperationResourceInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((OperationResource)wrapModel(inner)); + } + } + }); } @Override - public Observable getAzureAsyncHeaderResultAsync(String resourceGroupName, String workspaceName, String operationId) { + public Completable getLocationHeaderResultAsync(String resourceGroupName, String workspaceName, String operationId) { OperationsInner client = this.inner(); - return client.getAzureAsyncHeaderResultAsync(resourceGroupName, workspaceName, operationId) - ;} + return client.getLocationHeaderResultAsync(resourceGroupName, workspaceName, operationId).toCompletable(); + } @Override public Observable checkNameAvailabilityAsync(CheckNameAvailabilityRequest request) { diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/OperationsInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/OperationsInner.java index b07de2719a2b0..684423bd50e2d 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/OperationsInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/OperationsInner.java @@ -10,8 +10,8 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; -import com.microsoft.azure.CloudException; import com.microsoft.azure.management.synapse.v2019_06_01_preview.CheckNameAvailabilityRequest; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ErrorContractException; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; @@ -80,7 +80,7 @@ interface OperationsService { * * @param request The check request * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the CheckNameAvailabilityResponseInner object if successful. */ @@ -151,10 +151,10 @@ public Observable> call(Resp }); } - private ServiceResponse checkNameAvailabilityDelegate(Response response) throws ErrorContractInnerException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(ErrorContractInnerException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -163,7 +163,7 @@ private ServiceResponse checkNameAvailabilit * Get all available operations. * * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the List<AvailableRpOperationInner> object if successful. */ @@ -221,10 +221,10 @@ public Observable>> call(Respons }); } - private ServiceResponse> listDelegate(Response response) throws CloudException, IOException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listDelegate(Response response) throws ErrorContractException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -236,7 +236,7 @@ private ServiceResponse> listDelegate(Response> call(Response response) { }); } - private ServiceResponse getLocationHeaderResultDelegate(Response response) throws ErrorContractInnerException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getLocationHeaderResultDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) .register(204, new TypeToken() { }.getType()) - .registerError(ErrorContractInnerException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -333,11 +335,11 @@ private ServiceResponse getLocationHeaderResultDelegate(Response getAzureAsyncHeaderResultAsync(String resourceGroupName, String workspaceName, String operationId, final ServiceCallback serviceCallback) { + public ServiceFuture getAzureAsyncHeaderResultAsync(String resourceGroupName, String workspaceName, String operationId, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(getAzureAsyncHeaderResultWithServiceResponseAsync(resourceGroupName, workspaceName, operationId), serviceCallback); } @@ -364,12 +366,12 @@ public ServiceFuture getAzureAsyncHeaderResultAsync(String resourceGroup * @param workspaceName The name of the workspace * @param operationId Operation ID * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the Object object + * @return the observable to the OperationResourceInner object */ - public Observable getAzureAsyncHeaderResultAsync(String resourceGroupName, String workspaceName, String operationId) { - return getAzureAsyncHeaderResultWithServiceResponseAsync(resourceGroupName, workspaceName, operationId).map(new Func1, Object>() { + public Observable getAzureAsyncHeaderResultAsync(String resourceGroupName, String workspaceName, String operationId) { + return getAzureAsyncHeaderResultWithServiceResponseAsync(resourceGroupName, workspaceName, operationId).map(new Func1, OperationResourceInner>() { @Override - public Object call(ServiceResponse response) { + public OperationResourceInner call(ServiceResponse response) { return response.body(); } }); @@ -383,9 +385,9 @@ public Object call(ServiceResponse response) { * @param workspaceName The name of the workspace * @param operationId Operation ID * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the Object object + * @return the observable to the OperationResourceInner object */ - public Observable> getAzureAsyncHeaderResultWithServiceResponseAsync(String resourceGroupName, String workspaceName, String operationId) { + public Observable> getAzureAsyncHeaderResultWithServiceResponseAsync(String resourceGroupName, String workspaceName, String operationId) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -402,11 +404,11 @@ public Observable> getAzureAsyncHeaderResultWithServiceR throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.getAzureAsyncHeaderResult(this.client.subscriptionId(), resourceGroupName, workspaceName, operationId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = getAzureAsyncHeaderResultDelegate(response); + ServiceResponse clientResponse = getAzureAsyncHeaderResultDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -415,12 +417,11 @@ public Observable> call(Response response) }); } - private ServiceResponse getAzureAsyncHeaderResultDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getAzureAsyncHeaderResultDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(404, new TypeToken() { }.getType()) - .register(500, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PageImpl1.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PageImpl1.java new file mode 100644 index 0000000000000..d7f7cf7a98a71 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PageImpl1.java @@ -0,0 +1,75 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl1 implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl1 setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl1 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateEndpointConnectionForPrivateLinkHubImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateEndpointConnectionForPrivateLinkHubImpl.java new file mode 100644 index 0000000000000..b330b72177660 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateEndpointConnectionForPrivateLinkHubImpl.java @@ -0,0 +1,62 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import com.microsoft.azure.management.synapse.v2019_06_01_preview.PrivateEndpointConnectionForPrivateLinkHub; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.PrivateEndpoint; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.PrivateLinkServiceConnectionState; + +class PrivateEndpointConnectionForPrivateLinkHubImpl extends WrapperImpl implements PrivateEndpointConnectionForPrivateLinkHub { + private final SynapseManager manager; + + PrivateEndpointConnectionForPrivateLinkHubImpl(PrivateEndpointConnectionForPrivateLinkHubInner inner, SynapseManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public SynapseManager manager() { + return this.manager; + } + + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public PrivateEndpoint privateEndpoint() { + return this.inner().privateEndpoint(); + } + + @Override + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.inner().privateLinkServiceConnectionState(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateEndpointConnectionForPrivateLinkHubInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateEndpointConnectionForPrivateLinkHubInner.java new file mode 100644 index 0000000000000..6b5651dda5705 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateEndpointConnectionForPrivateLinkHubInner.java @@ -0,0 +1,70 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.PrivateEndpointConnectionForPrivateLinkHubBasic; + +/** + * The PrivateEndpointConnectionForPrivateLinkHubInner model. + */ +public class PrivateEndpointConnectionForPrivateLinkHubInner extends PrivateEndpointConnectionForPrivateLinkHubBasic { + /** + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The type property. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the PrivateEndpointConnectionForPrivateLinkHubInner object itself. + */ + public PrivateEndpointConnectionForPrivateLinkHubInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type value. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type value. + * + * @param type the type value to set + * @return the PrivateEndpointConnectionForPrivateLinkHubInner object itself. + */ + public PrivateEndpointConnectionForPrivateLinkHubInner withType(String type) { + this.type = type; + return this; + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateEndpointConnectionImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateEndpointConnectionImpl.java index 2716849331189..e43963f7c3b9b 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateEndpointConnectionImpl.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateEndpointConnectionImpl.java @@ -48,14 +48,14 @@ public SynapseManager manager() { @Override public Observable createResourceAsync() { PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); - return client.createAsync(this.resourceGroupName, this.workspaceName, this.privateEndpointConnectionName) + return client.createAsync(this.resourceGroupName, this.workspaceName, this.privateEndpointConnectionName, this.inner()) .map(innerToFluentMap(this)); } @Override public Observable updateResourceAsync() { PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); - return client.createAsync(this.resourceGroupName, this.workspaceName, this.privateEndpointConnectionName) + return client.createAsync(this.resourceGroupName, this.workspaceName, this.privateEndpointConnectionName, this.inner()) .map(innerToFluentMap(this)); } @@ -108,4 +108,16 @@ public PrivateEndpointConnectionImpl withExistingWorkspace(String resourceGroupN return this; } + @Override + public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.inner().withPrivateEndpoint(privateEndpoint); + return this; + } + + @Override + public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.inner().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateEndpointConnectionsInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateEndpointConnectionsInner.java index 41ddaafe290e1..a3d2e656d192b 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateEndpointConnectionsInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateEndpointConnectionsInner.java @@ -12,14 +12,17 @@ import com.google.common.reflect.TypeToken; import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ErrorContractException; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; import java.io.IOException; import java.util.List; import okhttp3.ResponseBody; +import retrofit2.http.Body; import retrofit2.http.GET; import retrofit2.http.Header; import retrofit2.http.Headers; @@ -64,11 +67,11 @@ interface PrivateEndpointConnectionsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.PrivateEndpointConnections create" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") - Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Body PrivateEndpointConnectionInner request, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.PrivateEndpointConnections beginCreate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") - Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Body PrivateEndpointConnectionInner request, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.PrivateEndpointConnections delete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}", method = "DELETE", hasBody = true) @@ -92,10 +95,10 @@ interface PrivateEndpointConnectionsService { * Gets a private endpoint connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace + * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PrivateEndpointConnectionInner object if successful. */ @@ -107,7 +110,7 @@ public PrivateEndpointConnectionInner get(String resourceGroupName, String works * Gets a private endpoint connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace + * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -121,7 +124,7 @@ public ServiceFuture getAsync(String resourceGro * Gets a private endpoint connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace + * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PrivateEndpointConnectionInner object @@ -139,7 +142,7 @@ public PrivateEndpointConnectionInner call(ServiceResponse> call(Response }); } - private ServiceResponse getDelegate(Response response) throws ErrorContractInnerException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(ErrorContractInnerException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -185,42 +188,45 @@ private ServiceResponse getDelegate(Response createAsync(String resourceGroupName, String workspaceName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName), serviceCallback); + public ServiceFuture createAsync(String resourceGroupName, String workspaceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner request, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, request), serviceCallback); } /** * Approve or reject a private endpoint connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace + * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param request Request body of private endpoint connection to create. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - public Observable createAsync(String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { - return createWithServiceResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName).map(new Func1, PrivateEndpointConnectionInner>() { + public Observable createAsync(String resourceGroupName, String workspaceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner request) { + return createWithServiceResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, request).map(new Func1, PrivateEndpointConnectionInner>() { @Override public PrivateEndpointConnectionInner call(ServiceResponse response) { return response.body(); @@ -232,12 +238,13 @@ public PrivateEndpointConnectionInner call(ServiceResponse> createWithServiceResponseAsync(String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + public Observable> createWithServiceResponseAsync(String resourceGroupName, String workspaceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner request) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -250,10 +257,14 @@ public Observable> createWithSer if (privateEndpointConnectionName == null) { throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); } + if (request == null) { + throw new IllegalArgumentException("Parameter request is required and cannot be null."); + } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + Validator.validate(request); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, request, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -261,42 +272,45 @@ public Observable> createWithSer * Approve or reject a private endpoint connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace + * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param request Request body of private endpoint connection to create. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PrivateEndpointConnectionInner object if successful. */ - public PrivateEndpointConnectionInner beginCreate(String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { - return beginCreateWithServiceResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName).toBlocking().single().body(); + public PrivateEndpointConnectionInner beginCreate(String resourceGroupName, String workspaceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner request) { + return beginCreateWithServiceResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, request).toBlocking().single().body(); } /** * Approve or reject a private endpoint connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace + * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param request Request body of private endpoint connection to create. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture beginCreateAsync(String resourceGroupName, String workspaceName, String privateEndpointConnectionName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName), serviceCallback); + public ServiceFuture beginCreateAsync(String resourceGroupName, String workspaceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner request, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, request), serviceCallback); } /** * Approve or reject a private endpoint connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace + * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param request Request body of private endpoint connection to create. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PrivateEndpointConnectionInner object */ - public Observable beginCreateAsync(String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { - return beginCreateWithServiceResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName).map(new Func1, PrivateEndpointConnectionInner>() { + public Observable beginCreateAsync(String resourceGroupName, String workspaceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner request) { + return beginCreateWithServiceResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, request).map(new Func1, PrivateEndpointConnectionInner>() { @Override public PrivateEndpointConnectionInner call(ServiceResponse response) { return response.body(); @@ -308,12 +322,13 @@ public PrivateEndpointConnectionInner call(ServiceResponse> beginCreateWithServiceResponseAsync(String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String workspaceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner request) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -326,10 +341,14 @@ public Observable> beginCreateWi if (privateEndpointConnectionName == null) { throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); } + if (request == null) { + throw new IllegalArgumentException("Parameter request is required and cannot be null."); + } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - return service.beginCreate(this.client.subscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + Validator.validate(request); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, workspaceName, privateEndpointConnectionName, request, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -343,11 +362,11 @@ public Observable> call(Response }); } - private ServiceResponse beginCreateDelegate(Response response) throws ErrorContractInnerException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginCreateDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(201, new TypeToken() { }.getType()) - .registerError(ErrorContractInnerException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -355,10 +374,10 @@ private ServiceResponse beginCreateDelegate(Resp * Delete a private endpoint connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace + * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the OperationResourceInner object if successful. */ @@ -370,7 +389,7 @@ public OperationResourceInner delete(String resourceGroupName, String workspaceN * Delete a private endpoint connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace + * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -384,7 +403,7 @@ public ServiceFuture deleteAsync(String resourceGroupNam * Delete a private endpoint connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace + * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -402,7 +421,7 @@ public OperationResourceInner call(ServiceResponse respo * Delete a private endpoint connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace + * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request @@ -431,10 +450,10 @@ public Observable> deleteWithServiceResp * Delete a private endpoint connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace + * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the OperationResourceInner object if successful. */ @@ -446,7 +465,7 @@ public OperationResourceInner beginDelete(String resourceGroupName, String works * Delete a private endpoint connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace + * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -460,7 +479,7 @@ public ServiceFuture beginDeleteAsync(String resourceGro * Delete a private endpoint connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace + * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the OperationResourceInner object @@ -478,7 +497,7 @@ public OperationResourceInner call(ServiceResponse respo * Delete a private endpoint connection. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace + * @param workspaceName The name of the workspace. * @param privateEndpointConnectionName The name of the private endpoint connection. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the OperationResourceInner object @@ -513,11 +532,12 @@ public Observable> call(Response beginDeleteDelegate(Response response) throws ErrorContractInnerException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) .register(204, new TypeToken() { }.getType()) - .registerError(ErrorContractInnerException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -525,9 +545,9 @@ private ServiceResponse beginDeleteDelegate(Response nextPage(String nextPageLink) { * Lists private endpoint connection in workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace + * @param workspaceName The name of the workspace. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object @@ -566,7 +586,7 @@ public Observable>> call(St * Lists private endpoint connection in workspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace + * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<PrivateEndpointConnectionInner> object */ @@ -584,7 +604,7 @@ public Page call(ServiceResponse>> call(Se * Lists private endpoint connection in workspace. * ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. - ServiceResponse> * @param workspaceName The name of the workspace + ServiceResponse> * @param workspaceName The name of the workspace. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<PrivateEndpointConnectionInner> object wrapped in {@link ServiceResponse} if successful. */ @@ -637,10 +657,10 @@ public Observable>> call(Re }); } - private ServiceResponse> listDelegate(Response response) throws ErrorContractInnerException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorContractInnerException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(ErrorContractInnerException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -649,7 +669,7 @@ private ServiceResponse> listDelegate(R * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<PrivateEndpointConnectionInner> object if successful. */ @@ -748,10 +768,10 @@ public Observable>> call(Re }); } - private ServiceResponse> listNextDelegate(Response response) throws ErrorContractInnerException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., ErrorContractInnerException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listNextDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(ErrorContractInnerException.class) + .registerError(ErrorContractException.class) .build(response); } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateEndpointConnectionsPrivateLinkHubsImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateEndpointConnectionsPrivateLinkHubsImpl.java new file mode 100644 index 0000000000000..122fc4f4627be --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateEndpointConnectionsPrivateLinkHubsImpl.java @@ -0,0 +1,53 @@ +/** + * 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. + * + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.PrivateEndpointConnectionsPrivateLinkHubs; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.PrivateEndpointConnectionForPrivateLinkHub; + +class PrivateEndpointConnectionsPrivateLinkHubsImpl extends WrapperImpl implements PrivateEndpointConnectionsPrivateLinkHubs { + private final SynapseManager manager; + + PrivateEndpointConnectionsPrivateLinkHubsImpl(SynapseManager manager) { + super(manager.inner().privateEndpointConnectionsPrivateLinkHubs()); + this.manager = manager; + } + + public SynapseManager manager() { + return this.manager; + } + + private PrivateEndpointConnectionForPrivateLinkHubImpl wrapModel(PrivateEndpointConnectionForPrivateLinkHubInner inner) { + return new PrivateEndpointConnectionForPrivateLinkHubImpl(inner, manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String privateLinkHubName) { + PrivateEndpointConnectionsPrivateLinkHubsInner client = this.inner(); + return client.listAsync(resourceGroupName, privateLinkHubName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PrivateEndpointConnectionForPrivateLinkHub call(PrivateEndpointConnectionForPrivateLinkHubInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateEndpointConnectionsPrivateLinkHubsInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateEndpointConnectionsPrivateLinkHubsInner.java new file mode 100644 index 0000000000000..320d46e7428b6 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateEndpointConnectionsPrivateLinkHubsInner.java @@ -0,0 +1,303 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ErrorContractException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PrivateEndpointConnectionsPrivateLinkHubs. + */ +public class PrivateEndpointConnectionsPrivateLinkHubsInner { + /** The Retrofit service to perform REST calls. */ + private PrivateEndpointConnectionsPrivateLinkHubsService service; + /** The service client containing this operation class. */ + private SynapseManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsPrivateLinkHubsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PrivateEndpointConnectionsPrivateLinkHubsInner(Retrofit retrofit, SynapseManagementClientImpl client) { + this.service = retrofit.create(PrivateEndpointConnectionsPrivateLinkHubsService.class); + this.client = client; + } + + /** + * The interface defining all the services for PrivateEndpointConnectionsPrivateLinkHubs to be + * used by Retrofit to perform actually REST calls. + */ + interface PrivateEndpointConnectionsPrivateLinkHubsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.PrivateEndpointConnectionsPrivateLinkHubs list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/privateLinkHubs/{privateLinkHubName}/privateEndpointConnections") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateLinkHubName") String privateLinkHubName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.PrivateEndpointConnectionsPrivateLinkHubs listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get all PrivateEndpointConnections in the PrivateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorContractException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PrivateEndpointConnectionForPrivateLinkHubInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String privateLinkHubName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, privateLinkHubName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all PrivateEndpointConnections in the PrivateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String privateLinkHubName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, privateLinkHubName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all PrivateEndpointConnections in the PrivateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateEndpointConnectionForPrivateLinkHubInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String privateLinkHubName) { + return listWithServiceResponseAsync(resourceGroupName, privateLinkHubName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all PrivateEndpointConnections in the PrivateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateEndpointConnectionForPrivateLinkHubInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String privateLinkHubName) { + return listSinglePageAsync(resourceGroupName, privateLinkHubName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all PrivateEndpointConnections in the PrivateLinkHub. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param privateLinkHubName Name of the privateLinkHub + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PrivateEndpointConnectionForPrivateLinkHubInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String privateLinkHubName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateLinkHubName == null) { + throw new IllegalArgumentException("Parameter privateLinkHubName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, privateLinkHubName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorContractException.class) + .build(response); + } + + /** + * Get all PrivateEndpointConnections in the PrivateLinkHub. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorContractException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PrivateEndpointConnectionForPrivateLinkHubInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all PrivateEndpointConnections in the PrivateLinkHub. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all PrivateEndpointConnections in the PrivateLinkHub. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateEndpointConnectionForPrivateLinkHubInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all PrivateEndpointConnections in the PrivateLinkHub. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<PrivateEndpointConnectionForPrivateLinkHubInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all PrivateEndpointConnections in the PrivateLinkHub. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<PrivateEndpointConnectionForPrivateLinkHubInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorContractException.class) + .build(response); + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateLinkHubImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateLinkHubImpl.java index 435897828cf0f..7f0577e0a04d9 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateLinkHubImpl.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateLinkHubImpl.java @@ -11,6 +11,8 @@ import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; import com.microsoft.azure.management.synapse.v2019_06_01_preview.PrivateLinkHub; import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.PrivateEndpointConnectionForPrivateLinkHubBasic; class PrivateLinkHubImpl extends GroupableResourceCoreImpl implements PrivateLinkHub, PrivateLinkHub.Definition, PrivateLinkHub.Update { PrivateLinkHubImpl(String name, PrivateLinkHubInner inner, SynapseManager manager) { @@ -43,9 +45,20 @@ public boolean isInCreateMode() { } + @Override + public List privateEndpointConnections() { + return this.inner().privateEndpointConnections(); + } + @Override public String provisioningState() { return this.inner().provisioningState(); } + @Override + public PrivateLinkHubImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateLinkHubInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateLinkHubInner.java index bdf78210c96a8..bd79092868b4a 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateLinkHubInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateLinkHubInner.java @@ -8,6 +8,8 @@ package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; +import java.util.List; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.PrivateEndpointConnectionForPrivateLinkHubBasic; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; import com.microsoft.azure.Resource; @@ -18,14 +20,19 @@ @JsonFlatten public class PrivateLinkHubInner extends Resource { /** - * PrivateLinkHub provisioning state. Possible values include: 'Succeeded', - * 'Failed'. + * PrivateLinkHub provisioning state. */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "properties.provisioningState") private String provisioningState; /** - * Get privateLinkHub provisioning state. Possible values include: 'Succeeded', 'Failed'. + * List of private endpoint connections. + */ + @JsonProperty(value = "properties.privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /** + * Get privateLinkHub provisioning state. * * @return the provisioningState value */ @@ -33,4 +40,24 @@ public String provisioningState() { return this.provisioningState; } + /** + * Set privateLinkHub provisioning state. + * + * @param provisioningState the provisioningState value to set + * @return the PrivateLinkHubInner object itself. + */ + public PrivateLinkHubInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get list of private endpoint connections. + * + * @return the privateEndpointConnections value + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateLinkHubsInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateLinkHubsInner.java index bdb63b093ac2b..17faf1f5bde41 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateLinkHubsInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateLinkHubsInner.java @@ -14,8 +14,8 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; import com.microsoft.azure.AzureServiceFuture; -import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ErrorContractException; import com.microsoft.azure.management.synapse.v2019_06_01_preview.PrivateLinkHubPatchInfo; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; @@ -81,12 +81,16 @@ interface PrivateLinkHubsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.PrivateLinkHubs createOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/privateLinkHubs/{privateLinkHubName}") - Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateLinkHubName") String privateLinkHubName, @Query("api-version") String apiVersion, @Body PrivateLinkHubInner privateLinkHubInfo, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateLinkHubName") String privateLinkHubName, @Body PrivateLinkHubInner privateLinkHubInfo, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.PrivateLinkHubs delete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/privateLinkHubs/{privateLinkHubName}", method = "DELETE", hasBody = true) Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateLinkHubName") String privateLinkHubName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.PrivateLinkHubs beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/privateLinkHubs/{privateLinkHubName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("privateLinkHubName") String privateLinkHubName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.PrivateLinkHubs list" }) @GET("subscriptions/{subscriptionId}/providers/Microsoft.Synapse/privateLinkHubs") Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -106,7 +110,7 @@ interface PrivateLinkHubsService { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<PrivateLinkHubInner> object if successful. */ @@ -209,10 +213,10 @@ public Observable>> call(Response> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -220,9 +224,9 @@ private ServiceResponse> listByResourceGroupDelega * Gets a privateLinkHub. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkHubName The name of the privateLinkHub + * @param privateLinkHubName Name of the privateLinkHub * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PrivateLinkHubInner object if successful. */ @@ -234,7 +238,7 @@ public PrivateLinkHubInner getByResourceGroup(String resourceGroupName, String p * Gets a privateLinkHub. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkHubName The name of the privateLinkHub + * @param privateLinkHubName Name of the privateLinkHub * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object @@ -247,7 +251,7 @@ public ServiceFuture getByResourceGroupAsync(String resourc * Gets a privateLinkHub. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkHubName The name of the privateLinkHub + * @param privateLinkHubName Name of the privateLinkHub * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PrivateLinkHubInner object */ @@ -264,7 +268,7 @@ public PrivateLinkHubInner call(ServiceResponse response) { * Gets a privateLinkHub. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkHubName The name of the privateLinkHub + * @param privateLinkHubName Name of the privateLinkHub * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PrivateLinkHubInner object */ @@ -295,10 +299,10 @@ public Observable> call(Response getByResourceGroupDelegate(Response response) throws ErrorContractInnerException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(ErrorContractInnerException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -306,9 +310,9 @@ private ServiceResponse getByResourceGroupDelegate(Response * Updates a privateLinkHub. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkHubName The name of the privateLinkHub + * @param privateLinkHubName Name of the privateLinkHub * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PrivateLinkHubInner object if successful. */ @@ -320,7 +324,7 @@ public PrivateLinkHubInner update(String resourceGroupName, String privateLinkHu * Updates a privateLinkHub. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkHubName The name of the privateLinkHub + * @param privateLinkHubName Name of the privateLinkHub * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object @@ -333,7 +337,7 @@ public ServiceFuture updateAsync(String resourceGroupName, * Updates a privateLinkHub. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkHubName The name of the privateLinkHub + * @param privateLinkHubName Name of the privateLinkHub * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PrivateLinkHubInner object */ @@ -350,7 +354,7 @@ public PrivateLinkHubInner call(ServiceResponse response) { * Updates a privateLinkHub. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkHubName The name of the privateLinkHub + * @param privateLinkHubName Name of the privateLinkHub * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PrivateLinkHubInner object */ @@ -388,10 +392,10 @@ public Observable> call(Response updateAsync(String resourceGroupName, * Updates a privateLinkHub. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkHubName The name of the privateLinkHub + * @param privateLinkHubName Name of the privateLinkHub * @param tags Resource tags * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PrivateLinkHubInner object @@ -435,7 +439,7 @@ public PrivateLinkHubInner call(ServiceResponse response) { * Updates a privateLinkHub. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkHubName The name of the privateLinkHub + * @param privateLinkHubName Name of the privateLinkHub * @param tags Resource tags * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PrivateLinkHubInner object @@ -470,11 +474,11 @@ public Observable> call(Response updateDelegate(Response response) throws ErrorContractInnerException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse updateDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(201, new TypeToken() { }.getType()) - .registerError(ErrorContractInnerException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -482,10 +486,10 @@ private ServiceResponse updateDelegate(Response createOrUpdateAsync(String resourceGro * Creates or updates a privateLinkHub. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkHubName The name of the privateLinkHub + * @param privateLinkHubName Name of the privateLinkHub * @param privateLinkHubInfo PrivateLinkHub create or update request properties * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PrivateLinkHubInner object @@ -529,7 +533,7 @@ public PrivateLinkHubInner call(ServiceResponse response) { * Creates or updates a privateLinkHub. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkHubName The name of the privateLinkHub + * @param privateLinkHubName Name of the privateLinkHub * @param privateLinkHubInfo PrivateLinkHub create or update request properties * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PrivateLinkHubInner object @@ -544,14 +548,14 @@ public Observable> createOrUpdateWithServic if (privateLinkHubName == null) { throw new IllegalArgumentException("Parameter privateLinkHubName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } if (privateLinkHubInfo == null) { throw new IllegalArgumentException("Parameter privateLinkHubInfo is required and cannot be null."); } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } Validator.validate(privateLinkHubInfo); - return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, privateLinkHubName, this.client.apiVersion(), privateLinkHubInfo, this.client.acceptLanguage(), this.client.userAgent()) + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, privateLinkHubName, privateLinkHubInfo, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -565,11 +569,11 @@ public Observable> call(Response createOrUpdateDelegate(Response response) throws ErrorContractInnerException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse createOrUpdateDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(201, new TypeToken() { }.getType()) - .registerError(ErrorContractInnerException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -577,20 +581,20 @@ private ServiceResponse createOrUpdateDelegate(Response deleteAsync(String resourceGroupName, String privateL * Deletes a privateLinkHub. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkHubName The name of the privateLinkHub + * @param privateLinkHubName Name of the privateLinkHub * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable for the request */ public Observable deleteAsync(String resourceGroupName, String privateLinkHubName) { return deleteWithServiceResponseAsync(resourceGroupName, privateLinkHubName).map(new Func1, Void>() { @@ -620,9 +624,9 @@ public Void call(ServiceResponse response) { * Deletes a privateLinkHub. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param privateLinkHubName The name of the privateLinkHub + * @param privateLinkHubName Name of the privateLinkHub * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceResponse} object if successful. + * @return the observable for the request */ public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String privateLinkHubName) { if (this.client.subscriptionId() == null) { @@ -637,12 +641,80 @@ public Observable> deleteWithServiceResponseAsync(String r if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - return service.delete(this.client.subscriptionId(), resourceGroupName, privateLinkHubName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, privateLinkHubName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a privateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorContractException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String privateLinkHubName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, privateLinkHubName).toBlocking().single().body(); + } + + /** + * Deletes a privateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String privateLinkHubName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, privateLinkHubName), serviceCallback); + } + + /** + * Deletes a privateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String privateLinkHubName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, privateLinkHubName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a privateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String privateLinkHubName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (privateLinkHubName == null) { + throw new IllegalArgumentException("Parameter privateLinkHubName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, privateLinkHubName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = deleteDelegate(response); + ServiceResponse clientResponse = beginDeleteDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -651,11 +723,12 @@ public Observable> call(Response response) { }); } - private ServiceResponse deleteDelegate(Response response) throws ErrorContractInnerException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) .register(204, new TypeToken() { }.getType()) - .registerError(ErrorContractInnerException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -663,7 +736,7 @@ private ServiceResponse deleteDelegate(Response response) th * Returns a list of privateLinkHubs in a subscription. * * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<PrivateLinkHubInner> object if successful. */ @@ -759,10 +832,10 @@ public Observable>> call(Response> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -771,7 +844,7 @@ private ServiceResponse> listDelegate(Response>> call(Response> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -882,7 +955,7 @@ private ServiceResponse> listByResourceGroupNextDe * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<PrivateLinkHubInner> object if successful. */ @@ -981,10 +1054,10 @@ public Observable>> call(Response> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listNextDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateLinkResourcesInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateLinkResourcesInner.java index da159a68c0c2c..1940eb95cebfb 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateLinkResourcesInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/PrivateLinkResourcesInner.java @@ -11,8 +11,8 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; import com.microsoft.azure.AzureServiceFuture; -import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ErrorContractException; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -78,7 +78,7 @@ interface PrivateLinkResourcesService { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<PrivateLinkResourceInner> object if successful. */ @@ -192,10 +192,10 @@ public Observable>> call(Response }); } - private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -207,7 +207,7 @@ private ServiceResponse> listDelegate(Respons * @param workspaceName The name of the workspace * @param privateLinkResourceName The name of the private link resource * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PrivateLinkResourceInner object if successful. */ @@ -289,10 +289,10 @@ public Observable> call(Response getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -302,7 +302,7 @@ private ServiceResponse getDelegate(Response>> call(Response }); } - private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listNextDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/ReplicationLinkImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/ReplicationLinkImpl.java index e4cb93936cb2a..3717865bdea70 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/ReplicationLinkImpl.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/ReplicationLinkImpl.java @@ -9,18 +9,27 @@ package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; import com.microsoft.azure.management.synapse.v2019_06_01_preview.ReplicationLink; -import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; import rx.Observable; import com.microsoft.azure.management.synapse.v2019_06_01_preview.ReplicationRole; import com.microsoft.azure.management.synapse.v2019_06_01_preview.ReplicationState; import org.joda.time.DateTime; -class ReplicationLinkImpl extends WrapperImpl implements ReplicationLink { +class ReplicationLinkImpl extends IndexableRefreshableWrapperImpl implements ReplicationLink { private final SynapseManager manager; + private String resourceGroupName; + private String workspaceName; + private String sqlPoolName; + private String linkId; ReplicationLinkImpl(ReplicationLinkInner inner, SynapseManager manager) { - super(inner); + super(null, inner); this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.workspaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "workspaces"); + this.sqlPoolName = IdParsingUtils.getValueFromIdByName(inner.id(), "sqlPools"); + this.linkId = IdParsingUtils.getValueFromIdByName(inner.id(), "replicationLinks"); } @Override @@ -28,6 +37,12 @@ public SynapseManager manager() { return this.manager; } + @Override + protected Observable getInnerAsync() { + SqlPoolReplicationLinksInner client = this.manager().inner().sqlPoolReplicationLinks(); + return client.getByNameAsync(this.resourceGroupName, this.workspaceName, this.sqlPoolName, this.linkId); + } + @Override diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/RestorableDroppedSqlPoolImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/RestorableDroppedSqlPoolImpl.java new file mode 100644 index 0000000000000..f8f9f45d36236 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/RestorableDroppedSqlPoolImpl.java @@ -0,0 +1,104 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import com.microsoft.azure.management.synapse.v2019_06_01_preview.RestorableDroppedSqlPool; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; + +class RestorableDroppedSqlPoolImpl extends IndexableRefreshableWrapperImpl implements RestorableDroppedSqlPool { + private final SynapseManager manager; + private String resourceGroupName; + private String workspaceName; + private String restorableDroppedSqlPoolId; + + RestorableDroppedSqlPoolImpl(RestorableDroppedSqlPoolInner inner, SynapseManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.workspaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "workspaces"); + this.restorableDroppedSqlPoolId = IdParsingUtils.getValueFromIdByName(inner.id(), "restorableDroppedSqlPools"); + } + + @Override + public SynapseManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + RestorableDroppedSqlPoolsInner client = this.manager().inner().restorableDroppedSqlPools(); + return client.getAsync(this.resourceGroupName, this.workspaceName, this.restorableDroppedSqlPoolId); + } + + + + @Override + public DateTime creationDate() { + return this.inner().creationDate(); + } + + @Override + public String databaseName() { + return this.inner().databaseName(); + } + + @Override + public DateTime deletionDate() { + return this.inner().deletionDate(); + } + + @Override + public DateTime earliestRestoreDate() { + return this.inner().earliestRestoreDate(); + } + + @Override + public String edition() { + return this.inner().edition(); + } + + @Override + public String elasticPoolName() { + return this.inner().elasticPoolName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String maxSizeBytes() { + return this.inner().maxSizeBytes(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String serviceLevelObjective() { + return this.inner().serviceLevelObjective(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/RestorableDroppedSqlPoolInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/RestorableDroppedSqlPoolInner.java new file mode 100644 index 0000000000000..0bcf9aed93f9b --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/RestorableDroppedSqlPoolInner.java @@ -0,0 +1,156 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * A restorable dropped Sql pool. + */ +@JsonFlatten +public class RestorableDroppedSqlPoolInner extends ProxyResource { + /** + * The geo-location where the resource lives. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /** + * The name of the database. + */ + @JsonProperty(value = "properties.databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /** + * The edition of the database. + */ + @JsonProperty(value = "properties.edition", access = JsonProperty.Access.WRITE_ONLY) + private String edition; + + /** + * The max size in bytes of the database. + */ + @JsonProperty(value = "properties.maxSizeBytes", access = JsonProperty.Access.WRITE_ONLY) + private String maxSizeBytes; + + /** + * The service level objective name of the database. + */ + @JsonProperty(value = "properties.serviceLevelObjective", access = JsonProperty.Access.WRITE_ONLY) + private String serviceLevelObjective; + + /** + * The elastic pool name of the database. + */ + @JsonProperty(value = "properties.elasticPoolName", access = JsonProperty.Access.WRITE_ONLY) + private String elasticPoolName; + + /** + * The creation date of the database (ISO8601 format). + */ + @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationDate; + + /** + * The deletion date of the database (ISO8601 format). + */ + @JsonProperty(value = "properties.deletionDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime deletionDate; + + /** + * The earliest restore date of the database (ISO8601 format). + */ + @JsonProperty(value = "properties.earliestRestoreDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime earliestRestoreDate; + + /** + * Get the geo-location where the resource lives. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Get the name of the database. + * + * @return the databaseName value + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get the edition of the database. + * + * @return the edition value + */ + public String edition() { + return this.edition; + } + + /** + * Get the max size in bytes of the database. + * + * @return the maxSizeBytes value + */ + public String maxSizeBytes() { + return this.maxSizeBytes; + } + + /** + * Get the service level objective name of the database. + * + * @return the serviceLevelObjective value + */ + public String serviceLevelObjective() { + return this.serviceLevelObjective; + } + + /** + * Get the elastic pool name of the database. + * + * @return the elasticPoolName value + */ + public String elasticPoolName() { + return this.elasticPoolName; + } + + /** + * Get the creation date of the database (ISO8601 format). + * + * @return the creationDate value + */ + public DateTime creationDate() { + return this.creationDate; + } + + /** + * Get the deletion date of the database (ISO8601 format). + * + * @return the deletionDate value + */ + public DateTime deletionDate() { + return this.deletionDate; + } + + /** + * Get the earliest restore date of the database (ISO8601 format). + * + * @return the earliestRestoreDate value + */ + public DateTime earliestRestoreDate() { + return this.earliestRestoreDate; + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/RestorableDroppedSqlPoolsImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/RestorableDroppedSqlPoolsImpl.java new file mode 100644 index 0000000000000..08bfba8fa8d36 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/RestorableDroppedSqlPoolsImpl.java @@ -0,0 +1,69 @@ +/** + * 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. + * + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.RestorableDroppedSqlPools; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.RestorableDroppedSqlPool; + +class RestorableDroppedSqlPoolsImpl extends WrapperImpl implements RestorableDroppedSqlPools { + private final SynapseManager manager; + + RestorableDroppedSqlPoolsImpl(SynapseManager manager) { + super(manager.inner().restorableDroppedSqlPools()); + this.manager = manager; + } + + public SynapseManager manager() { + return this.manager; + } + + private RestorableDroppedSqlPoolImpl wrapModel(RestorableDroppedSqlPoolInner inner) { + return new RestorableDroppedSqlPoolImpl(inner, manager()); + } + + @Override + public Observable listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + RestorableDroppedSqlPoolsInner client = this.inner(); + return client.listByWorkspaceAsync(resourceGroupName, workspaceName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public RestorableDroppedSqlPool call(RestorableDroppedSqlPoolInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String workspaceName, String restorableDroppedSqlPoolId) { + RestorableDroppedSqlPoolsInner client = this.inner(); + return client.getAsync(resourceGroupName, workspaceName, restorableDroppedSqlPoolId) + .flatMap(new Func1>() { + @Override + public Observable call(RestorableDroppedSqlPoolInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((RestorableDroppedSqlPool)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/RestorableDroppedSqlPoolsInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/RestorableDroppedSqlPoolsInner.java new file mode 100644 index 0000000000000..20063e15047cd --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/RestorableDroppedSqlPoolsInner.java @@ -0,0 +1,249 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ErrorContractException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in RestorableDroppedSqlPools. + */ +public class RestorableDroppedSqlPoolsInner { + /** The Retrofit service to perform REST calls. */ + private RestorableDroppedSqlPoolsService service; + /** The service client containing this operation class. */ + private SynapseManagementClientImpl client; + + /** + * Initializes an instance of RestorableDroppedSqlPoolsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RestorableDroppedSqlPoolsInner(Retrofit retrofit, SynapseManagementClientImpl client) { + this.service = retrofit.create(RestorableDroppedSqlPoolsService.class); + this.client = client; + } + + /** + * The interface defining all the services for RestorableDroppedSqlPools to be + * used by Retrofit to perform actually REST calls. + */ + interface RestorableDroppedSqlPoolsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.RestorableDroppedSqlPools get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/restorableDroppedSqlPools/{restorableDroppedSqlPoolId}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("restorableDroppedSqlPoolId") String restorableDroppedSqlPoolId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.RestorableDroppedSqlPools listByWorkspace" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/restorableDroppedSqlPools") + Observable> listByWorkspace(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a deleted sql pool that can be restored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param restorableDroppedSqlPoolId The id of the deleted Sql Pool in the form of sqlPoolName,deletionTimeInFileTimeFormat + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorContractException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RestorableDroppedSqlPoolInner object if successful. + */ + public RestorableDroppedSqlPoolInner get(String resourceGroupName, String workspaceName, String restorableDroppedSqlPoolId) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, restorableDroppedSqlPoolId).toBlocking().single().body(); + } + + /** + * Gets a deleted sql pool that can be restored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param restorableDroppedSqlPoolId The id of the deleted Sql Pool in the form of sqlPoolName,deletionTimeInFileTimeFormat + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String workspaceName, String restorableDroppedSqlPoolId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, workspaceName, restorableDroppedSqlPoolId), serviceCallback); + } + + /** + * Gets a deleted sql pool that can be restored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param restorableDroppedSqlPoolId The id of the deleted Sql Pool in the form of sqlPoolName,deletionTimeInFileTimeFormat + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RestorableDroppedSqlPoolInner object + */ + public Observable getAsync(String resourceGroupName, String workspaceName, String restorableDroppedSqlPoolId) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, restorableDroppedSqlPoolId).map(new Func1, RestorableDroppedSqlPoolInner>() { + @Override + public RestorableDroppedSqlPoolInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a deleted sql pool that can be restored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param restorableDroppedSqlPoolId The id of the deleted Sql Pool in the form of sqlPoolName,deletionTimeInFileTimeFormat + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RestorableDroppedSqlPoolInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String workspaceName, String restorableDroppedSqlPoolId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (restorableDroppedSqlPoolId == null) { + throw new IllegalArgumentException("Parameter restorableDroppedSqlPoolId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, workspaceName, restorableDroppedSqlPoolId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorContractException.class) + .build(response); + } + + /** + * Gets a list of deleted Sql pools that can be restored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorContractException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<RestorableDroppedSqlPoolInner> object if successful. + */ + public List listByWorkspace(String resourceGroupName, String workspaceName) { + return listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName).toBlocking().single().body(); + } + + /** + * Gets a list of deleted Sql pools that can be restored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByWorkspaceAsync(String resourceGroupName, String workspaceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName), serviceCallback); + } + + /** + * Gets a list of deleted Sql pools that can be restored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<RestorableDroppedSqlPoolInner> object + */ + public Observable> listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + return listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of deleted Sql pools that can be restored. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<RestorableDroppedSqlPoolInner> object + */ + public Observable>> listByWorkspaceWithServiceResponseAsync(String resourceGroupName, String workspaceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByWorkspace(this.client.subscriptionId(), resourceGroupName, workspaceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByWorkspaceDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByWorkspaceDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorContractException.class) + .build(response); + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/RestorePointImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/RestorePointImpl.java index 744e1b7b10d4f..eca27d3cb9517 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/RestorePointImpl.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/RestorePointImpl.java @@ -9,17 +9,26 @@ package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; import com.microsoft.azure.management.synapse.v2019_06_01_preview.RestorePoint; -import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; import rx.Observable; import org.joda.time.DateTime; import com.microsoft.azure.management.synapse.v2019_06_01_preview.RestorePointType; -class RestorePointImpl extends WrapperImpl implements RestorePoint { +class RestorePointImpl extends IndexableRefreshableWrapperImpl implements RestorePoint { private final SynapseManager manager; + private String resourceGroupName; + private String workspaceName; + private String sqlPoolName; + private String restorePointName; RestorePointImpl(RestorePointInner inner, SynapseManager manager) { - super(inner); + super(null, inner); this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.workspaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "workspaces"); + this.sqlPoolName = IdParsingUtils.getValueFromIdByName(inner.id(), "sqlPools"); + this.restorePointName = IdParsingUtils.getValueFromIdByName(inner.id(), "restorePoints"); } @Override @@ -27,6 +36,12 @@ public SynapseManager manager() { return this.manager; } + @Override + protected Observable getInnerAsync() { + SqlPoolRestorePointsInner client = this.manager().inner().sqlPoolRestorePoints(); + return client.getAsync(this.resourceGroupName, this.workspaceName, this.sqlPoolName, this.restorePointName); + } + @Override diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SensitivityLabelsImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SensitivityLabelsImpl.java index 4ab57ac945d66..bb045c35fb24b 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SensitivityLabelsImpl.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SensitivityLabelsImpl.java @@ -66,7 +66,7 @@ public Observable updateResourceAsync() { @Override protected Observable getInnerAsync() { SqlPoolSensitivityLabelsInner client = this.manager().inner().sqlPoolSensitivityLabels(); - return null; // NOP getInnerAsync implementation as get is not supported + return client.getAsync(this.resourceGroupName, this.workspaceName, this.sqlPoolName, this.schemaName, this.tableName, this.columnName); } @Override diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolBlobAuditingPoliciesImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolBlobAuditingPoliciesImpl.java index d6c4a375034d4..6a02ad5a8fa2b 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolBlobAuditingPoliciesImpl.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolBlobAuditingPoliciesImpl.java @@ -13,6 +13,7 @@ import com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolBlobAuditingPolicies; import rx.Observable; import rx.functions.Func1; +import com.microsoft.azure.Page; import com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolBlobAuditingPolicy; class SqlPoolBlobAuditingPoliciesImpl extends WrapperImpl implements SqlPoolBlobAuditingPolicies { @@ -40,6 +41,24 @@ private SqlPoolBlobAuditingPolicyImpl wrapModel(String name) { return new SqlPoolBlobAuditingPolicyImpl(name, this.manager()); } + @Override + public Observable listBySqlPoolAsync(final String resourceGroupName, final String workspaceName, final String sqlPoolName) { + SqlPoolBlobAuditingPoliciesInner client = this.inner(); + return client.listBySqlPoolAsync(resourceGroupName, workspaceName, sqlPoolName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public SqlPoolBlobAuditingPolicy call(SqlPoolBlobAuditingPolicyInner inner) { + return wrapModel(inner); + } + }); + } + @Override public Observable getAsync(String resourceGroupName, String workspaceName, String sqlPoolName) { SqlPoolBlobAuditingPoliciesInner client = this.inner(); diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolBlobAuditingPoliciesInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolBlobAuditingPoliciesInner.java index 3f2fa58a2dcfa..22ad0157cfe4d 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolBlobAuditingPoliciesInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolBlobAuditingPoliciesInner.java @@ -10,12 +10,17 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; import com.microsoft.rest.Validator; import java.io.IOException; +import java.util.List; import okhttp3.ResponseBody; import retrofit2.http.Body; import retrofit2.http.GET; @@ -24,6 +29,7 @@ import retrofit2.http.Path; import retrofit2.http.PUT; import retrofit2.http.Query; +import retrofit2.http.Url; import retrofit2.Response; import rx.functions.Func1; import rx.Observable; @@ -62,6 +68,14 @@ interface SqlPoolBlobAuditingPoliciesService { @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/auditingSettings/{blobAuditingPolicyName}") Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Path("blobAuditingPolicyName") String blobAuditingPolicyName, @Query("api-version") String apiVersion, @Body SqlPoolBlobAuditingPolicyInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolBlobAuditingPolicies listBySqlPool" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/auditingSettings") + Observable> listBySqlPool(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolBlobAuditingPolicies listBySqlPoolNext" }) + @GET + Observable> listBySqlPoolNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + } /** @@ -269,4 +283,246 @@ private ServiceResponse createOrUpdateDelegate(R .build(response); } + /** + * Lists auditing settings of a Sql pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SqlPoolBlobAuditingPolicyInner> object if successful. + */ + public PagedList listBySqlPool(final String resourceGroupName, final String workspaceName, final String sqlPoolName) { + ServiceResponse> response = listBySqlPoolSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listBySqlPoolNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists auditing settings of a Sql pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listBySqlPoolAsync(final String resourceGroupName, final String workspaceName, final String sqlPoolName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listBySqlPoolSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listBySqlPoolNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists auditing settings of a Sql pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SqlPoolBlobAuditingPolicyInner> object + */ + public Observable> listBySqlPoolAsync(final String resourceGroupName, final String workspaceName, final String sqlPoolName) { + return listBySqlPoolWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists auditing settings of a Sql pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SqlPoolBlobAuditingPolicyInner> object + */ + public Observable>> listBySqlPoolWithServiceResponseAsync(final String resourceGroupName, final String workspaceName, final String sqlPoolName) { + return listBySqlPoolSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listBySqlPoolNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists auditing settings of a Sql pool. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param workspaceName The name of the workspace + ServiceResponse> * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SqlPoolBlobAuditingPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listBySqlPoolSinglePageAsync(final String resourceGroupName, final String workspaceName, final String sqlPoolName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (sqlPoolName == null) { + throw new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listBySqlPool(this.client.subscriptionId(), resourceGroupName, workspaceName, sqlPoolName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listBySqlPoolDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listBySqlPoolDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists auditing settings of a Sql pool. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SqlPoolBlobAuditingPolicyInner> object if successful. + */ + public PagedList listBySqlPoolNext(final String nextPageLink) { + ServiceResponse> response = listBySqlPoolNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listBySqlPoolNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists auditing settings of a Sql pool. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listBySqlPoolNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listBySqlPoolNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listBySqlPoolNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists auditing settings of a Sql pool. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SqlPoolBlobAuditingPolicyInner> object + */ + public Observable> listBySqlPoolNextAsync(final String nextPageLink) { + return listBySqlPoolNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists auditing settings of a Sql pool. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SqlPoolBlobAuditingPolicyInner> object + */ + public Observable>> listBySqlPoolNextWithServiceResponseAsync(final String nextPageLink) { + return listBySqlPoolNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listBySqlPoolNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists auditing settings of a Sql pool. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SqlPoolBlobAuditingPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listBySqlPoolNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listBySqlPoolNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listBySqlPoolNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listBySqlPoolNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolColumnsImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolColumnsImpl.java new file mode 100644 index 0000000000000..afb3e499c32bf --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolColumnsImpl.java @@ -0,0 +1,50 @@ +/** + * 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. + * + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolColumns; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.TableSchemaSqlPoolWorkspaceSqlPoolColumnModel; + +class SqlPoolColumnsImpl extends WrapperImpl implements SqlPoolColumns { + private final SynapseManager manager; + + SqlPoolColumnsImpl(SynapseManager manager) { + super(manager.inner().sqlPoolColumns()); + this.manager = manager; + } + + public SynapseManager manager() { + return this.manager; + } + + private TableSchemaSqlPoolWorkspaceSqlPoolColumnModelImpl wrapModel(SqlPoolColumnInner inner) { + return new TableSchemaSqlPoolWorkspaceSqlPoolColumnModelImpl(inner, manager()); + } + + @Override + public Observable getAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName, String columnName) { + SqlPoolColumnsInner client = this.inner(); + return client.getAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName) + .flatMap(new Func1>() { + @Override + public Observable call(SqlPoolColumnInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((TableSchemaSqlPoolWorkspaceSqlPoolColumnModel)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolColumnsInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolColumnsInner.java new file mode 100644 index 0000000000000..ff1835394a2e9 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolColumnsInner.java @@ -0,0 +1,174 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in SqlPoolColumns. + */ +public class SqlPoolColumnsInner { + /** The Retrofit service to perform REST calls. */ + private SqlPoolColumnsService service; + /** The service client containing this operation class. */ + private SynapseManagementClientImpl client; + + /** + * Initializes an instance of SqlPoolColumnsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SqlPoolColumnsInner(Retrofit retrofit, SynapseManagementClientImpl client) { + this.service = retrofit.create(SqlPoolColumnsService.class); + this.client = client; + } + + /** + * The interface defining all the services for SqlPoolColumns to be + * used by Retrofit to perform actually REST calls. + */ + interface SqlPoolColumnsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolColumns get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Path("schemaName") String schemaName, @Path("tableName") String tableName, @Path("columnName") String columnName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get Sql pool column. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SqlPoolColumnInner object if successful. + */ + public SqlPoolColumnInner get(String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName, String columnName) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName).toBlocking().single().body(); + } + + /** + * Get Sql pool column. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName, String columnName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName), serviceCallback); + } + + /** + * Get Sql pool column. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlPoolColumnInner object + */ + public Observable getAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName, String columnName) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName).map(new Func1, SqlPoolColumnInner>() { + @Override + public SqlPoolColumnInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get Sql pool column. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlPoolColumnInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName, String columnName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (sqlPoolName == null) { + throw new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null."); + } + if (schemaName == null) { + throw new IllegalArgumentException("Parameter schemaName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName is required and cannot be null."); + } + if (columnName == null) { + throw new IllegalArgumentException("Parameter columnName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolConnectionPoliciesInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolConnectionPoliciesInner.java index 38e79e2c5edbc..9036284d6f3d8 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolConnectionPoliciesInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolConnectionPoliciesInner.java @@ -10,7 +10,7 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; -import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ErrorContractException; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; @@ -65,7 +65,7 @@ interface SqlPoolConnectionPoliciesService { * @param workspaceName The name of the workspace * @param sqlPoolName SQL pool name * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the SqlPoolConnectionPolicyInner object if successful. */ @@ -148,10 +148,10 @@ public Observable> call(Response getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolGeoBackupPoliciesImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolGeoBackupPoliciesImpl.java index c8706e4ba30d7..9c2518a91f5e6 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolGeoBackupPoliciesImpl.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolGeoBackupPoliciesImpl.java @@ -13,6 +13,7 @@ import com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolGeoBackupPolicies; import rx.Observable; import rx.functions.Func1; +import java.util.List; import com.microsoft.azure.management.synapse.v2019_06_01_preview.GeoBackupPolicy; class SqlPoolGeoBackupPoliciesImpl extends WrapperImpl implements SqlPoolGeoBackupPolicies { @@ -31,6 +32,24 @@ private GeoBackupPolicyImpl wrapModel(GeoBackupPolicyInner inner) { return new GeoBackupPolicyImpl(inner, manager()); } + @Override + public Observable listAsync(String resourceGroupName, String workspaceName, String sqlPoolName) { + SqlPoolGeoBackupPoliciesInner client = this.inner(); + return client.listAsync(resourceGroupName, workspaceName, sqlPoolName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public GeoBackupPolicy call(GeoBackupPolicyInner inner) { + return wrapModel(inner); + } + }); + } + @Override public Observable getAsync(String resourceGroupName, String workspaceName, String sqlPoolName) { SqlPoolGeoBackupPoliciesInner client = this.inner(); diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolGeoBackupPoliciesInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolGeoBackupPoliciesInner.java index 674857cc9bc0a..2f9e233d21dd7 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolGeoBackupPoliciesInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolGeoBackupPoliciesInner.java @@ -10,11 +10,12 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; -import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ErrorContractException; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; import java.io.IOException; +import java.util.List; import okhttp3.ResponseBody; import retrofit2.http.GET; import retrofit2.http.Header; @@ -51,12 +52,118 @@ public SqlPoolGeoBackupPoliciesInner(Retrofit retrofit, SynapseManagementClientI * used by Retrofit to perform actually REST calls. */ interface SqlPoolGeoBackupPoliciesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolGeoBackupPolicies list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/geoBackupPolicies") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolGeoBackupPolicies get" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/geoBackupPolicies/{geoBackupPolicyName}") Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Path("geoBackupPolicyName") String geoBackupPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); } + /** + * List SQL pool geo backup policies. + * Get list of SQL pool geo backup policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorContractException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<GeoBackupPolicyInner> object if successful. + */ + public List list(String resourceGroupName, String workspaceName, String sqlPoolName) { + return listWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName).toBlocking().single().body(); + } + + /** + * List SQL pool geo backup policies. + * Get list of SQL pool geo backup policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(String resourceGroupName, String workspaceName, String sqlPoolName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName), serviceCallback); + } + + /** + * List SQL pool geo backup policies. + * Get list of SQL pool geo backup policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<GeoBackupPolicyInner> object + */ + public Observable> listAsync(String resourceGroupName, String workspaceName, String sqlPoolName) { + return listWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List SQL pool geo backup policies. + * Get list of SQL pool geo backup policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<GeoBackupPolicyInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String workspaceName, String sqlPoolName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (sqlPoolName == null) { + throw new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, workspaceName, sqlPoolName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorContractException.class) + .build(response); + } + /** * Get a SQL pool geo backup policy. * Get the specified SQL pool geo backup policy. @@ -65,7 +172,7 @@ interface SqlPoolGeoBackupPoliciesService { * @param workspaceName The name of the workspace * @param sqlPoolName SQL pool name * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the GeoBackupPolicyInner object if successful. */ @@ -148,10 +255,10 @@ public Observable> call(Response getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolMetadataSyncConfigsImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolMetadataSyncConfigsImpl.java index fc40951394b6a..5af5bfb13c77f 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolMetadataSyncConfigsImpl.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolMetadataSyncConfigsImpl.java @@ -40,9 +40,9 @@ public MetadataSyncConfig call(MetadataSyncConfigInner inner) { } @Override - public Observable createAsync(String resourceGroupName, String workspaceName, String sqlPoolName) { + public Observable createAsync(String resourceGroupName, String workspaceName, String sqlPoolName, MetadataSyncConfigInner metadataSyncConfiguration) { SqlPoolMetadataSyncConfigsInner client = this.inner(); - return client.createAsync(resourceGroupName, workspaceName, sqlPoolName) + return client.createAsync(resourceGroupName, workspaceName, sqlPoolName, metadataSyncConfiguration) .map(new Func1() { @Override public MetadataSyncConfig call(MetadataSyncConfigInner inner) { diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolMetadataSyncConfigsInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolMetadataSyncConfigsInner.java index c133dbd5faef9..c9aa2412fad48 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolMetadataSyncConfigsInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolMetadataSyncConfigsInner.java @@ -10,9 +10,11 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ErrorContractException; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; import java.io.IOException; import okhttp3.ResponseBody; import retrofit2.http.Body; @@ -58,7 +60,7 @@ interface SqlPoolMetadataSyncConfigsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolMetadataSyncConfigs create" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/metadataSync/config") - Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body MetadataSyncConfigInner metadataSyncConfiguration, @Header("User-Agent") String userAgent); + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Query("api-version") String apiVersion, @Body MetadataSyncConfigInner metadataSyncConfiguration, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); } @@ -70,7 +72,7 @@ interface SqlPoolMetadataSyncConfigsService { * @param workspaceName The name of the workspace * @param sqlPoolName SQL pool name * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the MetadataSyncConfigInner object if successful. */ @@ -152,11 +154,11 @@ public Observable> call(Response getDelegate(Response response) throws ErrorContractInnerException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(404, new TypeToken() { }.getType()) - .registerError(ErrorContractInnerException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -167,13 +169,14 @@ private ServiceResponse getDelegate(Response createAsync(String resourceGroupName, String workspaceName, String sqlPoolName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName), serviceCallback); + public ServiceFuture createAsync(String resourceGroupName, String workspaceName, String sqlPoolName, MetadataSyncConfigInner metadataSyncConfiguration, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, metadataSyncConfiguration), serviceCallback); } /** @@ -198,11 +202,12 @@ public ServiceFuture createAsync(String resourceGroupNa * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace * @param sqlPoolName SQL pool name + * @param metadataSyncConfiguration Metadata sync configuration * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the MetadataSyncConfigInner object */ - public Observable createAsync(String resourceGroupName, String workspaceName, String sqlPoolName) { - return createWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName).map(new Func1, MetadataSyncConfigInner>() { + public Observable createAsync(String resourceGroupName, String workspaceName, String sqlPoolName, MetadataSyncConfigInner metadataSyncConfiguration) { + return createWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, metadataSyncConfiguration).map(new Func1, MetadataSyncConfigInner>() { @Override public MetadataSyncConfigInner call(ServiceResponse response) { return response.body(); @@ -217,10 +222,11 @@ public MetadataSyncConfigInner call(ServiceResponse res * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace * @param sqlPoolName SQL pool name + * @param metadataSyncConfiguration Metadata sync configuration * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the MetadataSyncConfigInner object */ - public Observable> createWithServiceResponseAsync(String resourceGroupName, String workspaceName, String sqlPoolName) { + public Observable> createWithServiceResponseAsync(String resourceGroupName, String workspaceName, String sqlPoolName, MetadataSyncConfigInner metadataSyncConfiguration) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -236,106 +242,11 @@ public Observable> createWithServiceRes if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - final Boolean enabled = null; - MetadataSyncConfigInner metadataSyncConfiguration = new MetadataSyncConfigInner(); - metadataSyncConfiguration.withEnabled(null); - return service.create(this.client.subscriptionId(), resourceGroupName, workspaceName, sqlPoolName, this.client.apiVersion(), this.client.acceptLanguage(), metadataSyncConfiguration, this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = createDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - /** - * Set SQL pool metadata sync config. - * Set the metadata sync configuration for a SQL pool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace - * @param sqlPoolName SQL pool name - * @param enabled Indicates whether the metadata sync is enabled or disabled - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the MetadataSyncConfigInner object if successful. - */ - public MetadataSyncConfigInner create(String resourceGroupName, String workspaceName, String sqlPoolName, Boolean enabled) { - return createWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, enabled).toBlocking().single().body(); - } - - /** - * Set SQL pool metadata sync config. - * Set the metadata sync configuration for a SQL pool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace - * @param sqlPoolName SQL pool name - * @param enabled Indicates whether the metadata sync is enabled or disabled - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture createAsync(String resourceGroupName, String workspaceName, String sqlPoolName, Boolean enabled, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, enabled), serviceCallback); - } - - /** - * Set SQL pool metadata sync config. - * Set the metadata sync configuration for a SQL pool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace - * @param sqlPoolName SQL pool name - * @param enabled Indicates whether the metadata sync is enabled or disabled - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the MetadataSyncConfigInner object - */ - public Observable createAsync(String resourceGroupName, String workspaceName, String sqlPoolName, Boolean enabled) { - return createWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, enabled).map(new Func1, MetadataSyncConfigInner>() { - @Override - public MetadataSyncConfigInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Set SQL pool metadata sync config. - * Set the metadata sync configuration for a SQL pool. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace - * @param sqlPoolName SQL pool name - * @param enabled Indicates whether the metadata sync is enabled or disabled - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the MetadataSyncConfigInner object - */ - public Observable> createWithServiceResponseAsync(String resourceGroupName, String workspaceName, String sqlPoolName, Boolean enabled) { - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (workspaceName == null) { - throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); - } - if (sqlPoolName == null) { - throw new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + if (metadataSyncConfiguration == null) { + throw new IllegalArgumentException("Parameter metadataSyncConfiguration is required and cannot be null."); } - MetadataSyncConfigInner metadataSyncConfiguration = new MetadataSyncConfigInner(); - metadataSyncConfiguration.withEnabled(enabled); - return service.create(this.client.subscriptionId(), resourceGroupName, workspaceName, sqlPoolName, this.client.apiVersion(), this.client.acceptLanguage(), metadataSyncConfiguration, this.client.userAgent()) + Validator.validate(metadataSyncConfiguration); + return service.create(this.client.subscriptionId(), resourceGroupName, workspaceName, sqlPoolName, this.client.apiVersion(), metadataSyncConfiguration, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -349,11 +260,11 @@ public Observable> call(Response createDelegate(Response response) throws ErrorContractInnerException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse createDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(404, new TypeToken() { }.getType()) - .registerError(ErrorContractInnerException.class) + .registerError(ErrorContractException.class) .build(response); } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolOperationResultsInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolOperationResultsInner.java index 7ae4e1b0cb1fa..ee74be2361814 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolOperationResultsInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolOperationResultsInner.java @@ -10,7 +10,7 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; -import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ErrorContractException; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; @@ -66,7 +66,7 @@ interface SqlPoolOperationResultsService { * @param sqlPoolName SQL pool name * @param operationId Operation ID * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the Object object if successful. */ @@ -154,10 +154,11 @@ public Observable> call(Response response) }); } - private ServiceResponse getLocationHeaderResultDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getLocationHeaderResultDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorContractException.class) .build(response); } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolReplicationLinksImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolReplicationLinksImpl.java index 7b180f2996f8e..7e52047679f05 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolReplicationLinksImpl.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolReplicationLinksImpl.java @@ -50,4 +50,20 @@ public ReplicationLink call(ReplicationLinkInner inner) { }); } + @Override + public Observable getByNameAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String linkId) { + SqlPoolReplicationLinksInner client = this.inner(); + return client.getByNameAsync(resourceGroupName, workspaceName, sqlPoolName, linkId) + .flatMap(new Func1>() { + @Override + public Observable call(ReplicationLinkInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((ReplicationLink)wrapModel(inner)); + } + } + }); + } + } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolReplicationLinksInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolReplicationLinksInner.java index 921957fe89af9..21623319fee4c 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolReplicationLinksInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolReplicationLinksInner.java @@ -11,10 +11,11 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; import com.microsoft.azure.AzureServiceFuture; -import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ErrorContractException; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; import java.io.IOException; @@ -60,6 +61,10 @@ interface SqlPoolReplicationLinksService { @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/replicationLinks") Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolReplicationLinks getByName" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/replicationLinks/{linkId}") + Observable> getByName(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Path("linkId") String linkId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolReplicationLinks listNext" }) @GET Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -74,7 +79,7 @@ interface SqlPoolReplicationLinksService { * @param workspaceName The name of the workspace * @param sqlPoolName SQL pool name * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<ReplicationLinkInner> object if successful. */ @@ -195,10 +200,114 @@ public Observable>> call(Response> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) + .build(response); + } + + /** + * Get SQL pool replication link by name. + * Get SQL pool replication link by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param linkId The ID of the replication link. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorContractException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationLinkInner object if successful. + */ + public ReplicationLinkInner getByName(String resourceGroupName, String workspaceName, String sqlPoolName, String linkId) { + return getByNameWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, linkId).toBlocking().single().body(); + } + + /** + * Get SQL pool replication link by name. + * Get SQL pool replication link by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param linkId The ID of the replication link. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByNameAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String linkId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByNameWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, linkId), serviceCallback); + } + + /** + * Get SQL pool replication link by name. + * Get SQL pool replication link by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param linkId The ID of the replication link. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationLinkInner object + */ + public Observable getByNameAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String linkId) { + return getByNameWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, linkId).map(new Func1, ReplicationLinkInner>() { + @Override + public ReplicationLinkInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get SQL pool replication link by name. + * Get SQL pool replication link by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param linkId The ID of the replication link. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationLinkInner object + */ + public Observable> getByNameWithServiceResponseAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String linkId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (sqlPoolName == null) { + throw new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null."); + } + if (linkId == null) { + throw new IllegalArgumentException("Parameter linkId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByName(this.client.subscriptionId(), resourceGroupName, workspaceName, sqlPoolName, linkId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByNameDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByNameDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorContractException.class) .build(response); } @@ -208,7 +317,7 @@ private ServiceResponse> listDelegate(Response>> call(Response> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listNextDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolRestorePointsImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolRestorePointsImpl.java index a0f0b31e71453..1ec7ad90e494b 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolRestorePointsImpl.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolRestorePointsImpl.java @@ -13,8 +13,9 @@ import com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolRestorePoints; import rx.Observable; import rx.functions.Func1; -import com.microsoft.azure.Page; import com.microsoft.azure.management.synapse.v2019_06_01_preview.RestorePoint; +import com.microsoft.azure.Page; +import rx.Completable; class SqlPoolRestorePointsImpl extends WrapperImpl implements SqlPoolRestorePoints { private final SynapseManager manager; @@ -32,6 +33,31 @@ private RestorePointImpl wrapRestorePointModel(RestorePointInner inner) { return new RestorePointImpl(inner, manager()); } + private Observable getRestorePointInnerUsingSqlPoolRestorePointsInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String workspaceName = IdParsingUtils.getValueFromIdByName(id, "workspaces"); + String sqlPoolName = IdParsingUtils.getValueFromIdByName(id, "sqlPools"); + String restorePointName = IdParsingUtils.getValueFromIdByName(id, "restorePoints"); + SqlPoolRestorePointsInner client = this.inner(); + return client.getAsync(resourceGroupName, workspaceName, sqlPoolName, restorePointName); + } + + @Override + public Observable getAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName) { + SqlPoolRestorePointsInner client = this.inner(); + return client.getAsync(resourceGroupName, workspaceName, sqlPoolName, restorePointName) + .flatMap(new Func1>() { + @Override + public Observable call(RestorePointInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((RestorePoint)wrapRestorePointModel(inner)); + } + } + }); + } + @Override public Observable listAsync(final String resourceGroupName, final String workspaceName, final String sqlPoolName) { SqlPoolRestorePointsInner client = this.inner(); @@ -50,6 +76,12 @@ public RestorePoint call(RestorePointInner inner) { }); } + @Override + public Completable deleteAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName) { + SqlPoolRestorePointsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, workspaceName, sqlPoolName, restorePointName).toCompletable(); + } + @Override public Observable createAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointLabel) { SqlPoolRestorePointsInner client = this.inner(); diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolRestorePointsInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolRestorePointsInner.java index c3bf04097c952..68aa702ef0800 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolRestorePointsInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolRestorePointsInner.java @@ -14,6 +14,7 @@ import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; import com.microsoft.azure.management.synapse.v2019_06_01_preview.CreateSqlPoolRestorePointDefinition; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ErrorContractException; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -26,6 +27,7 @@ import retrofit2.http.GET; import retrofit2.http.Header; import retrofit2.http.Headers; +import retrofit2.http.HTTP; import retrofit2.http.Path; import retrofit2.http.POST; import retrofit2.http.Query; @@ -74,6 +76,14 @@ interface SqlPoolRestorePointsService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/restorePoints") Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CreateSqlPoolRestorePointDefinition parameters, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolRestorePoints get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/restorePoints/{restorePointName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Path("restorePointName") String restorePointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolRestorePoints delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/restorePoints/{restorePointName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Path("restorePointName") String restorePointName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolRestorePoints listNext" }) @GET Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -88,7 +98,7 @@ interface SqlPoolRestorePointsService { * @param workspaceName The name of the workspace * @param sqlPoolName SQL pool name * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<RestorePointInner> object if successful. */ @@ -209,10 +219,10 @@ public Observable>> call(Response> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -405,13 +415,212 @@ private ServiceResponse beginCreateDelegate(Response getAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, restorePointName), serviceCallback); + } + + /** + * Gets a restore point. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RestorePointInner object + */ + public Observable getAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, restorePointName).map(new Func1, RestorePointInner>() { + @Override + public RestorePointInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a restore point. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RestorePointInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (sqlPoolName == null) { + throw new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null."); + } + if (restorePointName == null) { + throw new IllegalArgumentException("Parameter restorePointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, workspaceName, sqlPoolName, restorePointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a restore point. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName) { + deleteWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, restorePointName).toBlocking().single().body(); + } + + /** + * Deletes a restore point. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param restorePointName The name of the restore point. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, restorePointName), serviceCallback); + } + + /** + * Deletes a restore point. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName) { + return deleteWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, restorePointName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a restore point. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param restorePointName The name of the restore point. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (sqlPoolName == null) { + throw new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null."); + } + if (restorePointName == null) { + throw new IllegalArgumentException("Parameter restorePointName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, workspaceName, sqlPoolName, restorePointName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + /** * Get SQL pool backup. * Get SQL pool backup information. * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<RestorePointInner> object if successful. */ @@ -514,10 +723,10 @@ public Observable>> call(Response> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listNextDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolSchemaImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolSchemaImpl.java index 4e59b9ed5b3d7..f4c4426aaf1e8 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolSchemaImpl.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolSchemaImpl.java @@ -9,15 +9,24 @@ package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; import com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolSchema; -import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; import rx.Observable; -class SqlPoolSchemaImpl extends WrapperImpl implements SqlPoolSchema { +class SqlPoolSchemaImpl extends IndexableRefreshableWrapperImpl implements SqlPoolSchema { private final SynapseManager manager; + private String resourceGroupName; + private String workspaceName; + private String sqlPoolName; + private String schemaName; SqlPoolSchemaImpl(SqlPoolSchemaInner inner, SynapseManager manager) { - super(inner); + super(null, inner); this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.workspaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "workspaces"); + this.sqlPoolName = IdParsingUtils.getValueFromIdByName(inner.id(), "sqlPools"); + this.schemaName = IdParsingUtils.getValueFromIdByName(inner.id(), "schemas"); } @Override @@ -25,6 +34,12 @@ public SynapseManager manager() { return this.manager; } + @Override + protected Observable getInnerAsync() { + SqlPoolSchemasInner client = this.manager().inner().sqlPoolSchemas(); + return client.getAsync(this.resourceGroupName, this.workspaceName, this.sqlPoolName, this.schemaName); + } + @Override diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolSchemasImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolSchemasImpl.java index 33d80ef1b5ab7..03e33446c903c 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolSchemasImpl.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolSchemasImpl.java @@ -50,4 +50,20 @@ public SqlPoolSchema call(SqlPoolSchemaInner inner) { }); } + @Override + public Observable getAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName) { + SqlPoolSchemasInner client = this.inner(); + return client.getAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName) + .flatMap(new Func1>() { + @Override + public Observable call(SqlPoolSchemaInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((SqlPoolSchema)wrapModel(inner)); + } + } + }); + } + } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolSchemasInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolSchemasInner.java index 25f37279504cd..45d2f9da011fe 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolSchemasInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolSchemasInner.java @@ -15,6 +15,7 @@ import com.microsoft.azure.ListOperationCallback; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; import java.io.IOException; @@ -60,6 +61,10 @@ interface SqlPoolSchemasService { @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/schemas") Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolSchemas get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Path("schemaName") String schemaName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolSchemas listNext" }) @GET Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -337,6 +342,106 @@ private ServiceResponse> listDelegate(Response getAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName), serviceCallback); + } + + /** + * Get Sql Pool schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param schemaName The name of the schema. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlPoolSchemaInner object + */ + public Observable getAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName).map(new Func1, SqlPoolSchemaInner>() { + @Override + public SqlPoolSchemaInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get Sql Pool schema. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param schemaName The name of the schema. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlPoolSchemaInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (sqlPoolName == null) { + throw new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null."); + } + if (schemaName == null) { + throw new IllegalArgumentException("Parameter schemaName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, workspaceName, sqlPoolName, schemaName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + /** * Gets schemas of a given SQL pool. * Gets schemas of a given SQL pool. diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolSecurityAlertPoliciesImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolSecurityAlertPoliciesImpl.java index 0776fc7d66f96..5867ab510f2da 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolSecurityAlertPoliciesImpl.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolSecurityAlertPoliciesImpl.java @@ -13,6 +13,7 @@ import com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolSecurityAlertPolicies; import rx.Observable; import rx.functions.Func1; +import com.microsoft.azure.Page; import com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolSecurityAlertPolicy; class SqlPoolSecurityAlertPoliciesImpl extends WrapperImpl implements SqlPoolSecurityAlertPolicies { @@ -40,6 +41,24 @@ private SqlPoolSecurityAlertPolicyImpl wrapModel(String name) { return new SqlPoolSecurityAlertPolicyImpl(name, this.manager()); } + @Override + public Observable listAsync(final String resourceGroupName, final String workspaceName, final String sqlPoolName) { + SqlPoolSecurityAlertPoliciesInner client = this.inner(); + return client.listAsync(resourceGroupName, workspaceName, sqlPoolName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public SqlPoolSecurityAlertPolicy call(SqlPoolSecurityAlertPolicyInner inner) { + return wrapModel(inner); + } + }); + } + @Override public Observable getAsync(String resourceGroupName, String workspaceName, String sqlPoolName) { SqlPoolSecurityAlertPoliciesInner client = this.inner(); diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolSecurityAlertPoliciesInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolSecurityAlertPoliciesInner.java index e216ff06ee8a7..d41d71aa506f7 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolSecurityAlertPoliciesInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolSecurityAlertPoliciesInner.java @@ -10,12 +10,17 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; import com.microsoft.rest.Validator; import java.io.IOException; +import java.util.List; import okhttp3.ResponseBody; import retrofit2.http.Body; import retrofit2.http.GET; @@ -24,6 +29,7 @@ import retrofit2.http.Path; import retrofit2.http.PUT; import retrofit2.http.Query; +import retrofit2.http.Url; import retrofit2.Response; import rx.functions.Func1; import rx.Observable; @@ -54,6 +60,10 @@ public SqlPoolSecurityAlertPoliciesInner(Retrofit retrofit, SynapseManagementCli * used by Retrofit to perform actually REST calls. */ interface SqlPoolSecurityAlertPoliciesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolSecurityAlertPolicies list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/securityAlertPolicies") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolSecurityAlertPolicies get" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/securityAlertPolicies/{securityAlertPolicyName}") Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Path("securityAlertPolicyName") String securityAlertPolicyName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -62,6 +72,146 @@ interface SqlPoolSecurityAlertPoliciesService { @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/securityAlertPolicies/{securityAlertPolicyName}") Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Path("securityAlertPolicyName") String securityAlertPolicyName, @Query("api-version") String apiVersion, @Body SqlPoolSecurityAlertPolicyInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolSecurityAlertPolicies listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List Sql pool's security alert policies. + * Get a list of Sql pool's security alert policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SqlPoolSecurityAlertPolicyInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String workspaceName, final String sqlPoolName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Sql pool's security alert policies. + * Get a list of Sql pool's security alert policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String workspaceName, final String sqlPoolName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Sql pool's security alert policies. + * Get a list of Sql pool's security alert policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SqlPoolSecurityAlertPolicyInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String workspaceName, final String sqlPoolName) { + return listWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Sql pool's security alert policies. + * Get a list of Sql pool's security alert policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SqlPoolSecurityAlertPolicyInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String workspaceName, final String sqlPoolName) { + return listSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Sql pool's security alert policies. + * Get a list of Sql pool's security alert policies. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param workspaceName The name of the workspace + ServiceResponse> * @param sqlPoolName SQL pool name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SqlPoolSecurityAlertPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String workspaceName, final String sqlPoolName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (sqlPoolName == null) { + throw new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, workspaceName, sqlPoolName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); } /** @@ -269,4 +419,120 @@ private ServiceResponse createOrUpdateDelegate( .build(response); } + /** + * List Sql pool's security alert policies. + * Get a list of Sql pool's security alert policies. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SqlPoolSecurityAlertPolicyInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Sql pool's security alert policies. + * Get a list of Sql pool's security alert policies. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Sql pool's security alert policies. + * Get a list of Sql pool's security alert policies. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SqlPoolSecurityAlertPolicyInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Sql pool's security alert policies. + * Get a list of Sql pool's security alert policies. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SqlPoolSecurityAlertPolicyInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Sql pool's security alert policies. + * Get a list of Sql pool's security alert policies. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SqlPoolSecurityAlertPolicyInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolSensitivityLabelsImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolSensitivityLabelsImpl.java index 3e4a47bfb500f..20826c6556cb6 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolSensitivityLabelsImpl.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolSensitivityLabelsImpl.java @@ -14,6 +14,7 @@ import rx.Completable; import rx.Observable; import rx.functions.Func1; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.SensitivityLabels; import com.microsoft.azure.Page; import com.microsoft.azure.management.synapse.v2019_06_01_preview.CurrentSensitivityLabels; import com.microsoft.azure.management.synapse.v2019_06_01_preview.RecommendedSensitivityLabels; @@ -55,6 +56,22 @@ public Completable disableRecommendationAsync(String resourceGroupName, String w return client.disableRecommendationAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName).toCompletable(); } + @Override + public Observable getAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName, String columnName, SensitivityLabelSource sensitivityLabelSource) { + SqlPoolSensitivityLabelsInner client = this.inner(); + return client.getAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName, sensitivityLabelSource) + .flatMap(new Func1>() { + @Override + public Observable call(SensitivityLabelInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((SensitivityLabels)wrapModel(inner)); + } + } + }); + } + @Override public Completable deleteAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName, String columnName) { SqlPoolSensitivityLabelsInner client = this.inner(); diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolSensitivityLabelsInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolSensitivityLabelsInner.java index 097266a91d43a..cd75f69b80b6a 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolSensitivityLabelsInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolSensitivityLabelsInner.java @@ -13,6 +13,8 @@ import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ErrorContractException; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.SensitivityLabelSource; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -78,6 +80,10 @@ interface SqlPoolSensitivityLabelsService { @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}", method = "DELETE", hasBody = true) Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Path("schemaName") String schemaName, @Path("tableName") String tableName, @Path("columnName") String columnName, @Path("sensitivityLabelSource") String sensitivityLabelSource, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolSensitivityLabels get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Path("schemaName") String schemaName, @Path("tableName") String tableName, @Path("columnName") String columnName, @Path("sensitivityLabelSource") SensitivityLabelSource sensitivityLabelSource, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolSensitivityLabels enableRecommendation" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable") Observable> enableRecommendation(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Path("schemaName") String schemaName, @Path("tableName") String tableName, @Path("columnName") String columnName, @Path("sensitivityLabelSource") String sensitivityLabelSource, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -104,7 +110,7 @@ interface SqlPoolSensitivityLabelsService { * @param workspaceName The name of the workspace * @param sqlPoolName SQL pool name * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<SensitivityLabelInner> object if successful. */ @@ -235,7 +241,7 @@ public Observable>> call(Response>> call(Response> listCurrentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listCurrentDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -884,6 +890,128 @@ public Observable> call(Response response) { private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the sensitivity label of a given column. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @param sensitivityLabelSource The source of the sensitivity label. Possible values include: 'current', 'recommended' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SensitivityLabelInner object if successful. + */ + public SensitivityLabelInner get(String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName, String columnName, SensitivityLabelSource sensitivityLabelSource) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName, sensitivityLabelSource).toBlocking().single().body(); + } + + /** + * Gets the sensitivity label of a given column. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @param sensitivityLabelSource The source of the sensitivity label. Possible values include: 'current', 'recommended' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName, String columnName, SensitivityLabelSource sensitivityLabelSource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName, sensitivityLabelSource), serviceCallback); + } + + /** + * Gets the sensitivity label of a given column. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @param sensitivityLabelSource The source of the sensitivity label. Possible values include: 'current', 'recommended' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SensitivityLabelInner object + */ + public Observable getAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName, String columnName, SensitivityLabelSource sensitivityLabelSource) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName, sensitivityLabelSource).map(new Func1, SensitivityLabelInner>() { + @Override + public SensitivityLabelInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the sensitivity label of a given column. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @param sensitivityLabelSource The source of the sensitivity label. Possible values include: 'current', 'recommended' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SensitivityLabelInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName, String columnName, SensitivityLabelSource sensitivityLabelSource) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (sqlPoolName == null) { + throw new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null."); + } + if (schemaName == null) { + throw new IllegalArgumentException("Parameter schemaName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName is required and cannot be null."); + } + if (columnName == null) { + throw new IllegalArgumentException("Parameter columnName is required and cannot be null."); + } + if (sensitivityLabelSource == null) { + throw new IllegalArgumentException("Parameter sensitivityLabelSource is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName, sensitivityLabelSource, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -1122,7 +1250,7 @@ private ServiceResponse disableRecommendationDelegate(Response>> call(Response> listCurrentNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listCurrentNextDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolTableColumnsImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolTableColumnsImpl.java index 18b302894c418..8580dde8f6ee2 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolTableColumnsImpl.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolTableColumnsImpl.java @@ -14,7 +14,7 @@ import rx.Observable; import rx.functions.Func1; import com.microsoft.azure.Page; -import com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolColumn; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.TableSchemaSqlPoolWorkspaceSqlPoolColumn; class SqlPoolTableColumnsImpl extends WrapperImpl implements SqlPoolTableColumns { private final SynapseManager manager; @@ -28,12 +28,12 @@ public SynapseManager manager() { return this.manager; } - private SqlPoolColumnImpl wrapModel(SqlPoolColumnInner inner) { - return new SqlPoolColumnImpl(inner, manager()); + private TableSchemaSqlPoolWorkspaceSqlPoolColumnImpl wrapModel(SqlPoolColumnInner inner) { + return new TableSchemaSqlPoolWorkspaceSqlPoolColumnImpl(inner, manager()); } @Override - public Observable listByTableNameAsync(final String resourceGroupName, final String workspaceName, final String sqlPoolName, final String schemaName, final String tableName) { + public Observable listByTableNameAsync(final String resourceGroupName, final String workspaceName, final String sqlPoolName, final String schemaName, final String tableName) { SqlPoolTableColumnsInner client = this.inner(); return client.listByTableNameAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName) .flatMapIterable(new Func1, Iterable>() { @@ -42,9 +42,9 @@ public Iterable call(Page page) { return page.items(); } }) - .map(new Func1() { + .map(new Func1() { @Override - public SqlPoolColumn call(SqlPoolColumnInner inner) { + public TableSchemaSqlPoolWorkspaceSqlPoolColumn call(SqlPoolColumnInner inner) { return wrapModel(inner); } }); diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolTableImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolTableImpl.java index b950aa368c90e..f7215eb1e7052 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolTableImpl.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolTableImpl.java @@ -9,15 +9,26 @@ package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; import com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolTable; -import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; import rx.Observable; -class SqlPoolTableImpl extends WrapperImpl implements SqlPoolTable { +class SqlPoolTableImpl extends IndexableRefreshableWrapperImpl implements SqlPoolTable { private final SynapseManager manager; + private String resourceGroupName; + private String workspaceName; + private String sqlPoolName; + private String schemaName; + private String tableName; SqlPoolTableImpl(SqlPoolTableInner inner, SynapseManager manager) { - super(inner); + super(null, inner); this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.workspaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "workspaces"); + this.sqlPoolName = IdParsingUtils.getValueFromIdByName(inner.id(), "sqlPools"); + this.schemaName = IdParsingUtils.getValueFromIdByName(inner.id(), "schemas"); + this.tableName = IdParsingUtils.getValueFromIdByName(inner.id(), "tables"); } @Override @@ -25,6 +36,12 @@ public SynapseManager manager() { return this.manager; } + @Override + protected Observable getInnerAsync() { + SqlPoolTablesInner client = this.manager().inner().sqlPoolTables(); + return client.getAsync(this.resourceGroupName, this.workspaceName, this.sqlPoolName, this.schemaName, this.tableName); + } + @Override diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolTablesImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolTablesImpl.java index 6441cf3bd4809..02be02d616a42 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolTablesImpl.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolTablesImpl.java @@ -50,4 +50,20 @@ public SqlPoolTable call(SqlPoolTableInner inner) { }); } + @Override + public Observable getAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName) { + SqlPoolTablesInner client = this.inner(); + return client.getAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName) + .flatMap(new Func1>() { + @Override + public Observable call(SqlPoolTableInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((SqlPoolTable)wrapModel(inner)); + } + } + }); + } + } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolTablesInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolTablesInner.java index 0fcc0b94411aa..9999ff5d73f70 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolTablesInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolTablesInner.java @@ -15,6 +15,7 @@ import com.microsoft.azure.ListOperationCallback; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; import java.io.IOException; @@ -60,6 +61,10 @@ interface SqlPoolTablesService { @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}/tables") Observable> listBySchema(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Path("schemaName") String schemaName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolTables get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}/tables/{tableName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Path("schemaName") String schemaName, @Path("tableName") String tableName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolTables listBySchemaNext" }) @GET Observable> listBySchemaNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -353,6 +358,113 @@ private ServiceResponse> listBySchemaDelegate(Respon .build(response); } + /** + * Get Sql pool table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param schemaName The name of the schema. + * @param tableName The name of the table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SqlPoolTableInner object if successful. + */ + public SqlPoolTableInner get(String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName).toBlocking().single().body(); + } + + /** + * Get Sql pool table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param schemaName The name of the schema. + * @param tableName The name of the table. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName), serviceCallback); + } + + /** + * Get Sql pool table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param schemaName The name of the schema. + * @param tableName The name of the table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlPoolTableInner object + */ + public Observable getAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName).map(new Func1, SqlPoolTableInner>() { + @Override + public SqlPoolTableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get Sql pool table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param schemaName The name of the schema. + * @param tableName The name of the table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlPoolTableInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (sqlPoolName == null) { + throw new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null."); + } + if (schemaName == null) { + throw new IllegalArgumentException("Parameter schemaName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + /** * Gets tables of a given schema in a SQL pool. * Gets tables of a given schema in a SQL pool. diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolTransparentDataEncryptionsInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolTransparentDataEncryptionsInner.java index 94b456c753ee1..9b37457a4ec5f 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolTransparentDataEncryptionsInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolTransparentDataEncryptionsInner.java @@ -10,7 +10,7 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; -import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ErrorContractException; import com.microsoft.azure.management.synapse.v2019_06_01_preview.TransparentDataEncryptionStatus; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; @@ -72,7 +72,7 @@ interface SqlPoolTransparentDataEncryptionsService { * @param workspaceName The name of the workspace * @param sqlPoolName SQL pool name * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the TransparentDataEncryptionInner object if successful. */ @@ -155,10 +155,10 @@ public Observable> call(Response }); } - private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -170,7 +170,7 @@ private ServiceResponse getDelegate(Response> call(Response * @param sqlPoolName SQL pool name * @param status The status of the database transparent data encryption. Possible values include: 'Enabled', 'Disabled' * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the TransparentDataEncryptionInner object if successful. */ @@ -353,11 +353,11 @@ public Observable> call(Response }); } - private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse createOrUpdateDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(201, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolUsagesInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolUsagesInner.java index 8045d5d508265..3b1dfc1facda9 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolUsagesInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolUsagesInner.java @@ -11,8 +11,8 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; import com.microsoft.azure.AzureServiceFuture; -import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ErrorContractException; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceFuture; @@ -74,7 +74,7 @@ interface SqlPoolUsagesService { * @param workspaceName The name of the workspace * @param sqlPoolName SQL pool name * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<SqlPoolUsageInner> object if successful. */ @@ -195,10 +195,10 @@ public Observable>> call(Response> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -208,7 +208,7 @@ private ServiceResponse> listDelegate(Response>> call(Response> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listNextDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolVulnerabilityAssessmentRuleBaselineImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolVulnerabilityAssessmentRuleBaselineImpl.java index b80fb16e005ad..da04e425e2f3a 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolVulnerabilityAssessmentRuleBaselineImpl.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolVulnerabilityAssessmentRuleBaselineImpl.java @@ -29,7 +29,7 @@ class SqlPoolVulnerabilityAssessmentRuleBaselineImpl extends CreatableUpdatableI super(name, new SqlPoolVulnerabilityAssessmentRuleBaselineInner()); this.manager = manager; // Set resource name - this.baselineName = VulnerabilityAssessmentPolicyBaselineName.fromString(name); + this.baselineName = name; // } @@ -37,7 +37,7 @@ class SqlPoolVulnerabilityAssessmentRuleBaselineImpl extends CreatableUpdatableI super(inner.name(), inner); this.manager = manager; // Set resource name - this.baselineName = VulnerabilityAssessmentPolicyBaselineName.fromString(inner.name()); + this.baselineName = inner.name(); // set resource ancestor and positional variables this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); this.workspaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "workspaces"); @@ -69,7 +69,7 @@ public Observable updateResourceAsyn @Override protected Observable getInnerAsync() { SqlPoolVulnerabilityAssessmentRuleBaselinesInner client = this.manager().inner().sqlPoolVulnerabilityAssessmentRuleBaselines(); - return null; // NOP getInnerAsync implementation as get is not supported + return client.getAsync(this.resourceGroupName, this.workspaceName, this.sqlPoolName, this.ruleId, this.baselineName); } @Override diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolVulnerabilityAssessmentRuleBaselinesImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolVulnerabilityAssessmentRuleBaselinesImpl.java index 78559ada924b9..851a736be9900 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolVulnerabilityAssessmentRuleBaselinesImpl.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolVulnerabilityAssessmentRuleBaselinesImpl.java @@ -11,7 +11,9 @@ import com.microsoft.azure.arm.model.implementation.WrapperImpl; import com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolVulnerabilityAssessmentRuleBaselines; -import com.microsoft.azure.management.synapse.v2019_06_01_preview.VulnerabilityAssessmentPolicyBaselineName; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolVulnerabilityAssessmentRuleBaseline; import rx.Completable; class SqlPoolVulnerabilityAssessmentRuleBaselinesImpl extends WrapperImpl implements SqlPoolVulnerabilityAssessmentRuleBaselines { @@ -39,6 +41,32 @@ private SqlPoolVulnerabilityAssessmentRuleBaselineImpl wrapSqlPoolVulnerabilityA return new SqlPoolVulnerabilityAssessmentRuleBaselineImpl(inner, manager()); } + private Observable getSqlPoolVulnerabilityAssessmentRuleBaselineInnerUsingSqlPoolVulnerabilityAssessmentRuleBaselinesInnerAsync(String id) { + String resourceGroupName = IdParsingUtils.getValueFromIdByName(id, "resourceGroups"); + String workspaceName = IdParsingUtils.getValueFromIdByName(id, "workspaces"); + String sqlPoolName = IdParsingUtils.getValueFromIdByName(id, "sqlPools"); + String ruleId = IdParsingUtils.getValueFromIdByName(id, "rules"); + String baselineName = VulnerabilityAssessmentPolicyBaselineName.valueOf(IdParsingUtils.getValueFromIdByName(id, "baselines")); + SqlPoolVulnerabilityAssessmentRuleBaselinesInner client = this.inner(); + return client.getAsync(resourceGroupName, workspaceName, sqlPoolName, ruleId, baselineName); + } + + @Override + public Observable getAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String ruleId, VulnerabilityAssessmentPolicyBaselineName baselineName) { + SqlPoolVulnerabilityAssessmentRuleBaselinesInner client = this.inner(); + return client.getAsync(resourceGroupName, workspaceName, sqlPoolName, ruleId, baselineName) + .flatMap(new Func1>() { + @Override + public Observable call(SqlPoolVulnerabilityAssessmentRuleBaselineInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((SqlPoolVulnerabilityAssessmentRuleBaseline)wrapSqlPoolVulnerabilityAssessmentRuleBaselineModel(inner)); + } + } + }); + } + @Override public Completable deleteAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String ruleId, VulnerabilityAssessmentPolicyBaselineName baselineName) { SqlPoolVulnerabilityAssessmentRuleBaselinesInner client = this.inner(); diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolVulnerabilityAssessmentRuleBaselinesInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolVulnerabilityAssessmentRuleBaselinesInner.java index 4c0748ff342cb..51454cf2df716 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolVulnerabilityAssessmentRuleBaselinesInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolVulnerabilityAssessmentRuleBaselinesInner.java @@ -21,6 +21,7 @@ import java.util.List; import okhttp3.ResponseBody; import retrofit2.http.Body; +import retrofit2.http.GET; import retrofit2.http.Header; import retrofit2.http.Headers; import retrofit2.http.HTTP; @@ -65,6 +66,10 @@ interface SqlPoolVulnerabilityAssessmentRuleBaselinesService { @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}", method = "DELETE", hasBody = true) Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Path("vulnerabilityAssessmentName") String vulnerabilityAssessmentName, @Path("ruleId") String ruleId, @Path("baselineName") VulnerabilityAssessmentPolicyBaselineName baselineName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolVulnerabilityAssessmentRuleBaselines get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Path("vulnerabilityAssessmentName") String vulnerabilityAssessmentName, @Path("ruleId") String ruleId, @Path("baselineName") VulnerabilityAssessmentPolicyBaselineName baselineName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + } /** @@ -288,6 +293,115 @@ public Observable> call(Response response) { private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a SqlPool's vulnerability assessment rule baseline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param ruleId The vulnerability assessment rule ID. + * @param baselineName The name of the vulnerability assessment rule baseline (default implies a baseline on a Sql pool level rule and master for server level rule). Possible values include: 'master', 'default' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SqlPoolVulnerabilityAssessmentRuleBaselineInner object if successful. + */ + public SqlPoolVulnerabilityAssessmentRuleBaselineInner get(String resourceGroupName, String workspaceName, String sqlPoolName, String ruleId, VulnerabilityAssessmentPolicyBaselineName baselineName) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, ruleId, baselineName).toBlocking().single().body(); + } + + /** + * Gets a SqlPool's vulnerability assessment rule baseline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param ruleId The vulnerability assessment rule ID. + * @param baselineName The name of the vulnerability assessment rule baseline (default implies a baseline on a Sql pool level rule and master for server level rule). Possible values include: 'master', 'default' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String ruleId, VulnerabilityAssessmentPolicyBaselineName baselineName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, ruleId, baselineName), serviceCallback); + } + + /** + * Gets a SqlPool's vulnerability assessment rule baseline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param ruleId The vulnerability assessment rule ID. + * @param baselineName The name of the vulnerability assessment rule baseline (default implies a baseline on a Sql pool level rule and master for server level rule). Possible values include: 'master', 'default' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlPoolVulnerabilityAssessmentRuleBaselineInner object + */ + public Observable getAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String ruleId, VulnerabilityAssessmentPolicyBaselineName baselineName) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, ruleId, baselineName).map(new Func1, SqlPoolVulnerabilityAssessmentRuleBaselineInner>() { + @Override + public SqlPoolVulnerabilityAssessmentRuleBaselineInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a SqlPool's vulnerability assessment rule baseline. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param ruleId The vulnerability assessment rule ID. + * @param baselineName The name of the vulnerability assessment rule baseline (default implies a baseline on a Sql pool level rule and master for server level rule). Possible values include: 'master', 'default' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SqlPoolVulnerabilityAssessmentRuleBaselineInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String ruleId, VulnerabilityAssessmentPolicyBaselineName baselineName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (sqlPoolName == null) { + throw new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null."); + } + if (ruleId == null) { + throw new IllegalArgumentException("Parameter ruleId is required and cannot be null."); + } + if (baselineName == null) { + throw new IllegalArgumentException("Parameter baselineName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String vulnerabilityAssessmentName = "default"; + return service.get(this.client.subscriptionId(), resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, ruleId, baselineName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolVulnerabilityAssessmentScansImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolVulnerabilityAssessmentScansImpl.java index d4fa9d1184dd0..85b4dcee5f040 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolVulnerabilityAssessmentScansImpl.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolVulnerabilityAssessmentScansImpl.java @@ -70,4 +70,20 @@ public VulnerabilityAssessmentScanRecord call(VulnerabilityAssessmentScanRecordI }); } + @Override + public Observable getAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String scanId) { + SqlPoolVulnerabilityAssessmentScansInner client = this.inner(); + return client.getAsync(resourceGroupName, workspaceName, sqlPoolName, scanId) + .flatMap(new Func1>() { + @Override + public Observable call(VulnerabilityAssessmentScanRecordInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((VulnerabilityAssessmentScanRecord)wrapModel(inner)); + } + } + }); + } + } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolVulnerabilityAssessmentScansInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolVulnerabilityAssessmentScansInner.java index 9a8fc4fcb7eb8..f91bc37adf18e 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolVulnerabilityAssessmentScansInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolVulnerabilityAssessmentScansInner.java @@ -74,6 +74,10 @@ interface SqlPoolVulnerabilityAssessmentScansService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export") Observable> export(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Path("vulnerabilityAssessmentName") String vulnerabilityAssessmentName, @Path("scanId") String scanId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolVulnerabilityAssessmentScans get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("sqlPoolName") String sqlPoolName, @Path("vulnerabilityAssessmentName") String vulnerabilityAssessmentName, @Path("scanId") String scanId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolVulnerabilityAssessmentScans listNext" }) @GET Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -503,6 +507,107 @@ private ServiceResponse exportDe .build(response); } + /** + * Gets a vulnerability assessment scan record of a Sql pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VulnerabilityAssessmentScanRecordInner object if successful. + */ + public VulnerabilityAssessmentScanRecordInner get(String resourceGroupName, String workspaceName, String sqlPoolName, String scanId) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, scanId).toBlocking().single().body(); + } + + /** + * Gets a vulnerability assessment scan record of a Sql pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String scanId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, scanId), serviceCallback); + } + + /** + * Gets a vulnerability assessment scan record of a Sql pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VulnerabilityAssessmentScanRecordInner object + */ + public Observable getAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String scanId) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, sqlPoolName, scanId).map(new Func1, VulnerabilityAssessmentScanRecordInner>() { + @Override + public VulnerabilityAssessmentScanRecordInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a vulnerability assessment scan record of a Sql pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param sqlPoolName SQL pool name + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VulnerabilityAssessmentScanRecordInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String workspaceName, String sqlPoolName, String scanId) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (sqlPoolName == null) { + throw new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null."); + } + if (scanId == null) { + throw new IllegalArgumentException("Parameter scanId is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final String vulnerabilityAssessmentName = "default"; + return service.get(this.client.subscriptionId(), resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, scanId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + /** * Lists the vulnerability assessment scans of a SQL pool. * Lists the vulnerability assessment scans of a SQL pool. diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolVulnerabilityAssessmentsInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolVulnerabilityAssessmentsInner.java index 0bdda8266f34b..9b0a1fae38feb 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolVulnerabilityAssessmentsInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolVulnerabilityAssessmentsInner.java @@ -517,6 +517,7 @@ public Observable> call(Response response) { private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolsInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolsInner.java index b714ac6e4d0c1..35e9dd3335bb9 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolsInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SqlPoolsInner.java @@ -13,6 +13,7 @@ import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ErrorContractException; import com.microsoft.azure.management.synapse.v2019_06_01_preview.ResourceMoveDefinition; import com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolPatchInfo; import com.microsoft.azure.Page; @@ -129,7 +130,7 @@ interface SqlPoolsService { * @param workspaceName The name of the workspace * @param sqlPoolName SQL pool name * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the SqlPoolInner object if successful. */ @@ -211,10 +212,10 @@ public Observable> call(Response res }); } - private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -227,7 +228,7 @@ private ServiceResponse getDelegate(Response respons * @param sqlPoolName SQL pool name * @param sqlPoolInfo The updated SQL pool properties * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the SqlPoolInner object if successful. */ @@ -316,11 +317,10 @@ public Observable> call(Response res }); } - private ServiceResponse updateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse updateDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .register(202, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -333,7 +333,7 @@ private ServiceResponse updateDelegate(Response resp * @param sqlPoolName SQL pool name * @param sqlPoolInfo The SQL pool to create * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the SqlPoolInner object if successful. */ @@ -421,7 +421,7 @@ public Observable> createWithServiceResponseAsync( * @param sqlPoolName SQL pool name * @param sqlPoolInfo The SQL pool to create * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the SqlPoolInner object if successful. */ @@ -510,12 +510,12 @@ public Observable> call(Response res }); } - private ServiceResponse beginCreateDelegate(Response response) throws ErrorContractInnerException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginCreateDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) .register(404, new TypeToken() { }.getType()) - .registerError(ErrorContractInnerException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -527,7 +527,7 @@ private ServiceResponse beginCreateDelegate(Response * @param workspaceName The name of the workspace * @param sqlPoolName SQL pool name * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the Object object if successful. */ @@ -607,7 +607,7 @@ public Observable> deleteWithServiceResponseAsync(String * @param workspaceName The name of the workspace * @param sqlPoolName SQL pool name * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the Object object if successful. */ @@ -689,12 +689,12 @@ public Observable> call(Response response) }); } - private ServiceResponse beginDeleteDelegate(Response response) throws ErrorContractInnerException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) .register(204, new TypeToken() { }.getType()) - .registerError(ErrorContractInnerException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -705,7 +705,7 @@ private ServiceResponse beginDeleteDelegate(Response respo * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<SqlPoolInner> object if successful. */ @@ -819,10 +819,10 @@ public Observable>> call(Response> listByWorkspaceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listByWorkspaceDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -834,7 +834,7 @@ private ServiceResponse> listByWorkspaceDelegate(Response * @param workspaceName The name of the workspace * @param sqlPoolName SQL pool name * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the Object object if successful. */ @@ -914,7 +914,7 @@ public Observable> pauseWithServiceResponseAsync(String * @param workspaceName The name of the workspace * @param sqlPoolName SQL pool name * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the Object object if successful. */ @@ -996,11 +996,11 @@ public Observable> call(Response response) }); } - private ServiceResponse beginPauseDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginPauseDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -1012,7 +1012,7 @@ private ServiceResponse beginPauseDelegate(Response respon * @param workspaceName The name of the workspace * @param sqlPoolName SQL pool name * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the Object object if successful. */ @@ -1092,7 +1092,7 @@ public Observable> resumeWithServiceResponseAsync(String * @param workspaceName The name of the workspace * @param sqlPoolName SQL pool name * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the Object object if successful. */ @@ -1174,11 +1174,11 @@ public Observable> call(Response response) }); } - private ServiceResponse beginResumeDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginResumeDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -1293,7 +1293,7 @@ private ServiceResponse renameDelegate(Response response) th * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<SqlPoolInner> object if successful. */ @@ -1396,10 +1396,10 @@ public Observable>> call(Response> listByWorkspaceNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listByWorkspaceNextDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SynapseManagementClientImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SynapseManagementClientImpl.java index 9c53715e95e64..e96dcb901959d 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SynapseManagementClientImpl.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SynapseManagementClientImpl.java @@ -433,6 +433,58 @@ public SqlPoolVulnerabilityAssessmentRuleBaselinesInner sqlPoolVulnerabilityAsse return this.sqlPoolVulnerabilityAssessmentRuleBaselines; } + /** + * The ExtendedSqlPoolBlobAuditingPoliciesInner object to access its operations. + */ + private ExtendedSqlPoolBlobAuditingPoliciesInner extendedSqlPoolBlobAuditingPolicies; + + /** + * Gets the ExtendedSqlPoolBlobAuditingPoliciesInner object to access its operations. + * @return the ExtendedSqlPoolBlobAuditingPoliciesInner object. + */ + public ExtendedSqlPoolBlobAuditingPoliciesInner extendedSqlPoolBlobAuditingPolicies() { + return this.extendedSqlPoolBlobAuditingPolicies; + } + + /** + * The DataMaskingPoliciesInner object to access its operations. + */ + private DataMaskingPoliciesInner dataMaskingPolicies; + + /** + * Gets the DataMaskingPoliciesInner object to access its operations. + * @return the DataMaskingPoliciesInner object. + */ + public DataMaskingPoliciesInner dataMaskingPolicies() { + return this.dataMaskingPolicies; + } + + /** + * The DataMaskingRulesInner object to access its operations. + */ + private DataMaskingRulesInner dataMaskingRules; + + /** + * Gets the DataMaskingRulesInner object to access its operations. + * @return the DataMaskingRulesInner object. + */ + public DataMaskingRulesInner dataMaskingRules() { + return this.dataMaskingRules; + } + + /** + * The SqlPoolColumnsInner object to access its operations. + */ + private SqlPoolColumnsInner sqlPoolColumns; + + /** + * Gets the SqlPoolColumnsInner object to access its operations. + * @return the SqlPoolColumnsInner object. + */ + public SqlPoolColumnsInner sqlPoolColumns() { + return this.sqlPoolColumns; + } + /** * The WorkspacesInner object to access its operations. */ @@ -459,6 +511,19 @@ public WorkspaceAadAdminsInner workspaceAadAdmins() { return this.workspaceAadAdmins; } + /** + * The WorkspaceSqlAadAdminsInner object to access its operations. + */ + private WorkspaceSqlAadAdminsInner workspaceSqlAadAdmins; + + /** + * Gets the WorkspaceSqlAadAdminsInner object to access its operations. + * @return the WorkspaceSqlAadAdminsInner object. + */ + public WorkspaceSqlAadAdminsInner workspaceSqlAadAdmins() { + return this.workspaceSqlAadAdmins; + } + /** * The WorkspaceManagedIdentitySqlControlSettingsInner object to access its operations. */ @@ -472,6 +537,19 @@ public WorkspaceManagedIdentitySqlControlSettingsInner workspaceManagedIdentityS return this.workspaceManagedIdentitySqlControlSettings; } + /** + * The RestorableDroppedSqlPoolsInner object to access its operations. + */ + private RestorableDroppedSqlPoolsInner restorableDroppedSqlPools; + + /** + * Gets the RestorableDroppedSqlPoolsInner object to access its operations. + * @return the RestorableDroppedSqlPoolsInner object. + */ + public RestorableDroppedSqlPoolsInner restorableDroppedSqlPools() { + return this.restorableDroppedSqlPools; + } + /** * The IntegrationRuntimesInner object to access its operations. */ @@ -628,6 +706,32 @@ public PrivateLinkHubsInner privateLinkHubs() { return this.privateLinkHubs; } + /** + * The PrivateEndpointConnectionsPrivateLinkHubsInner object to access its operations. + */ + private PrivateEndpointConnectionsPrivateLinkHubsInner privateEndpointConnectionsPrivateLinkHubs; + + /** + * Gets the PrivateEndpointConnectionsPrivateLinkHubsInner object to access its operations. + * @return the PrivateEndpointConnectionsPrivateLinkHubsInner object. + */ + public PrivateEndpointConnectionsPrivateLinkHubsInner privateEndpointConnectionsPrivateLinkHubs() { + return this.privateEndpointConnectionsPrivateLinkHubs; + } + + /** + * The KeysInner object to access its operations. + */ + private KeysInner keys; + + /** + * Gets the KeysInner object to access its operations. + * @return the KeysInner object. + */ + public KeysInner keys() { + return this.keys; + } + /** * Initializes an instance of SynapseManagementClient client. * @@ -686,9 +790,15 @@ protected void initialize() { this.sqlPoolVulnerabilityAssessmentScans = new SqlPoolVulnerabilityAssessmentScansInner(restClient().retrofit(), this); this.sqlPoolSecurityAlertPolicies = new SqlPoolSecurityAlertPoliciesInner(restClient().retrofit(), this); this.sqlPoolVulnerabilityAssessmentRuleBaselines = new SqlPoolVulnerabilityAssessmentRuleBaselinesInner(restClient().retrofit(), this); + this.extendedSqlPoolBlobAuditingPolicies = new ExtendedSqlPoolBlobAuditingPoliciesInner(restClient().retrofit(), this); + this.dataMaskingPolicies = new DataMaskingPoliciesInner(restClient().retrofit(), this); + this.dataMaskingRules = new DataMaskingRulesInner(restClient().retrofit(), this); + this.sqlPoolColumns = new SqlPoolColumnsInner(restClient().retrofit(), this); this.workspaces = new WorkspacesInner(restClient().retrofit(), this); this.workspaceAadAdmins = new WorkspaceAadAdminsInner(restClient().retrofit(), this); + this.workspaceSqlAadAdmins = new WorkspaceSqlAadAdminsInner(restClient().retrofit(), this); this.workspaceManagedIdentitySqlControlSettings = new WorkspaceManagedIdentitySqlControlSettingsInner(restClient().retrofit(), this); + this.restorableDroppedSqlPools = new RestorableDroppedSqlPoolsInner(restClient().retrofit(), this); this.integrationRuntimes = new IntegrationRuntimesInner(restClient().retrofit(), this); this.integrationRuntimeNodeIpAddressOperations = new IntegrationRuntimeNodeIpAddressOperationsInner(restClient().retrofit(), this); this.integrationRuntimeObjectMetadatas = new IntegrationRuntimeObjectMetadatasInner(restClient().retrofit(), this); @@ -701,6 +811,8 @@ protected void initialize() { this.privateLinkResources = new PrivateLinkResourcesInner(restClient().retrofit(), this); this.privateEndpointConnections = new PrivateEndpointConnectionsInner(restClient().retrofit(), this); this.privateLinkHubs = new PrivateLinkHubsInner(restClient().retrofit(), this); + this.privateEndpointConnectionsPrivateLinkHubs = new PrivateEndpointConnectionsPrivateLinkHubsInner(restClient().retrofit(), this); + this.keys = new KeysInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SynapseManager.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SynapseManager.java index 3f912eb4e2d6d..78dd85c60b7b1 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SynapseManager.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/SynapseManager.java @@ -39,9 +39,15 @@ import com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolVulnerabilityAssessmentScans; import com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolSecurityAlertPolicies; import com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolVulnerabilityAssessmentRuleBaselines; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ExtendedSqlPoolBlobAuditingPolicies; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.DataMaskingPolicies; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.DataMaskingRules; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.SqlPoolColumns; import com.microsoft.azure.management.synapse.v2019_06_01_preview.Workspaces; import com.microsoft.azure.management.synapse.v2019_06_01_preview.WorkspaceAadAdmins; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.WorkspaceSqlAadAdmins; import com.microsoft.azure.management.synapse.v2019_06_01_preview.WorkspaceManagedIdentitySqlControlSettings; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.RestorableDroppedSqlPools; import com.microsoft.azure.management.synapse.v2019_06_01_preview.IntegrationRuntimes; import com.microsoft.azure.management.synapse.v2019_06_01_preview.IntegrationRuntimeNodeIpAddressOperations; import com.microsoft.azure.management.synapse.v2019_06_01_preview.IntegrationRuntimeObjectMetadatas; @@ -54,6 +60,8 @@ import com.microsoft.azure.management.synapse.v2019_06_01_preview.PrivateLinkResources; import com.microsoft.azure.management.synapse.v2019_06_01_preview.PrivateEndpointConnections; import com.microsoft.azure.management.synapse.v2019_06_01_preview.PrivateLinkHubs; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.PrivateEndpointConnectionsPrivateLinkHubs; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.Keys; import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; import com.microsoft.azure.arm.resources.implementation.ManagerCore; @@ -84,9 +92,15 @@ public final class SynapseManager extends ManagerCore implements TableSchemaSqlPoolWorkspaceSqlPoolColumn { + private final SynapseManager manager; + + TableSchemaSqlPoolWorkspaceSqlPoolColumnImpl(SqlPoolColumnInner inner, SynapseManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public SynapseManager manager() { + return this.manager; + } + + + + @Override + public ColumnDataType columnType() { + return this.inner().columnType(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/TableSchemaSqlPoolWorkspaceSqlPoolColumnModelImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/TableSchemaSqlPoolWorkspaceSqlPoolColumnModelImpl.java new file mode 100644 index 0000000000000..b25b21eb8fc10 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/TableSchemaSqlPoolWorkspaceSqlPoolColumnModelImpl.java @@ -0,0 +1,70 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import com.microsoft.azure.management.synapse.v2019_06_01_preview.TableSchemaSqlPoolWorkspaceSqlPoolColumnModel; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ColumnDataType; + +class TableSchemaSqlPoolWorkspaceSqlPoolColumnModelImpl extends IndexableRefreshableWrapperImpl implements TableSchemaSqlPoolWorkspaceSqlPoolColumnModel { + private final SynapseManager manager; + private String resourceGroupName; + private String workspaceName; + private String sqlPoolName; + private String schemaName; + private String tableName; + private String columnName; + + TableSchemaSqlPoolWorkspaceSqlPoolColumnModelImpl(SqlPoolColumnInner inner, SynapseManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.workspaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "workspaces"); + this.sqlPoolName = IdParsingUtils.getValueFromIdByName(inner.id(), "sqlPools"); + this.schemaName = IdParsingUtils.getValueFromIdByName(inner.id(), "schemas"); + this.tableName = IdParsingUtils.getValueFromIdByName(inner.id(), "tables"); + this.columnName = IdParsingUtils.getValueFromIdByName(inner.id(), "columns"); + } + + @Override + public SynapseManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + SqlPoolColumnsInner client = this.manager().inner().sqlPoolColumns(); + return client.getAsync(this.resourceGroupName, this.workspaceName, this.sqlPoolName, this.schemaName, this.tableName, this.columnName); + } + + + + @Override + public ColumnDataType columnType() { + return this.inner().columnType(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/VulnerabilityAssessmentScanRecordImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/VulnerabilityAssessmentScanRecordImpl.java index 17ff566f7f09d..175ed54153e5d 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/VulnerabilityAssessmentScanRecordImpl.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/VulnerabilityAssessmentScanRecordImpl.java @@ -9,7 +9,7 @@ package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; import com.microsoft.azure.management.synapse.v2019_06_01_preview.VulnerabilityAssessmentScanRecord; -import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; import rx.Observable; import org.joda.time.DateTime; import java.util.List; @@ -17,12 +17,21 @@ import com.microsoft.azure.management.synapse.v2019_06_01_preview.VulnerabilityAssessmentScanState; import com.microsoft.azure.management.synapse.v2019_06_01_preview.VulnerabilityAssessmentScanTriggerType; -class VulnerabilityAssessmentScanRecordImpl extends WrapperImpl implements VulnerabilityAssessmentScanRecord { +class VulnerabilityAssessmentScanRecordImpl extends IndexableRefreshableWrapperImpl implements VulnerabilityAssessmentScanRecord { private final SynapseManager manager; + private String resourceGroupName; + private String workspaceName; + private String sqlPoolName; + private String scanId; VulnerabilityAssessmentScanRecordImpl(VulnerabilityAssessmentScanRecordInner inner, SynapseManager manager) { - super(inner); + super(null, inner); this.manager = manager; + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.workspaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "workspaces"); + this.sqlPoolName = IdParsingUtils.getValueFromIdByName(inner.id(), "sqlPools"); + this.scanId = IdParsingUtils.getValueFromIdByName(inner.id(), "scans"); } @Override @@ -30,6 +39,12 @@ public SynapseManager manager() { return this.manager; } + @Override + protected Observable getInnerAsync() { + SqlPoolVulnerabilityAssessmentScansInner client = this.manager().inner().sqlPoolVulnerabilityAssessmentScans(); + return client.getAsync(this.resourceGroupName, this.workspaceName, this.sqlPoolName, this.scanId); + } + @Override diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/WorkspaceAadAdminsInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/WorkspaceAadAdminsInner.java index f32368b741e2f..1d0f805c836fc 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/WorkspaceAadAdminsInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/WorkspaceAadAdminsInner.java @@ -11,7 +11,7 @@ import com.microsoft.azure.arm.collection.InnerSupportsDelete; import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; -import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ErrorContractException; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; @@ -84,7 +84,7 @@ interface WorkspaceAadAdminsService { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the WorkspaceAadAdminInfoInner object if successful. */ @@ -157,10 +157,10 @@ public Observable> call(Response getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -171,7 +171,7 @@ private ServiceResponse getDelegate(Response> createOrUpdateWit * @param workspaceName The name of the workspace * @param aadAdminInfo Workspace active directory administrator properties * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the WorkspaceAadAdminInfoInner object if successful. */ @@ -328,11 +328,11 @@ public Observable> call(Response beginCreateOrUpdateDelegate(Response response) throws ErrorContractInnerException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) - .registerError(ErrorContractInnerException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -342,7 +342,7 @@ private ServiceResponse beginCreateOrUpdateDelegate( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ public void delete(String resourceGroupName, String workspaceName) { @@ -410,7 +410,7 @@ public Observable> deleteWithServiceResponseAsync(String r * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ public void beginDelete(String resourceGroupName, String workspaceName) { @@ -482,11 +482,12 @@ public Observable> call(Response response) { }); } - private ServiceResponse beginDeleteDelegate(Response response) throws ErrorContractInnerException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) - .registerError(ErrorContractInnerException.class) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorContractException.class) .build(response); } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/WorkspaceImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/WorkspaceImpl.java index 2ffba0d0f403c..a242bb9bcf2e3 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/WorkspaceImpl.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/WorkspaceImpl.java @@ -16,6 +16,10 @@ import com.microsoft.azure.management.synapse.v2019_06_01_preview.VirtualNetworkProfile; import java.util.Map; import java.util.List; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.EncryptionDetails; +import java.util.UUID; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ManagedVirtualNetworkSettings; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.BabylonConfiguration; import com.microsoft.azure.management.synapse.v2019_06_01_preview.ManagedIdentity; import java.util.ArrayList; import com.microsoft.azure.management.synapse.v2019_06_01_preview.PrivateEndpointConnection; @@ -71,6 +75,11 @@ private void resetCreateUpdateParameters() { this.updateParameter = new WorkspacePatchInfo(); } + @Override + public BabylonConfiguration babylonConfiguration() { + return this.inner().babylonConfiguration(); + } + @Override public Map connectivityEndpoints() { return this.inner().connectivityEndpoints(); @@ -81,6 +90,11 @@ public DataLakeStorageAccountDetails defaultDataLakeStorage() { return this.inner().defaultDataLakeStorage(); } + @Override + public EncryptionDetails encryption() { + return this.inner().encryption(); + } + @Override public Map extraProperties() { return this.inner().extraProperties(); @@ -101,6 +115,11 @@ public String managedVirtualNetwork() { return this.inner().managedVirtualNetwork(); } + @Override + public ManagedVirtualNetworkSettings managedVirtualNetworkSettings() { + return this.inner().managedVirtualNetworkSettings(); + } + @Override public List privateEndpointConnections() { List lst = new ArrayList(); @@ -132,6 +151,11 @@ public VirtualNetworkProfile virtualNetworkProfile() { return this.inner().virtualNetworkProfile(); } + @Override + public UUID workspaceUID() { + return this.inner().workspaceUID(); + } + @Override public WorkspaceImpl withConnectivityEndpoints(Map connectivityEndpoints) { this.inner().withConnectivityEndpoints(connectivityEndpoints); @@ -144,6 +168,12 @@ public WorkspaceImpl withDefaultDataLakeStorage(DataLakeStorageAccountDetails de return this; } + @Override + public WorkspaceImpl withEncryption(EncryptionDetails encryption) { + this.inner().withEncryption(encryption); + return this; + } + @Override public WorkspaceImpl withManagedResourceGroupName(String managedResourceGroupName) { this.inner().withManagedResourceGroupName(managedResourceGroupName); @@ -174,6 +204,16 @@ public WorkspaceImpl withVirtualNetworkProfile(VirtualNetworkProfile virtualNetw return this; } + @Override + public WorkspaceImpl withBabylonConfiguration(BabylonConfiguration babylonConfiguration) { + if (isInCreateMode()) { + this.inner().withBabylonConfiguration(babylonConfiguration); + } else { + this.updateParameter.withBabylonConfiguration(babylonConfiguration); + } + return this; + } + @Override public WorkspaceImpl withIdentity(ManagedIdentity identity) { if (isInCreateMode()) { @@ -184,6 +224,16 @@ public WorkspaceImpl withIdentity(ManagedIdentity identity) { return this; } + @Override + public WorkspaceImpl withManagedVirtualNetworkSettings(ManagedVirtualNetworkSettings managedVirtualNetworkSettings) { + if (isInCreateMode()) { + this.inner().withManagedVirtualNetworkSettings(managedVirtualNetworkSettings); + } else { + this.updateParameter.withManagedVirtualNetworkSettings(managedVirtualNetworkSettings); + } + return this; + } + @Override public WorkspaceImpl withSqlAdministratorLoginPassword(String sqlAdministratorLoginPassword) { if (isInCreateMode()) { diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/WorkspaceInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/WorkspaceInner.java index c21cc1cbcba82..bfd7ba0cf7584 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/WorkspaceInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/WorkspaceInner.java @@ -12,6 +12,10 @@ import com.microsoft.azure.management.synapse.v2019_06_01_preview.VirtualNetworkProfile; import java.util.Map; import java.util.List; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.EncryptionDetails; +import java.util.UUID; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ManagedVirtualNetworkSettings; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.BabylonConfiguration; import com.microsoft.azure.management.synapse.v2019_06_01_preview.ManagedIdentity; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; @@ -81,12 +85,36 @@ public class WorkspaceInner extends Resource { @JsonProperty(value = "properties.privateEndpointConnections") private List privateEndpointConnections; + /** + * The encryption details of the workspace. + */ + @JsonProperty(value = "properties.encryption") + private EncryptionDetails encryption; + + /** + * The workspace unique identifier. + */ + @JsonProperty(value = "properties.workspaceUID", access = JsonProperty.Access.WRITE_ONLY) + private UUID workspaceUID; + /** * Workspace level configs and feature flags. */ @JsonProperty(value = "properties.extraProperties", access = JsonProperty.Access.WRITE_ONLY) private Map extraProperties; + /** + * Managed Virtual Network Settings. + */ + @JsonProperty(value = "properties.managedVirtualNetworkSettings") + private ManagedVirtualNetworkSettings managedVirtualNetworkSettings; + + /** + * Babylon Configuration. + */ + @JsonProperty(value = "properties.babylonConfiguration") + private BabylonConfiguration babylonConfiguration; + /** * Identity of the workspace. */ @@ -262,6 +290,35 @@ public WorkspaceInner withPrivateEndpointConnections(List extraProperties() { return this.extraProperties; } + /** + * Get managed Virtual Network Settings. + * + * @return the managedVirtualNetworkSettings value + */ + public ManagedVirtualNetworkSettings managedVirtualNetworkSettings() { + return this.managedVirtualNetworkSettings; + } + + /** + * Set managed Virtual Network Settings. + * + * @param managedVirtualNetworkSettings the managedVirtualNetworkSettings value to set + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withManagedVirtualNetworkSettings(ManagedVirtualNetworkSettings managedVirtualNetworkSettings) { + this.managedVirtualNetworkSettings = managedVirtualNetworkSettings; + return this; + } + + /** + * Get babylon Configuration. + * + * @return the babylonConfiguration value + */ + public BabylonConfiguration babylonConfiguration() { + return this.babylonConfiguration; + } + + /** + * Set babylon Configuration. + * + * @param babylonConfiguration the babylonConfiguration value to set + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withBabylonConfiguration(BabylonConfiguration babylonConfiguration) { + this.babylonConfiguration = babylonConfiguration; + return this; + } + /** * Get identity of the workspace. * diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/WorkspaceManagedIdentitySqlControlSettingsInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/WorkspaceManagedIdentitySqlControlSettingsInner.java index a112ce0262cb4..5f70718e7ab33 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/WorkspaceManagedIdentitySqlControlSettingsInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/WorkspaceManagedIdentitySqlControlSettingsInner.java @@ -10,6 +10,7 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ErrorContractException; import com.microsoft.azure.management.synapse.v2019_06_01_preview.ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentity; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; @@ -70,7 +71,7 @@ interface WorkspaceManagedIdentitySqlControlSettingsService { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ManagedIdentitySqlControlSettingsModelInner object if successful. */ @@ -143,10 +144,10 @@ public Observable> }); } - private ServiceResponse getDelegate(Response response) throws ErrorContractInnerException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(ErrorContractInnerException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -156,7 +157,7 @@ private ServiceResponse getDelegate * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ManagedIdentitySqlControlSettingsModelInner object if successful. */ @@ -239,7 +240,7 @@ public Observable> * @param workspaceName The name of the workspace * @param grantSqlControlToManagedIdentity Grant sql control to managed identity * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ManagedIdentitySqlControlSettingsModelInner object if successful. */ @@ -318,10 +319,10 @@ public Observable> }); } - private ServiceResponse createOrUpdateDelegate(Response response) throws ErrorContractInnerException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse createOrUpdateDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(ErrorContractInnerException.class) + .registerError(ErrorContractException.class) .build(response); } diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/WorkspaceSqlAadAdminsImpl.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/WorkspaceSqlAadAdminsImpl.java new file mode 100644 index 0000000000000..469caef841349 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/WorkspaceSqlAadAdminsImpl.java @@ -0,0 +1,61 @@ +/** + * 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. + * abc + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.WorkspaceSqlAadAdmins; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.WorkspaceAadAdminInfo; + +class WorkspaceSqlAadAdminsImpl extends WrapperImpl implements WorkspaceSqlAadAdmins { + private final SynapseManager manager; + + WorkspaceSqlAadAdminsImpl(SynapseManager manager) { + super(manager.inner().workspaceSqlAadAdmins()); + this.manager = manager; + } + + public SynapseManager manager() { + return this.manager; + } + + @Override + public Observable getAsync(String resourceGroupName, String workspaceName) { + WorkspaceSqlAadAdminsInner client = this.inner(); + return client.getAsync(resourceGroupName, workspaceName) + .map(new Func1() { + @Override + public WorkspaceAadAdminInfo call(WorkspaceAadAdminInfoInner inner) { + return new WorkspaceAadAdminInfoImpl(inner, manager()); + } + }); + } + + @Override + public Observable createOrUpdateAsync(String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo) { + WorkspaceSqlAadAdminsInner client = this.inner(); + return client.createOrUpdateAsync(resourceGroupName, workspaceName, aadAdminInfo) + .map(new Func1() { + @Override + public WorkspaceAadAdminInfo call(WorkspaceAadAdminInfoInner inner) { + return new WorkspaceAadAdminInfoImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String workspaceName) { + WorkspaceSqlAadAdminsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, workspaceName).toCompletable(); + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/WorkspaceSqlAadAdminsInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/WorkspaceSqlAadAdminsInner.java new file mode 100644 index 0000000000000..231fa64cf3e25 --- /dev/null +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/WorkspaceSqlAadAdminsInner.java @@ -0,0 +1,494 @@ +/** + * 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. + */ + +package com.microsoft.azure.management.synapse.v2019_06_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ErrorContractException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in WorkspaceSqlAadAdmins. + */ +public class WorkspaceSqlAadAdminsInner implements InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private WorkspaceSqlAadAdminsService service; + /** The service client containing this operation class. */ + private SynapseManagementClientImpl client; + + /** + * Initializes an instance of WorkspaceSqlAadAdminsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public WorkspaceSqlAadAdminsInner(Retrofit retrofit, SynapseManagementClientImpl client) { + this.service = retrofit.create(WorkspaceSqlAadAdminsService.class); + this.client = client; + } + + /** + * The interface defining all the services for WorkspaceSqlAadAdmins to be + * used by Retrofit to perform actually REST calls. + */ + interface WorkspaceSqlAadAdminsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.WorkspaceSqlAadAdmins get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlAdministrators/activeDirectory") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.WorkspaceSqlAadAdmins createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlAdministrators/activeDirectory") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Query("api-version") String apiVersion, @Body WorkspaceAadAdminInfoInner aadAdminInfo, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.WorkspaceSqlAadAdmins beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlAdministrators/activeDirectory") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Query("api-version") String apiVersion, @Body WorkspaceAadAdminInfoInner aadAdminInfo, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.WorkspaceSqlAadAdmins delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlAdministrators/activeDirectory", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.synapse.v2019_06_01_preview.WorkspaceSqlAadAdmins beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlAdministrators/activeDirectory", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a workspace SQL active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorContractException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkspaceAadAdminInfoInner object if successful. + */ + public WorkspaceAadAdminInfoInner get(String resourceGroupName, String workspaceName) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName).toBlocking().single().body(); + } + + /** + * Gets a workspace SQL active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String workspaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, workspaceName), serviceCallback); + } + + /** + * Gets a workspace SQL active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceAadAdminInfoInner object + */ + public Observable getAsync(String resourceGroupName, String workspaceName) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName).map(new Func1, WorkspaceAadAdminInfoInner>() { + @Override + public WorkspaceAadAdminInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a workspace SQL active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceAadAdminInfoInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String workspaceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, workspaceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorContractException.class) + .build(response); + } + + /** + * Creates or updates a workspace SQL active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param aadAdminInfo Workspace active directory administrator properties + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorContractException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkspaceAadAdminInfoInner object if successful. + */ + public WorkspaceAadAdminInfoInner createOrUpdate(String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, aadAdminInfo).toBlocking().last().body(); + } + + /** + * Creates or updates a workspace SQL active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param aadAdminInfo Workspace active directory administrator properties + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, aadAdminInfo), serviceCallback); + } + + /** + * Creates or updates a workspace SQL active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param aadAdminInfo Workspace active directory administrator properties + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, aadAdminInfo).map(new Func1, WorkspaceAadAdminInfoInner>() { + @Override + public WorkspaceAadAdminInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a workspace SQL active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param aadAdminInfo Workspace active directory administrator properties + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (aadAdminInfo == null) { + throw new IllegalArgumentException("Parameter aadAdminInfo is required and cannot be null."); + } + Validator.validate(aadAdminInfo); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, workspaceName, this.client.apiVersion(), aadAdminInfo, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a workspace SQL active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param aadAdminInfo Workspace active directory administrator properties + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorContractException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkspaceAadAdminInfoInner object if successful. + */ + public WorkspaceAadAdminInfoInner beginCreateOrUpdate(String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, aadAdminInfo).toBlocking().single().body(); + } + + /** + * Creates or updates a workspace SQL active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param aadAdminInfo Workspace active directory administrator properties + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, aadAdminInfo), serviceCallback); + } + + /** + * Creates or updates a workspace SQL active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param aadAdminInfo Workspace active directory administrator properties + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceAadAdminInfoInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, aadAdminInfo).map(new Func1, WorkspaceAadAdminInfoInner>() { + @Override + public WorkspaceAadAdminInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a workspace SQL active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param aadAdminInfo Workspace active directory administrator properties + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceAadAdminInfoInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (aadAdminInfo == null) { + throw new IllegalArgumentException("Parameter aadAdminInfo is required and cannot be null."); + } + Validator.validate(aadAdminInfo); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, workspaceName, this.client.apiVersion(), aadAdminInfo, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorContractException.class) + .build(response); + } + + /** + * Deletes a workspace SQL active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorContractException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String workspaceName) { + deleteWithServiceResponseAsync(resourceGroupName, workspaceName).toBlocking().last().body(); + } + + /** + * Deletes a workspace SQL active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String workspaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, workspaceName), serviceCallback); + } + + /** + * Deletes a workspace SQL active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String workspaceName) { + return deleteWithServiceResponseAsync(resourceGroupName, workspaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a workspace SQL active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String workspaceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, workspaceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a workspace SQL active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorContractException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String workspaceName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, workspaceName).toBlocking().single().body(); + } + + /** + * Deletes a workspace SQL active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String workspaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, workspaceName), serviceCallback); + } + + /** + * Deletes a workspace SQL active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String workspaceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, workspaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a workspace SQL active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String workspaceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, workspaceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorContractException.class) + .build(response); + } + +} diff --git a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/WorkspacesInner.java b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/WorkspacesInner.java index dde9d4ae03b82..cf7263143dad4 100644 --- a/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/WorkspacesInner.java +++ b/sdk/synapse/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/synapse/v2019_06_01_preview/implementation/WorkspacesInner.java @@ -14,8 +14,8 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; import com.microsoft.azure.AzureServiceFuture; -import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.synapse.v2019_06_01_preview.ErrorContractException; import com.microsoft.azure.management.synapse.v2019_06_01_preview.WorkspacePatchInfo; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; @@ -117,7 +117,7 @@ interface WorkspacesService { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<WorkspaceInner> object if successful. */ @@ -220,10 +220,10 @@ public Observable>> call(Response> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -233,7 +233,7 @@ private ServiceResponse> listByResourceGroupDelegate(Re * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the WorkspaceInner object if successful. */ @@ -306,10 +306,10 @@ public Observable> call(Response r }); } - private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorContractInnerException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(ErrorContractInnerException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -320,7 +320,7 @@ private ServiceResponse getByResourceGroupDelegate(Response> updateWithServiceResponseAsyn * @param workspaceName The name of the workspace * @param workspacePatchInfo Workspace patch request properties * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the WorkspaceInner object if successful. */ @@ -477,11 +477,11 @@ public Observable> call(Response r }); } - private ServiceResponse beginUpdateDelegate(Response response) throws ErrorContractInnerException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginUpdateDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(201, new TypeToken() { }.getType()) - .registerError(ErrorContractInnerException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -492,7 +492,7 @@ private ServiceResponse beginUpdateDelegate(Response> createOrUpdateWithServiceResp * @param workspaceName The name of the workspace * @param workspaceInfo Workspace create or update request properties * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the WorkspaceInner object if successful. */ @@ -649,11 +649,11 @@ public Observable> call(Response r }); } - private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorContractInnerException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(201, new TypeToken() { }.getType()) - .registerError(ErrorContractInnerException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -663,7 +663,7 @@ private ServiceResponse beginCreateOrUpdateDelegate(Response> deleteWithServiceResponseAsync(String * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorContractInnerException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the Object object if successful. */ @@ -805,12 +805,12 @@ public Observable> call(Response response) }); } - private ServiceResponse beginDeleteDelegate(Response response) throws ErrorContractInnerException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) .register(204, new TypeToken() { }.getType()) - .registerError(ErrorContractInnerException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -818,7 +818,7 @@ private ServiceResponse beginDeleteDelegate(Response respo * Returns a list of workspaces in a subscription. * * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<WorkspaceInner> object if successful. */ @@ -914,10 +914,10 @@ public Observable>> call(Response> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -926,7 +926,7 @@ private ServiceResponse> listDelegate(Response>> call(Response> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); } @@ -1037,7 +1037,7 @@ private ServiceResponse> listByResourceGroupNextDelegat * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorContractException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<WorkspaceInner> object if successful. */ @@ -1136,10 +1136,10 @@ public Observable>> call(Response> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listNextDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorContractException.class) .build(response); }