From 978523f9dde187f143069a99279842e1f0fcca67 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 10 Feb 2021 00:10:03 +0000 Subject: [PATCH] CodeGen from PR 12925 in Azure/azure-rest-api-specs Merge f588cb817f884f5158d342c79eccee7615d19fe6 into 10ea08ffc0756fade711361ba2ff1cb1a8f56862 --- eng/versioning/version_client.txt | 1 + .../CHANGELOG.md | 5 + .../azure-resourcemanager-synapse/README.md | 99 + .../azure-resourcemanager-synapse/pom.xml | 67 + .../synapse/SynapseManager.java | 987 ++++++ .../synapse/fluent/BigDataPoolsClient.java | 283 ++ .../fluent/DataMaskingPoliciesClient.java | 81 + .../fluent/DataMaskingRulesClient.java | 127 + ...ndedSqlPoolBlobAuditingPoliciesClient.java | 118 + ...rationRuntimeAuthKeysOperationsClient.java | 88 + ...tegrationRuntimeConnectionInfosClient.java | 47 + .../IntegrationRuntimeCredentialsClient.java | 48 + ...tegrationRuntimeMonitoringDatasClient.java | 47 + ...nRuntimeNodeIpAddressOperationsClient.java | 54 + .../fluent/IntegrationRuntimeNodesClient.java | 131 + ...tegrationRuntimeObjectMetadatasClient.java | 118 + ...egrationRuntimeStatusOperationsClient.java | 47 + .../fluent/IntegrationRuntimesClient.java | 559 ++++ .../synapse/fluent/IpFirewallRulesClient.java | 273 ++ .../synapse/fluent/KeysClient.java | 133 + .../synapse/fluent/LibrariesClient.java | 44 + .../fluent/LibrariesOperationsClient.java | 42 + .../synapse/fluent/OperationsClient.java | 126 + .../PrivateEndpointConnectionsClient.java | 217 ++ ...pointConnectionsPrivateLinkHubsClient.java | 46 + ...vateLinkHubPrivateLinkResourcesClient.java | 74 + .../synapse/fluent/PrivateLinkHubsClient.java | 211 ++ .../fluent/PrivateLinkResourcesClient.java | 72 + .../RestorableDroppedSqlPoolsClient.java | 76 + .../SqlPoolBlobAuditingPoliciesClient.java | 113 + .../synapse/fluent/SqlPoolColumnsClient.java | 62 + .../SqlPoolConnectionPoliciesClient.java | 52 + ...PoolDataWarehouseUserActivitiesClient.java | 57 + .../SqlPoolGeoBackupPoliciesClient.java | 127 + ...SqlPoolMaintenanceWindowOptionsClient.java | 51 + .../SqlPoolMaintenanceWindowsClient.java | 94 + .../SqlPoolMetadataSyncConfigsClient.java | 84 + .../fluent/SqlPoolOperationResultsClient.java | 46 + .../fluent/SqlPoolOperationsClient.java | 44 + ...oolRecommendedSensitivityLabelsClient.java | 55 + .../fluent/SqlPoolReplicationLinksClient.java | 77 + .../fluent/SqlPoolRestorePointsClient.java | 191 ++ .../synapse/fluent/SqlPoolSchemasClient.java | 78 + .../SqlPoolSecurityAlertPoliciesClient.java | 131 + .../SqlPoolSensitivityLabelsClient.java | 370 +++ .../fluent/SqlPoolTableColumnsClient.java | 56 + .../synapse/fluent/SqlPoolTablesClient.java | 94 + ...lPoolTransparentDataEncryptionsClient.java | 133 + .../synapse/fluent/SqlPoolUsagesClient.java | 44 + ...rabilityAssessmentRuleBaselinesClient.java | 172 + ...oolVulnerabilityAssessmentScansClient.java | 235 ++ ...SqlPoolVulnerabilityAssessmentsClient.java | 170 + .../SqlPoolWorkloadClassifiersClient.java | 276 ++ .../fluent/SqlPoolWorkloadGroupsClient.java | 231 ++ .../synapse/fluent/SqlPoolsClient.java | 393 +++ .../fluent/SynapseManagementClient.java | 474 +++ .../fluent/WorkspaceAadAdminsClient.java | 158 + ...nagedIdentitySqlControlSettingsClient.java | 121 + ...edSqlServerBlobAuditingPoliciesClient.java | 160 + ...edSqlServerEncryptionProtectorsClient.java | 227 ++ ...verExtendedBlobAuditingPoliciesClient.java | 163 + ...gedSqlServerRecoverableSqlPoolsClient.java | 75 + ...dSqlServerSecurityAlertPoliciesClient.java | 162 + ...WorkspaceManagedSqlServerUsagesClient.java | 41 + ...lServerVulnerabilityAssessmentsClient.java | 154 + .../fluent/WorkspaceSqlAadAdminsClient.java | 158 + .../synapse/fluent/WorkspacesClient.java | 269 ++ .../models/AvailableRpOperationInner.java | 164 + .../models/BigDataPoolResourceInfoInner.java | 527 ++++ .../CheckNameAvailabilityResponseInner.java | 128 + .../fluent/models/DataMaskingPolicyInner.java | 164 + .../fluent/models/DataMaskingRuleInner.java | 388 +++ .../DataWarehouseUserActivitiesInner.java | 42 + .../models/EncryptionProtectorInner.java | 156 + ...ExtendedServerBlobAuditingPolicyInner.java | 520 +++ ...xtendedSqlPoolBlobAuditingPolicyInner.java | 520 +++ .../fluent/models/GeoBackupPolicyInner.java | 105 + .../IntegrationRuntimeAuthKeysInner.java | 76 + ...IntegrationRuntimeConnectionInfoInner.java | 161 + ...IntegrationRuntimeMonitoringDataInner.java | 81 + .../IntegrationRuntimeNodeIpAddressInner.java | 39 + .../IntegrationRuntimeResourceInner.java | 62 + ...IntegrationRuntimeStatusResponseInner.java | 74 + .../models/IpFirewallRuleInfoInner.java | 98 + .../synapse/fluent/models/KeyInner.java | 79 + .../fluent/models/LibraryResourceInner.java | 179 ++ .../models/MaintenanceWindowOptionsInner.java | 221 ++ .../models/MaintenanceWindowsInner.java | 58 + ...dIdentitySqlControlSettingsModelInner.java | 61 + .../models/MetadataSyncConfigInner.java | 79 + .../fluent/models/OperationResourceInner.java | 235 ++ ...pointConnectionForPrivateLinkHubInner.java | 97 + .../PrivateEndpointConnectionInner.java | 103 + .../fluent/models/PrivateLinkHubInner.java | 88 + .../models/PrivateLinkResourceInner.java | 44 + .../models/RecoverableSqlPoolInner.java | 88 + ...llFirewallRulesOperationResponseInner.java | 51 + .../fluent/models/ReplicationLinkInner.java | 197 ++ .../models/RestorableDroppedSqlPoolInner.java | 163 + .../fluent/models/RestorePointInner.java | 104 + ...SelfHostedIntegrationRuntimeNodeInner.java | 340 ++ .../fluent/models/SensitivityLabelInner.java | 236 ++ .../models/SensitivityLabelUpdateInner.java | 161 + .../models/ServerBlobAuditingPolicyInner.java | 494 +++ .../ServerSecurityAlertPolicyInner.java | 241 ++ .../fluent/models/ServerUsageInner.java | 130 + .../ServerVulnerabilityAssessmentInner.java | 150 + .../SqlPoolBlobAuditingPolicyInner.java | 458 +++ .../fluent/models/SqlPoolColumnInner.java | 69 + .../models/SqlPoolConnectionPolicyInner.java | 239 ++ .../synapse/fluent/models/SqlPoolInner.java | 334 ++ .../fluent/models/SqlPoolOperationInner.java | 239 ++ .../SqlPoolSecurityAlertPolicyInner.java | 241 ++ .../fluent/models/SqlPoolUsageInner.java | 130 + .../SqlPoolVulnerabilityAssessmentInner.java | 153 + ...nerabilityAssessmentRuleBaselineInner.java | 60 + ...lnerabilityAssessmentScansExportInner.java | 45 + .../SsisObjectMetadataListResponseInner.java | 81 + ...SsisObjectMetadataStatusResponseInner.java | 128 + .../TransparentDataEncryptionInner.java | 69 + ...ulnerabilityAssessmentScanRecordInner.java | 155 + .../models/WorkloadClassifierInner.java | 183 ++ .../fluent/models/WorkloadGroupInner.java | 183 ++ .../models/WorkspaceAadAdminInfoInner.java | 131 + .../synapse/fluent/models/WorkspaceInner.java | 489 +++ .../synapse/fluent/models/package-info.java | 6 + .../synapse/fluent/package-info.java | 6 + .../AvailableRpOperationImpl.java | 50 + .../BigDataPoolResourceInfoImpl.java | 361 +++ .../BigDataPoolsClientImpl.java | 1444 +++++++++ .../implementation/BigDataPoolsImpl.java | 192 ++ .../CheckNameAvailabilityResponseImpl.java | 44 + .../DataMaskingPoliciesClientImpl.java | 454 +++ .../DataMaskingPoliciesImpl.java | 117 + .../implementation/DataMaskingPolicyImpl.java | 178 ++ .../implementation/DataMaskingRuleImpl.java | 256 ++ .../DataMaskingRulesClientImpl.java | 725 +++++ .../implementation/DataMaskingRulesImpl.java | 156 + .../DataWarehouseUserActivitiesImpl.java | 44 + .../EncryptionProtectorImpl.java | 187 ++ .../ExtendedServerBlobAuditingPolicyImpl.java | 229 ++ ...SqlPoolBlobAuditingPoliciesClientImpl.java | 771 +++++ ...tendedSqlPoolBlobAuditingPoliciesImpl.java | 134 + ...ExtendedSqlPoolBlobAuditingPolicyImpl.java | 232 ++ .../implementation/GeoBackupPolicyImpl.java | 167 + .../IntegrationRuntimeAuthKeysImpl.java | 36 + ...onRuntimeAuthKeysOperationsClientImpl.java | 478 +++ ...egrationRuntimeAuthKeysOperationsImpl.java | 103 + .../IntegrationRuntimeConnectionInfoImpl.java | 64 + ...ationRuntimeConnectionInfosClientImpl.java | 247 ++ ...IntegrationRuntimeConnectionInfosImpl.java | 64 + ...tegrationRuntimeCredentialsClientImpl.java | 249 ++ .../IntegrationRuntimeCredentialsImpl.java | 44 + .../IntegrationRuntimeMonitoringDataImpl.java | 45 + ...ationRuntimeMonitoringDatasClientImpl.java | 247 ++ ...IntegrationRuntimeMonitoringDatasImpl.java | 64 + .../IntegrationRuntimeNodeIpAddressImpl.java | 33 + ...timeNodeIpAddressOperationsClientImpl.java | 272 ++ ...ionRuntimeNodeIpAddressOperationsImpl.java | 71 + .../IntegrationRuntimeNodesClientImpl.java | 721 +++++ .../IntegrationRuntimeNodesImpl.java | 135 + ...ationRuntimeObjectMetadatasClientImpl.java | 599 ++++ ...IntegrationRuntimeObjectMetadatasImpl.java | 96 + .../IntegrationRuntimeResourceImpl.java | 241 ++ ...tionRuntimeStatusOperationsClientImpl.java | 247 ++ ...ntegrationRuntimeStatusOperationsImpl.java | 64 + .../IntegrationRuntimeStatusResponseImpl.java | 38 + .../IntegrationRuntimesClientImpl.java | 2807 +++++++++++++++++ .../IntegrationRuntimesImpl.java | 271 ++ .../IpFirewallRuleInfoImpl.java | 146 + .../IpFirewallRulesClientImpl.java | 1418 +++++++++ .../implementation/IpFirewallRulesImpl.java | 216 ++ .../synapse/implementation/KeyImpl.java | 144 + .../implementation/KeysClientImpl.java | 893 ++++++ .../synapse/implementation/KeysImpl.java | 204 ++ .../implementation/LibrariesClientImpl.java | 235 ++ .../synapse/implementation/LibrariesImpl.java | 61 + .../LibrariesOperationsClientImpl.java | 339 ++ .../LibrariesOperationsImpl.java | 49 + .../implementation/LibraryResourceImpl.java | 73 + .../MaintenanceWindowOptionsImpl.java | 76 + .../MaintenanceWindowsImpl.java | 52 + ...edIdentitySqlControlSettingsModelImpl.java | 47 + .../MetadataSyncConfigImpl.java | 48 + .../implementation/OperationResourceImpl.java | 63 + .../implementation/OperationsClientImpl.java | 661 ++++ .../implementation/OperationsImpl.java | 139 + ...dpointConnectionForPrivateLinkHubImpl.java | 47 + .../PrivateEndpointConnectionImpl.java | 124 + .../PrivateEndpointConnectionsClientImpl.java | 1174 +++++++ .../PrivateEndpointConnectionsImpl.java | 225 ++ ...tConnectionsPrivateLinkHubsClientImpl.java | 352 +++ ...ndpointConnectionsPrivateLinkHubsImpl.java | 54 + .../implementation/PrivateLinkHubImpl.java | 194 ++ ...LinkHubPrivateLinkResourcesClientImpl.java | 532 ++++ ...rivateLinkHubPrivateLinkResourcesImpl.java | 80 + .../PrivateLinkHubsClientImpl.java | 1361 ++++++++ .../implementation/PrivateLinkHubsImpl.java | 174 + .../PrivateLinkResourceImpl.java | 45 + .../PrivateLinkResourcesClientImpl.java | 522 +++ .../PrivateLinkResourcesImpl.java | 74 + .../RecoverableSqlPoolImpl.java | 57 + ...AllFirewallRulesOperationResponseImpl.java | 33 + .../implementation/ReplicationLinkImpl.java | 87 + .../RestorableDroppedSqlPoolImpl.java | 77 + .../RestorableDroppedSqlPoolsClientImpl.java | 438 +++ .../RestorableDroppedSqlPoolsImpl.java | 77 + .../implementation/RestorePointImpl.java | 62 + .../SelfHostedIntegrationRuntimeNodeImpl.java | 120 + .../implementation/SensitivityLabelImpl.java | 250 ++ .../SensitivityLabelUpdateImpl.java | 68 + .../ServerBlobAuditingPolicyImpl.java | 217 ++ .../ServerSecurityAlertPolicyImpl.java | 209 ++ .../implementation/ServerUsageImpl.java | 57 + .../ServerVulnerabilityAssessmentImpl.java | 174 + ...SqlPoolBlobAuditingPoliciesClientImpl.java | 756 +++++ .../SqlPoolBlobAuditingPoliciesImpl.java | 133 + .../SqlPoolBlobAuditingPolicyImpl.java | 215 ++ .../implementation/SqlPoolColumnImpl.java | 49 + .../SqlPoolColumnsClientImpl.java | 309 ++ .../implementation/SqlPoolColumnsImpl.java | 77 + .../SqlPoolConnectionPoliciesClientImpl.java | 265 ++ .../SqlPoolConnectionPoliciesImpl.java | 70 + .../SqlPoolConnectionPolicyImpl.java | 76 + ...DataWarehouseUserActivitiesClientImpl.java | 283 ++ ...qlPoolDataWarehouseUserActivitiesImpl.java | 74 + .../SqlPoolGeoBackupPoliciesClientImpl.java | 709 +++++ .../SqlPoolGeoBackupPoliciesImpl.java | 162 + .../synapse/implementation/SqlPoolImpl.java | 361 +++ ...oolMaintenanceWindowOptionsClientImpl.java | 271 ++ .../SqlPoolMaintenanceWindowOptionsImpl.java | 70 + .../SqlPoolMaintenanceWindowsClientImpl.java | 492 +++ .../SqlPoolMaintenanceWindowsImpl.java | 93 + .../SqlPoolMetadataSyncConfigsClientImpl.java | 462 +++ .../SqlPoolMetadataSyncConfigsImpl.java | 96 + .../implementation/SqlPoolOperationImpl.java | 98 + .../SqlPoolOperationResultsClientImpl.java | 253 ++ .../SqlPoolOperationResultsImpl.java | 46 + .../SqlPoolOperationsClientImpl.java | 355 +++ .../implementation/SqlPoolOperationsImpl.java | 49 + ...ecommendedSensitivityLabelsClientImpl.java | 265 ++ ...lPoolRecommendedSensitivityLabelsImpl.java | 55 + .../SqlPoolReplicationLinksClientImpl.java | 550 ++++ .../SqlPoolReplicationLinksImpl.java | 77 + .../SqlPoolRestorePointsClientImpl.java | 1075 +++++++ .../SqlPoolRestorePointsImpl.java | 120 + .../SqlPoolSchemasClientImpl.java | 575 ++++ .../implementation/SqlPoolSchemasImpl.java | 54 + ...qlPoolSecurityAlertPoliciesClientImpl.java | 819 +++++ .../SqlPoolSecurityAlertPoliciesImpl.java | 169 + .../SqlPoolSecurityAlertPolicyImpl.java | 229 ++ .../SqlPoolSensitivityLabelsClientImpl.java | 2295 ++++++++++++++ .../SqlPoolSensitivityLabelsImpl.java | 336 ++ .../SqlPoolTableColumnsClientImpl.java | 454 +++ .../SqlPoolTableColumnsImpl.java | 58 + .../SqlPoolTablesClientImpl.java | 637 ++++ .../implementation/SqlPoolTablesImpl.java | 70 + ...lTransparentDataEncryptionsClientImpl.java | 829 +++++ ...SqlPoolTransparentDataEncryptionsImpl.java | 170 + .../implementation/SqlPoolUsageImpl.java | 57 + .../SqlPoolUsagesClientImpl.java | 353 +++ .../implementation/SqlPoolUsagesImpl.java | 49 + .../SqlPoolVulnerabilityAssessmentImpl.java | 200 ++ ...lnerabilityAssessmentRuleBaselineImpl.java | 218 ++ ...lityAssessmentRuleBaselinesClientImpl.java | 908 ++++++ ...nerabilityAssessmentRuleBaselinesImpl.java | 368 +++ ...ulnerabilityAssessmentScansClientImpl.java | 1261 ++++++++ ...ulnerabilityAssessmentScansExportImpl.java | 45 + ...lPoolVulnerabilityAssessmentScansImpl.java | 168 + ...oolVulnerabilityAssessmentsClientImpl.java | 1033 ++++++ .../SqlPoolVulnerabilityAssessmentsImpl.java | 267 ++ .../SqlPoolWorkloadClassifiersClientImpl.java | 1431 +++++++++ .../SqlPoolWorkloadClassifiersImpl.java | 298 ++ .../SqlPoolWorkloadGroupsClientImpl.java | 1219 +++++++ .../SqlPoolWorkloadGroupsImpl.java | 230 ++ .../implementation/SqlPoolsClientImpl.java | 2034 ++++++++++++ .../synapse/implementation/SqlPoolsImpl.java | 222 ++ .../SsisObjectMetadataListResponseImpl.java | 44 + .../SsisObjectMetadataStatusResponseImpl.java | 45 + .../SynapseManagementClientBuilder.java | 146 + .../SynapseManagementClientImpl.java | 1145 +++++++ .../TransparentDataEncryptionImpl.java | 183 ++ .../synapse/implementation/Utils.java | 196 ++ ...VulnerabilityAssessmentScanRecordImpl.java | 84 + .../WorkloadClassifierImpl.java | 221 ++ .../implementation/WorkloadGroupImpl.java | 184 ++ .../WorkspaceAadAdminInfoImpl.java | 56 + .../WorkspaceAadAdminsClientImpl.java | 757 +++++ .../WorkspaceAadAdminsImpl.java | 91 + .../synapse/implementation/WorkspaceImpl.java | 368 +++ ...dIdentitySqlControlSettingsClientImpl.java | 567 ++++ ...ManagedIdentitySqlControlSettingsImpl.java | 93 + ...lServerBlobAuditingPoliciesClientImpl.java | 898 ++++++ ...agedSqlServerBlobAuditingPoliciesImpl.java | 146 + ...lServerEncryptionProtectorsClientImpl.java | 1178 +++++++ ...agedSqlServerEncryptionProtectorsImpl.java | 157 + ...xtendedBlobAuditingPoliciesClientImpl.java | 903 ++++++ ...erverExtendedBlobAuditingPoliciesImpl.java | 150 + ...qlServerRecoverableSqlPoolsClientImpl.java | 523 +++ ...nagedSqlServerRecoverableSqlPoolsImpl.java | 76 + ...ServerSecurityAlertPoliciesClientImpl.java | 896 ++++++ ...gedSqlServerSecurityAlertPoliciesImpl.java | 148 + ...spaceManagedSqlServerUsagesClientImpl.java | 338 ++ .../WorkspaceManagedSqlServerUsagesImpl.java | 47 + ...verVulnerabilityAssessmentsClientImpl.java | 947 ++++++ ...SqlServerVulnerabilityAssessmentsImpl.java | 227 ++ .../WorkspaceSqlAadAdminsClientImpl.java | 758 +++++ .../WorkspaceSqlAadAdminsImpl.java | 91 + .../implementation/WorkspacesClientImpl.java | 1530 +++++++++ .../implementation/WorkspacesImpl.java | 170 + .../synapse/implementation/package-info.java | 6 + .../synapse/models/AutoPauseProperties.java | 77 + .../synapse/models/AutoScaleProperties.java | 102 + .../synapse/models/AvailableRpOperation.java | 52 + .../AvailableRpOperationDisplayInfo.java | 128 + .../synapse/models/AzureEntityResource.java | 40 + .../synapse/models/BigDataPoolPatchInfo.java | 51 + .../models/BigDataPoolResourceInfo.java | 521 +++ .../BigDataPoolResourceInfoListResult.java | 81 + .../synapse/models/BigDataPools.java | 147 + .../models/BlobAuditingPolicyName.java | 31 + .../models/BlobAuditingPolicyState.java | 47 + .../models/CheckNameAvailabilityRequest.java | 76 + .../models/CheckNameAvailabilityResponse.java | 45 + .../synapse/models/CmdkeySetup.java | 127 + .../synapse/models/ColumnDataType.java | 130 + .../synapse/models/ComponentSetup.java | 92 + .../synapse/models/ConnectionPolicyName.java | 31 + .../CreateSqlPoolRestorePointDefinition.java | 56 + .../synapse/models/CustomSetupBase.java | 37 + .../models/CustomerManagedKeyDetails.java | 68 + .../synapse/models/DataFlowComputeType.java | 37 + .../models/DataLakeStorageAccountDetails.java | 76 + .../synapse/models/DataMaskingFunction.java | 59 + .../synapse/models/DataMaskingPolicies.java | 69 + .../synapse/models/DataMaskingPolicy.java | 238 ++ .../synapse/models/DataMaskingRule.java | 518 +++ .../models/DataMaskingRuleListResult.java | 55 + .../synapse/models/DataMaskingRuleState.java | 47 + .../synapse/models/DataMaskingRules.java | 105 + .../synapse/models/DataMaskingState.java | 47 + .../models/DataWarehouseUserActivities.java | 45 + .../models/DataWarehouseUserActivityName.java | 31 + .../synapse/models/DayOfWeek.java | 49 + .../models/DynamicExecutorAllocation.java | 50 + .../synapse/models/EncryptionDetails.java | 68 + .../synapse/models/EncryptionProtector.java | 246 ++ .../models/EncryptionProtectorListResult.java | 59 + .../models/EncryptionProtectorName.java | 31 + .../synapse/models/EntityReference.java | 76 + .../synapse/models/EntityResource.java | 25 + .../models/EnvironmentVariableSetup.java | 96 + .../synapse/models/ErrorAdditionalInfo.java | 54 + .../ExtendedServerBlobAuditingPolicy.java | 727 +++++ ...dedServerBlobAuditingPolicyListResult.java | 59 + .../ExtendedSqlPoolBlobAuditingPolicies.java | 99 + .../ExtendedSqlPoolBlobAuditingPolicy.java | 733 +++++ ...edSqlPoolBlobAuditingPolicyListResult.java | 59 + .../synapse/models/GeoBackupPolicy.java | 189 ++ .../models/GeoBackupPolicyListResult.java | 55 + .../synapse/models/GeoBackupPolicyName.java | 31 + .../synapse/models/GeoBackupPolicyState.java | 47 + .../models/GetSsisObjectMetadataRequest.java | 50 + .../synapse/models/IntegrationRuntime.java | 104 + .../models/IntegrationRuntimeAuthKeyName.java | 34 + .../models/IntegrationRuntimeAuthKeys.java | 31 + .../IntegrationRuntimeAuthKeysOperations.java | 77 + .../models/IntegrationRuntimeAutoUpdate.java | 34 + .../IntegrationRuntimeComputeProperties.java | 232 ++ .../IntegrationRuntimeConnectionInfo.java | 71 + .../IntegrationRuntimeConnectionInfos.java | 39 + .../models/IntegrationRuntimeCredentials.java | 44 + ...ionRuntimeCustomSetupScriptProperties.java | 81 + .../IntegrationRuntimeDataFlowProperties.java | 144 + ...IntegrationRuntimeDataProxyProperties.java | 108 + .../models/IntegrationRuntimeEdition.java | 34 + ...IntegrationRuntimeEntityReferenceType.java | 37 + ...nRuntimeInternalChannelEncryptionMode.java | 38 + .../models/IntegrationRuntimeLicenseType.java | 34 + .../IntegrationRuntimeListResponse.java | 86 + .../IntegrationRuntimeMonitoringData.java | 32 + .../IntegrationRuntimeMonitoringDatas.java | 40 + .../IntegrationRuntimeNodeIpAddress.java | 24 + ...grationRuntimeNodeIpAddressOperations.java | 46 + .../IntegrationRuntimeNodeMonitoringData.java | 182 ++ .../models/IntegrationRuntimeNodes.java | 121 + .../IntegrationRuntimeObjectMetadatas.java | 73 + ...grationRuntimeRegenerateKeyParameters.java | 50 + .../models/IntegrationRuntimeResource.java | 279 ++ .../IntegrationRuntimeSsisCatalogInfo.java | 173 + ...egrationRuntimeSsisCatalogPricingTier.java | 41 + .../IntegrationRuntimeSsisProperties.java | 239 ++ .../models/IntegrationRuntimeState.java | 58 + .../models/IntegrationRuntimeStatus.java | 105 + .../IntegrationRuntimeStatusOperations.java | 39 + .../IntegrationRuntimeStatusResponse.java | 31 + .../models/IntegrationRuntimeType.java | 34 + .../IntegrationRuntimeUpdateResult.java | 37 + .../IntegrationRuntimeVNetProperties.java | 142 + .../synapse/models/IntegrationRuntimes.java | 284 ++ .../synapse/models/IpFirewallRuleInfo.java | 188 ++ .../models/IpFirewallRuleInfoListResult.java | 81 + .../models/IpFirewallRuleProperties.java | 94 + .../synapse/models/IpFirewallRules.java | 175 + .../resourcemanager/synapse/models/Key.java | 178 ++ .../synapse/models/KeyInfoListResult.java | 81 + .../resourcemanager/synapse/models/Keys.java | 145 + .../synapse/models/Libraries.java | 39 + .../synapse/models/LibrariesOperations.java | 36 + .../synapse/models/LibraryInfo.java | 174 + .../synapse/models/LibraryListResponse.java | 85 + .../synapse/models/LibraryRequirements.java | 92 + .../synapse/models/LibraryResource.java | 95 + .../models/LinkedIntegrationRuntime.java | 103 + ...kedIntegrationRuntimeKeyAuthorization.java | 64 + ...edIntegrationRuntimeRbacAuthorization.java | 62 + .../models/LinkedIntegrationRuntimeType.java | 36 + .../ListSqlPoolSecurityAlertPolicies.java | 59 + .../models/MaintenanceWindowOptions.java | 90 + .../models/MaintenanceWindowTimeRange.java | 102 + .../synapse/models/MaintenanceWindows.java | 46 + .../synapse/models/ManagedIdentity.java | 81 + ...anagedIdentitySqlControlSettingsModel.java | 46 + ...rtiesGrantSqlControlToManagedIdentity.java | 68 + ...qlControlToManagedIdentityActualState.java | 74 + ...lControlToManagedIdentityDesiredState.java | 54 + .../models/ManagedIntegrationRuntime.java | 113 + .../ManagedIntegrationRuntimeError.java | 124 + .../models/ManagedIntegrationRuntimeNode.java | 122 + .../ManagedIntegrationRuntimeNodeStatus.java | 41 + ...agedIntegrationRuntimeOperationResult.java | 154 + .../ManagedIntegrationRuntimeStatus.java | 104 + .../models/ManagedVirtualNetworkSettings.java | 104 + .../models/ManagementOperationState.java | 46 + .../synapse/models/MetadataSyncConfig.java | 52 + .../synapse/models/NodeSize.java | 49 + .../synapse/models/NodeSizeFamily.java | 34 + .../models/OperationMetaLogSpecification.java | 102 + ...ationMetaMetricDimensionSpecification.java | 102 + .../OperationMetaMetricSpecification.java | 315 ++ .../OperationMetaServiceSpecification.java | 85 + .../synapse/models/OperationResource.java | 75 + .../synapse/models/OperationStatus.java | 40 + .../synapse/models/Operations.java | 111 + .../synapse/models/PrivateEndpoint.java | 39 + .../models/PrivateEndpointConnection.java | 141 + ...teEndpointConnectionForPrivateLinkHub.java | 46 + ...pointConnectionForPrivateLinkHubBasic.java | 116 + ...onForPrivateLinkHubBasicAutoGenerated.java | 82 + ...vateLinkHubResourceCollectionResponse.java | 84 + .../models/PrivateEndpointConnectionList.java | 59 + .../PrivateEndpointConnectionProperties.java | 98 + .../models/PrivateEndpointConnections.java | 147 + ...ateEndpointConnectionsPrivateLinkHubs.java | 37 + .../synapse/models/PrivateLinkHub.java | 217 ++ .../models/PrivateLinkHubInfoListResult.java | 81 + .../models/PrivateLinkHubPatchInfo.java | 51 + .../PrivateLinkHubPrivateLinkResources.java | 65 + .../synapse/models/PrivateLinkHubs.java | 156 + .../synapse/models/PrivateLinkResource.java | 45 + .../models/PrivateLinkResourceListResult.java | 59 + .../models/PrivateLinkResourceProperties.java | 70 + .../synapse/models/PrivateLinkResources.java | 65 + .../PrivateLinkServiceConnectionState.java | 91 + .../synapse/models/ProvisioningState.java | 43 + .../synapse/models/PurviewConfiguration.java | 50 + .../models/QueryAggregationFunction.java | 53 + .../synapse/models/QueryExecutionType.java | 56 + .../synapse/models/QueryInterval.java | 74 + .../synapse/models/QueryMetric.java | 84 + .../synapse/models/QueryMetricUnit.java | 50 + .../models/QueryObservedMetricType.java | 56 + .../synapse/models/QueryStatistic.java | 58 + .../RecommendedSensitivityLabelUpdate.java | 131 + ...RecommendedSensitivityLabelUpdateKind.java | 47 + ...RecommendedSensitivityLabelUpdateList.java | 54 + .../synapse/models/RecoverableSqlPool.java | 67 + .../models/RecoverableSqlPoolListResult.java | 59 + ...laceAllFirewallRulesOperationResponse.java | 25 + .../ReplaceAllIpFirewallRulesRequest.java | 61 + .../synapse/models/ReplicationLink.java | 117 + .../models/ReplicationLinkListResult.java | 70 + .../synapse/models/ReplicationRole.java | 56 + .../synapse/models/ReplicationState.java | 40 + .../synapse/models/ResourceIdentityType.java | 47 + .../models/ResourceMoveDefinition.java | 55 + .../models/RestorableDroppedSqlPool.java | 102 + .../RestorableDroppedSqlPoolListResult.java | 60 + .../models/RestorableDroppedSqlPools.java | 68 + .../synapse/models/RestorePoint.java | 74 + .../models/RestorePointListResult.java | 59 + .../synapse/models/RestorePointType.java | 47 + .../synapse/models/SecretBase.java | 33 + .../synapse/models/SecureString.java | 64 + .../models/SecurityAlertPolicyName.java | 31 + .../SecurityAlertPolicyNameAutoGenerated.java | 32 + .../models/SecurityAlertPolicyState.java | 50 + .../models/SelfHostedIntegrationRuntime.java | 68 + .../SelfHostedIntegrationRuntimeNode.java | 154 + ...elfHostedIntegrationRuntimeNodeStatus.java | 50 + .../SelfHostedIntegrationRuntimeStatus.java | 333 ++ .../synapse/models/SensitivityLabel.java | 337 ++ .../models/SensitivityLabelListResult.java | 59 + .../synapse/models/SensitivityLabelRank.java | 56 + .../models/SensitivityLabelSource.java | 47 + .../models/SensitivityLabelUpdate.java | 73 + .../models/SensitivityLabelUpdateKind.java | 47 + .../models/SensitivityLabelUpdateList.java | 55 + .../models/ServerBlobAuditingPolicy.java | 689 ++++ .../ServerBlobAuditingPolicyListResult.java | 59 + .../synapse/models/ServerKeyType.java | 34 + .../models/ServerSecurityAlertPolicy.java | 362 +++ .../ServerSecurityAlertPolicyListResult.java | 59 + .../synapse/models/ServerUsage.java | 67 + .../synapse/models/ServerUsageListResult.java | 74 + .../models/ServerVulnerabilityAssessment.java | 262 ++ ...rverVulnerabilityAssessmentListResult.java | 59 + .../resourcemanager/synapse/models/Sku.java | 106 + .../synapse/models/SqlPool.java | 580 ++++ .../models/SqlPoolBlobAuditingPolicies.java | 99 + .../models/SqlPoolBlobAuditingPolicy.java | 631 ++++ .../SqlPoolBlobAuditingPolicyListResult.java | 59 + ...itingPolicySqlPoolOperationListResult.java | 60 + .../synapse/models/SqlPoolColumn.java | 52 + .../models/SqlPoolColumnListResult.java | 59 + .../synapse/models/SqlPoolColumns.java | 57 + .../models/SqlPoolConnectionPolicies.java | 46 + .../models/SqlPoolConnectionPolicy.java | 101 + .../SqlPoolDataWarehouseUserActivities.java | 49 + .../models/SqlPoolGeoBackupPolicies.java | 106 + .../synapse/models/SqlPoolInfoListResult.java | 81 + .../SqlPoolMaintenanceWindowOptions.java | 46 + .../models/SqlPoolMaintenanceWindows.java | 88 + .../models/SqlPoolMetadataSyncConfigs.java | 78 + .../synapse/models/SqlPoolOperation.java | 137 + .../models/SqlPoolOperationResults.java | 42 + .../synapse/models/SqlPoolOperations.java | 39 + .../synapse/models/SqlPoolPatchInfo.java | 369 +++ .../SqlPoolRecommendedSensitivityLabels.java | 48 + .../models/SqlPoolReplicationLinks.java | 70 + .../synapse/models/SqlPoolRestorePoints.java | 137 + .../models/SqlPoolSchemaListResult.java | 56 + .../synapse/models/SqlPoolSchemas.java | 72 + .../models/SqlPoolSecurityAlertPolicies.java | 109 + .../models/SqlPoolSecurityAlertPolicy.java | 363 +++ .../models/SqlPoolSensitivityLabels.java | 326 ++ .../synapse/models/SqlPoolTableColumns.java | 51 + .../models/SqlPoolTableListResult.java | 56 + .../synapse/models/SqlPoolTables.java | 88 + .../SqlPoolTransparentDataEncryptions.java | 109 + .../synapse/models/SqlPoolUsage.java | 67 + .../models/SqlPoolUsageListResult.java | 74 + .../synapse/models/SqlPoolUsages.java | 39 + .../SqlPoolVulnerabilityAssessment.java | 268 ++ ...PoolVulnerabilityAssessmentListResult.java | 59 + ...olVulnerabilityAssessmentRuleBaseline.java | 164 + ...lnerabilityAssessmentRuleBaselineItem.java | 58 + ...lVulnerabilityAssessmentRuleBaselines.java | 160 + .../SqlPoolVulnerabilityAssessmentScans.java | 174 + ...oolVulnerabilityAssessmentScansExport.java | 47 + .../SqlPoolVulnerabilityAssessments.java | 169 + .../models/SqlPoolWorkloadClassifiers.java | 177 ++ .../synapse/models/SqlPoolWorkloadGroups.java | 150 + .../synapse/models/SqlPools.java | 233 ++ .../synapse/models/SsisEnvironment.java | 107 + .../models/SsisEnvironmentReference.java | 128 + .../synapse/models/SsisFolder.java | 50 + .../synapse/models/SsisObjectMetadata.java | 117 + .../SsisObjectMetadataListResponse.java | 32 + .../SsisObjectMetadataStatusResponse.java | 45 + .../models/SsisObjectMetadataType.java | 40 + .../synapse/models/SsisPackage.java | 159 + .../synapse/models/SsisParameter.java | 336 ++ .../synapse/models/SsisProject.java | 162 + .../synapse/models/SsisVariable.java | 206 ++ .../synapse/models/StorageAccountType.java | 37 + .../synapse/models/TopQueries.java | 150 + .../models/TransparentDataEncryption.java | 172 + .../TransparentDataEncryptionListResult.java | 59 + .../models/TransparentDataEncryptionName.java | 31 + .../TransparentDataEncryptionStatus.java | 47 + .../UpdateIntegrationRuntimeNodeRequest.java | 54 + .../UpdateIntegrationRuntimeRequest.java | 82 + .../synapse/models/VirtualNetworkProfile.java | 50 + .../models/VulnerabilityAssessmentName.java | 31 + ...erabilityAssessmentPolicyBaselineName.java | 47 + ...ityAssessmentRecurringScansProperties.java | 109 + .../VulnerabilityAssessmentScanError.java | 54 + .../VulnerabilityAssessmentScanRecord.java | 96 + ...abilityAssessmentScanRecordListResult.java | 59 + .../VulnerabilityAssessmentScanState.java | 40 + ...ulnerabilityAssessmentScanTriggerType.java | 35 + .../synapse/models/WorkloadClassifier.java | 299 ++ .../models/WorkloadClassifierListResult.java | 59 + .../synapse/models/WorkloadGroup.java | 301 ++ .../models/WorkloadGroupListResult.java | 59 + .../synapse/models/Workspace.java | 539 ++++ .../synapse/models/WorkspaceAadAdminInfo.java | 66 + .../synapse/models/WorkspaceAadAdmins.java | 89 + .../models/WorkspaceInfoListResult.java | 81 + .../synapse/models/WorkspaceKeyDetails.java | 76 + ...paceManagedIdentitySqlControlSettings.java | 72 + ...eManagedSqlServerBlobAuditingPolicies.java | 98 + ...eManagedSqlServerEncryptionProtectors.java | 129 + ...SqlServerExtendedBlobAuditingPolicies.java | 98 + ...ceManagedSqlServerRecoverableSqlPools.java | 65 + ...ManagedSqlServerSecurityAlertPolicies.java | 100 + .../WorkspaceManagedSqlServerUsages.java | 36 + ...agedSqlServerVulnerabilityAssessments.java | 153 + .../synapse/models/WorkspacePatchInfo.java | 241 ++ .../WorkspaceRepositoryConfiguration.java | 262 ++ .../synapse/models/WorkspaceSqlAadAdmins.java | 89 + .../synapse/models/Workspaces.java | 159 + .../synapse/models/package-info.java | 6 + .../resourcemanager/synapse/package-info.java | 6 + .../src/main/java/module-info.java | 19 + sdk/synapse/ci.yml | 4 + sdk/synapse/pom.xml | 3 +- 618 files changed, 115204 insertions(+), 1 deletion(-) create mode 100644 sdk/synapse/azure-resourcemanager-synapse/CHANGELOG.md create mode 100644 sdk/synapse/azure-resourcemanager-synapse/README.md create mode 100644 sdk/synapse/azure-resourcemanager-synapse/pom.xml create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/SynapseManager.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/BigDataPoolsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/DataMaskingPoliciesClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/DataMaskingRulesClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/ExtendedSqlPoolBlobAuditingPoliciesClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeAuthKeysOperationsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeConnectionInfosClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeCredentialsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeMonitoringDatasClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeNodeIpAddressOperationsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeNodesClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeObjectMetadatasClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeStatusOperationsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimesClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IpFirewallRulesClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/KeysClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/LibrariesClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/LibrariesOperationsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/OperationsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/PrivateEndpointConnectionsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/PrivateEndpointConnectionsPrivateLinkHubsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/PrivateLinkHubPrivateLinkResourcesClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/PrivateLinkHubsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/PrivateLinkResourcesClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/RestorableDroppedSqlPoolsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolBlobAuditingPoliciesClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolColumnsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolConnectionPoliciesClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolDataWarehouseUserActivitiesClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolGeoBackupPoliciesClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolMaintenanceWindowOptionsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolMaintenanceWindowsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolMetadataSyncConfigsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolOperationResultsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolOperationsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolRecommendedSensitivityLabelsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolReplicationLinksClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolRestorePointsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolSchemasClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolSecurityAlertPoliciesClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolSensitivityLabelsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolTableColumnsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolTablesClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolTransparentDataEncryptionsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolUsagesClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolVulnerabilityAssessmentRuleBaselinesClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolVulnerabilityAssessmentScansClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolVulnerabilityAssessmentsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolWorkloadClassifiersClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolWorkloadGroupsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SynapseManagementClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceAadAdminsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedIdentitySqlControlSettingsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedSqlServerBlobAuditingPoliciesClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedSqlServerEncryptionProtectorsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedSqlServerRecoverableSqlPoolsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedSqlServerSecurityAlertPoliciesClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedSqlServerUsagesClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedSqlServerVulnerabilityAssessmentsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceSqlAadAdminsClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspacesClient.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/AvailableRpOperationInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/BigDataPoolResourceInfoInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/CheckNameAvailabilityResponseInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/DataMaskingPolicyInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/DataMaskingRuleInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/DataWarehouseUserActivitiesInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/EncryptionProtectorInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ExtendedServerBlobAuditingPolicyInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ExtendedSqlPoolBlobAuditingPolicyInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/GeoBackupPolicyInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/IntegrationRuntimeAuthKeysInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/IntegrationRuntimeConnectionInfoInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/IntegrationRuntimeMonitoringDataInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/IntegrationRuntimeNodeIpAddressInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/IntegrationRuntimeResourceInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/IntegrationRuntimeStatusResponseInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/IpFirewallRuleInfoInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/KeyInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/LibraryResourceInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/MaintenanceWindowOptionsInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/MaintenanceWindowsInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ManagedIdentitySqlControlSettingsModelInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/MetadataSyncConfigInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/OperationResourceInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/PrivateEndpointConnectionForPrivateLinkHubInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/PrivateEndpointConnectionInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/PrivateLinkHubInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/PrivateLinkResourceInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/RecoverableSqlPoolInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ReplaceAllFirewallRulesOperationResponseInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ReplicationLinkInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/RestorableDroppedSqlPoolInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/RestorePointInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SelfHostedIntegrationRuntimeNodeInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SensitivityLabelInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SensitivityLabelUpdateInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ServerBlobAuditingPolicyInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ServerSecurityAlertPolicyInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ServerUsageInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ServerVulnerabilityAssessmentInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolBlobAuditingPolicyInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolColumnInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolConnectionPolicyInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolOperationInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolSecurityAlertPolicyInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolUsageInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolVulnerabilityAssessmentInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolVulnerabilityAssessmentRuleBaselineInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolVulnerabilityAssessmentScansExportInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SsisObjectMetadataListResponseInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SsisObjectMetadataStatusResponseInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/TransparentDataEncryptionInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/VulnerabilityAssessmentScanRecordInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/WorkloadClassifierInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/WorkloadGroupInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/WorkspaceAadAdminInfoInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/WorkspaceInner.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/package-info.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/package-info.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/AvailableRpOperationImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/BigDataPoolResourceInfoImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/BigDataPoolsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/BigDataPoolsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/CheckNameAvailabilityResponseImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataMaskingPoliciesClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataMaskingPoliciesImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataMaskingPolicyImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataMaskingRuleImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataMaskingRulesClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataMaskingRulesImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataWarehouseUserActivitiesImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/EncryptionProtectorImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ExtendedServerBlobAuditingPolicyImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ExtendedSqlPoolBlobAuditingPoliciesClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ExtendedSqlPoolBlobAuditingPoliciesImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ExtendedSqlPoolBlobAuditingPolicyImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/GeoBackupPolicyImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeAuthKeysImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeAuthKeysOperationsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeAuthKeysOperationsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeConnectionInfoImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeConnectionInfosClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeConnectionInfosImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeCredentialsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeCredentialsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeMonitoringDataImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeMonitoringDatasClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeMonitoringDatasImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeNodeIpAddressImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeNodeIpAddressOperationsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeNodeIpAddressOperationsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeNodesClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeNodesImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeObjectMetadatasClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeObjectMetadatasImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeResourceImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeStatusOperationsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeStatusOperationsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeStatusResponseImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimesClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimesImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IpFirewallRuleInfoImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IpFirewallRulesClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IpFirewallRulesImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KeyImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KeysClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KeysImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/LibrariesClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/LibrariesImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/LibrariesOperationsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/LibrariesOperationsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/LibraryResourceImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/MaintenanceWindowOptionsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/MaintenanceWindowsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ManagedIdentitySqlControlSettingsModelImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/MetadataSyncConfigImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/OperationResourceImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/OperationsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/OperationsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionForPrivateLinkHubImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionsPrivateLinkHubsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionsPrivateLinkHubsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkHubImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkHubPrivateLinkResourcesClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkHubPrivateLinkResourcesImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkHubsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkHubsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkResourceImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkResourcesClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkResourcesImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/RecoverableSqlPoolImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ReplaceAllFirewallRulesOperationResponseImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ReplicationLinkImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/RestorableDroppedSqlPoolImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/RestorableDroppedSqlPoolsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/RestorableDroppedSqlPoolsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/RestorePointImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SelfHostedIntegrationRuntimeNodeImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SensitivityLabelImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SensitivityLabelUpdateImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ServerBlobAuditingPolicyImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ServerSecurityAlertPolicyImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ServerUsageImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ServerVulnerabilityAssessmentImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolBlobAuditingPoliciesClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolBlobAuditingPoliciesImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolBlobAuditingPolicyImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolColumnImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolColumnsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolColumnsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolConnectionPoliciesClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolConnectionPoliciesImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolConnectionPolicyImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolDataWarehouseUserActivitiesClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolDataWarehouseUserActivitiesImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolGeoBackupPoliciesClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolGeoBackupPoliciesImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolMaintenanceWindowOptionsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolMaintenanceWindowOptionsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolMaintenanceWindowsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolMaintenanceWindowsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolMetadataSyncConfigsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolMetadataSyncConfigsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolOperationImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolOperationResultsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolOperationResultsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolOperationsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolOperationsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolRecommendedSensitivityLabelsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolRecommendedSensitivityLabelsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolReplicationLinksClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolReplicationLinksImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolRestorePointsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolRestorePointsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolSchemasClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolSchemasImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolSecurityAlertPoliciesClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolSecurityAlertPoliciesImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolSecurityAlertPolicyImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolSensitivityLabelsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolSensitivityLabelsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolTableColumnsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolTableColumnsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolTablesClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolTablesImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolTransparentDataEncryptionsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolTransparentDataEncryptionsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolUsageImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolUsagesClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolUsagesImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentRuleBaselineImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentRuleBaselinesClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentRuleBaselinesImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentScansClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentScansExportImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentScansImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolWorkloadClassifiersClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolWorkloadClassifiersImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolWorkloadGroupsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolWorkloadGroupsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SsisObjectMetadataListResponseImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SsisObjectMetadataStatusResponseImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SynapseManagementClientBuilder.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SynapseManagementClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/TransparentDataEncryptionImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/Utils.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/VulnerabilityAssessmentScanRecordImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkloadClassifierImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkloadGroupImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceAadAdminInfoImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceAadAdminsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceAadAdminsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedIdentitySqlControlSettingsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedIdentitySqlControlSettingsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerBlobAuditingPoliciesClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerBlobAuditingPoliciesImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerEncryptionProtectorsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerEncryptionProtectorsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerRecoverableSqlPoolsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerRecoverableSqlPoolsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerSecurityAlertPoliciesClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerSecurityAlertPoliciesImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerUsagesClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerUsagesImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerVulnerabilityAssessmentsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerVulnerabilityAssessmentsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceSqlAadAdminsClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceSqlAadAdminsImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspacesClientImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspacesImpl.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/package-info.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AutoPauseProperties.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AutoScaleProperties.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AvailableRpOperation.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AvailableRpOperationDisplayInfo.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AzureEntityResource.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BigDataPoolPatchInfo.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BigDataPoolResourceInfo.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BigDataPoolResourceInfoListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BigDataPools.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BlobAuditingPolicyName.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BlobAuditingPolicyState.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CheckNameAvailabilityRequest.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CheckNameAvailabilityResponse.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CmdkeySetup.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ColumnDataType.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ComponentSetup.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ConnectionPolicyName.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CreateSqlPoolRestorePointDefinition.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CustomSetupBase.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CustomerManagedKeyDetails.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataFlowComputeType.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataLakeStorageAccountDetails.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingFunction.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingPolicies.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingPolicy.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingRule.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingRuleListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingRuleState.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingRules.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingState.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataWarehouseUserActivities.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataWarehouseUserActivityName.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DayOfWeek.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DynamicExecutorAllocation.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EncryptionDetails.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EncryptionProtector.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EncryptionProtectorListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EncryptionProtectorName.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EntityReference.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EntityResource.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EnvironmentVariableSetup.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ErrorAdditionalInfo.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ExtendedServerBlobAuditingPolicy.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ExtendedServerBlobAuditingPolicyListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ExtendedSqlPoolBlobAuditingPolicies.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ExtendedSqlPoolBlobAuditingPolicy.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ExtendedSqlPoolBlobAuditingPolicyListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/GeoBackupPolicy.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/GeoBackupPolicyListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/GeoBackupPolicyName.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/GeoBackupPolicyState.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/GetSsisObjectMetadataRequest.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntime.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeAuthKeyName.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeAuthKeys.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeAuthKeysOperations.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeAutoUpdate.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeComputeProperties.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeConnectionInfo.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeConnectionInfos.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeCredentials.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeCustomSetupScriptProperties.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeDataFlowProperties.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeDataProxyProperties.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeEdition.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeEntityReferenceType.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeInternalChannelEncryptionMode.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeLicenseType.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeListResponse.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeMonitoringData.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeMonitoringDatas.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeNodeIpAddress.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeNodeIpAddressOperations.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeNodeMonitoringData.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeNodes.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeObjectMetadatas.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeRegenerateKeyParameters.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeResource.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeSsisCatalogInfo.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeSsisCatalogPricingTier.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeSsisProperties.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeState.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeStatus.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeStatusOperations.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeStatusResponse.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeType.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeUpdateResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeVNetProperties.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimes.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IpFirewallRuleInfo.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IpFirewallRuleInfoListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IpFirewallRuleProperties.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IpFirewallRules.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Key.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KeyInfoListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Keys.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Libraries.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LibrariesOperations.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LibraryInfo.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LibraryListResponse.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LibraryRequirements.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LibraryResource.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LinkedIntegrationRuntime.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LinkedIntegrationRuntimeKeyAuthorization.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LinkedIntegrationRuntimeRbacAuthorization.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LinkedIntegrationRuntimeType.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ListSqlPoolSecurityAlertPolicies.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/MaintenanceWindowOptions.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/MaintenanceWindowTimeRange.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/MaintenanceWindows.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIdentity.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIdentitySqlControlSettingsModel.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentity.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityActualState.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityDesiredState.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIntegrationRuntime.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIntegrationRuntimeError.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIntegrationRuntimeNode.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIntegrationRuntimeNodeStatus.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIntegrationRuntimeOperationResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIntegrationRuntimeStatus.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedVirtualNetworkSettings.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagementOperationState.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/MetadataSyncConfig.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/NodeSize.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/NodeSizeFamily.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OperationMetaLogSpecification.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OperationMetaMetricDimensionSpecification.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OperationMetaMetricSpecification.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OperationMetaServiceSpecification.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OperationResource.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OperationStatus.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Operations.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpoint.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnection.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionForPrivateLinkHub.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionForPrivateLinkHubBasic.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionForPrivateLinkHubBasicAutoGenerated.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionList.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionProperties.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnections.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionsPrivateLinkHubs.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkHub.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkHubInfoListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkHubPatchInfo.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkHubPrivateLinkResources.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkHubs.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkResource.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkResourceListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkResourceProperties.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkResources.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkServiceConnectionState.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ProvisioningState.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PurviewConfiguration.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/QueryAggregationFunction.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/QueryExecutionType.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/QueryInterval.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/QueryMetric.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/QueryMetricUnit.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/QueryObservedMetricType.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/QueryStatistic.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RecommendedSensitivityLabelUpdate.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RecommendedSensitivityLabelUpdateKind.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RecommendedSensitivityLabelUpdateList.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RecoverableSqlPool.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RecoverableSqlPoolListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReplaceAllFirewallRulesOperationResponse.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReplaceAllIpFirewallRulesRequest.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReplicationLink.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReplicationLinkListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReplicationRole.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReplicationState.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ResourceIdentityType.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ResourceMoveDefinition.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RestorableDroppedSqlPool.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RestorableDroppedSqlPoolListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RestorableDroppedSqlPools.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RestorePoint.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RestorePointListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RestorePointType.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SecretBase.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SecureString.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SecurityAlertPolicyName.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SecurityAlertPolicyNameAutoGenerated.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SecurityAlertPolicyState.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SelfHostedIntegrationRuntime.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SelfHostedIntegrationRuntimeNode.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SelfHostedIntegrationRuntimeNodeStatus.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SelfHostedIntegrationRuntimeStatus.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SensitivityLabel.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SensitivityLabelListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SensitivityLabelRank.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SensitivityLabelSource.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SensitivityLabelUpdate.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SensitivityLabelUpdateKind.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SensitivityLabelUpdateList.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerBlobAuditingPolicy.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerBlobAuditingPolicyListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerKeyType.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerSecurityAlertPolicy.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerSecurityAlertPolicyListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerUsage.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerUsageListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerVulnerabilityAssessment.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerVulnerabilityAssessmentListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Sku.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPool.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolBlobAuditingPolicies.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolBlobAuditingPolicy.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolBlobAuditingPolicyListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolBlobAuditingPolicySqlPoolOperationListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolColumn.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolColumnListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolColumns.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolConnectionPolicies.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolConnectionPolicy.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolDataWarehouseUserActivities.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolGeoBackupPolicies.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolInfoListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolMaintenanceWindowOptions.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolMaintenanceWindows.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolMetadataSyncConfigs.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolOperation.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolOperationResults.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolOperations.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolPatchInfo.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolRecommendedSensitivityLabels.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolReplicationLinks.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolRestorePoints.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolSchemaListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolSchemas.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolSecurityAlertPolicies.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolSecurityAlertPolicy.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolSensitivityLabels.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolTableColumns.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolTableListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolTables.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolTransparentDataEncryptions.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolUsage.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolUsageListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolUsages.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessment.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessmentListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessmentRuleBaseline.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessmentRuleBaselineItem.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessmentRuleBaselines.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessmentScans.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessmentScansExport.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessments.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolWorkloadClassifiers.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolWorkloadGroups.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPools.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisEnvironment.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisEnvironmentReference.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisFolder.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisObjectMetadata.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisObjectMetadataListResponse.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisObjectMetadataStatusResponse.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisObjectMetadataType.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisPackage.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisParameter.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisProject.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisVariable.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/StorageAccountType.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/TopQueries.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/TransparentDataEncryption.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/TransparentDataEncryptionListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/TransparentDataEncryptionName.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/TransparentDataEncryptionStatus.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/UpdateIntegrationRuntimeNodeRequest.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/UpdateIntegrationRuntimeRequest.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VirtualNetworkProfile.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentName.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentPolicyBaselineName.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentRecurringScansProperties.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentScanError.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentScanRecord.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentScanRecordListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentScanState.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentScanTriggerType.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkloadClassifier.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkloadClassifierListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkloadGroup.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkloadGroupListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Workspace.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceAadAdminInfo.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceAadAdmins.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceInfoListResult.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceKeyDetails.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedIdentitySqlControlSettings.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedSqlServerBlobAuditingPolicies.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedSqlServerEncryptionProtectors.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedSqlServerExtendedBlobAuditingPolicies.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedSqlServerRecoverableSqlPools.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedSqlServerSecurityAlertPolicies.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedSqlServerUsages.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedSqlServerVulnerabilityAssessments.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspacePatchInfo.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceRepositoryConfiguration.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceSqlAadAdmins.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Workspaces.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/package-info.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/package-info.java create mode 100644 sdk/synapse/azure-resourcemanager-synapse/src/main/java/module-info.java diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index b4c831789a970..3a73c0085ac33 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -200,6 +200,7 @@ com.azure.resourcemanager:azure-resourcemanager-eventgrid;1.0.0-beta.1;1.0.0-bet com.azure.resourcemanager:azure-resourcemanager-healthbot;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-confluent;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-digitaltwins;1.0.0-beta.1;1.0.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-synapse;1.0.0-beta.1;1.0.0-beta.1 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current # version. Unreleased dependencies are only valid for dependency versions. diff --git a/sdk/synapse/azure-resourcemanager-synapse/CHANGELOG.md b/sdk/synapse/azure-resourcemanager-synapse/CHANGELOG.md new file mode 100644 index 0000000000000..f97877fb11fc1 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2021-02-10) + +- Azure Resource Manager Synapse client library for Java. This package contains Microsoft Azure SDK for Synapse Management SDK. Azure Synapse Analytics Management Client. Package tag package-2020-12-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/synapse/azure-resourcemanager-synapse/README.md b/sdk/synapse/azure-resourcemanager-synapse/README.md new file mode 100644 index 0000000000000..fcd8c9d686df9 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/README.md @@ -0,0 +1,99 @@ +# Azure Resource Manager Synapse client library for Java + +Azure Resource Manager Synapse client library for Java. + +This package contains Microsoft Azure SDK for Synapse Management SDK. Azure Synapse Analytics Management Client. Package tag package-2020-12-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-synapse;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-synapse + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +SynapseManager manager = SynapseManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/master/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/synapse/azure-resourcemanager-synapse/pom.xml b/sdk/synapse/azure-resourcemanager-synapse/pom.xml new file mode 100644 index 0000000000000..9c4525954778f --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/pom.xml @@ -0,0 +1,67 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-synapse + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Synapse Management + This package contains Microsoft Azure SDK for Synapse Management SDK. Azure Synapse Analytics Management Client. Package tag package-2020-12-01. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + + com.azure + azure-core + 1.13.0 + + + com.azure + azure-core-management + 1.1.1 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + + diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/SynapseManager.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/SynapseManager.java new file mode 100644 index 0000000000000..1bc9b22f4254f --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/SynapseManager.java @@ -0,0 +1,987 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.SynapseManagementClient; +import com.azure.resourcemanager.synapse.implementation.BigDataPoolsImpl; +import com.azure.resourcemanager.synapse.implementation.DataMaskingPoliciesImpl; +import com.azure.resourcemanager.synapse.implementation.DataMaskingRulesImpl; +import com.azure.resourcemanager.synapse.implementation.ExtendedSqlPoolBlobAuditingPoliciesImpl; +import com.azure.resourcemanager.synapse.implementation.IntegrationRuntimeAuthKeysOperationsImpl; +import com.azure.resourcemanager.synapse.implementation.IntegrationRuntimeConnectionInfosImpl; +import com.azure.resourcemanager.synapse.implementation.IntegrationRuntimeCredentialsImpl; +import com.azure.resourcemanager.synapse.implementation.IntegrationRuntimeMonitoringDatasImpl; +import com.azure.resourcemanager.synapse.implementation.IntegrationRuntimeNodeIpAddressOperationsImpl; +import com.azure.resourcemanager.synapse.implementation.IntegrationRuntimeNodesImpl; +import com.azure.resourcemanager.synapse.implementation.IntegrationRuntimeObjectMetadatasImpl; +import com.azure.resourcemanager.synapse.implementation.IntegrationRuntimeStatusOperationsImpl; +import com.azure.resourcemanager.synapse.implementation.IntegrationRuntimesImpl; +import com.azure.resourcemanager.synapse.implementation.IpFirewallRulesImpl; +import com.azure.resourcemanager.synapse.implementation.KeysImpl; +import com.azure.resourcemanager.synapse.implementation.LibrariesImpl; +import com.azure.resourcemanager.synapse.implementation.LibrariesOperationsImpl; +import com.azure.resourcemanager.synapse.implementation.OperationsImpl; +import com.azure.resourcemanager.synapse.implementation.PrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.synapse.implementation.PrivateEndpointConnectionsPrivateLinkHubsImpl; +import com.azure.resourcemanager.synapse.implementation.PrivateLinkHubPrivateLinkResourcesImpl; +import com.azure.resourcemanager.synapse.implementation.PrivateLinkHubsImpl; +import com.azure.resourcemanager.synapse.implementation.PrivateLinkResourcesImpl; +import com.azure.resourcemanager.synapse.implementation.RestorableDroppedSqlPoolsImpl; +import com.azure.resourcemanager.synapse.implementation.SqlPoolBlobAuditingPoliciesImpl; +import com.azure.resourcemanager.synapse.implementation.SqlPoolColumnsImpl; +import com.azure.resourcemanager.synapse.implementation.SqlPoolConnectionPoliciesImpl; +import com.azure.resourcemanager.synapse.implementation.SqlPoolDataWarehouseUserActivitiesImpl; +import com.azure.resourcemanager.synapse.implementation.SqlPoolGeoBackupPoliciesImpl; +import com.azure.resourcemanager.synapse.implementation.SqlPoolMaintenanceWindowOptionsImpl; +import com.azure.resourcemanager.synapse.implementation.SqlPoolMaintenanceWindowsImpl; +import com.azure.resourcemanager.synapse.implementation.SqlPoolMetadataSyncConfigsImpl; +import com.azure.resourcemanager.synapse.implementation.SqlPoolOperationResultsImpl; +import com.azure.resourcemanager.synapse.implementation.SqlPoolOperationsImpl; +import com.azure.resourcemanager.synapse.implementation.SqlPoolRecommendedSensitivityLabelsImpl; +import com.azure.resourcemanager.synapse.implementation.SqlPoolReplicationLinksImpl; +import com.azure.resourcemanager.synapse.implementation.SqlPoolRestorePointsImpl; +import com.azure.resourcemanager.synapse.implementation.SqlPoolSchemasImpl; +import com.azure.resourcemanager.synapse.implementation.SqlPoolSecurityAlertPoliciesImpl; +import com.azure.resourcemanager.synapse.implementation.SqlPoolSensitivityLabelsImpl; +import com.azure.resourcemanager.synapse.implementation.SqlPoolTableColumnsImpl; +import com.azure.resourcemanager.synapse.implementation.SqlPoolTablesImpl; +import com.azure.resourcemanager.synapse.implementation.SqlPoolTransparentDataEncryptionsImpl; +import com.azure.resourcemanager.synapse.implementation.SqlPoolUsagesImpl; +import com.azure.resourcemanager.synapse.implementation.SqlPoolVulnerabilityAssessmentRuleBaselinesImpl; +import com.azure.resourcemanager.synapse.implementation.SqlPoolVulnerabilityAssessmentScansImpl; +import com.azure.resourcemanager.synapse.implementation.SqlPoolVulnerabilityAssessmentsImpl; +import com.azure.resourcemanager.synapse.implementation.SqlPoolWorkloadClassifiersImpl; +import com.azure.resourcemanager.synapse.implementation.SqlPoolWorkloadGroupsImpl; +import com.azure.resourcemanager.synapse.implementation.SqlPoolsImpl; +import com.azure.resourcemanager.synapse.implementation.SynapseManagementClientBuilder; +import com.azure.resourcemanager.synapse.implementation.WorkspaceAadAdminsImpl; +import com.azure.resourcemanager.synapse.implementation.WorkspaceManagedIdentitySqlControlSettingsImpl; +import com.azure.resourcemanager.synapse.implementation.WorkspaceManagedSqlServerBlobAuditingPoliciesImpl; +import com.azure.resourcemanager.synapse.implementation.WorkspaceManagedSqlServerEncryptionProtectorsImpl; +import com.azure.resourcemanager.synapse.implementation.WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesImpl; +import com.azure.resourcemanager.synapse.implementation.WorkspaceManagedSqlServerRecoverableSqlPoolsImpl; +import com.azure.resourcemanager.synapse.implementation.WorkspaceManagedSqlServerSecurityAlertPoliciesImpl; +import com.azure.resourcemanager.synapse.implementation.WorkspaceManagedSqlServerUsagesImpl; +import com.azure.resourcemanager.synapse.implementation.WorkspaceManagedSqlServerVulnerabilityAssessmentsImpl; +import com.azure.resourcemanager.synapse.implementation.WorkspaceSqlAadAdminsImpl; +import com.azure.resourcemanager.synapse.implementation.WorkspacesImpl; +import com.azure.resourcemanager.synapse.models.BigDataPools; +import com.azure.resourcemanager.synapse.models.DataMaskingPolicies; +import com.azure.resourcemanager.synapse.models.DataMaskingRules; +import com.azure.resourcemanager.synapse.models.ExtendedSqlPoolBlobAuditingPolicies; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeAuthKeysOperations; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeConnectionInfos; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeCredentials; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeMonitoringDatas; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeNodeIpAddressOperations; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeNodes; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeObjectMetadatas; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeStatusOperations; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimes; +import com.azure.resourcemanager.synapse.models.IpFirewallRules; +import com.azure.resourcemanager.synapse.models.Keys; +import com.azure.resourcemanager.synapse.models.Libraries; +import com.azure.resourcemanager.synapse.models.LibrariesOperations; +import com.azure.resourcemanager.synapse.models.Operations; +import com.azure.resourcemanager.synapse.models.PrivateEndpointConnections; +import com.azure.resourcemanager.synapse.models.PrivateEndpointConnectionsPrivateLinkHubs; +import com.azure.resourcemanager.synapse.models.PrivateLinkHubPrivateLinkResources; +import com.azure.resourcemanager.synapse.models.PrivateLinkHubs; +import com.azure.resourcemanager.synapse.models.PrivateLinkResources; +import com.azure.resourcemanager.synapse.models.RestorableDroppedSqlPools; +import com.azure.resourcemanager.synapse.models.SqlPoolBlobAuditingPolicies; +import com.azure.resourcemanager.synapse.models.SqlPoolColumns; +import com.azure.resourcemanager.synapse.models.SqlPoolConnectionPolicies; +import com.azure.resourcemanager.synapse.models.SqlPoolDataWarehouseUserActivities; +import com.azure.resourcemanager.synapse.models.SqlPoolGeoBackupPolicies; +import com.azure.resourcemanager.synapse.models.SqlPoolMaintenanceWindowOptions; +import com.azure.resourcemanager.synapse.models.SqlPoolMaintenanceWindows; +import com.azure.resourcemanager.synapse.models.SqlPoolMetadataSyncConfigs; +import com.azure.resourcemanager.synapse.models.SqlPoolOperationResults; +import com.azure.resourcemanager.synapse.models.SqlPoolOperations; +import com.azure.resourcemanager.synapse.models.SqlPoolRecommendedSensitivityLabels; +import com.azure.resourcemanager.synapse.models.SqlPoolReplicationLinks; +import com.azure.resourcemanager.synapse.models.SqlPoolRestorePoints; +import com.azure.resourcemanager.synapse.models.SqlPoolSchemas; +import com.azure.resourcemanager.synapse.models.SqlPoolSecurityAlertPolicies; +import com.azure.resourcemanager.synapse.models.SqlPoolSensitivityLabels; +import com.azure.resourcemanager.synapse.models.SqlPoolTableColumns; +import com.azure.resourcemanager.synapse.models.SqlPoolTables; +import com.azure.resourcemanager.synapse.models.SqlPoolTransparentDataEncryptions; +import com.azure.resourcemanager.synapse.models.SqlPoolUsages; +import com.azure.resourcemanager.synapse.models.SqlPoolVulnerabilityAssessmentRuleBaselines; +import com.azure.resourcemanager.synapse.models.SqlPoolVulnerabilityAssessmentScans; +import com.azure.resourcemanager.synapse.models.SqlPoolVulnerabilityAssessments; +import com.azure.resourcemanager.synapse.models.SqlPoolWorkloadClassifiers; +import com.azure.resourcemanager.synapse.models.SqlPoolWorkloadGroups; +import com.azure.resourcemanager.synapse.models.SqlPools; +import com.azure.resourcemanager.synapse.models.WorkspaceAadAdmins; +import com.azure.resourcemanager.synapse.models.WorkspaceManagedIdentitySqlControlSettings; +import com.azure.resourcemanager.synapse.models.WorkspaceManagedSqlServerBlobAuditingPolicies; +import com.azure.resourcemanager.synapse.models.WorkspaceManagedSqlServerEncryptionProtectors; +import com.azure.resourcemanager.synapse.models.WorkspaceManagedSqlServerExtendedBlobAuditingPolicies; +import com.azure.resourcemanager.synapse.models.WorkspaceManagedSqlServerRecoverableSqlPools; +import com.azure.resourcemanager.synapse.models.WorkspaceManagedSqlServerSecurityAlertPolicies; +import com.azure.resourcemanager.synapse.models.WorkspaceManagedSqlServerUsages; +import com.azure.resourcemanager.synapse.models.WorkspaceManagedSqlServerVulnerabilityAssessments; +import com.azure.resourcemanager.synapse.models.WorkspaceSqlAadAdmins; +import com.azure.resourcemanager.synapse.models.Workspaces; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Entry point to SynapseManager. Azure Synapse Analytics Management Client. */ +public final class SynapseManager { + private BigDataPools bigDataPools; + + private Operations operations; + + private IpFirewallRules ipFirewallRules; + + private SqlPools sqlPools; + + private SqlPoolMetadataSyncConfigs sqlPoolMetadataSyncConfigs; + + private SqlPoolOperationResults sqlPoolOperationResults; + + private SqlPoolGeoBackupPolicies sqlPoolGeoBackupPolicies; + + private SqlPoolDataWarehouseUserActivities sqlPoolDataWarehouseUserActivities; + + private SqlPoolRestorePoints sqlPoolRestorePoints; + + private SqlPoolReplicationLinks sqlPoolReplicationLinks; + + private SqlPoolMaintenanceWindows sqlPoolMaintenanceWindows; + + private SqlPoolMaintenanceWindowOptions sqlPoolMaintenanceWindowOptions; + + private SqlPoolTransparentDataEncryptions sqlPoolTransparentDataEncryptions; + + private SqlPoolBlobAuditingPolicies sqlPoolBlobAuditingPolicies; + + private SqlPoolOperations sqlPoolOperations; + + private SqlPoolUsages sqlPoolUsages; + + private SqlPoolSensitivityLabels sqlPoolSensitivityLabels; + + private SqlPoolRecommendedSensitivityLabels sqlPoolRecommendedSensitivityLabels; + + private SqlPoolSchemas sqlPoolSchemas; + + private SqlPoolTables sqlPoolTables; + + private SqlPoolTableColumns sqlPoolTableColumns; + + private SqlPoolConnectionPolicies sqlPoolConnectionPolicies; + + private SqlPoolVulnerabilityAssessments sqlPoolVulnerabilityAssessments; + + private SqlPoolVulnerabilityAssessmentScans sqlPoolVulnerabilityAssessmentScans; + + private SqlPoolSecurityAlertPolicies sqlPoolSecurityAlertPolicies; + + private SqlPoolVulnerabilityAssessmentRuleBaselines sqlPoolVulnerabilityAssessmentRuleBaselines; + + private ExtendedSqlPoolBlobAuditingPolicies extendedSqlPoolBlobAuditingPolicies; + + private DataMaskingPolicies dataMaskingPolicies; + + private DataMaskingRules dataMaskingRules; + + private SqlPoolColumns sqlPoolColumns; + + private SqlPoolWorkloadGroups sqlPoolWorkloadGroups; + + private SqlPoolWorkloadClassifiers sqlPoolWorkloadClassifiers; + + private Workspaces workspaces; + + private WorkspaceAadAdmins workspaceAadAdmins; + + private WorkspaceSqlAadAdmins workspaceSqlAadAdmins; + + private WorkspaceManagedIdentitySqlControlSettings workspaceManagedIdentitySqlControlSettings; + + private RestorableDroppedSqlPools restorableDroppedSqlPools; + + private IntegrationRuntimes integrationRuntimes; + + private IntegrationRuntimeNodeIpAddressOperations integrationRuntimeNodeIpAddressOperations; + + private IntegrationRuntimeObjectMetadatas integrationRuntimeObjectMetadatas; + + private IntegrationRuntimeNodes integrationRuntimeNodes; + + private IntegrationRuntimeCredentials integrationRuntimeCredentials; + + private IntegrationRuntimeConnectionInfos integrationRuntimeConnectionInfos; + + private IntegrationRuntimeAuthKeysOperations integrationRuntimeAuthKeysOperations; + + private IntegrationRuntimeMonitoringDatas integrationRuntimeMonitoringDatas; + + private IntegrationRuntimeStatusOperations integrationRuntimeStatusOperations; + + private PrivateLinkResources privateLinkResources; + + private PrivateLinkHubPrivateLinkResources privateLinkHubPrivateLinkResources; + + private PrivateEndpointConnections privateEndpointConnections; + + private PrivateLinkHubs privateLinkHubs; + + private PrivateEndpointConnectionsPrivateLinkHubs privateEndpointConnectionsPrivateLinkHubs; + + private WorkspaceManagedSqlServerBlobAuditingPolicies workspaceManagedSqlServerBlobAuditingPolicies; + + private WorkspaceManagedSqlServerExtendedBlobAuditingPolicies workspaceManagedSqlServerExtendedBlobAuditingPolicies; + + private WorkspaceManagedSqlServerSecurityAlertPolicies workspaceManagedSqlServerSecurityAlertPolicies; + + private WorkspaceManagedSqlServerVulnerabilityAssessments workspaceManagedSqlServerVulnerabilityAssessments; + + private WorkspaceManagedSqlServerEncryptionProtectors workspaceManagedSqlServerEncryptionProtectors; + + private WorkspaceManagedSqlServerUsages workspaceManagedSqlServerUsages; + + private WorkspaceManagedSqlServerRecoverableSqlPools workspaceManagedSqlServerRecoverableSqlPools; + + private Keys keys; + + private Libraries libraries; + + private LibrariesOperations librariesOperations; + + private final SynapseManagementClient clientObject; + + private SynapseManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new SynapseManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Synapse service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Synapse service API instance. + */ + public static SynapseManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create SynapseManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new SynapseManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of Synapse service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Synapse service API instance. + */ + public SynapseManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.synapse") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies + .add( + new BearerTokenAuthenticationPolicy( + credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new SynapseManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of BigDataPools. */ + public BigDataPools bigDataPools() { + if (this.bigDataPools == null) { + this.bigDataPools = new BigDataPoolsImpl(clientObject.getBigDataPools(), this); + } + return bigDataPools; + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of IpFirewallRules. */ + public IpFirewallRules ipFirewallRules() { + if (this.ipFirewallRules == null) { + this.ipFirewallRules = new IpFirewallRulesImpl(clientObject.getIpFirewallRules(), this); + } + return ipFirewallRules; + } + + /** @return Resource collection API of SqlPools. */ + public SqlPools sqlPools() { + if (this.sqlPools == null) { + this.sqlPools = new SqlPoolsImpl(clientObject.getSqlPools(), this); + } + return sqlPools; + } + + /** @return Resource collection API of SqlPoolMetadataSyncConfigs. */ + public SqlPoolMetadataSyncConfigs sqlPoolMetadataSyncConfigs() { + if (this.sqlPoolMetadataSyncConfigs == null) { + this.sqlPoolMetadataSyncConfigs = + new SqlPoolMetadataSyncConfigsImpl(clientObject.getSqlPoolMetadataSyncConfigs(), this); + } + return sqlPoolMetadataSyncConfigs; + } + + /** @return Resource collection API of SqlPoolOperationResults. */ + public SqlPoolOperationResults sqlPoolOperationResults() { + if (this.sqlPoolOperationResults == null) { + this.sqlPoolOperationResults = + new SqlPoolOperationResultsImpl(clientObject.getSqlPoolOperationResults(), this); + } + return sqlPoolOperationResults; + } + + /** @return Resource collection API of SqlPoolGeoBackupPolicies. */ + public SqlPoolGeoBackupPolicies sqlPoolGeoBackupPolicies() { + if (this.sqlPoolGeoBackupPolicies == null) { + this.sqlPoolGeoBackupPolicies = + new SqlPoolGeoBackupPoliciesImpl(clientObject.getSqlPoolGeoBackupPolicies(), this); + } + return sqlPoolGeoBackupPolicies; + } + + /** @return Resource collection API of SqlPoolDataWarehouseUserActivities. */ + public SqlPoolDataWarehouseUserActivities sqlPoolDataWarehouseUserActivities() { + if (this.sqlPoolDataWarehouseUserActivities == null) { + this.sqlPoolDataWarehouseUserActivities = + new SqlPoolDataWarehouseUserActivitiesImpl(clientObject.getSqlPoolDataWarehouseUserActivities(), this); + } + return sqlPoolDataWarehouseUserActivities; + } + + /** @return Resource collection API of SqlPoolRestorePoints. */ + public SqlPoolRestorePoints sqlPoolRestorePoints() { + if (this.sqlPoolRestorePoints == null) { + this.sqlPoolRestorePoints = new SqlPoolRestorePointsImpl(clientObject.getSqlPoolRestorePoints(), this); + } + return sqlPoolRestorePoints; + } + + /** @return Resource collection API of SqlPoolReplicationLinks. */ + public SqlPoolReplicationLinks sqlPoolReplicationLinks() { + if (this.sqlPoolReplicationLinks == null) { + this.sqlPoolReplicationLinks = + new SqlPoolReplicationLinksImpl(clientObject.getSqlPoolReplicationLinks(), this); + } + return sqlPoolReplicationLinks; + } + + /** @return Resource collection API of SqlPoolMaintenanceWindows. */ + public SqlPoolMaintenanceWindows sqlPoolMaintenanceWindows() { + if (this.sqlPoolMaintenanceWindows == null) { + this.sqlPoolMaintenanceWindows = + new SqlPoolMaintenanceWindowsImpl(clientObject.getSqlPoolMaintenanceWindows(), this); + } + return sqlPoolMaintenanceWindows; + } + + /** @return Resource collection API of SqlPoolMaintenanceWindowOptions. */ + public SqlPoolMaintenanceWindowOptions sqlPoolMaintenanceWindowOptions() { + if (this.sqlPoolMaintenanceWindowOptions == null) { + this.sqlPoolMaintenanceWindowOptions = + new SqlPoolMaintenanceWindowOptionsImpl(clientObject.getSqlPoolMaintenanceWindowOptions(), this); + } + return sqlPoolMaintenanceWindowOptions; + } + + /** @return Resource collection API of SqlPoolTransparentDataEncryptions. */ + public SqlPoolTransparentDataEncryptions sqlPoolTransparentDataEncryptions() { + if (this.sqlPoolTransparentDataEncryptions == null) { + this.sqlPoolTransparentDataEncryptions = + new SqlPoolTransparentDataEncryptionsImpl(clientObject.getSqlPoolTransparentDataEncryptions(), this); + } + return sqlPoolTransparentDataEncryptions; + } + + /** @return Resource collection API of SqlPoolBlobAuditingPolicies. */ + public SqlPoolBlobAuditingPolicies sqlPoolBlobAuditingPolicies() { + if (this.sqlPoolBlobAuditingPolicies == null) { + this.sqlPoolBlobAuditingPolicies = + new SqlPoolBlobAuditingPoliciesImpl(clientObject.getSqlPoolBlobAuditingPolicies(), this); + } + return sqlPoolBlobAuditingPolicies; + } + + /** @return Resource collection API of SqlPoolOperations. */ + public SqlPoolOperations sqlPoolOperations() { + if (this.sqlPoolOperations == null) { + this.sqlPoolOperations = new SqlPoolOperationsImpl(clientObject.getSqlPoolOperations(), this); + } + return sqlPoolOperations; + } + + /** @return Resource collection API of SqlPoolUsages. */ + public SqlPoolUsages sqlPoolUsages() { + if (this.sqlPoolUsages == null) { + this.sqlPoolUsages = new SqlPoolUsagesImpl(clientObject.getSqlPoolUsages(), this); + } + return sqlPoolUsages; + } + + /** @return Resource collection API of SqlPoolSensitivityLabels. */ + public SqlPoolSensitivityLabels sqlPoolSensitivityLabels() { + if (this.sqlPoolSensitivityLabels == null) { + this.sqlPoolSensitivityLabels = + new SqlPoolSensitivityLabelsImpl(clientObject.getSqlPoolSensitivityLabels(), this); + } + return sqlPoolSensitivityLabels; + } + + /** @return Resource collection API of SqlPoolRecommendedSensitivityLabels. */ + public SqlPoolRecommendedSensitivityLabels sqlPoolRecommendedSensitivityLabels() { + if (this.sqlPoolRecommendedSensitivityLabels == null) { + this.sqlPoolRecommendedSensitivityLabels = + new SqlPoolRecommendedSensitivityLabelsImpl( + clientObject.getSqlPoolRecommendedSensitivityLabels(), this); + } + return sqlPoolRecommendedSensitivityLabels; + } + + /** @return Resource collection API of SqlPoolSchemas. */ + public SqlPoolSchemas sqlPoolSchemas() { + if (this.sqlPoolSchemas == null) { + this.sqlPoolSchemas = new SqlPoolSchemasImpl(clientObject.getSqlPoolSchemas(), this); + } + return sqlPoolSchemas; + } + + /** @return Resource collection API of SqlPoolTables. */ + public SqlPoolTables sqlPoolTables() { + if (this.sqlPoolTables == null) { + this.sqlPoolTables = new SqlPoolTablesImpl(clientObject.getSqlPoolTables(), this); + } + return sqlPoolTables; + } + + /** @return Resource collection API of SqlPoolTableColumns. */ + public SqlPoolTableColumns sqlPoolTableColumns() { + if (this.sqlPoolTableColumns == null) { + this.sqlPoolTableColumns = new SqlPoolTableColumnsImpl(clientObject.getSqlPoolTableColumns(), this); + } + return sqlPoolTableColumns; + } + + /** @return Resource collection API of SqlPoolConnectionPolicies. */ + public SqlPoolConnectionPolicies sqlPoolConnectionPolicies() { + if (this.sqlPoolConnectionPolicies == null) { + this.sqlPoolConnectionPolicies = + new SqlPoolConnectionPoliciesImpl(clientObject.getSqlPoolConnectionPolicies(), this); + } + return sqlPoolConnectionPolicies; + } + + /** @return Resource collection API of SqlPoolVulnerabilityAssessments. */ + public SqlPoolVulnerabilityAssessments sqlPoolVulnerabilityAssessments() { + if (this.sqlPoolVulnerabilityAssessments == null) { + this.sqlPoolVulnerabilityAssessments = + new SqlPoolVulnerabilityAssessmentsImpl(clientObject.getSqlPoolVulnerabilityAssessments(), this); + } + return sqlPoolVulnerabilityAssessments; + } + + /** @return Resource collection API of SqlPoolVulnerabilityAssessmentScans. */ + public SqlPoolVulnerabilityAssessmentScans sqlPoolVulnerabilityAssessmentScans() { + if (this.sqlPoolVulnerabilityAssessmentScans == null) { + this.sqlPoolVulnerabilityAssessmentScans = + new SqlPoolVulnerabilityAssessmentScansImpl( + clientObject.getSqlPoolVulnerabilityAssessmentScans(), this); + } + return sqlPoolVulnerabilityAssessmentScans; + } + + /** @return Resource collection API of SqlPoolSecurityAlertPolicies. */ + public SqlPoolSecurityAlertPolicies sqlPoolSecurityAlertPolicies() { + if (this.sqlPoolSecurityAlertPolicies == null) { + this.sqlPoolSecurityAlertPolicies = + new SqlPoolSecurityAlertPoliciesImpl(clientObject.getSqlPoolSecurityAlertPolicies(), this); + } + return sqlPoolSecurityAlertPolicies; + } + + /** @return Resource collection API of SqlPoolVulnerabilityAssessmentRuleBaselines. */ + public SqlPoolVulnerabilityAssessmentRuleBaselines sqlPoolVulnerabilityAssessmentRuleBaselines() { + if (this.sqlPoolVulnerabilityAssessmentRuleBaselines == null) { + this.sqlPoolVulnerabilityAssessmentRuleBaselines = + new SqlPoolVulnerabilityAssessmentRuleBaselinesImpl( + clientObject.getSqlPoolVulnerabilityAssessmentRuleBaselines(), this); + } + return sqlPoolVulnerabilityAssessmentRuleBaselines; + } + + /** @return Resource collection API of ExtendedSqlPoolBlobAuditingPolicies. */ + public ExtendedSqlPoolBlobAuditingPolicies extendedSqlPoolBlobAuditingPolicies() { + if (this.extendedSqlPoolBlobAuditingPolicies == null) { + this.extendedSqlPoolBlobAuditingPolicies = + new ExtendedSqlPoolBlobAuditingPoliciesImpl( + clientObject.getExtendedSqlPoolBlobAuditingPolicies(), this); + } + return extendedSqlPoolBlobAuditingPolicies; + } + + /** @return Resource collection API of DataMaskingPolicies. */ + public DataMaskingPolicies dataMaskingPolicies() { + if (this.dataMaskingPolicies == null) { + this.dataMaskingPolicies = new DataMaskingPoliciesImpl(clientObject.getDataMaskingPolicies(), this); + } + return dataMaskingPolicies; + } + + /** @return Resource collection API of DataMaskingRules. */ + public DataMaskingRules dataMaskingRules() { + if (this.dataMaskingRules == null) { + this.dataMaskingRules = new DataMaskingRulesImpl(clientObject.getDataMaskingRules(), this); + } + return dataMaskingRules; + } + + /** @return Resource collection API of SqlPoolColumns. */ + public SqlPoolColumns sqlPoolColumns() { + if (this.sqlPoolColumns == null) { + this.sqlPoolColumns = new SqlPoolColumnsImpl(clientObject.getSqlPoolColumns(), this); + } + return sqlPoolColumns; + } + + /** @return Resource collection API of SqlPoolWorkloadGroups. */ + public SqlPoolWorkloadGroups sqlPoolWorkloadGroups() { + if (this.sqlPoolWorkloadGroups == null) { + this.sqlPoolWorkloadGroups = new SqlPoolWorkloadGroupsImpl(clientObject.getSqlPoolWorkloadGroups(), this); + } + return sqlPoolWorkloadGroups; + } + + /** @return Resource collection API of SqlPoolWorkloadClassifiers. */ + public SqlPoolWorkloadClassifiers sqlPoolWorkloadClassifiers() { + if (this.sqlPoolWorkloadClassifiers == null) { + this.sqlPoolWorkloadClassifiers = + new SqlPoolWorkloadClassifiersImpl(clientObject.getSqlPoolWorkloadClassifiers(), this); + } + return sqlPoolWorkloadClassifiers; + } + + /** @return Resource collection API of Workspaces. */ + public Workspaces workspaces() { + if (this.workspaces == null) { + this.workspaces = new WorkspacesImpl(clientObject.getWorkspaces(), this); + } + return workspaces; + } + + /** @return Resource collection API of WorkspaceAadAdmins. */ + public WorkspaceAadAdmins workspaceAadAdmins() { + if (this.workspaceAadAdmins == null) { + this.workspaceAadAdmins = new WorkspaceAadAdminsImpl(clientObject.getWorkspaceAadAdmins(), this); + } + return workspaceAadAdmins; + } + + /** @return Resource collection API of WorkspaceSqlAadAdmins. */ + public WorkspaceSqlAadAdmins workspaceSqlAadAdmins() { + if (this.workspaceSqlAadAdmins == null) { + this.workspaceSqlAadAdmins = new WorkspaceSqlAadAdminsImpl(clientObject.getWorkspaceSqlAadAdmins(), this); + } + return workspaceSqlAadAdmins; + } + + /** @return Resource collection API of WorkspaceManagedIdentitySqlControlSettings. */ + public WorkspaceManagedIdentitySqlControlSettings workspaceManagedIdentitySqlControlSettings() { + if (this.workspaceManagedIdentitySqlControlSettings == null) { + this.workspaceManagedIdentitySqlControlSettings = + new WorkspaceManagedIdentitySqlControlSettingsImpl( + clientObject.getWorkspaceManagedIdentitySqlControlSettings(), this); + } + return workspaceManagedIdentitySqlControlSettings; + } + + /** @return Resource collection API of RestorableDroppedSqlPools. */ + public RestorableDroppedSqlPools restorableDroppedSqlPools() { + if (this.restorableDroppedSqlPools == null) { + this.restorableDroppedSqlPools = + new RestorableDroppedSqlPoolsImpl(clientObject.getRestorableDroppedSqlPools(), this); + } + return restorableDroppedSqlPools; + } + + /** @return Resource collection API of IntegrationRuntimes. */ + public IntegrationRuntimes integrationRuntimes() { + if (this.integrationRuntimes == null) { + this.integrationRuntimes = new IntegrationRuntimesImpl(clientObject.getIntegrationRuntimes(), this); + } + return integrationRuntimes; + } + + /** @return Resource collection API of IntegrationRuntimeNodeIpAddressOperations. */ + public IntegrationRuntimeNodeIpAddressOperations integrationRuntimeNodeIpAddressOperations() { + if (this.integrationRuntimeNodeIpAddressOperations == null) { + this.integrationRuntimeNodeIpAddressOperations = + new IntegrationRuntimeNodeIpAddressOperationsImpl( + clientObject.getIntegrationRuntimeNodeIpAddressOperations(), this); + } + return integrationRuntimeNodeIpAddressOperations; + } + + /** @return Resource collection API of IntegrationRuntimeObjectMetadatas. */ + public IntegrationRuntimeObjectMetadatas integrationRuntimeObjectMetadatas() { + if (this.integrationRuntimeObjectMetadatas == null) { + this.integrationRuntimeObjectMetadatas = + new IntegrationRuntimeObjectMetadatasImpl(clientObject.getIntegrationRuntimeObjectMetadatas(), this); + } + return integrationRuntimeObjectMetadatas; + } + + /** @return Resource collection API of IntegrationRuntimeNodes. */ + public IntegrationRuntimeNodes integrationRuntimeNodes() { + if (this.integrationRuntimeNodes == null) { + this.integrationRuntimeNodes = + new IntegrationRuntimeNodesImpl(clientObject.getIntegrationRuntimeNodes(), this); + } + return integrationRuntimeNodes; + } + + /** @return Resource collection API of IntegrationRuntimeCredentials. */ + public IntegrationRuntimeCredentials integrationRuntimeCredentials() { + if (this.integrationRuntimeCredentials == null) { + this.integrationRuntimeCredentials = + new IntegrationRuntimeCredentialsImpl(clientObject.getIntegrationRuntimeCredentials(), this); + } + return integrationRuntimeCredentials; + } + + /** @return Resource collection API of IntegrationRuntimeConnectionInfos. */ + public IntegrationRuntimeConnectionInfos integrationRuntimeConnectionInfos() { + if (this.integrationRuntimeConnectionInfos == null) { + this.integrationRuntimeConnectionInfos = + new IntegrationRuntimeConnectionInfosImpl(clientObject.getIntegrationRuntimeConnectionInfos(), this); + } + return integrationRuntimeConnectionInfos; + } + + /** @return Resource collection API of IntegrationRuntimeAuthKeysOperations. */ + public IntegrationRuntimeAuthKeysOperations integrationRuntimeAuthKeysOperations() { + if (this.integrationRuntimeAuthKeysOperations == null) { + this.integrationRuntimeAuthKeysOperations = + new IntegrationRuntimeAuthKeysOperationsImpl( + clientObject.getIntegrationRuntimeAuthKeysOperations(), this); + } + return integrationRuntimeAuthKeysOperations; + } + + /** @return Resource collection API of IntegrationRuntimeMonitoringDatas. */ + public IntegrationRuntimeMonitoringDatas integrationRuntimeMonitoringDatas() { + if (this.integrationRuntimeMonitoringDatas == null) { + this.integrationRuntimeMonitoringDatas = + new IntegrationRuntimeMonitoringDatasImpl(clientObject.getIntegrationRuntimeMonitoringDatas(), this); + } + return integrationRuntimeMonitoringDatas; + } + + /** @return Resource collection API of IntegrationRuntimeStatusOperations. */ + public IntegrationRuntimeStatusOperations integrationRuntimeStatusOperations() { + if (this.integrationRuntimeStatusOperations == null) { + this.integrationRuntimeStatusOperations = + new IntegrationRuntimeStatusOperationsImpl(clientObject.getIntegrationRuntimeStatusOperations(), this); + } + return integrationRuntimeStatusOperations; + } + + /** @return Resource collection API of PrivateLinkResources. */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + } + return privateLinkResources; + } + + /** @return Resource collection API of PrivateLinkHubPrivateLinkResources. */ + public PrivateLinkHubPrivateLinkResources privateLinkHubPrivateLinkResources() { + if (this.privateLinkHubPrivateLinkResources == null) { + this.privateLinkHubPrivateLinkResources = + new PrivateLinkHubPrivateLinkResourcesImpl(clientObject.getPrivateLinkHubPrivateLinkResources(), this); + } + return privateLinkHubPrivateLinkResources; + } + + /** @return Resource collection API of PrivateEndpointConnections. */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = + new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** @return Resource collection API of PrivateLinkHubs. */ + public PrivateLinkHubs privateLinkHubs() { + if (this.privateLinkHubs == null) { + this.privateLinkHubs = new PrivateLinkHubsImpl(clientObject.getPrivateLinkHubs(), this); + } + return privateLinkHubs; + } + + /** @return Resource collection API of PrivateEndpointConnectionsPrivateLinkHubs. */ + public PrivateEndpointConnectionsPrivateLinkHubs privateEndpointConnectionsPrivateLinkHubs() { + if (this.privateEndpointConnectionsPrivateLinkHubs == null) { + this.privateEndpointConnectionsPrivateLinkHubs = + new PrivateEndpointConnectionsPrivateLinkHubsImpl( + clientObject.getPrivateEndpointConnectionsPrivateLinkHubs(), this); + } + return privateEndpointConnectionsPrivateLinkHubs; + } + + /** @return Resource collection API of WorkspaceManagedSqlServerBlobAuditingPolicies. */ + public WorkspaceManagedSqlServerBlobAuditingPolicies workspaceManagedSqlServerBlobAuditingPolicies() { + if (this.workspaceManagedSqlServerBlobAuditingPolicies == null) { + this.workspaceManagedSqlServerBlobAuditingPolicies = + new WorkspaceManagedSqlServerBlobAuditingPoliciesImpl( + clientObject.getWorkspaceManagedSqlServerBlobAuditingPolicies(), this); + } + return workspaceManagedSqlServerBlobAuditingPolicies; + } + + /** @return Resource collection API of WorkspaceManagedSqlServerExtendedBlobAuditingPolicies. */ + public WorkspaceManagedSqlServerExtendedBlobAuditingPolicies + workspaceManagedSqlServerExtendedBlobAuditingPolicies() { + if (this.workspaceManagedSqlServerExtendedBlobAuditingPolicies == null) { + this.workspaceManagedSqlServerExtendedBlobAuditingPolicies = + new WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesImpl( + clientObject.getWorkspaceManagedSqlServerExtendedBlobAuditingPolicies(), this); + } + return workspaceManagedSqlServerExtendedBlobAuditingPolicies; + } + + /** @return Resource collection API of WorkspaceManagedSqlServerSecurityAlertPolicies. */ + public WorkspaceManagedSqlServerSecurityAlertPolicies workspaceManagedSqlServerSecurityAlertPolicies() { + if (this.workspaceManagedSqlServerSecurityAlertPolicies == null) { + this.workspaceManagedSqlServerSecurityAlertPolicies = + new WorkspaceManagedSqlServerSecurityAlertPoliciesImpl( + clientObject.getWorkspaceManagedSqlServerSecurityAlertPolicies(), this); + } + return workspaceManagedSqlServerSecurityAlertPolicies; + } + + /** @return Resource collection API of WorkspaceManagedSqlServerVulnerabilityAssessments. */ + public WorkspaceManagedSqlServerVulnerabilityAssessments workspaceManagedSqlServerVulnerabilityAssessments() { + if (this.workspaceManagedSqlServerVulnerabilityAssessments == null) { + this.workspaceManagedSqlServerVulnerabilityAssessments = + new WorkspaceManagedSqlServerVulnerabilityAssessmentsImpl( + clientObject.getWorkspaceManagedSqlServerVulnerabilityAssessments(), this); + } + return workspaceManagedSqlServerVulnerabilityAssessments; + } + + /** @return Resource collection API of WorkspaceManagedSqlServerEncryptionProtectors. */ + public WorkspaceManagedSqlServerEncryptionProtectors workspaceManagedSqlServerEncryptionProtectors() { + if (this.workspaceManagedSqlServerEncryptionProtectors == null) { + this.workspaceManagedSqlServerEncryptionProtectors = + new WorkspaceManagedSqlServerEncryptionProtectorsImpl( + clientObject.getWorkspaceManagedSqlServerEncryptionProtectors(), this); + } + return workspaceManagedSqlServerEncryptionProtectors; + } + + /** @return Resource collection API of WorkspaceManagedSqlServerUsages. */ + public WorkspaceManagedSqlServerUsages workspaceManagedSqlServerUsages() { + if (this.workspaceManagedSqlServerUsages == null) { + this.workspaceManagedSqlServerUsages = + new WorkspaceManagedSqlServerUsagesImpl(clientObject.getWorkspaceManagedSqlServerUsages(), this); + } + return workspaceManagedSqlServerUsages; + } + + /** @return Resource collection API of WorkspaceManagedSqlServerRecoverableSqlPools. */ + public WorkspaceManagedSqlServerRecoverableSqlPools workspaceManagedSqlServerRecoverableSqlPools() { + if (this.workspaceManagedSqlServerRecoverableSqlPools == null) { + this.workspaceManagedSqlServerRecoverableSqlPools = + new WorkspaceManagedSqlServerRecoverableSqlPoolsImpl( + clientObject.getWorkspaceManagedSqlServerRecoverableSqlPools(), this); + } + return workspaceManagedSqlServerRecoverableSqlPools; + } + + /** @return Resource collection API of Keys. */ + public Keys keys() { + if (this.keys == null) { + this.keys = new KeysImpl(clientObject.getKeys(), this); + } + return keys; + } + + /** @return Resource collection API of Libraries. */ + public Libraries libraries() { + if (this.libraries == null) { + this.libraries = new LibrariesImpl(clientObject.getLibraries(), this); + } + return libraries; + } + + /** @return Resource collection API of LibrariesOperations. */ + public LibrariesOperations librariesOperations() { + if (this.librariesOperations == null) { + this.librariesOperations = new LibrariesOperationsImpl(clientObject.getLibrariesOperations(), this); + } + return librariesOperations; + } + + /** + * @return Wrapped service client SynapseManagementClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. + */ + public SynapseManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/BigDataPoolsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/BigDataPoolsClient.java new file mode 100644 index 0000000000000..e7dd282c1e73f --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/BigDataPoolsClient.java @@ -0,0 +1,283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.models.BigDataPoolResourceInfoInner; +import com.azure.resourcemanager.synapse.models.BigDataPoolPatchInfo; + +/** An instance of this class provides access to all the operations defined in BigDataPoolsClient. */ +public interface BigDataPoolsClient { + /** + * Get a Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BigDataPoolResourceInfoInner get(String resourceGroupName, String workspaceName, String bigDataPoolName); + + /** + * Get a Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String bigDataPoolName, Context context); + + /** + * Patch a Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @param bigDataPoolPatchInfo The updated Big Data pool properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BigDataPoolResourceInfoInner update( + String resourceGroupName, + String workspaceName, + String bigDataPoolName, + BigDataPoolPatchInfo bigDataPoolPatchInfo); + + /** + * Patch a Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @param bigDataPoolPatchInfo The updated Big Data pool properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String workspaceName, + String bigDataPoolName, + BigDataPoolPatchInfo bigDataPoolPatchInfo, + Context context); + + /** + * Create a new Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, BigDataPoolResourceInfoInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String bigDataPoolName, + BigDataPoolResourceInfoInner bigDataPoolInfo, + Boolean force); + + /** + * Create a new Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @param bigDataPoolInfo The Big Data pool to create. + * @param force Whether to stop any running jobs in the Big Data pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, BigDataPoolResourceInfoInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String bigDataPoolName, + BigDataPoolResourceInfoInner bigDataPoolInfo, + Boolean force, + Context context); + + /** + * Create a new Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BigDataPoolResourceInfoInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String bigDataPoolName, + BigDataPoolResourceInfoInner bigDataPoolInfo, + Boolean force); + + /** + * Create a new Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @param bigDataPoolInfo The Big Data pool to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BigDataPoolResourceInfoInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String bigDataPoolName, + BigDataPoolResourceInfoInner bigDataPoolInfo); + + /** + * Create a new Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @param bigDataPoolInfo The Big Data pool to create. + * @param force Whether to stop any running jobs in the Big Data pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BigDataPoolResourceInfoInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String bigDataPoolName, + BigDataPoolResourceInfoInner bigDataPoolInfo, + Boolean force, + Context context); + + /** + * Delete a Big Data pool from the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Object> beginDelete( + String resourceGroupName, String workspaceName, String bigDataPoolName); + + /** + * Delete a Big Data pool from the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Object> beginDelete( + String resourceGroupName, String workspaceName, String bigDataPoolName, Context context); + + /** + * Delete a Big Data pool from the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Object delete(String resourceGroupName, String workspaceName, String bigDataPoolName); + + /** + * Delete a Big Data pool from the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Object delete(String resourceGroupName, String workspaceName, String bigDataPoolName, Context context); + + /** + * List Big Data pools 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of Big Data pool information. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * List Big Data pools in a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of Big Data pool information. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/DataMaskingPoliciesClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/DataMaskingPoliciesClient.java new file mode 100644 index 0000000000000..acc4fdccdcbf2 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/DataMaskingPoliciesClient.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.DataMaskingPolicyInner; + +/** An instance of this class provides access to all the operations defined in DataMaskingPoliciesClient. */ +public interface DataMaskingPoliciesClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataMaskingPolicyInner createOrUpdate( + String resourceGroupName, String workspaceName, String sqlPoolName, DataMaskingPolicyInner parameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + DataMaskingPolicyInner parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool data masking policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataMaskingPolicyInner get(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool data masking policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/DataMaskingRulesClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/DataMaskingRulesClient.java new file mode 100644 index 0000000000000..9d540d76fbe0b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/DataMaskingRulesClient.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.DataMaskingRuleInner; + +/** An instance of this class provides access to all the operations defined in DataMaskingRulesClient. */ +public interface DataMaskingRulesClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Sql pool data masking rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataMaskingRuleInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String dataMaskingRuleName, + DataMaskingRuleInner parameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Sql pool data masking rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String dataMaskingRuleName, + DataMaskingRuleInner parameters, + Context context); + + /** + * Gets the specific 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific Sql pool data masking rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataMaskingRuleInner get( + String resourceGroupName, String workspaceName, String sqlPoolName, String dataMaskingRuleName); + + /** + * Gets the specific 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific Sql pool data masking rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String dataMaskingRuleName, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool data masking rules. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySqlPool( + String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool data masking rules. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySqlPool( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/ExtendedSqlPoolBlobAuditingPoliciesClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/ExtendedSqlPoolBlobAuditingPoliciesClient.java new file mode 100644 index 0000000000000..afc9253beba6e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/ExtendedSqlPoolBlobAuditingPoliciesClient.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.ExtendedSqlPoolBlobAuditingPolicyInner; + +/** + * An instance of this class provides access to all the operations defined in ExtendedSqlPoolBlobAuditingPoliciesClient. + */ +public interface ExtendedSqlPoolBlobAuditingPoliciesClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended Sql pool's blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExtendedSqlPoolBlobAuditingPolicyInner get(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended Sql pool's blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended Sql pool blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExtendedSqlPoolBlobAuditingPolicyInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + ExtendedSqlPoolBlobAuditingPolicyInner parameters); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended Sql pool blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + ExtendedSqlPoolBlobAuditingPolicyInner parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of sql pool extended auditing settings. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySqlPool( + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of sql pool extended auditing settings. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySqlPool( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeAuthKeysOperationsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeAuthKeysOperationsClient.java new file mode 100644 index 0000000000000..39778b5c46116 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeAuthKeysOperationsClient.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeAuthKeysInner; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeRegenerateKeyParameters; + +/** + * An instance of this class provides access to all the operations defined in + * IntegrationRuntimeAuthKeysOperationsClient. + */ +public interface IntegrationRuntimeAuthKeysOperationsClient { + /** + * Regenerate the authentication key for 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 regenerateKeyParameters The parameters for regenerating integration runtime authentication key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the integration runtime authentication keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IntegrationRuntimeAuthKeysInner regenerate( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + IntegrationRuntimeRegenerateKeyParameters regenerateKeyParameters); + + /** + * Regenerate the authentication key for 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 regenerateKeyParameters The parameters for regenerating integration runtime authentication key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the integration runtime authentication keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response regenerateWithResponse( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + IntegrationRuntimeRegenerateKeyParameters regenerateKeyParameters, + Context context); + + /** + * List authentication keys 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the integration runtime authentication keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IntegrationRuntimeAuthKeysInner list(String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * List authentication keys 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the integration runtime authentication keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeConnectionInfosClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeConnectionInfosClient.java new file mode 100644 index 0000000000000..8faaf0b820cf9 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeConnectionInfosClient.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeConnectionInfoInner; + +/** + * An instance of this class provides access to all the operations defined in IntegrationRuntimeConnectionInfosClient. + */ +public interface IntegrationRuntimeConnectionInfosClient { + /** + * Get connection info for 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection info for an integration runtime. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IntegrationRuntimeConnectionInfoInner get( + String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * Get connection info for 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection info for an integration runtime. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeCredentialsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeCredentialsClient.java new file mode 100644 index 0000000000000..82c88d5d0de7d --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeCredentialsClient.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** An instance of this class provides access to all the operations defined in IntegrationRuntimeCredentialsClient. */ +public interface IntegrationRuntimeCredentialsClient { + /** + * Force the integration runtime to synchronize credentials across integration runtime nodes, and this will override + * the credentials across all worker nodes with those available on the dispatcher node. If you already have the + * latest credential backup file, you should manually import it (preferred) on any self-hosted integration runtime + * node than using this API directly. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void sync(String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * Force the integration runtime to synchronize credentials across integration runtime nodes, and this will override + * the credentials across all worker nodes with those available on the dispatcher node. If you already have the + * latest credential backup file, you should manually import it (preferred) on any self-hosted integration runtime + * node than using this API directly. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response syncWithResponse( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeMonitoringDatasClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeMonitoringDatasClient.java new file mode 100644 index 0000000000000..44bd2f349e86a --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeMonitoringDatasClient.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeMonitoringDataInner; + +/** + * An instance of this class provides access to all the operations defined in IntegrationRuntimeMonitoringDatasClient. + */ +public interface IntegrationRuntimeMonitoringDatasClient { + /** + * Get monitoring data for 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return monitoring data for an integration runtime. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IntegrationRuntimeMonitoringDataInner list( + String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * Get monitoring data for 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return monitoring data for an integration runtime. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeNodeIpAddressOperationsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeNodeIpAddressOperationsClient.java new file mode 100644 index 0000000000000..d034aefa47458 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeNodeIpAddressOperationsClient.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeNodeIpAddressInner; + +/** + * An instance of this class provides access to all the operations defined in + * IntegrationRuntimeNodeIpAddressOperationsClient. + */ +public interface IntegrationRuntimeNodeIpAddressOperationsClient { + /** + * Get the IP address of an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IP address of an integration runtime node. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IntegrationRuntimeNodeIpAddressInner get( + String resourceGroupName, String workspaceName, String integrationRuntimeName, String nodeName); + + /** + * Get the IP address of an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IP address of an integration runtime node. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String nodeName, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeNodesClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeNodesClient.java new file mode 100644 index 0000000000000..432a6824bbed5 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeNodesClient.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.SelfHostedIntegrationRuntimeNodeInner; +import com.azure.resourcemanager.synapse.models.UpdateIntegrationRuntimeNodeRequest; + +/** An instance of this class provides access to all the operations defined in IntegrationRuntimeNodesClient. */ +public interface IntegrationRuntimeNodesClient { + /** + * Get an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an integration runtime node. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SelfHostedIntegrationRuntimeNodeInner get( + String resourceGroupName, String workspaceName, String integrationRuntimeName, String nodeName); + + /** + * Get an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an integration runtime node. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String nodeName, + Context context); + + /** + * Create an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @param updateIntegrationRuntimeNodeRequest The parameters for updating an integration runtime node. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of Self-hosted integration runtime node. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SelfHostedIntegrationRuntimeNodeInner update( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String nodeName, + UpdateIntegrationRuntimeNodeRequest updateIntegrationRuntimeNodeRequest); + + /** + * Create an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @param updateIntegrationRuntimeNodeRequest The parameters for updating an integration runtime node. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of Self-hosted integration runtime node. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String nodeName, + UpdateIntegrationRuntimeNodeRequest updateIntegrationRuntimeNodeRequest, + Context context); + + /** + * Delete an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String integrationRuntimeName, String nodeName); + + /** + * Delete an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String nodeName, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeObjectMetadatasClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeObjectMetadatasClient.java new file mode 100644 index 0000000000000..2246ac135c415 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeObjectMetadatasClient.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.models.SsisObjectMetadataListResponseInner; +import com.azure.resourcemanager.synapse.fluent.models.SsisObjectMetadataStatusResponseInner; +import com.azure.resourcemanager.synapse.models.GetSsisObjectMetadataRequest; + +/** + * An instance of this class provides access to all the operations defined in IntegrationRuntimeObjectMetadatasClient. + */ +public interface IntegrationRuntimeObjectMetadatasClient { + /** + * Get object metadata from 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object metadata from an integration runtime. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SsisObjectMetadataListResponseInner list( + String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * Get object metadata from 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 getMetadataRequest The parameters for getting a SSIS object metadata. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object metadata from an integration runtime. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + GetSsisObjectMetadataRequest getMetadataRequest, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SsisObjectMetadataStatusResponseInner> beginRefresh( + String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SsisObjectMetadataStatusResponseInner> beginRefresh( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SsisObjectMetadataStatusResponseInner refresh( + String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SsisObjectMetadataStatusResponseInner refresh( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeStatusOperationsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeStatusOperationsClient.java new file mode 100644 index 0000000000000..a74ba49f38038 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimeStatusOperationsClient.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeStatusResponseInner; + +/** + * An instance of this class provides access to all the operations defined in IntegrationRuntimeStatusOperationsClient. + */ +public interface IntegrationRuntimeStatusOperationsClient { + /** + * Get the integration runtime status. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the integration runtime status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IntegrationRuntimeStatusResponseInner get( + String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * Get the integration runtime status. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the integration runtime status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimesClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimesClient.java new file mode 100644 index 0000000000000..83d1293317107 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IntegrationRuntimesClient.java @@ -0,0 +1,559 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeResourceInner; +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeStatusResponseInner; +import com.azure.resourcemanager.synapse.models.UpdateIntegrationRuntimeRequest; + +/** An instance of this class provides access to all the operations defined in IntegrationRuntimesClient. */ +public interface IntegrationRuntimesClient { + /** + * Update 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 updateIntegrationRuntimeRequest The parameters for updating an integration runtime. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IntegrationRuntimeResourceInner update( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + UpdateIntegrationRuntimeRequest updateIntegrationRuntimeRequest); + + /** + * Update 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 updateIntegrationRuntimeRequest The parameters for updating an integration runtime. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + UpdateIntegrationRuntimeRequest updateIntegrationRuntimeRequest, + Context context); + + /** + * Get 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an integration runtime. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IntegrationRuntimeResourceInner get(String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * Get 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 ifNoneMatch ETag of the integration runtime entity. Should only be specified for get. If the ETag matches + * the existing entity tag, or if * was provided, then no content will be returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an integration runtime. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String ifNoneMatch, + Context context); + + /** + * Create 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 integrationRuntime Integration runtime resource definition. + * @param ifMatch ETag of the integration runtime entity. Should only be specified for update, for which it should + * match existing entity or can be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, IntegrationRuntimeResourceInner> beginCreate( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + IntegrationRuntimeResourceInner integrationRuntime, + String ifMatch); + + /** + * Create 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 integrationRuntime Integration runtime resource definition. + * @param ifMatch ETag of the integration runtime entity. Should only be specified for update, for which it should + * match existing entity or can be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, IntegrationRuntimeResourceInner> beginCreate( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + IntegrationRuntimeResourceInner integrationRuntime, + String ifMatch, + Context context); + + /** + * Create 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 integrationRuntime Integration runtime resource definition. + * @param ifMatch ETag of the integration runtime entity. Should only be specified for update, for which it should + * match existing entity or can be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IntegrationRuntimeResourceInner create( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + IntegrationRuntimeResourceInner integrationRuntime, + String ifMatch); + + /** + * Create 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 integrationRuntime Integration runtime resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IntegrationRuntimeResourceInner create( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + IntegrationRuntimeResourceInner integrationRuntime); + + /** + * Create 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 integrationRuntime Integration runtime resource definition. + * @param ifMatch ETag of the integration runtime entity. Should only be specified for update, for which it should + * match existing entity or can be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IntegrationRuntimeResourceInner create( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + IntegrationRuntimeResourceInner integrationRuntime, + String ifMatch, + Context context); + + /** + * Delete 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * Delete 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context); + + /** + * Delete 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * Delete 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context); + + /** + * Upgrade 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void upgrade(String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * Upgrade 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response upgradeWithResponse( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context); + + /** + * List all integration runtimes. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of integration runtime resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * List all integration runtimes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of integration runtime resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, IntegrationRuntimeStatusResponseInner> beginStart( + String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, IntegrationRuntimeStatusResponseInner> beginStart( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IntegrationRuntimeStatusResponseInner start( + String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IntegrationRuntimeStatusResponseInner start( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStop( + String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginStop( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginEnableInteractiveQuery( + String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginEnableInteractiveQuery( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void enableInteractiveQuery(String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void enableInteractiveQuery( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context); + + /** + * Disable 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDisableInteractiveQuery( + String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * Disable 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDisableInteractiveQuery( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context); + + /** + * Disable 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void disableInteractiveQuery(String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * Disable 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void disableInteractiveQuery( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IpFirewallRulesClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IpFirewallRulesClient.java new file mode 100644 index 0000000000000..5753f5b05565e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/IpFirewallRulesClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.models.IpFirewallRuleInfoInner; +import com.azure.resourcemanager.synapse.fluent.models.ReplaceAllFirewallRulesOperationResponseInner; +import com.azure.resourcemanager.synapse.models.ReplaceAllIpFirewallRulesRequest; + +/** An instance of this class provides access to all the operations defined in IpFirewallRulesClient. */ +public interface IpFirewallRulesClient { + /** + * Returns a list of firewall rules. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of IP firewall rules. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * Returns a list of firewall rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of IP firewall rules. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context); + + /** + * Creates or updates a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @param ipFirewallRuleInfo IP firewall rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return iP firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, IpFirewallRuleInfoInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String ruleName, IpFirewallRuleInfoInner ipFirewallRuleInfo); + + /** + * Creates or updates a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @param ipFirewallRuleInfo IP firewall rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return iP firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, IpFirewallRuleInfoInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String ruleName, + IpFirewallRuleInfoInner ipFirewallRuleInfo, + Context context); + + /** + * Creates or updates a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @param ipFirewallRuleInfo IP firewall rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return iP firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpFirewallRuleInfoInner createOrUpdate( + String resourceGroupName, String workspaceName, String ruleName, IpFirewallRuleInfoInner ipFirewallRuleInfo); + + /** + * Creates or updates a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @param ipFirewallRuleInfo IP firewall rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return iP firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpFirewallRuleInfoInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String ruleName, + IpFirewallRuleInfoInner ipFirewallRuleInfo, + Context context); + + /** + * Deletes a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Object> beginDelete(String resourceGroupName, String workspaceName, String ruleName); + + /** + * Deletes a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Object> beginDelete( + String resourceGroupName, String workspaceName, String ruleName, Context context); + + /** + * Deletes a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Object delete(String resourceGroupName, String workspaceName, String ruleName); + + /** + * Deletes a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Object delete(String resourceGroupName, String workspaceName, String ruleName, Context context); + + /** + * Get a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IpFirewallRuleInfoInner get(String resourceGroupName, String workspaceName, String ruleName); + + /** + * Get a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String ruleName, Context context); + + /** + * Replaces firewall rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param request Replace all IP firewall rules request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing operation for replacing the firewall rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ReplaceAllFirewallRulesOperationResponseInner> + beginReplaceAll(String resourceGroupName, String workspaceName, ReplaceAllIpFirewallRulesRequest request); + + /** + * Replaces firewall rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param request Replace all IP firewall rules request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing operation for replacing the firewall rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ReplaceAllFirewallRulesOperationResponseInner> + beginReplaceAll( + String resourceGroupName, String workspaceName, ReplaceAllIpFirewallRulesRequest request, Context context); + + /** + * Replaces firewall rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param request Replace all IP firewall rules request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing operation for replacing the firewall rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplaceAllFirewallRulesOperationResponseInner replaceAll( + String resourceGroupName, String workspaceName, ReplaceAllIpFirewallRulesRequest request); + + /** + * Replaces firewall rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param request Replace all IP firewall rules request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing operation for replacing the firewall rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplaceAllFirewallRulesOperationResponseInner replaceAll( + String resourceGroupName, String workspaceName, ReplaceAllIpFirewallRulesRequest request, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/KeysClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/KeysClient.java new file mode 100644 index 0000000000000..bc9e106ef788d --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/KeysClient.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.KeyInner; + +/** An instance of this class provides access to all the operations defined in KeysClient. */ +public interface KeysClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of keys. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of keys. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KeyInner get(String resourceGroupName, String workspaceName, String keyName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, String keyName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KeyInner createOrUpdate(String resourceGroupName, String workspaceName, String keyName, KeyInner keyProperties); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String workspaceName, String keyName, KeyInner keyProperties, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + KeyInner delete(String resourceGroupName, String workspaceName, String keyName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String keyName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/LibrariesClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/LibrariesClient.java new file mode 100644 index 0000000000000..582188c8ed315 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/LibrariesClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.LibraryResourceInner; + +/** An instance of this class provides access to all the operations defined in LibrariesClient. */ +public interface LibrariesClient { + /** + * Get library by name in a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param libraryName Library name. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return library by name in a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LibraryResourceInner get(String resourceGroupName, String libraryName, String workspaceName); + + /** + * Get library by name in a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param libraryName Library name. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return library by name in a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String libraryName, String workspaceName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/LibrariesOperationsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/LibrariesOperationsClient.java new file mode 100644 index 0000000000000..847a45be0b0ab --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/LibrariesOperationsClient.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.LibraryResourceInner; + +/** An instance of this class provides access to all the operations defined in LibrariesOperationsClient. */ +public interface LibrariesOperationsClient { + /** + * List libraries 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Library resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * List libraries in a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Library resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/OperationsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/OperationsClient.java new file mode 100644 index 0000000000000..fdd8f12d046d6 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/OperationsClient.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.AvailableRpOperationInner; +import com.azure.resourcemanager.synapse.fluent.models.CheckNameAvailabilityResponseInner; +import com.azure.resourcemanager.synapse.fluent.models.OperationResourceInner; +import com.azure.resourcemanager.synapse.models.CheckNameAvailabilityRequest; +import java.util.List; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Check whether a workspace name is available. + * + * @param request The check request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a response saying whether the workspace name is available. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameAvailabilityResponseInner checkNameAvailability(CheckNameAvailabilityRequest request); + + /** + * Check whether a workspace name is available. + * + * @param request The check request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a response saying whether the workspace name is available. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + CheckNameAvailabilityRequest request, Context context); + + /** + * Get all available operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + List list(); + + /** + * Get all available operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response> listWithResponse(Context context); + + /** + * 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. + * @param operationId Operation ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void getLocationHeaderResult(String resourceGroupName, String workspaceName, String operationId); + + /** + * 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. + * @param operationId Operation ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of an operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getLocationHeaderResultWithResponse( + String resourceGroupName, String workspaceName, String operationId, Context context); + + /** + * 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. + * @param operationId Operation ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationResourceInner getAzureAsyncHeaderResult( + String resourceGroupName, String workspaceName, String operationId); + + /** + * 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. + * @param operationId Operation ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getAzureAsyncHeaderResultWithResponse( + String resourceGroupName, String workspaceName, String operationId, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/PrivateEndpointConnectionsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/PrivateEndpointConnectionsClient.java new file mode 100644 index 0000000000000..6f8d45f947b28 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.models.OperationResourceInner; +import com.azure.resourcemanager.synapse.fluent.models.PrivateEndpointConnectionInner; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public interface PrivateEndpointConnectionsClient { + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); + + /** + * 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 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateEndpointConnectionInner> beginCreate( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner request); + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @param request Request body of private endpoint connection to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, PrivateEndpointConnectionInner> beginCreate( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner request, + Context context); + + /** + * 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 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner create( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner request); + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @param request Request body of private endpoint connection to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner create( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner request, + Context context); + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OperationResourceInner> beginDelete( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, OperationResourceInner> beginDelete( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationResourceInner delete(String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationResourceInner delete( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/PrivateEndpointConnectionsPrivateLinkHubsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/PrivateEndpointConnectionsPrivateLinkHubsClient.java new file mode 100644 index 0000000000000..aaea5f3852f8a --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/PrivateEndpointConnectionsPrivateLinkHubsClient.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.PrivateEndpointConnectionForPrivateLinkHubInner; + +/** + * An instance of this class provides access to all the operations defined in + * PrivateEndpointConnectionsPrivateLinkHubsClient. + */ +public interface PrivateEndpointConnectionsPrivateLinkHubsClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all PrivateEndpointConnections in the PrivateLinkHub. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String privateLinkHubName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all PrivateEndpointConnections in the PrivateLinkHub. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String privateLinkHubName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/PrivateLinkHubPrivateLinkResourcesClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/PrivateLinkHubPrivateLinkResourcesClient.java new file mode 100644 index 0000000000000..b25fe98f9da63 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/PrivateLinkHubPrivateLinkResourcesClient.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.PrivateLinkResourceInner; + +/** + * An instance of this class provides access to all the operations defined in PrivateLinkHubPrivateLinkResourcesClient. + */ +public interface PrivateLinkHubPrivateLinkResourcesClient { + /** + * Get all private link resources for a private link hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName The name of the private link hub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link resources for a private link hub. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateLinkHubName); + + /** + * Get all private link resources for a private link hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName The name of the private link hub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link resources for a private link hub. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String privateLinkHubName, Context context); + + /** + * Get private link resource in private link hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName The name of the private link hub. + * @param privateLinkResourceName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link resource in private link hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceInner get(String resourceGroupName, String privateLinkHubName, String privateLinkResourceName); + + /** + * Get private link resource in private link hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName The name of the private link hub. + * @param privateLinkResourceName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link resource in private link hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String privateLinkHubName, String privateLinkResourceName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/PrivateLinkHubsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/PrivateLinkHubsClient.java new file mode 100644 index 0000000000000..608ebbd9c8e13 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/PrivateLinkHubsClient.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.models.PrivateLinkHubInner; +import com.azure.resourcemanager.synapse.models.PrivateLinkHubPatchInfo; + +/** An instance of this class provides access to all the operations defined in PrivateLinkHubsClient. */ +public interface PrivateLinkHubsClient { + /** + * Returns a list of privateLinkHubs in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of privateLinkHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Returns a list of privateLinkHubs in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of privateLinkHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a privateLinkHub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkHubInner getByResourceGroup(String resourceGroupName, String privateLinkHubName); + + /** + * Gets a privateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a privateLinkHub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String privateLinkHubName, Context context); + + /** + * Updates a privateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param privateLinkHubPatchInfo PrivateLinkHub patch request properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a privateLinkHub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkHubInner update( + String resourceGroupName, String privateLinkHubName, PrivateLinkHubPatchInfo privateLinkHubPatchInfo); + + /** + * Updates a privateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param privateLinkHubPatchInfo PrivateLinkHub patch request properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a privateLinkHub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String privateLinkHubName, + PrivateLinkHubPatchInfo privateLinkHubPatchInfo, + Context context); + + /** + * Creates or updates a privateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param privateLinkHubInfo PrivateLinkHub create or update request properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a privateLinkHub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkHubInner createOrUpdate( + String resourceGroupName, String privateLinkHubName, PrivateLinkHubInner privateLinkHubInfo); + + /** + * Creates or updates a privateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param privateLinkHubInfo PrivateLinkHub create or update request properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a privateLinkHub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, String privateLinkHubName, PrivateLinkHubInner privateLinkHubInfo, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String privateLinkHubName); + + /** + * Deletes a privateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String privateLinkHubName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String privateLinkHubName); + + /** + * Deletes a privateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String privateLinkHubName, Context context); + + /** + * Returns a list of privateLinkHubs in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of privateLinkHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Returns a list of privateLinkHubs in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of privateLinkHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/PrivateLinkResourcesClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/PrivateLinkResourcesClient.java new file mode 100644 index 0000000000000..3a4609b87b7d9 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/PrivateLinkResourcesClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.PrivateLinkResourceInner; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +public interface PrivateLinkResourcesClient { + /** + * Get all private link resources for a workspaces. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link resources for a workspaces. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Get all private link resources for a workspaces. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link resources for a workspaces. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Get private link resource in workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link resource in workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceInner get(String resourceGroupName, String workspaceName, String privateLinkResourceName); + + /** + * Get private link resource in workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateLinkResourceName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link resource in workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String privateLinkResourceName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/RestorableDroppedSqlPoolsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/RestorableDroppedSqlPoolsClient.java new file mode 100644 index 0000000000000..9314a871f68ed --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/RestorableDroppedSqlPoolsClient.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.RestorableDroppedSqlPoolInner; + +/** An instance of this class provides access to all the operations defined in RestorableDroppedSqlPoolsClient. */ +public interface RestorableDroppedSqlPoolsClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a deleted sql pool that can be restored. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RestorableDroppedSqlPoolInner get( + String resourceGroupName, String workspaceName, String restorableDroppedSqlPoolId); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a deleted sql pool that can be restored. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String restorableDroppedSqlPoolId, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of deleted Sql pools that can be restored. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of deleted Sql pools that can be restored. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolBlobAuditingPoliciesClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolBlobAuditingPoliciesClient.java new file mode 100644 index 0000000000000..512eb175e250a --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolBlobAuditingPoliciesClient.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolBlobAuditingPolicyInner; + +/** An instance of this class provides access to all the operations defined in SqlPoolBlobAuditingPoliciesClient. */ +public interface SqlPoolBlobAuditingPoliciesClient { + /** + * Get a 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlPoolBlobAuditingPolicyInner get(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Get a 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * Creates or updates a 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 database blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlPoolBlobAuditingPolicyInner createOrUpdate( + String resourceGroupName, String workspaceName, String sqlPoolName, SqlPoolBlobAuditingPolicyInner parameters); + + /** + * Creates or updates a 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 database blob auditing policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + SqlPoolBlobAuditingPolicyInner parameters, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool auditing settings. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySqlPool( + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool auditing settings. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySqlPool( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolColumnsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolColumnsClient.java new file mode 100644 index 0000000000000..3688d6e20c6b6 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolColumnsClient.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolColumnInner; + +/** An instance of this class provides access to all the operations defined in SqlPoolColumnsClient. */ +public interface SqlPoolColumnsClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql pool column. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlPoolColumnInner get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql pool column. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolConnectionPoliciesClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolConnectionPoliciesClient.java new file mode 100644 index 0000000000000..ac25db287463d --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolConnectionPoliciesClient.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolConnectionPolicyInner; +import com.azure.resourcemanager.synapse.models.ConnectionPolicyName; + +/** An instance of this class provides access to all the operations defined in SqlPoolConnectionPoliciesClient. */ +public interface SqlPoolConnectionPoliciesClient { + /** + * Get a Sql pool's connection policy, which is used with table auditing. + * + * @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 connectionPolicyName The name of the connection policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's connection policy, which is used with table auditing. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlPoolConnectionPolicyInner get( + String resourceGroupName, String workspaceName, String sqlPoolName, ConnectionPolicyName connectionPolicyName); + + /** + * Get a Sql pool's connection policy, which is used with table auditing. + * + * @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 connectionPolicyName The name of the connection policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's connection policy, which is used with table auditing. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + ConnectionPolicyName connectionPolicyName, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolDataWarehouseUserActivitiesClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolDataWarehouseUserActivitiesClient.java new file mode 100644 index 0000000000000..102c0d6bd3a3d --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolDataWarehouseUserActivitiesClient.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.DataWarehouseUserActivitiesInner; +import com.azure.resourcemanager.synapse.models.DataWarehouseUserActivityName; + +/** + * An instance of this class provides access to all the operations defined in SqlPoolDataWarehouseUserActivitiesClient. + */ +public interface SqlPoolDataWarehouseUserActivitiesClient { + /** + * Gets the user activities of a SQL pool which includes running and suspended queries. + * + * @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 dataWarehouseUserActivityName The activity name of the Sql pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the user activities of a SQL pool which includes running and suspended queries. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataWarehouseUserActivitiesInner get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + DataWarehouseUserActivityName dataWarehouseUserActivityName); + + /** + * Gets the user activities of a SQL pool which includes running and suspended queries. + * + * @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 dataWarehouseUserActivityName The activity name of the Sql pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the user activities of a SQL pool which includes running and suspended queries. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + DataWarehouseUserActivityName dataWarehouseUserActivityName, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolGeoBackupPoliciesClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolGeoBackupPoliciesClient.java new file mode 100644 index 0000000000000..8c2a4f6cd6d9b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolGeoBackupPoliciesClient.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.GeoBackupPolicyInner; +import com.azure.resourcemanager.synapse.models.GeoBackupPolicyName; + +/** An instance of this class provides access to all the operations defined in SqlPoolGeoBackupPoliciesClient. */ +public interface SqlPoolGeoBackupPoliciesClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pool geo backup policies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pool geo backup policies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * Updates a SQL Pool geo backup 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 geoBackupPolicyName The name of the geo backup policy. + * @param parameters The required parameters for creating or updating the geo backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a database geo backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GeoBackupPolicyInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + GeoBackupPolicyName geoBackupPolicyName, + GeoBackupPolicyInner parameters); + + /** + * Updates a SQL Pool geo backup 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 geoBackupPolicyName The name of the geo backup policy. + * @param parameters The required parameters for creating or updating the geo backup policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a database geo backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + GeoBackupPolicyName geoBackupPolicyName, + GeoBackupPolicyInner parameters, + Context context); + + /** + * Get the specified SQL pool geo backup 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 geoBackupPolicyName The name of the geo backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified SQL pool geo backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GeoBackupPolicyInner get( + String resourceGroupName, String workspaceName, String sqlPoolName, GeoBackupPolicyName geoBackupPolicyName); + + /** + * Get the specified SQL pool geo backup 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 geoBackupPolicyName The name of the geo backup policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified SQL pool geo backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + GeoBackupPolicyName geoBackupPolicyName, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolMaintenanceWindowOptionsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolMaintenanceWindowOptionsClient.java new file mode 100644 index 0000000000000..54798ebfd965d --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolMaintenanceWindowOptionsClient.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.MaintenanceWindowOptionsInner; + +/** An instance of this class provides access to all the operations defined in SqlPoolMaintenanceWindowOptionsClient. */ +public interface SqlPoolMaintenanceWindowOptionsClient { + /** + * Get list of SQL pool's available maintenance windows. + * + * @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 maintenanceWindowOptionsName Maintenance window options name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pool's available maintenance windows. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MaintenanceWindowOptionsInner get( + String resourceGroupName, String workspaceName, String sqlPoolName, String maintenanceWindowOptionsName); + + /** + * Get list of SQL pool's available maintenance windows. + * + * @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 maintenanceWindowOptionsName Maintenance window options name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pool's available maintenance windows. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String maintenanceWindowOptionsName, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolMaintenanceWindowsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolMaintenanceWindowsClient.java new file mode 100644 index 0000000000000..e6322cd431373 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolMaintenanceWindowsClient.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.MaintenanceWindowsInner; + +/** An instance of this class provides access to all the operations defined in SqlPoolMaintenanceWindowsClient. */ +public interface SqlPoolMaintenanceWindowsClient { + /** + * Get a SQL pool's Maintenance Windows. + * + * @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 maintenanceWindowName Maintenance window name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's Maintenance Windows. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MaintenanceWindowsInner get( + String resourceGroupName, String workspaceName, String sqlPoolName, String maintenanceWindowName); + + /** + * Get a SQL pool's Maintenance Windows. + * + * @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 maintenanceWindowName Maintenance window name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's Maintenance Windows. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String maintenanceWindowName, + Context context); + + /** + * Creates or updates a Sql pool's maintenance windows settings. + * + * @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 maintenanceWindowName Maintenance window name. + * @param parameters The required parameters for creating or updating Maintenance Windows settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void createOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String maintenanceWindowName, + MaintenanceWindowsInner parameters); + + /** + * Creates or updates a Sql pool's maintenance windows settings. + * + * @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 maintenanceWindowName Maintenance window name. + * @param parameters The required parameters for creating or updating Maintenance Windows settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String maintenanceWindowName, + MaintenanceWindowsInner parameters, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolMetadataSyncConfigsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolMetadataSyncConfigsClient.java new file mode 100644 index 0000000000000..46d0eb6c82ac4 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolMetadataSyncConfigsClient.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.MetadataSyncConfigInner; + +/** An instance of this class provides access to all the operations defined in SqlPoolMetadataSyncConfigsClient. */ +public interface SqlPoolMetadataSyncConfigsClient { + /** + * Get 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the metadata sync configuration for a SQL pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MetadataSyncConfigInner get(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Get 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the metadata sync configuration for a SQL pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * 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 metadataSyncConfiguration Metadata sync configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration for metadata sync. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MetadataSyncConfigInner create( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + MetadataSyncConfigInner metadataSyncConfiguration); + + /** + * 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 metadataSyncConfiguration Metadata sync configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration for metadata sync. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + MetadataSyncConfigInner metadataSyncConfiguration, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolOperationResultsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolOperationResultsClient.java new file mode 100644 index 0000000000000..ef4a9a0a0b69d --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolOperationResultsClient.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** An instance of this class provides access to all the operations defined in SqlPoolOperationResultsClient. */ +public interface SqlPoolOperationResultsClient { + /** + * Get the status of a SQL pool operation. + * + * @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 operationId Operation ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a SQL pool operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Object getLocationHeaderResult( + String resourceGroupName, String workspaceName, String sqlPoolName, String operationId); + + /** + * Get the status of a SQL pool operation. + * + * @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 operationId Operation ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a SQL pool operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getLocationHeaderResultWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, String operationId, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolOperationsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolOperationsClient.java new file mode 100644 index 0000000000000..9afb298383e36 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolOperationsClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolOperationInner; + +/** An instance of this class provides access to all the operations defined in SqlPoolOperationsClient. */ +public interface SqlPoolOperationsClient { + /** + * Gets a list of operations performed on the 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations performed on the SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Gets a list of operations performed on the 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations performed on the SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolRecommendedSensitivityLabelsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolRecommendedSensitivityLabelsClient.java new file mode 100644 index 0000000000000..2e45291855861 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolRecommendedSensitivityLabelsClient.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.models.RecommendedSensitivityLabelUpdateList; + +/** + * An instance of this class provides access to all the operations defined in SqlPoolRecommendedSensitivityLabelsClient. + */ +public interface SqlPoolRecommendedSensitivityLabelsClient { + /** + * Update recommended sensitivity labels states of a given SQL Pool using an operations batch. + * + * @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 A list of recommended sensitivity label update operations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void update( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + RecommendedSensitivityLabelUpdateList parameters); + + /** + * Update recommended sensitivity labels states of a given SQL Pool using an operations batch. + * + * @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 A list of recommended sensitivity label update operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + RecommendedSensitivityLabelUpdateList parameters, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolReplicationLinksClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolReplicationLinksClient.java new file mode 100644 index 0000000000000..71f75474f77bc --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolReplicationLinksClient.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.ReplicationLinkInner; + +/** An instance of this class provides access to all the operations defined in SqlPoolReplicationLinksClient. */ +public interface SqlPoolReplicationLinksClient { + /** + * Lists a Sql pool's replication links. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the response to a List Sql pool replication link request. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Lists a Sql pool's replication links. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the response to a List Sql pool replication link request. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool replication link by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicationLinkInner getByName(String resourceGroupName, String workspaceName, String sqlPoolName, String linkId); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool replication link by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByNameWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, String linkId, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolRestorePointsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolRestorePointsClient.java new file mode 100644 index 0000000000000..cacd018812771 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolRestorePointsClient.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.models.RestorePointInner; +import com.azure.resourcemanager.synapse.models.CreateSqlPoolRestorePointDefinition; + +/** An instance of this class provides access to all the operations defined in SqlPoolRestorePointsClient. */ +public interface SqlPoolRestorePointsClient { + /** + * Get SQL pool backup information. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool backup information. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Get SQL pool backup information. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool backup information. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * Creates a restore point for a data warehouse. + * + * @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 definition for creating the restore point of this Sql pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database restore points. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RestorePointInner> beginCreate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + CreateSqlPoolRestorePointDefinition parameters); + + /** + * Creates a restore point for a data warehouse. + * + * @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 definition for creating the restore point of this Sql pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database restore points. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, RestorePointInner> beginCreate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + CreateSqlPoolRestorePointDefinition parameters, + Context context); + + /** + * Creates a restore point for a data warehouse. + * + * @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 definition for creating the restore point of this Sql pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database restore points. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RestorePointInner create( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + CreateSqlPoolRestorePointDefinition parameters); + + /** + * Creates a restore point for a data warehouse. + * + * @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 definition for creating the restore point of this Sql pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database restore points. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RestorePointInner create( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + CreateSqlPoolRestorePointDefinition parameters, + Context context); + + /** + * 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. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a restore point. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RestorePointInner get(String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName); + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a restore point. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolSchemasClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolSchemasClient.java new file mode 100644 index 0000000000000..3390c0e2b0c1d --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolSchemasClient.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.Resource; +import com.azure.core.util.Context; + +/** An instance of this class provides access to all the operations defined in SqlPoolSchemasClient. */ +public interface SqlPoolSchemasClient { + /** + * Gets schemas of a given 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schemas of a given SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Gets schemas of a given 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 filter An OData filter expression that filters elements in the collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schemas of a given SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, String filter, Context context); + + /** + * 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. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql Pool schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Resource get(String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName); + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql Pool schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolSecurityAlertPoliciesClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolSecurityAlertPoliciesClient.java new file mode 100644 index 0000000000000..ef3d0f770a3c3 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolSecurityAlertPoliciesClient.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolSecurityAlertPolicyInner; +import com.azure.resourcemanager.synapse.models.SecurityAlertPolicyName; + +/** An instance of this class provides access to all the operations defined in SqlPoolSecurityAlertPoliciesClient. */ +public interface SqlPoolSecurityAlertPoliciesClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool's security alert policies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool's security alert policies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * Get a Sql pool's security alert 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 securityAlertPolicyName The name of the security alert policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlPoolSecurityAlertPolicyInner get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + SecurityAlertPolicyName securityAlertPolicyName); + + /** + * Get a Sql pool's security alert 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 securityAlertPolicyName The name of the security alert policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + SecurityAlertPolicyName securityAlertPolicyName, + Context context); + + /** + * Create or update a Sql pool's security alert 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 securityAlertPolicyName The name of the security alert policy. + * @param parameters The Sql pool security alert policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlPoolSecurityAlertPolicyInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + SecurityAlertPolicyName securityAlertPolicyName, + SqlPoolSecurityAlertPolicyInner parameters); + + /** + * Create or update a Sql pool's security alert 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 securityAlertPolicyName The name of the security alert policy. + * @param parameters The Sql pool security alert policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + SecurityAlertPolicyName securityAlertPolicyName, + SqlPoolSecurityAlertPolicyInner parameters, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolSensitivityLabelsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolSensitivityLabelsClient.java new file mode 100644 index 0000000000000..e7f648008951e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolSensitivityLabelsClient.java @@ -0,0 +1,370 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.SensitivityLabelInner; +import com.azure.resourcemanager.synapse.models.SensitivityLabelSource; +import com.azure.resourcemanager.synapse.models.SensitivityLabelUpdateList; + +/** An instance of this class provides access to all the operations defined in SqlPoolSensitivityLabelsClient. */ +public interface SqlPoolSensitivityLabelsClient { + /** + * Gets SQL pool sensitivity labels. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool sensitivity labels. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCurrent( + String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Gets SQL pool sensitivity labels. + * + * @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 filter An OData filter expression that filters elements in the collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool sensitivity labels. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCurrent( + String resourceGroupName, String workspaceName, String sqlPoolName, String filter, Context context); + + /** + * Update sensitivity labels of a given SQL Pool using an operations batch. + * + * @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 A list of sensitivity label update operations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void update( + String resourceGroupName, String workspaceName, String sqlPoolName, SensitivityLabelUpdateList parameters); + + /** + * Update sensitivity labels of a given SQL Pool using an operations batch. + * + * @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 A list of sensitivity label update operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + SensitivityLabelUpdateList parameters, + Context context); + + /** + * Gets sensitivity labels of a given 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sensitivity labels of a given SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listRecommended( + String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Gets sensitivity labels of a given 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 includeDisabledRecommendations Specifies whether to include disabled recommendations or not. + * @param skipToken An OData query option to indicate how many elements to skip in the collection. + * @param filter An OData filter expression that filters elements in the collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sensitivity labels of a given SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listRecommended( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + Boolean includeDisabledRecommendations, + String skipToken, + String filter, + Context context); + + /** + * Creates or updates the sensitivity label of a given column in 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 schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @param parameters The column sensitivity label resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a sensitivity label. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SensitivityLabelInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + SensitivityLabelInner parameters); + + /** + * Creates or updates the sensitivity label of a given column in 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 schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @param parameters The column sensitivity label resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a sensitivity label. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + SensitivityLabelInner parameters, + Context context); + + /** + * Deletes the sensitivity label of a given column in 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 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName); + + /** + * Deletes the sensitivity label of a given column in 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 schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sensitivity label of a given column. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SensitivityLabelInner get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + SensitivityLabelSource sensitivityLabelSource); + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sensitivity label of a given column. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + SensitivityLabelSource sensitivityLabelSource, + Context context); + + /** + * Enables sensitivity recommendations on a given column (recommendations are enabled by default on all columns). + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void enableRecommendation( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName); + + /** + * Enables sensitivity recommendations on a given column (recommendations are enabled by default on all columns). + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response enableRecommendationWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + Context context); + + /** + * Disables sensitivity recommendations on 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void disableRecommendation( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName); + + /** + * Disables sensitivity recommendations on 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response disableRecommendationWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolTableColumnsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolTableColumnsClient.java new file mode 100644 index 0000000000000..f606715942dc0 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolTableColumnsClient.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolColumnInner; + +/** An instance of this class provides access to all the operations defined in SqlPoolTableColumnsClient. */ +public interface SqlPoolTableColumnsClient { + /** + * Gets columns in a given table in 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 schemaName The name of the schema. + * @param tableName The name of the table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return columns in a given table in a SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByTableName( + String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName); + + /** + * Gets columns in a given table in 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 schemaName The name of the schema. + * @param tableName The name of the table. + * @param filter An OData filter expression that filters elements in the collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return columns in a given table in a SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByTableName( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String filter, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolTablesClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolTablesClient.java new file mode 100644 index 0000000000000..37669168b07d4 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolTablesClient.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.Resource; +import com.azure.core.util.Context; + +/** An instance of this class provides access to all the operations defined in SqlPoolTablesClient. */ +public interface SqlPoolTablesClient { + /** + * Gets tables of a given schema in 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 schemaName The name of the schema. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tables of a given schema in a SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySchema( + String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName); + + /** + * Gets tables of a given schema in 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 schemaName The name of the schema. + * @param filter An OData filter expression that filters elements in the collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tables of a given schema in a SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySchema( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String filter, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql pool table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Resource get( + String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql pool table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolTransparentDataEncryptionsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolTransparentDataEncryptionsClient.java new file mode 100644 index 0000000000000..c2ad5c063ea3b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolTransparentDataEncryptionsClient.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.TransparentDataEncryptionInner; +import com.azure.resourcemanager.synapse.models.TransparentDataEncryptionName; + +/** + * An instance of this class provides access to all the operations defined in SqlPoolTransparentDataEncryptionsClient. + */ +public interface SqlPoolTransparentDataEncryptionsClient { + /** + * Get a SQL pool's transparent data encryption configuration. + * + * @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 transparentDataEncryptionName The name of the transparent data encryption configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's transparent data encryption configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TransparentDataEncryptionInner get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + TransparentDataEncryptionName transparentDataEncryptionName); + + /** + * Get a SQL pool's transparent data encryption configuration. + * + * @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 transparentDataEncryptionName The name of the transparent data encryption configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's transparent data encryption configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + TransparentDataEncryptionName transparentDataEncryptionName, + Context context); + + /** + * Creates or updates a Sql pool's transparent data encryption configuration. + * + * @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 transparentDataEncryptionName The name of the transparent data encryption configuration. + * @param parameters The required parameters for creating or updating transparent data encryption. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Sql pool transparent data encryption configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TransparentDataEncryptionInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + TransparentDataEncryptionName transparentDataEncryptionName, + TransparentDataEncryptionInner parameters); + + /** + * Creates or updates a Sql pool's transparent data encryption configuration. + * + * @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 transparentDataEncryptionName The name of the transparent data encryption configuration. + * @param parameters The required parameters for creating or updating transparent data encryption. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Sql pool transparent data encryption configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + TransparentDataEncryptionName transparentDataEncryptionName, + TransparentDataEncryptionInner parameters, + Context context); + + /** + * Get list of SQL pool's transparent data encryption configurations. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pool's transparent data encryption configurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Get list of SQL pool's transparent data encryption configurations. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pool's transparent data encryption configurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolUsagesClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolUsagesClient.java new file mode 100644 index 0000000000000..86f757fb2a300 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolUsagesClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolUsageInner; + +/** An instance of this class provides access to all the operations defined in SqlPoolUsagesClient. */ +public interface SqlPoolUsagesClient { + /** + * Gets SQL pool usages. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool usages. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Gets SQL pool usages. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool usages. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolVulnerabilityAssessmentRuleBaselinesClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolVulnerabilityAssessmentRuleBaselinesClient.java new file mode 100644 index 0000000000000..0974a63fa6827 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolVulnerabilityAssessmentRuleBaselinesClient.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolVulnerabilityAssessmentRuleBaselineInner; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentName; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentPolicyBaselineName; + +/** + * An instance of this class provides access to all the operations defined in + * SqlPoolVulnerabilityAssessmentRuleBaselinesClient. + */ +public interface SqlPoolVulnerabilityAssessmentRuleBaselinesClient { + /** + * Creates or updates a Sql pool'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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @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 workspace level rule). + * @param parameters The requested rule baseline resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool vulnerability assessment rule baseline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlPoolVulnerabilityAssessmentRuleBaselineInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId, + VulnerabilityAssessmentPolicyBaselineName baselineName, + SqlPoolVulnerabilityAssessmentRuleBaselineInner parameters); + + /** + * Creates or updates a Sql pool'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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @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 workspace level rule). + * @param parameters The requested rule baseline resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool vulnerability assessment rule baseline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId, + VulnerabilityAssessmentPolicyBaselineName baselineName, + SqlPoolVulnerabilityAssessmentRuleBaselineInner parameters, + Context context); + + /** + * Removes the database'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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @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 workspace level rule). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId, + VulnerabilityAssessmentPolicyBaselineName baselineName); + + /** + * Removes the database'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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @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 workspace level rule). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId, + VulnerabilityAssessmentPolicyBaselineName baselineName, + Context context); + + /** + * 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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @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). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SqlPool's vulnerability assessment rule baseline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlPoolVulnerabilityAssessmentRuleBaselineInner get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId, + VulnerabilityAssessmentPolicyBaselineName baselineName); + + /** + * 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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @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). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SqlPool's vulnerability assessment rule baseline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId, + VulnerabilityAssessmentPolicyBaselineName baselineName, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolVulnerabilityAssessmentScansClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolVulnerabilityAssessmentScansClient.java new file mode 100644 index 0000000000000..0e4ed1fc30a1e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolVulnerabilityAssessmentScansClient.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolVulnerabilityAssessmentScansExportInner; +import com.azure.resourcemanager.synapse.fluent.models.VulnerabilityAssessmentScanRecordInner; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentName; + +/** + * An instance of this class provides access to all the operations defined in SqlPoolVulnerabilityAssessmentScansClient. + */ +public interface SqlPoolVulnerabilityAssessmentScansClient { + /** + * Lists the vulnerability assessment scans 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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of vulnerability assessment scan records. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName); + + /** + * Lists the vulnerability assessment scans 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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of vulnerability assessment scan records. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + Context context); + + /** + * Executes a Vulnerability Assessment database scan. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginInitiateScan( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId); + + /** + * Executes a Vulnerability Assessment database scan. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginInitiateScan( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId, + Context context); + + /** + * Executes a Vulnerability Assessment database scan. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void initiateScan( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId); + + /** + * Executes a Vulnerability Assessment database scan. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void initiateScan( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId, + Context context); + + /** + * Convert an existing scan result to a human readable format. If already exists nothing happens. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool Vulnerability Assessment scan export resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlPoolVulnerabilityAssessmentScansExportInner export( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId); + + /** + * Convert an existing scan result to a human readable format. If already exists nothing happens. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool Vulnerability Assessment scan export resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response exportWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId, + Context context); + + /** + * 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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vulnerability assessment scan record of a Sql pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + VulnerabilityAssessmentScanRecordInner get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + 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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vulnerability assessment scan record of a Sql pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolVulnerabilityAssessmentsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolVulnerabilityAssessmentsClient.java new file mode 100644 index 0000000000000..fae47775bc527 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolVulnerabilityAssessmentsClient.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolVulnerabilityAssessmentInner; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentName; + +/** An instance of this class provides access to all the operations defined in SqlPoolVulnerabilityAssessmentsClient. */ +public interface SqlPoolVulnerabilityAssessmentsClient { + /** + * Lists the vulnerability assessment policies associated with 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the Sql pool's vulnerability assessments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Lists the vulnerability assessment policies associated with 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the Sql pool's vulnerability assessments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * Gets the Sql pool's vulnerability assessment. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Sql pool's vulnerability assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlPoolVulnerabilityAssessmentInner get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName); + + /** + * Gets the Sql pool's vulnerability assessment. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Sql pool's vulnerability assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + Context context); + + /** + * Creates or updates the Sql pool vulnerability assessment. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param parameters The requested resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool vulnerability assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlPoolVulnerabilityAssessmentInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + SqlPoolVulnerabilityAssessmentInner parameters); + + /** + * Creates or updates the Sql pool vulnerability assessment. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param parameters The requested resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool vulnerability assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + SqlPoolVulnerabilityAssessmentInner parameters, + Context context); + + /** + * Removes the database's vulnerability assessment. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName); + + /** + * Removes the database's vulnerability assessment. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolWorkloadClassifiersClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolWorkloadClassifiersClient.java new file mode 100644 index 0000000000000..558f365b20185 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolWorkloadClassifiersClient.java @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.models.WorkloadClassifierInner; + +/** An instance of this class provides access to all the operations defined in SqlPoolWorkloadClassifiersClient. */ +public interface SqlPoolWorkloadClassifiersClient { + /** + * Get a workload classifier of Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workload classifier of Sql pool's workload group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadClassifierInner get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName); + + /** + * Get a workload classifier of Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workload classifier of Sql pool's workload group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName, + Context context); + + /** + * Create Or Update workload classifier for a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @param parameters The properties of the workload classifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workload classifier operations for a data warehouse. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadClassifierInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName, + WorkloadClassifierInner parameters); + + /** + * Create Or Update workload classifier for a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @param parameters The properties of the workload classifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workload classifier operations for a data warehouse. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadClassifierInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName, + WorkloadClassifierInner parameters, + Context context); + + /** + * Create Or Update workload classifier for a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @param parameters The properties of the workload classifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workload classifier operations for a data warehouse. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadClassifierInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName, + WorkloadClassifierInner parameters); + + /** + * Create Or Update workload classifier for a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @param parameters The properties of the workload classifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workload classifier operations for a data warehouse. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadClassifierInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName, + WorkloadClassifierInner parameters, + Context context); + + /** + * Remove workload classifier of a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName); + + /** + * Remove workload classifier of a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName, + Context context); + + /** + * Remove workload classifier of a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName); + + /** + * Remove workload classifier of a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName, + Context context); + + /** + * Get list of Sql pool's workload classifier for workload groups. + * + * @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 workloadGroupName The name of the workload group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Sql pool's workload classifier for workload groups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName); + + /** + * Get list of Sql pool's workload classifier for workload groups. + * + * @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 workloadGroupName The name of the workload group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Sql pool's workload classifier for workload groups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolWorkloadGroupsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolWorkloadGroupsClient.java new file mode 100644 index 0000000000000..6ab5247d6847e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolWorkloadGroupsClient.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.models.WorkloadGroupInner; + +/** An instance of this class provides access to all the operations defined in SqlPoolWorkloadGroupsClient. */ +public interface SqlPoolWorkloadGroupsClient { + /** + * Get a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's workload group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadGroupInner get( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName); + + /** + * Get a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's workload group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName, Context context); + + /** + * Create Or Update a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param parameters The requested workload group state. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workload group operations for a sql pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadGroupInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + WorkloadGroupInner parameters); + + /** + * Create Or Update a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param parameters The requested workload group state. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workload group operations for a sql pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkloadGroupInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + WorkloadGroupInner parameters, + Context context); + + /** + * Create Or Update a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param parameters The requested workload group state. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workload group operations for a sql pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadGroupInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + WorkloadGroupInner parameters); + + /** + * Create Or Update a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param parameters The requested workload group state. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workload group operations for a sql pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkloadGroupInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + WorkloadGroupInner parameters, + Context context); + + /** + * Remove Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName); + + /** + * Remove Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName, Context context); + + /** + * Remove Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName); + + /** + * Remove Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName, Context context); + + /** + * Get list of Sql pool's workload groups. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Sql pool's workload groups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Get list of Sql pool's workload groups. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Sql pool's workload groups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolsClient.java new file mode 100644 index 0000000000000..d43b9d9c4a0cc --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SqlPoolsClient.java @@ -0,0 +1,393 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolInner; +import com.azure.resourcemanager.synapse.models.ResourceMoveDefinition; +import com.azure.resourcemanager.synapse.models.SqlPoolPatchInfo; + +/** An instance of this class provides access to all the operations defined in SqlPoolsClient. */ +public interface SqlPoolsClient { + /** + * Get SQL pool properties. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlPoolInner get(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Get SQL pool properties. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * Apply a partial update to 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 sqlPoolInfo The updated SQL pool properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Analytics pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlPoolInner update( + String resourceGroupName, String workspaceName, String sqlPoolName, SqlPoolPatchInfo sqlPoolInfo); + + /** + * Apply a partial update to 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 sqlPoolInfo The updated SQL pool properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Analytics pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + SqlPoolPatchInfo sqlPoolInfo, + Context context); + + /** + * Create 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 sqlPoolInfo The SQL pool to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Analytics pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SqlPoolInner> beginCreate( + String resourceGroupName, String workspaceName, String sqlPoolName, SqlPoolInner sqlPoolInfo); + + /** + * Create 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 sqlPoolInfo The SQL pool to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Analytics pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SqlPoolInner> beginCreate( + String resourceGroupName, String workspaceName, String sqlPoolName, SqlPoolInner sqlPoolInfo, Context context); + + /** + * Create 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 sqlPoolInfo The SQL pool to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Analytics pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlPoolInner create(String resourceGroupName, String workspaceName, String sqlPoolName, SqlPoolInner sqlPoolInfo); + + /** + * Create 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 sqlPoolInfo The SQL pool to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Analytics pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SqlPoolInner create( + String resourceGroupName, String workspaceName, String sqlPoolName, SqlPoolInner sqlPoolInfo, Context context); + + /** + * Delete 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Object> beginDelete( + String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Delete 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Object> beginDelete( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * Delete 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Object delete(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Delete 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Object delete(String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * List all SQL pools. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * List all SQL pools. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context); + + /** + * Pause 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Object> beginPause( + String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Pause 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Object> beginPause( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * Pause 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Object pause(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Pause 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Object pause(String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * Resume 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Object> beginResume( + String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Resume 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Object> beginResume( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * Resume 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Object resume(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Resume 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Object resume(String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * Rename 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 parameters The resource move definition for renaming this Sql pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void rename(String resourceGroupName, String workspaceName, String sqlPoolName, ResourceMoveDefinition parameters); + + /** + * Rename 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 parameters The resource move definition for renaming this Sql pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response renameWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + ResourceMoveDefinition parameters, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SynapseManagementClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SynapseManagementClient.java new file mode 100644 index 0000000000000..079d0d3de5747 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/SynapseManagementClient.java @@ -0,0 +1,474 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for SynapseManagementClient class. */ +public interface SynapseManagementClient { + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the BigDataPoolsClient object to access its operations. + * + * @return the BigDataPoolsClient object. + */ + BigDataPoolsClient getBigDataPools(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the IpFirewallRulesClient object to access its operations. + * + * @return the IpFirewallRulesClient object. + */ + IpFirewallRulesClient getIpFirewallRules(); + + /** + * Gets the SqlPoolsClient object to access its operations. + * + * @return the SqlPoolsClient object. + */ + SqlPoolsClient getSqlPools(); + + /** + * Gets the SqlPoolMetadataSyncConfigsClient object to access its operations. + * + * @return the SqlPoolMetadataSyncConfigsClient object. + */ + SqlPoolMetadataSyncConfigsClient getSqlPoolMetadataSyncConfigs(); + + /** + * Gets the SqlPoolOperationResultsClient object to access its operations. + * + * @return the SqlPoolOperationResultsClient object. + */ + SqlPoolOperationResultsClient getSqlPoolOperationResults(); + + /** + * Gets the SqlPoolGeoBackupPoliciesClient object to access its operations. + * + * @return the SqlPoolGeoBackupPoliciesClient object. + */ + SqlPoolGeoBackupPoliciesClient getSqlPoolGeoBackupPolicies(); + + /** + * Gets the SqlPoolDataWarehouseUserActivitiesClient object to access its operations. + * + * @return the SqlPoolDataWarehouseUserActivitiesClient object. + */ + SqlPoolDataWarehouseUserActivitiesClient getSqlPoolDataWarehouseUserActivities(); + + /** + * Gets the SqlPoolRestorePointsClient object to access its operations. + * + * @return the SqlPoolRestorePointsClient object. + */ + SqlPoolRestorePointsClient getSqlPoolRestorePoints(); + + /** + * Gets the SqlPoolReplicationLinksClient object to access its operations. + * + * @return the SqlPoolReplicationLinksClient object. + */ + SqlPoolReplicationLinksClient getSqlPoolReplicationLinks(); + + /** + * Gets the SqlPoolMaintenanceWindowsClient object to access its operations. + * + * @return the SqlPoolMaintenanceWindowsClient object. + */ + SqlPoolMaintenanceWindowsClient getSqlPoolMaintenanceWindows(); + + /** + * Gets the SqlPoolMaintenanceWindowOptionsClient object to access its operations. + * + * @return the SqlPoolMaintenanceWindowOptionsClient object. + */ + SqlPoolMaintenanceWindowOptionsClient getSqlPoolMaintenanceWindowOptions(); + + /** + * Gets the SqlPoolTransparentDataEncryptionsClient object to access its operations. + * + * @return the SqlPoolTransparentDataEncryptionsClient object. + */ + SqlPoolTransparentDataEncryptionsClient getSqlPoolTransparentDataEncryptions(); + + /** + * Gets the SqlPoolBlobAuditingPoliciesClient object to access its operations. + * + * @return the SqlPoolBlobAuditingPoliciesClient object. + */ + SqlPoolBlobAuditingPoliciesClient getSqlPoolBlobAuditingPolicies(); + + /** + * Gets the SqlPoolOperationsClient object to access its operations. + * + * @return the SqlPoolOperationsClient object. + */ + SqlPoolOperationsClient getSqlPoolOperations(); + + /** + * Gets the SqlPoolUsagesClient object to access its operations. + * + * @return the SqlPoolUsagesClient object. + */ + SqlPoolUsagesClient getSqlPoolUsages(); + + /** + * Gets the SqlPoolSensitivityLabelsClient object to access its operations. + * + * @return the SqlPoolSensitivityLabelsClient object. + */ + SqlPoolSensitivityLabelsClient getSqlPoolSensitivityLabels(); + + /** + * Gets the SqlPoolRecommendedSensitivityLabelsClient object to access its operations. + * + * @return the SqlPoolRecommendedSensitivityLabelsClient object. + */ + SqlPoolRecommendedSensitivityLabelsClient getSqlPoolRecommendedSensitivityLabels(); + + /** + * Gets the SqlPoolSchemasClient object to access its operations. + * + * @return the SqlPoolSchemasClient object. + */ + SqlPoolSchemasClient getSqlPoolSchemas(); + + /** + * Gets the SqlPoolTablesClient object to access its operations. + * + * @return the SqlPoolTablesClient object. + */ + SqlPoolTablesClient getSqlPoolTables(); + + /** + * Gets the SqlPoolTableColumnsClient object to access its operations. + * + * @return the SqlPoolTableColumnsClient object. + */ + SqlPoolTableColumnsClient getSqlPoolTableColumns(); + + /** + * Gets the SqlPoolConnectionPoliciesClient object to access its operations. + * + * @return the SqlPoolConnectionPoliciesClient object. + */ + SqlPoolConnectionPoliciesClient getSqlPoolConnectionPolicies(); + + /** + * Gets the SqlPoolVulnerabilityAssessmentsClient object to access its operations. + * + * @return the SqlPoolVulnerabilityAssessmentsClient object. + */ + SqlPoolVulnerabilityAssessmentsClient getSqlPoolVulnerabilityAssessments(); + + /** + * Gets the SqlPoolVulnerabilityAssessmentScansClient object to access its operations. + * + * @return the SqlPoolVulnerabilityAssessmentScansClient object. + */ + SqlPoolVulnerabilityAssessmentScansClient getSqlPoolVulnerabilityAssessmentScans(); + + /** + * Gets the SqlPoolSecurityAlertPoliciesClient object to access its operations. + * + * @return the SqlPoolSecurityAlertPoliciesClient object. + */ + SqlPoolSecurityAlertPoliciesClient getSqlPoolSecurityAlertPolicies(); + + /** + * Gets the SqlPoolVulnerabilityAssessmentRuleBaselinesClient object to access its operations. + * + * @return the SqlPoolVulnerabilityAssessmentRuleBaselinesClient object. + */ + SqlPoolVulnerabilityAssessmentRuleBaselinesClient getSqlPoolVulnerabilityAssessmentRuleBaselines(); + + /** + * Gets the ExtendedSqlPoolBlobAuditingPoliciesClient object to access its operations. + * + * @return the ExtendedSqlPoolBlobAuditingPoliciesClient object. + */ + ExtendedSqlPoolBlobAuditingPoliciesClient getExtendedSqlPoolBlobAuditingPolicies(); + + /** + * Gets the DataMaskingPoliciesClient object to access its operations. + * + * @return the DataMaskingPoliciesClient object. + */ + DataMaskingPoliciesClient getDataMaskingPolicies(); + + /** + * Gets the DataMaskingRulesClient object to access its operations. + * + * @return the DataMaskingRulesClient object. + */ + DataMaskingRulesClient getDataMaskingRules(); + + /** + * Gets the SqlPoolColumnsClient object to access its operations. + * + * @return the SqlPoolColumnsClient object. + */ + SqlPoolColumnsClient getSqlPoolColumns(); + + /** + * Gets the SqlPoolWorkloadGroupsClient object to access its operations. + * + * @return the SqlPoolWorkloadGroupsClient object. + */ + SqlPoolWorkloadGroupsClient getSqlPoolWorkloadGroups(); + + /** + * Gets the SqlPoolWorkloadClassifiersClient object to access its operations. + * + * @return the SqlPoolWorkloadClassifiersClient object. + */ + SqlPoolWorkloadClassifiersClient getSqlPoolWorkloadClassifiers(); + + /** + * Gets the WorkspacesClient object to access its operations. + * + * @return the WorkspacesClient object. + */ + WorkspacesClient getWorkspaces(); + + /** + * Gets the WorkspaceAadAdminsClient object to access its operations. + * + * @return the WorkspaceAadAdminsClient object. + */ + WorkspaceAadAdminsClient getWorkspaceAadAdmins(); + + /** + * Gets the WorkspaceSqlAadAdminsClient object to access its operations. + * + * @return the WorkspaceSqlAadAdminsClient object. + */ + WorkspaceSqlAadAdminsClient getWorkspaceSqlAadAdmins(); + + /** + * Gets the WorkspaceManagedIdentitySqlControlSettingsClient object to access its operations. + * + * @return the WorkspaceManagedIdentitySqlControlSettingsClient object. + */ + WorkspaceManagedIdentitySqlControlSettingsClient getWorkspaceManagedIdentitySqlControlSettings(); + + /** + * Gets the RestorableDroppedSqlPoolsClient object to access its operations. + * + * @return the RestorableDroppedSqlPoolsClient object. + */ + RestorableDroppedSqlPoolsClient getRestorableDroppedSqlPools(); + + /** + * Gets the IntegrationRuntimesClient object to access its operations. + * + * @return the IntegrationRuntimesClient object. + */ + IntegrationRuntimesClient getIntegrationRuntimes(); + + /** + * Gets the IntegrationRuntimeNodeIpAddressOperationsClient object to access its operations. + * + * @return the IntegrationRuntimeNodeIpAddressOperationsClient object. + */ + IntegrationRuntimeNodeIpAddressOperationsClient getIntegrationRuntimeNodeIpAddressOperations(); + + /** + * Gets the IntegrationRuntimeObjectMetadatasClient object to access its operations. + * + * @return the IntegrationRuntimeObjectMetadatasClient object. + */ + IntegrationRuntimeObjectMetadatasClient getIntegrationRuntimeObjectMetadatas(); + + /** + * Gets the IntegrationRuntimeNodesClient object to access its operations. + * + * @return the IntegrationRuntimeNodesClient object. + */ + IntegrationRuntimeNodesClient getIntegrationRuntimeNodes(); + + /** + * Gets the IntegrationRuntimeCredentialsClient object to access its operations. + * + * @return the IntegrationRuntimeCredentialsClient object. + */ + IntegrationRuntimeCredentialsClient getIntegrationRuntimeCredentials(); + + /** + * Gets the IntegrationRuntimeConnectionInfosClient object to access its operations. + * + * @return the IntegrationRuntimeConnectionInfosClient object. + */ + IntegrationRuntimeConnectionInfosClient getIntegrationRuntimeConnectionInfos(); + + /** + * Gets the IntegrationRuntimeAuthKeysOperationsClient object to access its operations. + * + * @return the IntegrationRuntimeAuthKeysOperationsClient object. + */ + IntegrationRuntimeAuthKeysOperationsClient getIntegrationRuntimeAuthKeysOperations(); + + /** + * Gets the IntegrationRuntimeMonitoringDatasClient object to access its operations. + * + * @return the IntegrationRuntimeMonitoringDatasClient object. + */ + IntegrationRuntimeMonitoringDatasClient getIntegrationRuntimeMonitoringDatas(); + + /** + * Gets the IntegrationRuntimeStatusOperationsClient object to access its operations. + * + * @return the IntegrationRuntimeStatusOperationsClient object. + */ + IntegrationRuntimeStatusOperationsClient getIntegrationRuntimeStatusOperations(); + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + PrivateLinkResourcesClient getPrivateLinkResources(); + + /** + * Gets the PrivateLinkHubPrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkHubPrivateLinkResourcesClient object. + */ + PrivateLinkHubPrivateLinkResourcesClient getPrivateLinkHubPrivateLinkResources(); + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the PrivateLinkHubsClient object to access its operations. + * + * @return the PrivateLinkHubsClient object. + */ + PrivateLinkHubsClient getPrivateLinkHubs(); + + /** + * Gets the PrivateEndpointConnectionsPrivateLinkHubsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsPrivateLinkHubsClient object. + */ + PrivateEndpointConnectionsPrivateLinkHubsClient getPrivateEndpointConnectionsPrivateLinkHubs(); + + /** + * Gets the WorkspaceManagedSqlServerBlobAuditingPoliciesClient object to access its operations. + * + * @return the WorkspaceManagedSqlServerBlobAuditingPoliciesClient object. + */ + WorkspaceManagedSqlServerBlobAuditingPoliciesClient getWorkspaceManagedSqlServerBlobAuditingPolicies(); + + /** + * Gets the WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClient object to access its operations. + * + * @return the WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClient object. + */ + WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClient + getWorkspaceManagedSqlServerExtendedBlobAuditingPolicies(); + + /** + * Gets the WorkspaceManagedSqlServerSecurityAlertPoliciesClient object to access its operations. + * + * @return the WorkspaceManagedSqlServerSecurityAlertPoliciesClient object. + */ + WorkspaceManagedSqlServerSecurityAlertPoliciesClient getWorkspaceManagedSqlServerSecurityAlertPolicies(); + + /** + * Gets the WorkspaceManagedSqlServerVulnerabilityAssessmentsClient object to access its operations. + * + * @return the WorkspaceManagedSqlServerVulnerabilityAssessmentsClient object. + */ + WorkspaceManagedSqlServerVulnerabilityAssessmentsClient getWorkspaceManagedSqlServerVulnerabilityAssessments(); + + /** + * Gets the WorkspaceManagedSqlServerEncryptionProtectorsClient object to access its operations. + * + * @return the WorkspaceManagedSqlServerEncryptionProtectorsClient object. + */ + WorkspaceManagedSqlServerEncryptionProtectorsClient getWorkspaceManagedSqlServerEncryptionProtectors(); + + /** + * Gets the WorkspaceManagedSqlServerUsagesClient object to access its operations. + * + * @return the WorkspaceManagedSqlServerUsagesClient object. + */ + WorkspaceManagedSqlServerUsagesClient getWorkspaceManagedSqlServerUsages(); + + /** + * Gets the WorkspaceManagedSqlServerRecoverableSqlPoolsClient object to access its operations. + * + * @return the WorkspaceManagedSqlServerRecoverableSqlPoolsClient object. + */ + WorkspaceManagedSqlServerRecoverableSqlPoolsClient getWorkspaceManagedSqlServerRecoverableSqlPools(); + + /** + * Gets the KeysClient object to access its operations. + * + * @return the KeysClient object. + */ + KeysClient getKeys(); + + /** + * Gets the LibrariesClient object to access its operations. + * + * @return the LibrariesClient object. + */ + LibrariesClient getLibraries(); + + /** + * Gets the LibrariesOperationsClient object to access its operations. + * + * @return the LibrariesOperationsClient object. + */ + LibrariesOperationsClient getLibrariesOperations(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceAadAdminsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceAadAdminsClient.java new file mode 100644 index 0000000000000..9e5ab4f563d8b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceAadAdminsClient.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.models.WorkspaceAadAdminInfoInner; + +/** An instance of this class provides access to all the operations defined in WorkspaceAadAdminsClient. */ +public interface WorkspaceAadAdminsClient { + /** + * Gets a workspace 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace active directory admin. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceAadAdminInfoInner get(String resourceGroupName, String workspaceName); + + /** + * Gets a workspace active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace active directory admin. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, Context context); + + /** + * Creates or updates a workspace 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkspaceAadAdminInfoInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo); + + /** + * Creates or updates a workspace 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkspaceAadAdminInfoInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo, Context context); + + /** + * Creates or updates a workspace 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceAadAdminInfoInner createOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo); + + /** + * Creates or updates a workspace 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceAadAdminInfoInner createOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo, Context context); + + /** + * Deletes a workspace 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName); + + /** + * Deletes a workspace active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, Context context); + + /** + * Deletes a workspace 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName); + + /** + * Deletes a workspace active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedIdentitySqlControlSettingsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedIdentitySqlControlSettingsClient.java new file mode 100644 index 0000000000000..24755e7754514 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedIdentitySqlControlSettingsClient.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.models.ManagedIdentitySqlControlSettingsModelInner; + +/** + * An instance of this class provides access to all the operations defined in + * WorkspaceManagedIdentitySqlControlSettingsClient. + */ +public interface WorkspaceManagedIdentitySqlControlSettingsClient { + /** + * Get Managed Identity Sql Control Settings. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed Identity Sql Control Settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedIdentitySqlControlSettingsModelInner get(String resourceGroupName, String workspaceName); + + /** + * Get Managed Identity Sql Control Settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed Identity Sql Control Settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, Context context); + + /** + * Create or update Managed Identity Sql Control Settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param managedIdentitySqlControlSettings Managed Identity Sql Control Settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql Control Settings for workspace managed identity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ManagedIdentitySqlControlSettingsModelInner> + beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + ManagedIdentitySqlControlSettingsModelInner managedIdentitySqlControlSettings); + + /** + * Create or update Managed Identity Sql Control Settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param managedIdentitySqlControlSettings Managed Identity Sql Control Settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql Control Settings for workspace managed identity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ManagedIdentitySqlControlSettingsModelInner> + beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + ManagedIdentitySqlControlSettingsModelInner managedIdentitySqlControlSettings, + Context context); + + /** + * Create or update Managed Identity Sql Control Settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param managedIdentitySqlControlSettings Managed Identity Sql Control Settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql Control Settings for workspace managed identity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedIdentitySqlControlSettingsModelInner createOrUpdate( + String resourceGroupName, + String workspaceName, + ManagedIdentitySqlControlSettingsModelInner managedIdentitySqlControlSettings); + + /** + * Create or update Managed Identity Sql Control Settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param managedIdentitySqlControlSettings Managed Identity Sql Control Settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql Control Settings for workspace managed identity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedIdentitySqlControlSettingsModelInner createOrUpdate( + String resourceGroupName, + String workspaceName, + ManagedIdentitySqlControlSettingsModelInner managedIdentitySqlControlSettings, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedSqlServerBlobAuditingPoliciesClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedSqlServerBlobAuditingPoliciesClient.java new file mode 100644 index 0000000000000..09f853c302789 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedSqlServerBlobAuditingPoliciesClient.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.models.ServerBlobAuditingPolicyInner; +import com.azure.resourcemanager.synapse.models.BlobAuditingPolicyName; + +/** + * An instance of this class provides access to all the operations defined in + * WorkspaceManagedSqlServerBlobAuditingPoliciesClient. + */ +public interface WorkspaceManagedSqlServerBlobAuditingPoliciesClient { + /** + * Get a workspace managed sql server'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 blobAuditingPolicyName The name of the blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace managed sql server's blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerBlobAuditingPolicyInner get( + String resourceGroupName, String workspaceName, BlobAuditingPolicyName blobAuditingPolicyName); + + /** + * Get a workspace managed sql server'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 blobAuditingPolicyName The name of the blob auditing policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace managed sql server's blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, BlobAuditingPolicyName blobAuditingPolicyName, Context context); + + /** + * Create or Update a workspace managed sql server'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 blobAuditingPolicyName The name of the blob auditing policy. + * @param parameters Properties of extended blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ServerBlobAuditingPolicyInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + ServerBlobAuditingPolicyInner parameters); + + /** + * Create or Update a workspace managed sql server'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 blobAuditingPolicyName The name of the blob auditing policy. + * @param parameters Properties of extended blob auditing policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ServerBlobAuditingPolicyInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + ServerBlobAuditingPolicyInner parameters, + Context context); + + /** + * Create or Update a workspace managed sql server'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 blobAuditingPolicyName The name of the blob auditing policy. + * @param parameters Properties of extended blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerBlobAuditingPolicyInner createOrUpdate( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + ServerBlobAuditingPolicyInner parameters); + + /** + * Create or Update a workspace managed sql server'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 blobAuditingPolicyName The name of the blob auditing policy. + * @param parameters Properties of extended blob auditing policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerBlobAuditingPolicyInner createOrUpdate( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + ServerBlobAuditingPolicyInner parameters, + Context context); + + /** + * List workspace managed sql server's blob auditing policies. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server auditing settings. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * List workspace managed sql server's blob auditing policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server auditing settings. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedSqlServerEncryptionProtectorsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedSqlServerEncryptionProtectorsClient.java new file mode 100644 index 0000000000000..72ffb352d339b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedSqlServerEncryptionProtectorsClient.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.models.EncryptionProtectorInner; +import com.azure.resourcemanager.synapse.models.EncryptionProtectorName; + +/** + * An instance of this class provides access to all the operations defined in + * WorkspaceManagedSqlServerEncryptionProtectorsClient. + */ +public interface WorkspaceManagedSqlServerEncryptionProtectorsClient { + /** + * Get workspace managed sql server's encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's encryption protector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EncryptionProtectorInner get( + String resourceGroupName, String workspaceName, EncryptionProtectorName encryptionProtectorName); + + /** + * Get workspace managed sql server's encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's encryption protector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String workspaceName, + EncryptionProtectorName encryptionProtectorName, + Context context); + + /** + * Updates workspace managed sql server's encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @param parameters The requested encryption protector resource state. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the server encryption protector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, EncryptionProtectorInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + EncryptionProtectorName encryptionProtectorName, + EncryptionProtectorInner parameters); + + /** + * Updates workspace managed sql server's encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @param parameters The requested encryption protector resource state. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the server encryption protector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, EncryptionProtectorInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + EncryptionProtectorName encryptionProtectorName, + EncryptionProtectorInner parameters, + Context context); + + /** + * Updates workspace managed sql server's encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @param parameters The requested encryption protector resource state. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the server encryption protector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EncryptionProtectorInner createOrUpdate( + String resourceGroupName, + String workspaceName, + EncryptionProtectorName encryptionProtectorName, + EncryptionProtectorInner parameters); + + /** + * Updates workspace managed sql server's encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @param parameters The requested encryption protector resource state. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the server encryption protector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + EncryptionProtectorInner createOrUpdate( + String resourceGroupName, + String workspaceName, + EncryptionProtectorName encryptionProtectorName, + EncryptionProtectorInner parameters, + Context context); + + /** + * Get list of encryption protectors for workspace managed sql server. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption protectors for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Get list of encryption protectors for workspace managed sql server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption protectors for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Revalidates workspace managed sql server's existing encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRevalidate( + String resourceGroupName, String workspaceName, EncryptionProtectorName encryptionProtectorName); + + /** + * Revalidates workspace managed sql server's existing encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRevalidate( + String resourceGroupName, + String workspaceName, + EncryptionProtectorName encryptionProtectorName, + Context context); + + /** + * Revalidates workspace managed sql server's existing encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void revalidate(String resourceGroupName, String workspaceName, EncryptionProtectorName encryptionProtectorName); + + /** + * Revalidates workspace managed sql server's existing encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void revalidate( + String resourceGroupName, + String workspaceName, + EncryptionProtectorName encryptionProtectorName, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClient.java new file mode 100644 index 0000000000000..75d03eaff457a --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClient.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.models.ExtendedServerBlobAuditingPolicyInner; +import com.azure.resourcemanager.synapse.models.BlobAuditingPolicyName; + +/** + * An instance of this class provides access to all the operations defined in + * WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClient. + */ +public interface WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClient { + /** + * Get a workspace SQL server's extended blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param blobAuditingPolicyName The name of the blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace SQL server's extended blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExtendedServerBlobAuditingPolicyInner get( + String resourceGroupName, String workspaceName, BlobAuditingPolicyName blobAuditingPolicyName); + + /** + * Get a workspace SQL server's extended blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param blobAuditingPolicyName The name of the blob auditing policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace SQL server's extended blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, BlobAuditingPolicyName blobAuditingPolicyName, Context context); + + /** + * Create or Update a workspace managed sql server's extended blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param blobAuditingPolicyName The name of the blob auditing policy. + * @param parameters Properties of extended blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended server blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExtendedServerBlobAuditingPolicyInner> + beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + ExtendedServerBlobAuditingPolicyInner parameters); + + /** + * Create or Update a workspace managed sql server's extended blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param blobAuditingPolicyName The name of the blob auditing policy. + * @param parameters Properties of extended blob auditing policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended server blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ExtendedServerBlobAuditingPolicyInner> + beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + ExtendedServerBlobAuditingPolicyInner parameters, + Context context); + + /** + * Create or Update a workspace managed sql server's extended blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param blobAuditingPolicyName The name of the blob auditing policy. + * @param parameters Properties of extended blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended server blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExtendedServerBlobAuditingPolicyInner createOrUpdate( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + ExtendedServerBlobAuditingPolicyInner parameters); + + /** + * Create or Update a workspace managed sql server's extended blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param blobAuditingPolicyName The name of the blob auditing policy. + * @param parameters Properties of extended blob auditing policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended server blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExtendedServerBlobAuditingPolicyInner createOrUpdate( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + ExtendedServerBlobAuditingPolicyInner parameters, + Context context); + + /** + * List workspace managed sql server's extended blob auditing policies. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server extended auditing settings. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName); + + /** + * List workspace managed sql server's extended blob auditing policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server extended auditing settings. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedSqlServerRecoverableSqlPoolsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedSqlServerRecoverableSqlPoolsClient.java new file mode 100644 index 0000000000000..2958aa673ef8d --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedSqlServerRecoverableSqlPoolsClient.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.RecoverableSqlPoolInner; + +/** + * An instance of this class provides access to all the operations defined in + * WorkspaceManagedSqlServerRecoverableSqlPoolsClient. + */ +public interface WorkspaceManagedSqlServerRecoverableSqlPoolsClient { + /** + * Get list of recoverable sql pools for workspace managed sql server. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of recoverable sql pools for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Get list of recoverable sql pools for workspace managed sql server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of recoverable sql pools for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Get recoverable sql pools for workspace managed sql server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sqlPoolName The name of the sql pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recoverable sql pools for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoverableSqlPoolInner get(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Get recoverable sql pools for workspace managed sql server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sqlPoolName The name of the sql pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recoverable sql pools for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedSqlServerSecurityAlertPoliciesClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedSqlServerSecurityAlertPoliciesClient.java new file mode 100644 index 0000000000000..f60d1a277acd7 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedSqlServerSecurityAlertPoliciesClient.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.models.ServerSecurityAlertPolicyInner; +import com.azure.resourcemanager.synapse.models.SecurityAlertPolicyNameAutoGenerated; + +/** + * An instance of this class provides access to all the operations defined in + * WorkspaceManagedSqlServerSecurityAlertPoliciesClient. + */ +public interface WorkspaceManagedSqlServerSecurityAlertPoliciesClient { + /** + * Get a workspace managed sql server's security alert policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param securityAlertPolicyName The name of the security alert policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace managed sql server's security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerSecurityAlertPolicyInner get( + String resourceGroupName, String workspaceName, SecurityAlertPolicyNameAutoGenerated securityAlertPolicyName); + + /** + * Get a workspace managed sql server's security alert policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param securityAlertPolicyName The name of the security alert policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace managed sql server's security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String workspaceName, + SecurityAlertPolicyNameAutoGenerated securityAlertPolicyName, + Context context); + + /** + * Create or Update a workspace managed sql server's threat detection policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param securityAlertPolicyName The name of the security alert policy. + * @param parameters The workspace managed sql server security alert policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed Sql server security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ServerSecurityAlertPolicyInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + SecurityAlertPolicyNameAutoGenerated securityAlertPolicyName, + ServerSecurityAlertPolicyInner parameters); + + /** + * Create or Update a workspace managed sql server's threat detection policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param securityAlertPolicyName The name of the security alert policy. + * @param parameters The workspace managed sql server security alert policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed Sql server security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ServerSecurityAlertPolicyInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + SecurityAlertPolicyNameAutoGenerated securityAlertPolicyName, + ServerSecurityAlertPolicyInner parameters, + Context context); + + /** + * Create or Update a workspace managed sql server's threat detection policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param securityAlertPolicyName The name of the security alert policy. + * @param parameters The workspace managed sql server security alert policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed Sql server security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerSecurityAlertPolicyInner createOrUpdate( + String resourceGroupName, + String workspaceName, + SecurityAlertPolicyNameAutoGenerated securityAlertPolicyName, + ServerSecurityAlertPolicyInner parameters); + + /** + * Create or Update a workspace managed sql server's threat detection policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param securityAlertPolicyName The name of the security alert policy. + * @param parameters The workspace managed sql server security alert policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed Sql server security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerSecurityAlertPolicyInner createOrUpdate( + String resourceGroupName, + String workspaceName, + SecurityAlertPolicyNameAutoGenerated securityAlertPolicyName, + ServerSecurityAlertPolicyInner parameters, + Context context); + + /** + * Get workspace managed sql server's threat detection policies. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's threat detection policies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Get workspace managed sql server's threat detection policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's threat detection policies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedSqlServerUsagesClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedSqlServerUsagesClient.java new file mode 100644 index 0000000000000..3b1c97e59dec2 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedSqlServerUsagesClient.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.ServerUsageInner; + +/** An instance of this class provides access to all the operations defined in WorkspaceManagedSqlServerUsagesClient. */ +public interface WorkspaceManagedSqlServerUsagesClient { + /** + * Get list of server usages metric for workspace managed sql server. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of server usages metric for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Get list of server usages metric for workspace managed sql server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of server usages metric for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedSqlServerVulnerabilityAssessmentsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedSqlServerVulnerabilityAssessmentsClient.java new file mode 100644 index 0000000000000..00646beae03eb --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceManagedSqlServerVulnerabilityAssessmentsClient.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.ServerVulnerabilityAssessmentInner; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentName; + +/** + * An instance of this class provides access to all the operations defined in + * WorkspaceManagedSqlServerVulnerabilityAssessmentsClient. + */ +public interface WorkspaceManagedSqlServerVulnerabilityAssessmentsClient { + /** + * Get workspace managed sql server's vulnerability assessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param vulnerabilityAssessmentName The name of the vulnerability assessment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's vulnerability assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerVulnerabilityAssessmentInner get( + String resourceGroupName, String workspaceName, VulnerabilityAssessmentName vulnerabilityAssessmentName); + + /** + * Get workspace managed sql server's vulnerability assessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's vulnerability assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, + String workspaceName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + Context context); + + /** + * Create or Update workspace managed sql server's vulnerability assessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param parameters Properties for vulnerability assessment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server vulnerability assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServerVulnerabilityAssessmentInner createOrUpdate( + String resourceGroupName, + String workspaceName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + ServerVulnerabilityAssessmentInner parameters); + + /** + * Create or Update workspace managed sql server's vulnerability assessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param parameters Properties for vulnerability assessment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server vulnerability assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + ServerVulnerabilityAssessmentInner parameters, + Context context); + + /** + * Remove workspace managed sql server's vulnerability assessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param vulnerabilityAssessmentName The name of the vulnerability assessment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete( + String resourceGroupName, String workspaceName, VulnerabilityAssessmentName vulnerabilityAssessmentName); + + /** + * Remove workspace managed sql server's vulnerability assessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, + String workspaceName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + Context context); + + /** + * Lists the vulnerability assessment policies associated with a workspace managed sql server. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the server's vulnerability assessments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Lists the vulnerability assessment policies associated with a workspace managed sql server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the server's vulnerability assessments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String workspaceName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceSqlAadAdminsClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceSqlAadAdminsClient.java new file mode 100644 index 0000000000000..5bb5302768f67 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspaceSqlAadAdminsClient.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.models.WorkspaceAadAdminInfoInner; + +/** An instance of this class provides access to all the operations defined in WorkspaceSqlAadAdminsClient. */ +public interface WorkspaceSqlAadAdminsClient { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace SQL active directory admin. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceAadAdminInfoInner get(String resourceGroupName, String workspaceName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace SQL active directory admin. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String workspaceName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkspaceAadAdminInfoInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkspaceAadAdminInfoInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceAadAdminInfoInner createOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceAadAdminInfoInner createOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String workspaceName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspacesClient.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspacesClient.java new file mode 100644 index 0000000000000..c40896e729b9a --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/WorkspacesClient.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.models.WorkspaceInner; +import com.azure.resourcemanager.synapse.models.WorkspacePatchInfo; + +/** An instance of this class provides access to all the operations defined in WorkspacesClient. */ +public interface WorkspacesClient { + /** + * Returns a list of workspaces in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of workspaces. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Returns a list of workspaces in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of workspaces. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceInner getByResourceGroup(String resourceGroupName, String workspaceName); + + /** + * Gets a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String workspaceName, Context context); + + /** + * Updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspacePatchInfo Workspace patch request properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkspaceInner> beginUpdate( + String resourceGroupName, String workspaceName, WorkspacePatchInfo workspacePatchInfo); + + /** + * Updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspacePatchInfo Workspace patch request properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkspaceInner> beginUpdate( + String resourceGroupName, String workspaceName, WorkspacePatchInfo workspacePatchInfo, Context context); + + /** + * Updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspacePatchInfo Workspace patch request properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceInner update(String resourceGroupName, String workspaceName, WorkspacePatchInfo workspacePatchInfo); + + /** + * Updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspacePatchInfo Workspace patch request properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceInner update( + String resourceGroupName, String workspaceName, WorkspacePatchInfo workspacePatchInfo, Context context); + + /** + * Creates or updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceInfo Workspace create or update request properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkspaceInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceInner workspaceInfo); + + /** + * Creates or updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceInfo Workspace create or update request properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, WorkspaceInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceInner workspaceInfo, Context context); + + /** + * Creates or updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceInfo Workspace create or update request properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner workspaceInfo); + + /** + * Creates or updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceInfo Workspace create or update request properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + WorkspaceInner createOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceInner workspaceInfo, Context context); + + /** + * Deletes 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Object> beginDelete(String resourceGroupName, String workspaceName); + + /** + * Deletes a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Object> beginDelete(String resourceGroupName, String workspaceName, Context context); + + /** + * Deletes 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Object delete(String resourceGroupName, String workspaceName); + + /** + * Deletes a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Object delete(String resourceGroupName, String workspaceName, Context context); + + /** + * Returns a list of workspaces in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of workspaces. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Returns a list of workspaces in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of workspaces. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/AvailableRpOperationInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/AvailableRpOperationInner.java new file mode 100644 index 0000000000000..9910f145d2835 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/AvailableRpOperationInner.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.AvailableRpOperationDisplayInfo; +import com.azure.resourcemanager.synapse.models.OperationMetaServiceSpecification; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An operation that is available in this resource provider. */ +@JsonFlatten +@Fluent +public class AvailableRpOperationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableRpOperationInner.class); + + /* + * Display properties of the operation + */ + @JsonProperty(value = "display") + private AvailableRpOperationDisplayInfo display; + + /* + * Whether this operation is a data action + */ + @JsonProperty(value = "isDataAction") + private String isDataAction; + + /* + * Operation name + */ + @JsonProperty(value = "name") + private String name; + + /* + * Operation origin + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * Operation service specification + */ + @JsonProperty(value = "properties.serviceSpecification") + private OperationMetaServiceSpecification serviceSpecification; + + /** + * Get the display property: Display properties of the operation. + * + * @return the display value. + */ + public AvailableRpOperationDisplayInfo display() { + return this.display; + } + + /** + * Set the display property: Display properties of the operation. + * + * @param display the display value to set. + * @return the AvailableRpOperationInner object itself. + */ + public AvailableRpOperationInner withDisplay(AvailableRpOperationDisplayInfo display) { + this.display = display; + return this; + } + + /** + * Get the isDataAction property: Whether this operation is a data action. + * + * @return the isDataAction value. + */ + public String isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: Whether this operation is a data action. + * + * @param isDataAction the isDataAction value to set. + * @return the AvailableRpOperationInner object itself. + */ + public AvailableRpOperationInner withIsDataAction(String isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get the name property: Operation name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Operation name. + * + * @param name the name value to set. + * @return the AvailableRpOperationInner object itself. + */ + public AvailableRpOperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the origin property: Operation origin. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: Operation origin. + * + * @param origin the origin value to set. + * @return the AvailableRpOperationInner object itself. + */ + public AvailableRpOperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the serviceSpecification property: Operation service specification. + * + * @return the serviceSpecification value. + */ + public OperationMetaServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set the serviceSpecification property: Operation service specification. + * + * @param serviceSpecification the serviceSpecification value to set. + * @return the AvailableRpOperationInner object itself. + */ + public AvailableRpOperationInner withServiceSpecification(OperationMetaServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + if (serviceSpecification() != null) { + serviceSpecification().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/BigDataPoolResourceInfoInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/BigDataPoolResourceInfoInner.java new file mode 100644 index 0000000000000..19b1ca5ba7d3e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/BigDataPoolResourceInfoInner.java @@ -0,0 +1,527 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.AutoPauseProperties; +import com.azure.resourcemanager.synapse.models.AutoScaleProperties; +import com.azure.resourcemanager.synapse.models.DynamicExecutorAllocation; +import com.azure.resourcemanager.synapse.models.LibraryInfo; +import com.azure.resourcemanager.synapse.models.LibraryRequirements; +import com.azure.resourcemanager.synapse.models.NodeSize; +import com.azure.resourcemanager.synapse.models.NodeSizeFamily; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** A Big Data pool. */ +@JsonFlatten +@Fluent +public class BigDataPoolResourceInfoInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BigDataPoolResourceInfoInner.class); + + /* + * The state of the Big Data pool. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /* + * Auto-scaling properties + */ + @JsonProperty(value = "properties.autoScale") + private AutoScaleProperties autoScale; + + /* + * The time when the Big Data pool was created. + */ + @JsonProperty(value = "properties.creationDate") + private OffsetDateTime creationDate; + + /* + * Auto-pausing properties + */ + @JsonProperty(value = "properties.autoPause") + private AutoPauseProperties autoPause; + + /* + * Whether compute isolation is required or not. + */ + @JsonProperty(value = "properties.isComputeIsolationEnabled") + private Boolean isComputeIsolationEnabled; + + /* + * Whether session level packages enabled. + */ + @JsonProperty(value = "properties.sessionLevelPackagesEnabled") + private Boolean sessionLevelPackagesEnabled; + + /* + * The cache size + */ + @JsonProperty(value = "properties.cacheSize") + private Integer cacheSize; + + /* + * Dynamic Executor Allocation + */ + @JsonProperty(value = "properties.dynamicExecutorAllocation") + private DynamicExecutorAllocation dynamicExecutorAllocation; + + /* + * The Spark events folder + */ + @JsonProperty(value = "properties.sparkEventsFolder") + private String sparkEventsFolder; + + /* + * The number of nodes in the Big Data pool. + */ + @JsonProperty(value = "properties.nodeCount") + private Integer nodeCount; + + /* + * Library version requirements + */ + @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. + */ + @JsonProperty(value = "properties.sparkVersion") + private String sparkVersion; + + /* + * The default folder where Spark logs will be written. + */ + @JsonProperty(value = "properties.defaultSparkLogFolder") + private String defaultSparkLogFolder; + + /* + * The level of compute power that each node in the Big Data pool has. + */ + @JsonProperty(value = "properties.nodeSize") + private NodeSize nodeSize; + + /* + * The kind of nodes that the Big Data pool provides. + */ + @JsonProperty(value = "properties.nodeSizeFamily") + private NodeSizeFamily nodeSizeFamily; + + /* + * The time when the Big Data pool was updated successfully. + */ + @JsonProperty(value = "properties.lastSucceededTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastSucceededTimestamp; + + /** + * Get the provisioningState property: The state of the Big Data pool. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The state of the Big Data pool. + * + * @param provisioningState the provisioningState value to set. + * @return the BigDataPoolResourceInfoInner object itself. + */ + public BigDataPoolResourceInfoInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the autoScale property: Auto-scaling properties. + * + * @return the autoScale value. + */ + public AutoScaleProperties autoScale() { + return this.autoScale; + } + + /** + * Set the autoScale property: Auto-scaling properties. + * + * @param autoScale the autoScale value to set. + * @return the BigDataPoolResourceInfoInner object itself. + */ + public BigDataPoolResourceInfoInner withAutoScale(AutoScaleProperties autoScale) { + this.autoScale = autoScale; + return this; + } + + /** + * Get the creationDate property: The time when the Big Data pool was created. + * + * @return the creationDate value. + */ + public OffsetDateTime creationDate() { + return this.creationDate; + } + + /** + * Set the creationDate property: The time when the Big Data pool was created. + * + * @param creationDate the creationDate value to set. + * @return the BigDataPoolResourceInfoInner object itself. + */ + public BigDataPoolResourceInfoInner withCreationDate(OffsetDateTime creationDate) { + this.creationDate = creationDate; + return this; + } + + /** + * Get the autoPause property: Auto-pausing properties. + * + * @return the autoPause value. + */ + public AutoPauseProperties autoPause() { + return this.autoPause; + } + + /** + * Set the autoPause property: Auto-pausing properties. + * + * @param autoPause the autoPause value to set. + * @return the BigDataPoolResourceInfoInner object itself. + */ + public BigDataPoolResourceInfoInner withAutoPause(AutoPauseProperties autoPause) { + this.autoPause = autoPause; + return this; + } + + /** + * Get the isComputeIsolationEnabled property: Whether compute isolation is required or not. + * + * @return the isComputeIsolationEnabled value. + */ + public Boolean isComputeIsolationEnabled() { + return this.isComputeIsolationEnabled; + } + + /** + * Set the isComputeIsolationEnabled property: Whether compute isolation is required or not. + * + * @param isComputeIsolationEnabled the isComputeIsolationEnabled value to set. + * @return the BigDataPoolResourceInfoInner object itself. + */ + public BigDataPoolResourceInfoInner withIsComputeIsolationEnabled(Boolean isComputeIsolationEnabled) { + this.isComputeIsolationEnabled = isComputeIsolationEnabled; + return this; + } + + /** + * Get the sessionLevelPackagesEnabled property: Whether session level packages enabled. + * + * @return the sessionLevelPackagesEnabled value. + */ + public Boolean sessionLevelPackagesEnabled() { + return this.sessionLevelPackagesEnabled; + } + + /** + * Set the sessionLevelPackagesEnabled property: Whether session level packages enabled. + * + * @param sessionLevelPackagesEnabled the sessionLevelPackagesEnabled value to set. + * @return the BigDataPoolResourceInfoInner object itself. + */ + public BigDataPoolResourceInfoInner withSessionLevelPackagesEnabled(Boolean sessionLevelPackagesEnabled) { + this.sessionLevelPackagesEnabled = sessionLevelPackagesEnabled; + return this; + } + + /** + * Get the cacheSize property: The cache size. + * + * @return the cacheSize value. + */ + public Integer cacheSize() { + return this.cacheSize; + } + + /** + * Set the cacheSize property: The cache size. + * + * @param cacheSize the cacheSize value to set. + * @return the BigDataPoolResourceInfoInner object itself. + */ + public BigDataPoolResourceInfoInner withCacheSize(Integer cacheSize) { + this.cacheSize = cacheSize; + return this; + } + + /** + * Get the dynamicExecutorAllocation property: Dynamic Executor Allocation. + * + * @return the dynamicExecutorAllocation value. + */ + public DynamicExecutorAllocation dynamicExecutorAllocation() { + return this.dynamicExecutorAllocation; + } + + /** + * Set the dynamicExecutorAllocation property: Dynamic Executor Allocation. + * + * @param dynamicExecutorAllocation the dynamicExecutorAllocation value to set. + * @return the BigDataPoolResourceInfoInner object itself. + */ + public BigDataPoolResourceInfoInner withDynamicExecutorAllocation( + DynamicExecutorAllocation dynamicExecutorAllocation) { + this.dynamicExecutorAllocation = dynamicExecutorAllocation; + return this; + } + + /** + * Get the sparkEventsFolder property: The Spark events folder. + * + * @return the sparkEventsFolder value. + */ + public String sparkEventsFolder() { + return this.sparkEventsFolder; + } + + /** + * Set the sparkEventsFolder property: The Spark events folder. + * + * @param sparkEventsFolder the sparkEventsFolder value to set. + * @return the BigDataPoolResourceInfoInner object itself. + */ + public BigDataPoolResourceInfoInner withSparkEventsFolder(String sparkEventsFolder) { + this.sparkEventsFolder = sparkEventsFolder; + return this; + } + + /** + * Get the nodeCount property: The number of nodes in the Big Data pool. + * + * @return the nodeCount value. + */ + public Integer nodeCount() { + return this.nodeCount; + } + + /** + * Set the nodeCount property: The number of nodes in the Big Data pool. + * + * @param nodeCount the nodeCount value to set. + * @return the BigDataPoolResourceInfoInner object itself. + */ + public BigDataPoolResourceInfoInner withNodeCount(Integer nodeCount) { + this.nodeCount = nodeCount; + return this; + } + + /** + * Get the libraryRequirements property: Library version requirements. + * + * @return the libraryRequirements value. + */ + public LibraryRequirements libraryRequirements() { + return this.libraryRequirements; + } + + /** + * Set the libraryRequirements property: Library version requirements. + * + * @param libraryRequirements the libraryRequirements value to set. + * @return the BigDataPoolResourceInfoInner object itself. + */ + public BigDataPoolResourceInfoInner withLibraryRequirements(LibraryRequirements libraryRequirements) { + this.libraryRequirements = libraryRequirements; + return this; + } + + /** + * Get the customLibraries property: List of custom libraries/packages associated with the spark pool. + * + * @return the customLibraries value. + */ + public List customLibraries() { + return this.customLibraries; + } + + /** + * Set the customLibraries property: 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 the sparkConfigProperties property: Spark configuration file to specify additional properties. + * + * @return the sparkConfigProperties value. + */ + public LibraryRequirements sparkConfigProperties() { + return this.sparkConfigProperties; + } + + /** + * Set the sparkConfigProperties property: 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 sparkVersion property: The Apache Spark version. + * + * @return the sparkVersion value. + */ + public String sparkVersion() { + return this.sparkVersion; + } + + /** + * Set the sparkVersion property: The Apache Spark version. + * + * @param sparkVersion the sparkVersion value to set. + * @return the BigDataPoolResourceInfoInner object itself. + */ + public BigDataPoolResourceInfoInner withSparkVersion(String sparkVersion) { + this.sparkVersion = sparkVersion; + return this; + } + + /** + * Get the defaultSparkLogFolder property: The default folder where Spark logs will be written. + * + * @return the defaultSparkLogFolder value. + */ + public String defaultSparkLogFolder() { + return this.defaultSparkLogFolder; + } + + /** + * Set the defaultSparkLogFolder property: The default folder where Spark logs will be written. + * + * @param defaultSparkLogFolder the defaultSparkLogFolder value to set. + * @return the BigDataPoolResourceInfoInner object itself. + */ + public BigDataPoolResourceInfoInner withDefaultSparkLogFolder(String defaultSparkLogFolder) { + this.defaultSparkLogFolder = defaultSparkLogFolder; + return this; + } + + /** + * Get the nodeSize property: The level of compute power that each node in the Big Data pool has. + * + * @return the nodeSize value. + */ + public NodeSize nodeSize() { + return this.nodeSize; + } + + /** + * Set the nodeSize property: The level of compute power that each node in the Big Data pool has. + * + * @param nodeSize the nodeSize value to set. + * @return the BigDataPoolResourceInfoInner object itself. + */ + public BigDataPoolResourceInfoInner withNodeSize(NodeSize nodeSize) { + this.nodeSize = nodeSize; + return this; + } + + /** + * Get the nodeSizeFamily property: The kind of nodes that the Big Data pool provides. + * + * @return the nodeSizeFamily value. + */ + public NodeSizeFamily nodeSizeFamily() { + return this.nodeSizeFamily; + } + + /** + * Set the nodeSizeFamily property: The kind of nodes that the Big Data pool provides. + * + * @param nodeSizeFamily the nodeSizeFamily value to set. + * @return the BigDataPoolResourceInfoInner object itself. + */ + public BigDataPoolResourceInfoInner withNodeSizeFamily(NodeSizeFamily nodeSizeFamily) { + this.nodeSizeFamily = nodeSizeFamily; + return this; + } + + /** + * Get the lastSucceededTimestamp property: The time when the Big Data pool was updated successfully. + * + * @return the lastSucceededTimestamp value. + */ + public OffsetDateTime lastSucceededTimestamp() { + return this.lastSucceededTimestamp; + } + + /** {@inheritDoc} */ + @Override + public BigDataPoolResourceInfoInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public BigDataPoolResourceInfoInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (autoScale() != null) { + autoScale().validate(); + } + if (autoPause() != null) { + autoPause().validate(); + } + if (dynamicExecutorAllocation() != null) { + dynamicExecutorAllocation().validate(); + } + if (libraryRequirements() != null) { + libraryRequirements().validate(); + } + if (customLibraries() != null) { + customLibraries().forEach(e -> e.validate()); + } + if (sparkConfigProperties() != null) { + sparkConfigProperties().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/CheckNameAvailabilityResponseInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/CheckNameAvailabilityResponseInner.java new file mode 100644 index 0000000000000..9704542551ecd --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/CheckNameAvailabilityResponseInner.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A response saying whether the workspace name is available. */ +@Fluent +public final class CheckNameAvailabilityResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailabilityResponseInner.class); + + /* + * Validation message + */ + @JsonProperty(value = "message") + private String message; + + /* + * Whether the workspace name is available + */ + @JsonProperty(value = "available") + private Boolean available; + + /* + * Reason the workspace name is or is not available + */ + @JsonProperty(value = "reason") + private String reason; + + /* + * Workspace name + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the message property: Validation message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Validation message. + * + * @param message the message value to set. + * @return the CheckNameAvailabilityResponseInner object itself. + */ + public CheckNameAvailabilityResponseInner withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the available property: Whether the workspace name is available. + * + * @return the available value. + */ + public Boolean available() { + return this.available; + } + + /** + * Set the available property: Whether the workspace name is available. + * + * @param available the available value to set. + * @return the CheckNameAvailabilityResponseInner object itself. + */ + public CheckNameAvailabilityResponseInner withAvailable(Boolean available) { + this.available = available; + return this; + } + + /** + * Get the reason property: Reason the workspace name is or is not available. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason property: Reason the workspace name is or is not available. + * + * @param reason the reason value to set. + * @return the CheckNameAvailabilityResponseInner object itself. + */ + public CheckNameAvailabilityResponseInner withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get the name property: Workspace name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Workspace name. + * + * @param name the name value to set. + * @return the CheckNameAvailabilityResponseInner object itself. + */ + public CheckNameAvailabilityResponseInner withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/DataMaskingPolicyInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/DataMaskingPolicyInner.java new file mode 100644 index 0000000000000..aeacd91bf3303 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/DataMaskingPolicyInner.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.DataMaskingState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The DataMaskingPolicy model. */ +@JsonFlatten +@Fluent +public class DataMaskingPolicyInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataMaskingPolicyInner.class); + + /* + * 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; + + /* + * Fully qualified resource ID of the sql pool + */ + @JsonProperty(value = "managedBy", access = JsonProperty.Access.WRITE_ONLY) + private String managedBy; + + /* + * The state of the data masking policy. + */ + @JsonProperty(value = "properties.dataMaskingState") + 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; + + /** + * Get the location property: The location of the data masking policy. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the kind property: The kind of data masking policy. Metadata, used for Azure portal. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Get the managedBy property: Fully qualified resource ID of the sql pool. + * + * @return the managedBy value. + */ + public String managedBy() { + return this.managedBy; + } + + /** + * Get the dataMaskingState property: The state of the data masking policy. + * + * @return the dataMaskingState value. + */ + public DataMaskingState dataMaskingState() { + return this.dataMaskingState; + } + + /** + * Set the dataMaskingState property: The state of the data masking policy. + * + * @param dataMaskingState the dataMaskingState value to set. + * @return the DataMaskingPolicyInner object itself. + */ + public DataMaskingPolicyInner withDataMaskingState(DataMaskingState dataMaskingState) { + this.dataMaskingState = dataMaskingState; + return this; + } + + /** + * Get the exemptPrincipals property: 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 exemptPrincipals property: 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 applicationPrincipals property: 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 maskingLevel property: The masking level. This is a legacy parameter and is no longer used. + * + * @return the maskingLevel value. + */ + public String maskingLevel() { + return this.maskingLevel; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/DataMaskingRuleInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/DataMaskingRuleInner.java new file mode 100644 index 0000000000000..f801f9b098336 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/DataMaskingRuleInner.java @@ -0,0 +1,388 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.DataMaskingFunction; +import com.azure.resourcemanager.synapse.models.DataMaskingRuleState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Represents a Sql pool data masking rule. */ +@JsonFlatten +@Fluent +public class DataMaskingRuleInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataMaskingRuleInner.class); + + /* + * 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; + + /* + * The rule Id. + */ + @JsonProperty(value = "properties.id", access = JsonProperty.Access.WRITE_ONLY) + private String idPropertiesId; + + /* + * 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. + */ + @JsonProperty(value = "properties.ruleState") + private DataMaskingRuleState ruleState; + + /* + * The schema name on which the data masking rule is applied. + */ + @JsonProperty(value = "properties.schemaName") + private String schemaName; + + /* + * The table name on which the data masking rule is applied. + */ + @JsonProperty(value = "properties.tableName") + private String tableName; + + /* + * The column name on which the data masking rule is applied. + */ + @JsonProperty(value = "properties.columnName") + private String columnName; + + /* + * The masking function that is used for the data masking rule. + */ + @JsonProperty(value = "properties.maskingFunction") + 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; + + /** + * Get the location property: The location of the data masking rule. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the kind property: The kind of Data Masking Rule. Metadata, used for Azure portal. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Get the idPropertiesId property: The rule Id. + * + * @return the idPropertiesId value. + */ + public String idPropertiesId() { + return this.idPropertiesId; + } + + /** + * Get the aliasName property: 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 aliasName property: 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 ruleState property: 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. + * + * @return the ruleState value. + */ + public DataMaskingRuleState ruleState() { + return this.ruleState; + } + + /** + * Set the ruleState property: 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. + * + * @param ruleState the ruleState value to set. + * @return the DataMaskingRuleInner object itself. + */ + public DataMaskingRuleInner withRuleState(DataMaskingRuleState ruleState) { + this.ruleState = ruleState; + return this; + } + + /** + * Get the schemaName property: The schema name on which the data masking rule is applied. + * + * @return the schemaName value. + */ + public String schemaName() { + return this.schemaName; + } + + /** + * Set the schemaName property: 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 tableName property: The table name on which the data masking rule is applied. + * + * @return the tableName value. + */ + public String tableName() { + return this.tableName; + } + + /** + * Set the tableName property: 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 columnName property: The column name on which the data masking rule is applied. + * + * @return the columnName value. + */ + public String columnName() { + return this.columnName; + } + + /** + * Set the columnName property: 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 maskingFunction property: The masking function that is used for the data masking rule. + * + * @return the maskingFunction value. + */ + public DataMaskingFunction maskingFunction() { + return this.maskingFunction; + } + + /** + * Set the maskingFunction property: The masking function that is used for the data masking rule. + * + * @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: 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: 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: 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: 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 the prefixSize property: 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 the prefixSize property: 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 the suffixSize property: 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 the suffixSize property: 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 the replacementString property: 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 the replacementString property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/DataWarehouseUserActivitiesInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/DataWarehouseUserActivitiesInner.java new file mode 100644 index 0000000000000..836be594beb56 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/DataWarehouseUserActivitiesInner.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** User activities of a data warehouse. */ +@JsonFlatten +@Immutable +public class DataWarehouseUserActivitiesInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataWarehouseUserActivitiesInner.class); + + /* + * Count of running and suspended queries. + */ + @JsonProperty(value = "properties.activeQueriesCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer activeQueriesCount; + + /** + * Get the activeQueriesCount property: Count of running and suspended queries. + * + * @return the activeQueriesCount value. + */ + public Integer activeQueriesCount() { + return this.activeQueriesCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/EncryptionProtectorInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/EncryptionProtectorInner.java new file mode 100644 index 0000000000000..5d19d8ddd463f --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/EncryptionProtectorInner.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.ServerKeyType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The server encryption protector. */ +@JsonFlatten +@Fluent +public class EncryptionProtectorInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionProtectorInner.class); + + /* + * Kind of encryption protector. This is metadata used for the Azure portal + * experience. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private String kind; + + /* + * Resource location. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /* + * Subregion of the encryption protector. + */ + @JsonProperty(value = "properties.subregion", access = JsonProperty.Access.WRITE_ONLY) + private String subregion; + + /* + * The name of the server key. + */ + @JsonProperty(value = "properties.serverKeyName") + private String serverKeyName; + + /* + * The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. + */ + @JsonProperty(value = "properties.serverKeyType") + private ServerKeyType serverKeyType; + + /* + * The URI of the server key. + */ + @JsonProperty(value = "properties.uri", access = JsonProperty.Access.WRITE_ONLY) + private String uri; + + /* + * Thumbprint of the server key. + */ + @JsonProperty(value = "properties.thumbprint", access = JsonProperty.Access.WRITE_ONLY) + private String thumbprint; + + /** + * Get the kind property: Kind of encryption protector. This is metadata used for the Azure portal experience. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Get the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the subregion property: Subregion of the encryption protector. + * + * @return the subregion value. + */ + public String subregion() { + return this.subregion; + } + + /** + * Get the serverKeyName property: The name of the server key. + * + * @return the serverKeyName value. + */ + public String serverKeyName() { + return this.serverKeyName; + } + + /** + * Set the serverKeyName property: The name of the server key. + * + * @param serverKeyName the serverKeyName value to set. + * @return the EncryptionProtectorInner object itself. + */ + public EncryptionProtectorInner withServerKeyName(String serverKeyName) { + this.serverKeyName = serverKeyName; + return this; + } + + /** + * Get the serverKeyType property: The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. + * + * @return the serverKeyType value. + */ + public ServerKeyType serverKeyType() { + return this.serverKeyType; + } + + /** + * Set the serverKeyType property: The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. + * + * @param serverKeyType the serverKeyType value to set. + * @return the EncryptionProtectorInner object itself. + */ + public EncryptionProtectorInner withServerKeyType(ServerKeyType serverKeyType) { + this.serverKeyType = serverKeyType; + return this; + } + + /** + * Get the uri property: The URI of the server key. + * + * @return the uri value. + */ + public String uri() { + return this.uri; + } + + /** + * Get the thumbprint property: Thumbprint of the server key. + * + * @return the thumbprint value. + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ExtendedServerBlobAuditingPolicyInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ExtendedServerBlobAuditingPolicyInner.java new file mode 100644 index 0000000000000..8e9571ae50d8b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ExtendedServerBlobAuditingPolicyInner.java @@ -0,0 +1,520 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.BlobAuditingPolicyState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.UUID; + +/** An extended server blob auditing policy. */ +@JsonFlatten +@Fluent +public class ExtendedServerBlobAuditingPolicyInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtendedServerBlobAuditingPolicyInner.class); + + /* + * 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. + */ + @JsonProperty(value = "properties.state") + 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 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 the predicateExpression property: Specifies condition of where clause when creating an audit. + * + * @return the predicateExpression value. + */ + public String predicateExpression() { + return this.predicateExpression; + } + + /** + * Set the predicateExpression property: Specifies condition of where clause when creating an audit. + * + * @param predicateExpression the predicateExpression value to set. + * @return the ExtendedServerBlobAuditingPolicyInner object itself. + */ + public ExtendedServerBlobAuditingPolicyInner withPredicateExpression(String predicateExpression) { + this.predicateExpression = predicateExpression; + return this; + } + + /** + * Get the state property: Specifies the state of the policy. If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled are required. + * + * @return the state value. + */ + public BlobAuditingPolicyState state() { + return this.state; + } + + /** + * Set the state property: Specifies the state of the policy. If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled are required. + * + * @param state the state value to set. + * @return the ExtendedServerBlobAuditingPolicyInner object itself. + */ + public ExtendedServerBlobAuditingPolicyInner withState(BlobAuditingPolicyState state) { + this.state = state; + return this; + } + + /** + * Get the storageEndpoint property: 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 the storageEndpoint property: 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 ExtendedServerBlobAuditingPolicyInner object itself. + */ + public ExtendedServerBlobAuditingPolicyInner withStorageEndpoint(String storageEndpoint) { + this.storageEndpoint = storageEndpoint; + return this; + } + + /** + * Get the storageAccountAccessKey property: 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 the storageAccountAccessKey property: 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 ExtendedServerBlobAuditingPolicyInner object itself. + */ + public ExtendedServerBlobAuditingPolicyInner withStorageAccountAccessKey(String storageAccountAccessKey) { + this.storageAccountAccessKey = storageAccountAccessKey; + return this; + } + + /** + * Get the retentionDays property: 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 the retentionDays property: Specifies the number of days to keep in the audit logs in the storage account. + * + * @param retentionDays the retentionDays value to set. + * @return the ExtendedServerBlobAuditingPolicyInner object itself. + */ + public ExtendedServerBlobAuditingPolicyInner withRetentionDays(Integer retentionDays) { + this.retentionDays = retentionDays; + return this; + } + + /** + * Get the auditActionsAndGroups property: 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 the auditActionsAndGroups property: 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 ExtendedServerBlobAuditingPolicyInner object itself. + */ + public ExtendedServerBlobAuditingPolicyInner withAuditActionsAndGroups(List auditActionsAndGroups) { + this.auditActionsAndGroups = auditActionsAndGroups; + return this; + } + + /** + * Get the storageAccountSubscriptionId property: Specifies the blob storage subscription Id. + * + * @return the storageAccountSubscriptionId value. + */ + public UUID storageAccountSubscriptionId() { + return this.storageAccountSubscriptionId; + } + + /** + * Set the storageAccountSubscriptionId property: Specifies the blob storage subscription Id. + * + * @param storageAccountSubscriptionId the storageAccountSubscriptionId value to set. + * @return the ExtendedServerBlobAuditingPolicyInner object itself. + */ + public ExtendedServerBlobAuditingPolicyInner withStorageAccountSubscriptionId(UUID storageAccountSubscriptionId) { + this.storageAccountSubscriptionId = storageAccountSubscriptionId; + return this; + } + + /** + * Get the isStorageSecondaryKeyInUse property: Specifies whether storageAccountAccessKey value is the storage's + * secondary key. + * + * @return the isStorageSecondaryKeyInUse value. + */ + public Boolean isStorageSecondaryKeyInUse() { + return this.isStorageSecondaryKeyInUse; + } + + /** + * Set the isStorageSecondaryKeyInUse property: Specifies whether storageAccountAccessKey value is the storage's + * secondary key. + * + * @param isStorageSecondaryKeyInUse the isStorageSecondaryKeyInUse value to set. + * @return the ExtendedServerBlobAuditingPolicyInner object itself. + */ + public ExtendedServerBlobAuditingPolicyInner withIsStorageSecondaryKeyInUse(Boolean isStorageSecondaryKeyInUse) { + this.isStorageSecondaryKeyInUse = isStorageSecondaryKeyInUse; + return this; + } + + /** + * Get the isAzureMonitorTargetEnabled property: 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 the isAzureMonitorTargetEnabled property: 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 ExtendedServerBlobAuditingPolicyInner object itself. + */ + public ExtendedServerBlobAuditingPolicyInner withIsAzureMonitorTargetEnabled(Boolean isAzureMonitorTargetEnabled) { + this.isAzureMonitorTargetEnabled = isAzureMonitorTargetEnabled; + return this; + } + + /** + * Get the queueDelayMs property: 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 the queueDelayMs property: 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 ExtendedServerBlobAuditingPolicyInner object itself. + */ + public ExtendedServerBlobAuditingPolicyInner withQueueDelayMs(Integer queueDelayMs) { + this.queueDelayMs = queueDelayMs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ExtendedSqlPoolBlobAuditingPolicyInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ExtendedSqlPoolBlobAuditingPolicyInner.java new file mode 100644 index 0000000000000..385eb11be45a6 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ExtendedSqlPoolBlobAuditingPolicyInner.java @@ -0,0 +1,520 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.BlobAuditingPolicyState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.UUID; + +/** An extended Sql pool blob auditing policy. */ +@JsonFlatten +@Fluent +public class ExtendedSqlPoolBlobAuditingPolicyInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtendedSqlPoolBlobAuditingPolicyInner.class); + + /* + * 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. + */ + @JsonProperty(value = "properties.state") + 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 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 the predicateExpression property: Specifies condition of where clause when creating an audit. + * + * @return the predicateExpression value. + */ + public String predicateExpression() { + return this.predicateExpression; + } + + /** + * Set the predicateExpression property: 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 the state property: Specifies the state of the policy. If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled are required. + * + * @return the state value. + */ + public BlobAuditingPolicyState state() { + return this.state; + } + + /** + * Set the state property: Specifies the state of the policy. If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled are required. + * + * @param state the state value to set. + * @return the ExtendedSqlPoolBlobAuditingPolicyInner object itself. + */ + public ExtendedSqlPoolBlobAuditingPolicyInner withState(BlobAuditingPolicyState state) { + this.state = state; + return this; + } + + /** + * Get the storageEndpoint property: 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 the storageEndpoint property: 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 the storageAccountAccessKey property: 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 the storageAccountAccessKey property: 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 the retentionDays property: 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 the retentionDays property: 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 the auditActionsAndGroups property: 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 the auditActionsAndGroups property: 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 the storageAccountSubscriptionId property: Specifies the blob storage subscription Id. + * + * @return the storageAccountSubscriptionId value. + */ + public UUID storageAccountSubscriptionId() { + return this.storageAccountSubscriptionId; + } + + /** + * Set the storageAccountSubscriptionId property: 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 the isStorageSecondaryKeyInUse property: Specifies whether storageAccountAccessKey value is the storage's + * secondary key. + * + * @return the isStorageSecondaryKeyInUse value. + */ + public Boolean isStorageSecondaryKeyInUse() { + return this.isStorageSecondaryKeyInUse; + } + + /** + * Set the isStorageSecondaryKeyInUse property: 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 the isAzureMonitorTargetEnabled property: 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 the isAzureMonitorTargetEnabled property: 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 the queueDelayMs property: 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 the queueDelayMs property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/GeoBackupPolicyInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/GeoBackupPolicyInner.java new file mode 100644 index 0000000000000..82c90f398caaa --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/GeoBackupPolicyInner.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.GeoBackupPolicyState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A database geo backup policy. */ +@JsonFlatten +@Fluent +public class GeoBackupPolicyInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GeoBackupPolicyInner.class); + + /* + * Kind of geo backup policy. This is metadata used for the Azure portal + * experience. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private String kind; + + /* + * Backup policy location. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /* + * The state of the geo backup policy. + */ + @JsonProperty(value = "properties.state", required = true) + private GeoBackupPolicyState state; + + /* + * The storage type of the geo backup policy. + */ + @JsonProperty(value = "properties.storageType", access = JsonProperty.Access.WRITE_ONLY) + private String storageType; + + /** + * Get the kind property: Kind of geo backup policy. This is metadata used for the Azure portal experience. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Get the location property: Backup policy location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the state property: The state of the geo backup policy. + * + * @return the state value. + */ + public GeoBackupPolicyState state() { + return this.state; + } + + /** + * Set the state property: The state of the geo backup policy. + * + * @param state the state value to set. + * @return the GeoBackupPolicyInner object itself. + */ + public GeoBackupPolicyInner withState(GeoBackupPolicyState state) { + this.state = state; + return this; + } + + /** + * Get the storageType property: The storage type of the geo backup policy. + * + * @return the storageType value. + */ + public String storageType() { + return this.storageType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (state() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property state in model GeoBackupPolicyInner")); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/IntegrationRuntimeAuthKeysInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/IntegrationRuntimeAuthKeysInner.java new file mode 100644 index 0000000000000..9025d9f620ac1 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/IntegrationRuntimeAuthKeysInner.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The integration runtime authentication keys. */ +@Fluent +public final class IntegrationRuntimeAuthKeysInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IntegrationRuntimeAuthKeysInner.class); + + /* + * The primary integration runtime authentication key. + */ + @JsonProperty(value = "authKey1") + private String authKey1; + + /* + * The secondary integration runtime authentication key. + */ + @JsonProperty(value = "authKey2") + private String authKey2; + + /** + * Get the authKey1 property: The primary integration runtime authentication key. + * + * @return the authKey1 value. + */ + public String authKey1() { + return this.authKey1; + } + + /** + * Set the authKey1 property: The primary integration runtime authentication key. + * + * @param authKey1 the authKey1 value to set. + * @return the IntegrationRuntimeAuthKeysInner object itself. + */ + public IntegrationRuntimeAuthKeysInner withAuthKey1(String authKey1) { + this.authKey1 = authKey1; + return this; + } + + /** + * Get the authKey2 property: The secondary integration runtime authentication key. + * + * @return the authKey2 value. + */ + public String authKey2() { + return this.authKey2; + } + + /** + * Set the authKey2 property: The secondary integration runtime authentication key. + * + * @param authKey2 the authKey2 value to set. + * @return the IntegrationRuntimeAuthKeysInner object itself. + */ + public IntegrationRuntimeAuthKeysInner withAuthKey2(String authKey2) { + this.authKey2 = authKey2; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/IntegrationRuntimeConnectionInfoInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/IntegrationRuntimeConnectionInfoInner.java new file mode 100644 index 0000000000000..623b6e124d844 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/IntegrationRuntimeConnectionInfoInner.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.HashMap; +import java.util.Map; + +/** Connection information for encrypting the on-premises data source credentials. */ +@Fluent +public final class IntegrationRuntimeConnectionInfoInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IntegrationRuntimeConnectionInfoInner.class); + + /* + * The token generated in service. Callers use this token to authenticate + * to integration runtime. + */ + @JsonProperty(value = "serviceToken", access = JsonProperty.Access.WRITE_ONLY) + private String serviceToken; + + /* + * The integration runtime SSL certificate thumbprint. Click-Once + * application uses it to do server validation. + */ + @JsonProperty(value = "identityCertThumbprint", access = JsonProperty.Access.WRITE_ONLY) + private String identityCertThumbprint; + + /* + * The on-premises integration runtime host URL. + */ + @JsonProperty(value = "hostServiceUri", access = JsonProperty.Access.WRITE_ONLY) + private String hostServiceUri; + + /* + * The integration runtime version. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * The public key for encrypting a credential when transferring the + * credential to the integration runtime. + */ + @JsonProperty(value = "publicKey", access = JsonProperty.Access.WRITE_ONLY) + private String publicKey; + + /* + * Whether the identity certificate is expired. + */ + @JsonProperty(value = "isIdentityCertExprired", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isIdentityCertExprired; + + /* + * Connection information for encrypting the on-premises data source + * credentials. + */ + @JsonIgnore private Map additionalProperties; + + /** + * Get the serviceToken property: The token generated in service. Callers use this token to authenticate to + * integration runtime. + * + * @return the serviceToken value. + */ + public String serviceToken() { + return this.serviceToken; + } + + /** + * Get the identityCertThumbprint property: The integration runtime SSL certificate thumbprint. Click-Once + * application uses it to do server validation. + * + * @return the identityCertThumbprint value. + */ + public String identityCertThumbprint() { + return this.identityCertThumbprint; + } + + /** + * Get the hostServiceUri property: The on-premises integration runtime host URL. + * + * @return the hostServiceUri value. + */ + public String hostServiceUri() { + return this.hostServiceUri; + } + + /** + * Get the version property: The integration runtime version. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the publicKey property: The public key for encrypting a credential when transferring the credential to the + * integration runtime. + * + * @return the publicKey value. + */ + public String publicKey() { + return this.publicKey; + } + + /** + * Get the isIdentityCertExprired property: Whether the identity certificate is expired. + * + * @return the isIdentityCertExprired value. + */ + public Boolean isIdentityCertExprired() { + return this.isIdentityCertExprired; + } + + /** + * Get the additionalProperties property: Connection information for encrypting the on-premises data source + * credentials. + * + * @return the additionalProperties value. + */ + @JsonAnyGetter + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Connection information for encrypting the on-premises data source + * credentials. + * + * @param additionalProperties the additionalProperties value to set. + * @return the IntegrationRuntimeConnectionInfoInner object itself. + */ + public IntegrationRuntimeConnectionInfoInner withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + @JsonAnySetter + void withAdditionalProperties(String key, Object value) { + if (additionalProperties == null) { + additionalProperties = new HashMap<>(); + } + additionalProperties.put(key, value); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/IntegrationRuntimeMonitoringDataInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/IntegrationRuntimeMonitoringDataInner.java new file mode 100644 index 0000000000000..4149466aedbb1 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/IntegrationRuntimeMonitoringDataInner.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeNodeMonitoringData; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Get monitoring data response. */ +@Fluent +public final class IntegrationRuntimeMonitoringDataInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IntegrationRuntimeMonitoringDataInner.class); + + /* + * Integration runtime name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Integration runtime node monitoring data. + */ + @JsonProperty(value = "nodes") + private List nodes; + + /** + * Get the name property: Integration runtime name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Integration runtime name. + * + * @param name the name value to set. + * @return the IntegrationRuntimeMonitoringDataInner object itself. + */ + public IntegrationRuntimeMonitoringDataInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the nodes property: Integration runtime node monitoring data. + * + * @return the nodes value. + */ + public List nodes() { + return this.nodes; + } + + /** + * Set the nodes property: Integration runtime node monitoring data. + * + * @param nodes the nodes value to set. + * @return the IntegrationRuntimeMonitoringDataInner object itself. + */ + public IntegrationRuntimeMonitoringDataInner withNodes(List nodes) { + this.nodes = nodes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (nodes() != null) { + nodes().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/IntegrationRuntimeNodeIpAddressInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/IntegrationRuntimeNodeIpAddressInner.java new file mode 100644 index 0000000000000..f1c1e6fedb699 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/IntegrationRuntimeNodeIpAddressInner.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The IP address of self-hosted integration runtime node. */ +@Immutable +public final class IntegrationRuntimeNodeIpAddressInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IntegrationRuntimeNodeIpAddressInner.class); + + /* + * The IP address of self-hosted integration runtime node. + */ + @JsonProperty(value = "ipAddress", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddress; + + /** + * Get the ipAddress property: The IP address of self-hosted integration runtime node. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/IntegrationRuntimeResourceInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/IntegrationRuntimeResourceInner.java new file mode 100644 index 0000000000000..ccd640380f694 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/IntegrationRuntimeResourceInner.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.AzureEntityResource; +import com.azure.resourcemanager.synapse.models.IntegrationRuntime; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Integration runtime resource type. */ +@Fluent +public final class IntegrationRuntimeResourceInner extends AzureEntityResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IntegrationRuntimeResourceInner.class); + + /* + * Integration runtime properties. + */ + @JsonProperty(value = "properties", required = true) + private IntegrationRuntime properties; + + /** + * Get the properties property: Integration runtime properties. + * + * @return the properties value. + */ + public IntegrationRuntime properties() { + return this.properties; + } + + /** + * Set the properties property: Integration runtime properties. + * + * @param properties the properties value to set. + * @return the IntegrationRuntimeResourceInner object itself. + */ + public IntegrationRuntimeResourceInner withProperties(IntegrationRuntime properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (properties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property properties in model IntegrationRuntimeResourceInner")); + } else { + properties().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/IntegrationRuntimeStatusResponseInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/IntegrationRuntimeStatusResponseInner.java new file mode 100644 index 0000000000000..e7b4ec49fde47 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/IntegrationRuntimeStatusResponseInner.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Integration runtime status response. */ +@Fluent +public final class IntegrationRuntimeStatusResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IntegrationRuntimeStatusResponseInner.class); + + /* + * The integration runtime name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Integration runtime properties. + */ + @JsonProperty(value = "properties", required = true) + private IntegrationRuntimeStatus properties; + + /** + * Get the name property: The integration runtime name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the properties property: Integration runtime properties. + * + * @return the properties value. + */ + public IntegrationRuntimeStatus properties() { + return this.properties; + } + + /** + * Set the properties property: Integration runtime properties. + * + * @param properties the properties value to set. + * @return the IntegrationRuntimeStatusResponseInner object itself. + */ + public IntegrationRuntimeStatusResponseInner withProperties(IntegrationRuntimeStatus properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property properties in model IntegrationRuntimeStatusResponseInner")); + } else { + properties().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/IpFirewallRuleInfoInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/IpFirewallRuleInfoInner.java new file mode 100644 index 0000000000000..b979ef0074928 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/IpFirewallRuleInfoInner.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP firewall rule. */ +@JsonFlatten +@Fluent +public class IpFirewallRuleInfoInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpFirewallRuleInfoInner.class); + + /* + * The end IP address of the firewall rule. Must be IPv4 format. Must be + * greater than or equal to startIpAddress + */ + @JsonProperty(value = "properties.endIpAddress") + private String endIpAddress; + + /* + * Resource provisioning state + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The start IP address of the firewall rule. Must be IPv4 format + */ + @JsonProperty(value = "properties.startIpAddress") + private String startIpAddress; + + /** + * Get the endIpAddress property: The end IP address of the firewall rule. Must be IPv4 format. Must be greater than + * or equal to startIpAddress. + * + * @return the endIpAddress value. + */ + public String endIpAddress() { + return this.endIpAddress; + } + + /** + * Set the endIpAddress property: The end IP address of the firewall rule. Must be IPv4 format. Must be greater than + * or equal to startIpAddress. + * + * @param endIpAddress the endIpAddress value to set. + * @return the IpFirewallRuleInfoInner object itself. + */ + public IpFirewallRuleInfoInner withEndIpAddress(String endIpAddress) { + this.endIpAddress = endIpAddress; + return this; + } + + /** + * Get the provisioningState property: Resource provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the startIpAddress property: The start IP address of the firewall rule. Must be IPv4 format. + * + * @return the startIpAddress value. + */ + public String startIpAddress() { + return this.startIpAddress; + } + + /** + * Set the startIpAddress property: The start IP address of the firewall rule. Must be IPv4 format. + * + * @param startIpAddress the startIpAddress value to set. + * @return the IpFirewallRuleInfoInner object itself. + */ + public IpFirewallRuleInfoInner withStartIpAddress(String startIpAddress) { + this.startIpAddress = startIpAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/KeyInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/KeyInner.java new file mode 100644 index 0000000000000..7cb05a3f23620 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/KeyInner.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A workspace key. */ +@JsonFlatten +@Fluent +public class KeyInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyInner.class); + + /* + * 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 the isActiveCmk property: Used to activate the workspace after a customer managed key is provided. + * + * @return the isActiveCmk value. + */ + public Boolean isActiveCmk() { + return this.isActiveCmk; + } + + /** + * Set the isActiveCmk property: 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 keyVaultUrl property: The Key Vault Url of the workspace key. + * + * @return the keyVaultUrl value. + */ + public String keyVaultUrl() { + return this.keyVaultUrl; + } + + /** + * Set the keyVaultUrl property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/LibraryResourceInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/LibraryResourceInner.java new file mode 100644 index 0000000000000..940a58360db88 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/LibraryResourceInner.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.AzureEntityResource; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Library response details. */ +@JsonFlatten +@Fluent +public class LibraryResourceInner extends AzureEntityResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LibraryResourceInner.class); + + /* + * Name of the library. + */ + @JsonProperty(value = "properties.name") + private String namePropertiesName; + + /* + * Storage blob path of library. + */ + @JsonProperty(value = "properties.path") + private String path; + + /* + * Storage blob container name. + */ + @JsonProperty(value = "properties.containerName") + private String containerName; + + /* + * The last update time of the library. + */ + @JsonProperty(value = "properties.uploadedTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime uploadedTimestamp; + + /* + * Type of the library. + */ + @JsonProperty(value = "properties.type") + private String typePropertiesType; + + /* + * Provisioning status of the library/package. + */ + @JsonProperty(value = "properties.provisioningStatus", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningStatus; + + /* + * Creator Id of the library/package. + */ + @JsonProperty(value = "properties.creatorId", access = JsonProperty.Access.WRITE_ONLY) + private String creatorId; + + /** + * Get the namePropertiesName property: Name of the library. + * + * @return the namePropertiesName value. + */ + public String namePropertiesName() { + return this.namePropertiesName; + } + + /** + * Set the namePropertiesName property: Name of the library. + * + * @param namePropertiesName the namePropertiesName value to set. + * @return the LibraryResourceInner object itself. + */ + public LibraryResourceInner withNamePropertiesName(String namePropertiesName) { + this.namePropertiesName = namePropertiesName; + return this; + } + + /** + * Get the path property: Storage blob path of library. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: Storage blob path of library. + * + * @param path the path value to set. + * @return the LibraryResourceInner object itself. + */ + public LibraryResourceInner withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the containerName property: Storage blob container name. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: Storage blob container name. + * + * @param containerName the containerName value to set. + * @return the LibraryResourceInner object itself. + */ + public LibraryResourceInner withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the uploadedTimestamp property: The last update time of the library. + * + * @return the uploadedTimestamp value. + */ + public OffsetDateTime uploadedTimestamp() { + return this.uploadedTimestamp; + } + + /** + * Get the typePropertiesType property: Type of the library. + * + * @return the typePropertiesType value. + */ + public String typePropertiesType() { + return this.typePropertiesType; + } + + /** + * Set the typePropertiesType property: Type of the library. + * + * @param typePropertiesType the typePropertiesType value to set. + * @return the LibraryResourceInner object itself. + */ + public LibraryResourceInner withTypePropertiesType(String typePropertiesType) { + this.typePropertiesType = typePropertiesType; + return this; + } + + /** + * Get the provisioningStatus property: Provisioning status of the library/package. + * + * @return the provisioningStatus value. + */ + public String provisioningStatus() { + return this.provisioningStatus; + } + + /** + * Get the creatorId property: Creator Id of the library/package. + * + * @return the creatorId value. + */ + public String creatorId() { + return this.creatorId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/MaintenanceWindowOptionsInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/MaintenanceWindowOptionsInner.java new file mode 100644 index 0000000000000..2d2fb50ebe3af --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/MaintenanceWindowOptionsInner.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.MaintenanceWindowTimeRange; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Maintenance window options. */ +@JsonFlatten +@Fluent +public class MaintenanceWindowOptionsInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MaintenanceWindowOptionsInner.class); + + /* + * Whether maintenance windows are enabled for the database. + */ + @JsonProperty(value = "properties.isEnabled") + private Boolean isEnabled; + + /* + * Available maintenance cycles e.g. {Saturday, 0, 48*60}, {Wednesday, 0, + * 24*60}. + */ + @JsonProperty(value = "properties.maintenanceWindowCycles") + private List maintenanceWindowCycles; + + /* + * Minimum duration of maintenance window. + */ + @JsonProperty(value = "properties.minDurationInMinutes") + private Integer minDurationInMinutes; + + /* + * Default duration for maintenance window. + */ + @JsonProperty(value = "properties.defaultDurationInMinutes") + private Integer defaultDurationInMinutes; + + /* + * Minimum number of maintenance windows cycles to be set on the database. + */ + @JsonProperty(value = "properties.minCycles") + private Integer minCycles; + + /* + * Time granularity in minutes for maintenance windows. + */ + @JsonProperty(value = "properties.timeGranularityInMinutes") + private Integer timeGranularityInMinutes; + + /* + * Whether we allow multiple maintenance windows per cycle. + */ + @JsonProperty(value = "properties.allowMultipleMaintenanceWindowsPerCycle") + private Boolean allowMultipleMaintenanceWindowsPerCycle; + + /** + * Get the isEnabled property: Whether maintenance windows are enabled for the database. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * Set the isEnabled property: Whether maintenance windows are enabled for the database. + * + * @param isEnabled the isEnabled value to set. + * @return the MaintenanceWindowOptionsInner object itself. + */ + public MaintenanceWindowOptionsInner withIsEnabled(Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Get the maintenanceWindowCycles property: Available maintenance cycles e.g. {Saturday, 0, 48*60}, {Wednesday, 0, + * 24*60}. + * + * @return the maintenanceWindowCycles value. + */ + public List maintenanceWindowCycles() { + return this.maintenanceWindowCycles; + } + + /** + * Set the maintenanceWindowCycles property: Available maintenance cycles e.g. {Saturday, 0, 48*60}, {Wednesday, 0, + * 24*60}. + * + * @param maintenanceWindowCycles the maintenanceWindowCycles value to set. + * @return the MaintenanceWindowOptionsInner object itself. + */ + public MaintenanceWindowOptionsInner withMaintenanceWindowCycles( + List maintenanceWindowCycles) { + this.maintenanceWindowCycles = maintenanceWindowCycles; + return this; + } + + /** + * Get the minDurationInMinutes property: Minimum duration of maintenance window. + * + * @return the minDurationInMinutes value. + */ + public Integer minDurationInMinutes() { + return this.minDurationInMinutes; + } + + /** + * Set the minDurationInMinutes property: Minimum duration of maintenance window. + * + * @param minDurationInMinutes the minDurationInMinutes value to set. + * @return the MaintenanceWindowOptionsInner object itself. + */ + public MaintenanceWindowOptionsInner withMinDurationInMinutes(Integer minDurationInMinutes) { + this.minDurationInMinutes = minDurationInMinutes; + return this; + } + + /** + * Get the defaultDurationInMinutes property: Default duration for maintenance window. + * + * @return the defaultDurationInMinutes value. + */ + public Integer defaultDurationInMinutes() { + return this.defaultDurationInMinutes; + } + + /** + * Set the defaultDurationInMinutes property: Default duration for maintenance window. + * + * @param defaultDurationInMinutes the defaultDurationInMinutes value to set. + * @return the MaintenanceWindowOptionsInner object itself. + */ + public MaintenanceWindowOptionsInner withDefaultDurationInMinutes(Integer defaultDurationInMinutes) { + this.defaultDurationInMinutes = defaultDurationInMinutes; + return this; + } + + /** + * Get the minCycles property: Minimum number of maintenance windows cycles to be set on the database. + * + * @return the minCycles value. + */ + public Integer minCycles() { + return this.minCycles; + } + + /** + * Set the minCycles property: Minimum number of maintenance windows cycles to be set on the database. + * + * @param minCycles the minCycles value to set. + * @return the MaintenanceWindowOptionsInner object itself. + */ + public MaintenanceWindowOptionsInner withMinCycles(Integer minCycles) { + this.minCycles = minCycles; + return this; + } + + /** + * Get the timeGranularityInMinutes property: Time granularity in minutes for maintenance windows. + * + * @return the timeGranularityInMinutes value. + */ + public Integer timeGranularityInMinutes() { + return this.timeGranularityInMinutes; + } + + /** + * Set the timeGranularityInMinutes property: Time granularity in minutes for maintenance windows. + * + * @param timeGranularityInMinutes the timeGranularityInMinutes value to set. + * @return the MaintenanceWindowOptionsInner object itself. + */ + public MaintenanceWindowOptionsInner withTimeGranularityInMinutes(Integer timeGranularityInMinutes) { + this.timeGranularityInMinutes = timeGranularityInMinutes; + return this; + } + + /** + * Get the allowMultipleMaintenanceWindowsPerCycle property: Whether we allow multiple maintenance windows per + * cycle. + * + * @return the allowMultipleMaintenanceWindowsPerCycle value. + */ + public Boolean allowMultipleMaintenanceWindowsPerCycle() { + return this.allowMultipleMaintenanceWindowsPerCycle; + } + + /** + * Set the allowMultipleMaintenanceWindowsPerCycle property: Whether we allow multiple maintenance windows per + * cycle. + * + * @param allowMultipleMaintenanceWindowsPerCycle the allowMultipleMaintenanceWindowsPerCycle value to set. + * @return the MaintenanceWindowOptionsInner object itself. + */ + public MaintenanceWindowOptionsInner withAllowMultipleMaintenanceWindowsPerCycle( + Boolean allowMultipleMaintenanceWindowsPerCycle) { + this.allowMultipleMaintenanceWindowsPerCycle = allowMultipleMaintenanceWindowsPerCycle; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (maintenanceWindowCycles() != null) { + maintenanceWindowCycles().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/MaintenanceWindowsInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/MaintenanceWindowsInner.java new file mode 100644 index 0000000000000..41b69243f26c6 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/MaintenanceWindowsInner.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.MaintenanceWindowTimeRange; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Maintenance windows. */ +@JsonFlatten +@Fluent +public class MaintenanceWindowsInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MaintenanceWindowsInner.class); + + /* + * The timeRanges property. + */ + @JsonProperty(value = "properties.timeRanges") + private List timeRanges; + + /** + * Get the timeRanges property: The timeRanges property. + * + * @return the timeRanges value. + */ + public List timeRanges() { + return this.timeRanges; + } + + /** + * Set the timeRanges property: The timeRanges property. + * + * @param timeRanges the timeRanges value to set. + * @return the MaintenanceWindowsInner object itself. + */ + public MaintenanceWindowsInner withTimeRanges(List timeRanges) { + this.timeRanges = timeRanges; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (timeRanges() != null) { + timeRanges().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ManagedIdentitySqlControlSettingsModelInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ManagedIdentitySqlControlSettingsModelInner.java new file mode 100644 index 0000000000000..42f9ed740c7cf --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ManagedIdentitySqlControlSettingsModelInner.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentity; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Sql Control Settings for workspace managed identity. */ +@JsonFlatten +@Fluent +public class ManagedIdentitySqlControlSettingsModelInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedIdentitySqlControlSettingsModelInner.class); + + /* + * Grant sql control to managed identity + */ + @JsonProperty(value = "properties.grantSqlControlToManagedIdentity") + private ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentity + grantSqlControlToManagedIdentity; + + /** + * Get the grantSqlControlToManagedIdentity property: Grant sql control to managed identity. + * + * @return the grantSqlControlToManagedIdentity value. + */ + public ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentity + grantSqlControlToManagedIdentity() { + return this.grantSqlControlToManagedIdentity; + } + + /** + * Set the grantSqlControlToManagedIdentity property: Grant sql control to managed identity. + * + * @param grantSqlControlToManagedIdentity the grantSqlControlToManagedIdentity value to set. + * @return the ManagedIdentitySqlControlSettingsModelInner object itself. + */ + public ManagedIdentitySqlControlSettingsModelInner withGrantSqlControlToManagedIdentity( + ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentity + grantSqlControlToManagedIdentity) { + this.grantSqlControlToManagedIdentity = grantSqlControlToManagedIdentity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (grantSqlControlToManagedIdentity() != null) { + grantSqlControlToManagedIdentity().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/MetadataSyncConfigInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/MetadataSyncConfigInner.java new file mode 100644 index 0000000000000..bb27859bb5d28 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/MetadataSyncConfigInner.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configuration for metadata sync. */ +@JsonFlatten +@Fluent +public class MetadataSyncConfigInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetadataSyncConfigInner.class); + + /* + * Indicates whether the metadata sync is enabled or disabled + */ + @JsonProperty(value = "properties.enabled") + private Boolean enabled; + + /* + * The Sync Interval in minutes. + */ + @JsonProperty(value = "properties.syncIntervalInMinutes") + private Integer syncIntervalInMinutes; + + /** + * Get the enabled property: Indicates whether the metadata sync is enabled or disabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Indicates whether the metadata sync is enabled or disabled. + * + * @param enabled the enabled value to set. + * @return the MetadataSyncConfigInner object itself. + */ + public MetadataSyncConfigInner withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the syncIntervalInMinutes property: The Sync Interval in minutes. + * + * @return the syncIntervalInMinutes value. + */ + public Integer syncIntervalInMinutes() { + return this.syncIntervalInMinutes; + } + + /** + * Set the syncIntervalInMinutes property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/OperationResourceInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/OperationResourceInner.java new file mode 100644 index 0000000000000..85ac613dacd1a --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/OperationResourceInner.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.OperationStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** An operation. */ +@Fluent +public final class OperationResourceInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationResourceInner.class); + + /* + * Operation ID + */ + @JsonProperty(value = "id") + private String id; + + /* + * Operation name + */ + @JsonProperty(value = "name") + private String name; + + /* + * Operation status + */ + @JsonProperty(value = "status") + private OperationStatus status; + + /* + * Operation properties + */ + @JsonProperty(value = "properties") + private Object properties; + + /* + * Errors from the operation + */ + @JsonProperty(value = "error") + private ManagementError error; + + /* + * Operation start time + */ + @JsonProperty(value = "startTime") + private OffsetDateTime startTime; + + /* + * Operation start time + */ + @JsonProperty(value = "endTime") + private OffsetDateTime endTime; + + /* + * Completion percentage of the operation + */ + @JsonProperty(value = "percentComplete") + private Float percentComplete; + + /** + * Get the id property: Operation ID. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Operation ID. + * + * @param id the id value to set. + * @return the OperationResourceInner object itself. + */ + public OperationResourceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: Operation name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Operation name. + * + * @param name the name value to set. + * @return the OperationResourceInner object itself. + */ + public OperationResourceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the status property: Operation status. + * + * @return the status value. + */ + public OperationStatus status() { + return this.status; + } + + /** + * Set the status property: Operation status. + * + * @param status the status value to set. + * @return the OperationResourceInner object itself. + */ + public OperationResourceInner withStatus(OperationStatus status) { + this.status = status; + return this; + } + + /** + * Get the properties property: Operation properties. + * + * @return the properties value. + */ + public Object properties() { + return this.properties; + } + + /** + * Set the properties property: Operation properties. + * + * @param properties the properties value to set. + * @return the OperationResourceInner object itself. + */ + public OperationResourceInner withProperties(Object properties) { + this.properties = properties; + return this; + } + + /** + * Get the error property: Errors from the operation. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Set the error property: Errors from the operation. + * + * @param error the error value to set. + * @return the OperationResourceInner object itself. + */ + public OperationResourceInner withError(ManagementError error) { + this.error = error; + return this; + } + + /** + * Get the startTime property: Operation start time. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: Operation start time. + * + * @param startTime the startTime value to set. + * @return the OperationResourceInner object itself. + */ + public OperationResourceInner withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: Operation start time. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: Operation start time. + * + * @param endTime the endTime value to set. + * @return the OperationResourceInner object itself. + */ + public OperationResourceInner withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the percentComplete property: Completion percentage of the operation. + * + * @return the percentComplete value. + */ + public Float percentComplete() { + return this.percentComplete; + } + + /** + * Set the percentComplete property: Completion percentage of the operation. + * + * @param percentComplete the percentComplete value to set. + * @return the OperationResourceInner object itself. + */ + public OperationResourceInner withPercentComplete(Float percentComplete) { + this.percentComplete = percentComplete; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/PrivateEndpointConnectionForPrivateLinkHubInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/PrivateEndpointConnectionForPrivateLinkHubInner.java new file mode 100644 index 0000000000000..75555a3a1bc3f --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/PrivateEndpointConnectionForPrivateLinkHubInner.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.PrivateEndpointConnectionForPrivateLinkHubBasicAutoGenerated; +import com.azure.resourcemanager.synapse.models.PrivateEndpointConnectionProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PrivateEndpointConnectionForPrivateLinkHub model. */ +@Fluent +public final class PrivateEndpointConnectionForPrivateLinkHubInner + extends PrivateEndpointConnectionForPrivateLinkHubBasicAutoGenerated { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionForPrivateLinkHubInner.class); + + /* + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The type property. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name property. + * + * @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 property: The type property. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type property. + * + * @param type the type value to set. + * @return the PrivateEndpointConnectionForPrivateLinkHubInner object itself. + */ + public PrivateEndpointConnectionForPrivateLinkHubInner withType(String type) { + this.type = type; + return this; + } + + /** {@inheritDoc} */ + @Override + public PrivateEndpointConnectionForPrivateLinkHubInner withId(String id) { + super.withId(id); + return this; + } + + /** {@inheritDoc} */ + @Override + public PrivateEndpointConnectionForPrivateLinkHubInner withProperties( + PrivateEndpointConnectionProperties properties) { + super.withProperties(properties); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/PrivateEndpointConnectionInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 0000000000000..b7cc5a3c5ca18 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.PrivateEndpoint; +import com.azure.resourcemanager.synapse.models.PrivateLinkServiceConnectionState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A private endpoint connection. */ +@JsonFlatten +@Fluent +public class PrivateEndpointConnectionInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionInner.class); + + /* + * 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 the privateEndpoint property: The private endpoint which the connection belongs to. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: The private endpoint which the connection belongs to. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: Connection state of the private endpoint connection. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: Connection state of the private endpoint connection. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the private endpoint connection. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() != null) { + privateLinkServiceConnectionState().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/PrivateLinkHubInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/PrivateLinkHubInner.java new file mode 100644 index 0000000000000..0bd2cf01a58f8 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/PrivateLinkHubInner.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.PrivateEndpointConnectionForPrivateLinkHubBasic; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** A privateLinkHub. */ +@JsonFlatten +@Fluent +public class PrivateLinkHubInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkHubInner.class); + + /* + * PrivateLinkHub provisioning state + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /* + * List of private endpoint connections + */ + @JsonProperty(value = "properties.privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /** + * Get the provisioningState property: PrivateLinkHub provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: 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 the privateEndpointConnections property: List of private endpoint connections. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** {@inheritDoc} */ + @Override + public PrivateLinkHubInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public PrivateLinkHubInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/PrivateLinkResourceInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/PrivateLinkResourceInner.java new file mode 100644 index 0000000000000..451f0fe5846af --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/PrivateLinkResourceInner.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.PrivateLinkResourceProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A private link resource. */ +@Immutable +public final class PrivateLinkResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceInner.class); + + /* + * The private link resource properties. + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private PrivateLinkResourceProperties properties; + + /** + * Get the properties property: The private link resource properties. + * + * @return the properties value. + */ + public PrivateLinkResourceProperties properties() { + return this.properties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/RecoverableSqlPoolInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/RecoverableSqlPoolInner.java new file mode 100644 index 0000000000000..ef65ee8229a14 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/RecoverableSqlPoolInner.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** A recoverable sql pool. */ +@JsonFlatten +@Immutable +public class RecoverableSqlPoolInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoverableSqlPoolInner.class); + + /* + * The edition of the database + */ + @JsonProperty(value = "properties.edition", access = JsonProperty.Access.WRITE_ONLY) + private String edition; + + /* + * 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 last available backup date of the database (ISO8601 format) + */ + @JsonProperty(value = "properties.lastAvailableBackupDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastAvailableBackupDate; + + /** + * Get the edition property: The edition of the database. + * + * @return the edition value. + */ + public String edition() { + return this.edition; + } + + /** + * Get the serviceLevelObjective property: The service level objective name of the database. + * + * @return the serviceLevelObjective value. + */ + public String serviceLevelObjective() { + return this.serviceLevelObjective; + } + + /** + * Get the elasticPoolName property: The elastic pool name of the database. + * + * @return the elasticPoolName value. + */ + public String elasticPoolName() { + return this.elasticPoolName; + } + + /** + * Get the lastAvailableBackupDate property: The last available backup date of the database (ISO8601 format). + * + * @return the lastAvailableBackupDate value. + */ + public OffsetDateTime lastAvailableBackupDate() { + return this.lastAvailableBackupDate; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ReplaceAllFirewallRulesOperationResponseInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ReplaceAllFirewallRulesOperationResponseInner.java new file mode 100644 index 0000000000000..45e1457fc6470 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ReplaceAllFirewallRulesOperationResponseInner.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An existing operation for replacing the firewall rules. */ +@Fluent +public final class ReplaceAllFirewallRulesOperationResponseInner { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(ReplaceAllFirewallRulesOperationResponseInner.class); + + /* + * The operation ID + */ + @JsonProperty(value = "operationId") + private String operationId; + + /** + * Get the operationId property: The operation ID. + * + * @return the operationId value. + */ + public String operationId() { + return this.operationId; + } + + /** + * Set the operationId property: The operation ID. + * + * @param operationId the operationId value to set. + * @return the ReplaceAllFirewallRulesOperationResponseInner object itself. + */ + public ReplaceAllFirewallRulesOperationResponseInner withOperationId(String operationId) { + this.operationId = operationId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ReplicationLinkInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ReplicationLinkInner.java new file mode 100644 index 0000000000000..a2cbcfb0af5bf --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ReplicationLinkInner.java @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.ReplicationRole; +import com.azure.resourcemanager.synapse.models.ReplicationState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Represents a Sql pool replication link. */ +@JsonFlatten +@Immutable +public class ReplicationLinkInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicationLinkInner.class); + + /* + * Location of the workspace that contains this firewall rule. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /* + * Legacy value indicating whether termination is allowed. Currently + * always returns true. + */ + @JsonProperty(value = "properties.isTerminationAllowed", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isTerminationAllowed; + + /* + * Replication mode of this replication link. + */ + @JsonProperty(value = "properties.replicationMode", access = JsonProperty.Access.WRITE_ONLY) + private String replicationMode; + + /* + * The name of the workspace hosting the partner Sql pool. + */ + @JsonProperty(value = "properties.partnerServer", access = JsonProperty.Access.WRITE_ONLY) + private String partnerServer; + + /* + * The name of the partner Sql pool. + */ + @JsonProperty(value = "properties.partnerDatabase", access = JsonProperty.Access.WRITE_ONLY) + private String partnerDatabase; + + /* + * The Azure Region of the partner Sql pool. + */ + @JsonProperty(value = "properties.partnerLocation", access = JsonProperty.Access.WRITE_ONLY) + private String partnerLocation; + + /* + * The role of the Sql pool in the replication link. + */ + @JsonProperty(value = "properties.role", access = JsonProperty.Access.WRITE_ONLY) + private ReplicationRole role; + + /* + * The role of the partner Sql pool in the replication link. + */ + @JsonProperty(value = "properties.partnerRole", access = JsonProperty.Access.WRITE_ONLY) + private ReplicationRole partnerRole; + + /* + * The start time for the replication link. + */ + @JsonProperty(value = "properties.startTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTime; + + /* + * The percentage of seeding complete for the replication link. + */ + @JsonProperty(value = "properties.percentComplete", access = JsonProperty.Access.WRITE_ONLY) + private Integer percentComplete; + + /* + * The replication state for the replication link. + */ + @JsonProperty(value = "properties.replicationState", access = JsonProperty.Access.WRITE_ONLY) + private ReplicationState replicationState; + + /** + * Get the location property: Location of the workspace that contains this firewall rule. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the isTerminationAllowed property: Legacy value indicating whether termination is allowed. Currently always + * returns true. + * + * @return the isTerminationAllowed value. + */ + public Boolean isTerminationAllowed() { + return this.isTerminationAllowed; + } + + /** + * Get the replicationMode property: Replication mode of this replication link. + * + * @return the replicationMode value. + */ + public String replicationMode() { + return this.replicationMode; + } + + /** + * Get the partnerServer property: The name of the workspace hosting the partner Sql pool. + * + * @return the partnerServer value. + */ + public String partnerServer() { + return this.partnerServer; + } + + /** + * Get the partnerDatabase property: The name of the partner Sql pool. + * + * @return the partnerDatabase value. + */ + public String partnerDatabase() { + return this.partnerDatabase; + } + + /** + * Get the partnerLocation property: The Azure Region of the partner Sql pool. + * + * @return the partnerLocation value. + */ + public String partnerLocation() { + return this.partnerLocation; + } + + /** + * Get the role property: The role of the Sql pool in the replication link. + * + * @return the role value. + */ + public ReplicationRole role() { + return this.role; + } + + /** + * Get the partnerRole property: The role of the partner Sql pool in the replication link. + * + * @return the partnerRole value. + */ + public ReplicationRole partnerRole() { + return this.partnerRole; + } + + /** + * Get the startTime property: The start time for the replication link. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the percentComplete property: The percentage of seeding complete for the replication link. + * + * @return the percentComplete value. + */ + public Integer percentComplete() { + return this.percentComplete; + } + + /** + * Get the replicationState property: The replication state for the replication link. + * + * @return the replicationState value. + */ + public ReplicationState replicationState() { + return this.replicationState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/RestorableDroppedSqlPoolInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/RestorableDroppedSqlPoolInner.java new file mode 100644 index 0000000000000..87219d0a307d2 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/RestorableDroppedSqlPoolInner.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** A restorable dropped Sql pool. */ +@JsonFlatten +@Immutable +public class RestorableDroppedSqlPoolInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RestorableDroppedSqlPoolInner.class); + + /* + * 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 OffsetDateTime creationDate; + + /* + * The deletion date of the database (ISO8601 format) + */ + @JsonProperty(value = "properties.deletionDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime deletionDate; + + /* + * The earliest restore date of the database (ISO8601 format) + */ + @JsonProperty(value = "properties.earliestRestoreDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime earliestRestoreDate; + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the databaseName property: The name of the database. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get the edition property: The edition of the database. + * + * @return the edition value. + */ + public String edition() { + return this.edition; + } + + /** + * Get the maxSizeBytes property: The max size in bytes of the database. + * + * @return the maxSizeBytes value. + */ + public String maxSizeBytes() { + return this.maxSizeBytes; + } + + /** + * Get the serviceLevelObjective property: The service level objective name of the database. + * + * @return the serviceLevelObjective value. + */ + public String serviceLevelObjective() { + return this.serviceLevelObjective; + } + + /** + * Get the elasticPoolName property: The elastic pool name of the database. + * + * @return the elasticPoolName value. + */ + public String elasticPoolName() { + return this.elasticPoolName; + } + + /** + * Get the creationDate property: The creation date of the database (ISO8601 format). + * + * @return the creationDate value. + */ + public OffsetDateTime creationDate() { + return this.creationDate; + } + + /** + * Get the deletionDate property: The deletion date of the database (ISO8601 format). + * + * @return the deletionDate value. + */ + public OffsetDateTime deletionDate() { + return this.deletionDate; + } + + /** + * Get the earliestRestoreDate property: The earliest restore date of the database (ISO8601 format). + * + * @return the earliestRestoreDate value. + */ + public OffsetDateTime earliestRestoreDate() { + return this.earliestRestoreDate; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/RestorePointInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/RestorePointInner.java new file mode 100644 index 0000000000000..c06bc32985edf --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/RestorePointInner.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.RestorePointType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Database restore points. */ +@JsonFlatten +@Immutable +public class RestorePointInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RestorePointInner.class); + + /* + * Resource location. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /* + * The type of restore point + */ + @JsonProperty(value = "properties.restorePointType", access = JsonProperty.Access.WRITE_ONLY) + private RestorePointType restorePointType; + + /* + * The earliest time to which this database can be restored + */ + @JsonProperty(value = "properties.earliestRestoreDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime earliestRestoreDate; + + /* + * The time the backup was taken + */ + @JsonProperty(value = "properties.restorePointCreationDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime restorePointCreationDate; + + /* + * The label of restore point for backup request by user + */ + @JsonProperty(value = "properties.restorePointLabel", access = JsonProperty.Access.WRITE_ONLY) + private String restorePointLabel; + + /** + * Get the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the restorePointType property: The type of restore point. + * + * @return the restorePointType value. + */ + public RestorePointType restorePointType() { + return this.restorePointType; + } + + /** + * Get the earliestRestoreDate property: The earliest time to which this database can be restored. + * + * @return the earliestRestoreDate value. + */ + public OffsetDateTime earliestRestoreDate() { + return this.earliestRestoreDate; + } + + /** + * Get the restorePointCreationDate property: The time the backup was taken. + * + * @return the restorePointCreationDate value. + */ + public OffsetDateTime restorePointCreationDate() { + return this.restorePointCreationDate; + } + + /** + * Get the restorePointLabel property: The label of restore point for backup request by user. + * + * @return the restorePointLabel value. + */ + public String restorePointLabel() { + return this.restorePointLabel; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SelfHostedIntegrationRuntimeNodeInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SelfHostedIntegrationRuntimeNodeInner.java new file mode 100644 index 0000000000000..8668c0d53b99a --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SelfHostedIntegrationRuntimeNodeInner.java @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeUpdateResult; +import com.azure.resourcemanager.synapse.models.SelfHostedIntegrationRuntimeNodeStatus; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; + +/** Properties of Self-hosted integration runtime node. */ +@Fluent +public final class SelfHostedIntegrationRuntimeNodeInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SelfHostedIntegrationRuntimeNodeInner.class); + + /* + * Name of the integration runtime node. + */ + @JsonProperty(value = "nodeName", access = JsonProperty.Access.WRITE_ONLY) + private String nodeName; + + /* + * Machine name of the integration runtime node. + */ + @JsonProperty(value = "machineName", access = JsonProperty.Access.WRITE_ONLY) + private String machineName; + + /* + * URI for the host machine of the integration runtime. + */ + @JsonProperty(value = "hostServiceUri", access = JsonProperty.Access.WRITE_ONLY) + private String hostServiceUri; + + /* + * Status of the integration runtime node. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private SelfHostedIntegrationRuntimeNodeStatus status; + + /* + * The integration runtime capabilities dictionary + */ + @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY) + private Map capabilities; + + /* + * Status of the integration runtime node version. + */ + @JsonProperty(value = "versionStatus", access = JsonProperty.Access.WRITE_ONLY) + private String versionStatus; + + /* + * Version of the integration runtime node. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * The time at which the integration runtime node was registered in ISO8601 + * format. + */ + @JsonProperty(value = "registerTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime registerTime; + + /* + * The most recent time at which the integration runtime was connected in + * ISO8601 format. + */ + @JsonProperty(value = "lastConnectTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastConnectTime; + + /* + * The time at which the integration runtime will expire in ISO8601 format. + */ + @JsonProperty(value = "expiryTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime expiryTime; + + /* + * The time the node last started up. + */ + @JsonProperty(value = "lastStartTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastStartTime; + + /* + * The integration runtime node last stop time. + */ + @JsonProperty(value = "lastStopTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastStopTime; + + /* + * The result of the last integration runtime node update. + */ + @JsonProperty(value = "lastUpdateResult", access = JsonProperty.Access.WRITE_ONLY) + private IntegrationRuntimeUpdateResult lastUpdateResult; + + /* + * The last time for the integration runtime node update start. + */ + @JsonProperty(value = "lastStartUpdateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastStartUpdateTime; + + /* + * The last time for the integration runtime node update end. + */ + @JsonProperty(value = "lastEndUpdateTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastEndUpdateTime; + + /* + * Indicates whether this node is the active dispatcher for integration + * runtime requests. + */ + @JsonProperty(value = "isActiveDispatcher", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isActiveDispatcher; + + /* + * Maximum concurrent jobs on the integration runtime node. + */ + @JsonProperty(value = "concurrentJobsLimit", access = JsonProperty.Access.WRITE_ONLY) + private Integer concurrentJobsLimit; + + /* + * The maximum concurrent jobs in this integration runtime. + */ + @JsonProperty(value = "maxConcurrentJobs", access = JsonProperty.Access.WRITE_ONLY) + private Integer maxConcurrentJobs; + + /* + * Properties of Self-hosted integration runtime node. + */ + @JsonIgnore private Map additionalProperties; + + /** + * Get the nodeName property: Name of the integration runtime node. + * + * @return the nodeName value. + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Get the machineName property: Machine name of the integration runtime node. + * + * @return the machineName value. + */ + public String machineName() { + return this.machineName; + } + + /** + * Get the hostServiceUri property: URI for the host machine of the integration runtime. + * + * @return the hostServiceUri value. + */ + public String hostServiceUri() { + return this.hostServiceUri; + } + + /** + * Get the status property: Status of the integration runtime node. + * + * @return the status value. + */ + public SelfHostedIntegrationRuntimeNodeStatus status() { + return this.status; + } + + /** + * Get the capabilities property: The integration runtime capabilities dictionary. + * + * @return the capabilities value. + */ + public Map capabilities() { + return this.capabilities; + } + + /** + * Get the versionStatus property: Status of the integration runtime node version. + * + * @return the versionStatus value. + */ + public String versionStatus() { + return this.versionStatus; + } + + /** + * Get the version property: Version of the integration runtime node. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the registerTime property: The time at which the integration runtime node was registered in ISO8601 format. + * + * @return the registerTime value. + */ + public OffsetDateTime registerTime() { + return this.registerTime; + } + + /** + * Get the lastConnectTime property: The most recent time at which the integration runtime was connected in ISO8601 + * format. + * + * @return the lastConnectTime value. + */ + public OffsetDateTime lastConnectTime() { + return this.lastConnectTime; + } + + /** + * Get the expiryTime property: The time at which the integration runtime will expire in ISO8601 format. + * + * @return the expiryTime value. + */ + public OffsetDateTime expiryTime() { + return this.expiryTime; + } + + /** + * Get the lastStartTime property: The time the node last started up. + * + * @return the lastStartTime value. + */ + public OffsetDateTime lastStartTime() { + return this.lastStartTime; + } + + /** + * Get the lastStopTime property: The integration runtime node last stop time. + * + * @return the lastStopTime value. + */ + public OffsetDateTime lastStopTime() { + return this.lastStopTime; + } + + /** + * Get the lastUpdateResult property: The result of the last integration runtime node update. + * + * @return the lastUpdateResult value. + */ + public IntegrationRuntimeUpdateResult lastUpdateResult() { + return this.lastUpdateResult; + } + + /** + * Get the lastStartUpdateTime property: The last time for the integration runtime node update start. + * + * @return the lastStartUpdateTime value. + */ + public OffsetDateTime lastStartUpdateTime() { + return this.lastStartUpdateTime; + } + + /** + * Get the lastEndUpdateTime property: The last time for the integration runtime node update end. + * + * @return the lastEndUpdateTime value. + */ + public OffsetDateTime lastEndUpdateTime() { + return this.lastEndUpdateTime; + } + + /** + * Get the isActiveDispatcher property: Indicates whether this node is the active dispatcher for integration runtime + * requests. + * + * @return the isActiveDispatcher value. + */ + public Boolean isActiveDispatcher() { + return this.isActiveDispatcher; + } + + /** + * Get the concurrentJobsLimit property: Maximum concurrent jobs on the integration runtime node. + * + * @return the concurrentJobsLimit value. + */ + public Integer concurrentJobsLimit() { + return this.concurrentJobsLimit; + } + + /** + * Get the maxConcurrentJobs property: The maximum concurrent jobs in this integration runtime. + * + * @return the maxConcurrentJobs value. + */ + public Integer maxConcurrentJobs() { + return this.maxConcurrentJobs; + } + + /** + * Get the additionalProperties property: Properties of Self-hosted integration runtime node. + * + * @return the additionalProperties value. + */ + @JsonAnyGetter + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Properties of Self-hosted integration runtime node. + * + * @param additionalProperties the additionalProperties value to set. + * @return the SelfHostedIntegrationRuntimeNodeInner object itself. + */ + public SelfHostedIntegrationRuntimeNodeInner withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + @JsonAnySetter + void withAdditionalProperties(String key, Object value) { + if (additionalProperties == null) { + additionalProperties = new HashMap<>(); + } + additionalProperties.put(key, value); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SensitivityLabelInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SensitivityLabelInner.java new file mode 100644 index 0000000000000..2f4e7dc9aaf24 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SensitivityLabelInner.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.SensitivityLabelRank; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A sensitivity label. */ +@JsonFlatten +@Fluent +public class SensitivityLabelInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SensitivityLabelInner.class); + + /* + * managed by + */ + @JsonProperty(value = "managedBy", access = JsonProperty.Access.WRITE_ONLY) + private String managedBy; + + /* + * The schema name. + */ + @JsonProperty(value = "properties.schemaName", access = JsonProperty.Access.WRITE_ONLY) + private String schemaName; + + /* + * The table name. + */ + @JsonProperty(value = "properties.tableName", access = JsonProperty.Access.WRITE_ONLY) + private String tableName; + + /* + * The column name. + */ + @JsonProperty(value = "properties.columnName", access = JsonProperty.Access.WRITE_ONLY) + private String columnName; + + /* + * The label name. + */ + @JsonProperty(value = "properties.labelName") + private String labelName; + + /* + * The label ID. + */ + @JsonProperty(value = "properties.labelId") + private String labelId; + + /* + * The information type. + */ + @JsonProperty(value = "properties.informationType") + private String informationType; + + /* + * The information type ID. + */ + @JsonProperty(value = "properties.informationTypeId") + private String informationTypeId; + + /* + * Is sensitivity recommendation disabled. Applicable for recommended + * sensitivity label only. Specifies whether the sensitivity recommendation + * on this column is disabled (dismissed) or not. + */ + @JsonProperty(value = "properties.isDisabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDisabled; + + /* + * The rank property. + */ + @JsonProperty(value = "properties.rank") + private SensitivityLabelRank rank; + + /** + * Get the managedBy property: managed by. + * + * @return the managedBy value. + */ + public String managedBy() { + return this.managedBy; + } + + /** + * Get the schemaName property: The schema name. + * + * @return the schemaName value. + */ + public String schemaName() { + return this.schemaName; + } + + /** + * Get the tableName property: The table name. + * + * @return the tableName value. + */ + public String tableName() { + return this.tableName; + } + + /** + * Get the columnName property: The column name. + * + * @return the columnName value. + */ + public String columnName() { + return this.columnName; + } + + /** + * Get the labelName property: The label name. + * + * @return the labelName value. + */ + public String labelName() { + return this.labelName; + } + + /** + * Set the labelName property: The label name. + * + * @param labelName the labelName value to set. + * @return the SensitivityLabelInner object itself. + */ + public SensitivityLabelInner withLabelName(String labelName) { + this.labelName = labelName; + return this; + } + + /** + * Get the labelId property: The label ID. + * + * @return the labelId value. + */ + public String labelId() { + return this.labelId; + } + + /** + * Set the labelId property: The label ID. + * + * @param labelId the labelId value to set. + * @return the SensitivityLabelInner object itself. + */ + public SensitivityLabelInner withLabelId(String labelId) { + this.labelId = labelId; + return this; + } + + /** + * Get the informationType property: The information type. + * + * @return the informationType value. + */ + public String informationType() { + return this.informationType; + } + + /** + * Set the informationType property: The information type. + * + * @param informationType the informationType value to set. + * @return the SensitivityLabelInner object itself. + */ + public SensitivityLabelInner withInformationType(String informationType) { + this.informationType = informationType; + return this; + } + + /** + * Get the informationTypeId property: The information type ID. + * + * @return the informationTypeId value. + */ + public String informationTypeId() { + return this.informationTypeId; + } + + /** + * Set the informationTypeId property: The information type ID. + * + * @param informationTypeId the informationTypeId value to set. + * @return the SensitivityLabelInner object itself. + */ + public SensitivityLabelInner withInformationTypeId(String informationTypeId) { + this.informationTypeId = informationTypeId; + return this; + } + + /** + * Get the isDisabled property: Is sensitivity recommendation disabled. Applicable for recommended sensitivity label + * only. Specifies whether the sensitivity recommendation on this column is disabled (dismissed) or not. + * + * @return the isDisabled value. + */ + public Boolean isDisabled() { + return this.isDisabled; + } + + /** + * Get the rank property: The rank property. + * + * @return the rank value. + */ + public SensitivityLabelRank rank() { + return this.rank; + } + + /** + * Set the rank property: The rank property. + * + * @param rank the rank value to set. + * @return the SensitivityLabelInner object itself. + */ + public SensitivityLabelInner withRank(SensitivityLabelRank rank) { + this.rank = rank; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SensitivityLabelUpdateInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SensitivityLabelUpdateInner.java new file mode 100644 index 0000000000000..37c56cfbff96d --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SensitivityLabelUpdateInner.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.SensitivityLabelUpdateKind; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A sensitivity label update operation. */ +@JsonFlatten +@Fluent +public class SensitivityLabelUpdateInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SensitivityLabelUpdateInner.class); + + /* + * The op property. + */ + @JsonProperty(value = "properties.op") + private SensitivityLabelUpdateKind op; + + /* + * Schema name of the column to update. + */ + @JsonProperty(value = "properties.schema") + private String schema; + + /* + * Table name of the column to update. + */ + @JsonProperty(value = "properties.table") + private String table; + + /* + * Column name to update. + */ + @JsonProperty(value = "properties.column") + private String column; + + /* + * The sensitivity label information to apply on a column. + */ + @JsonProperty(value = "properties.sensitivityLabel") + private SensitivityLabelInner sensitivityLabel; + + /** + * Get the op property: The op property. + * + * @return the op value. + */ + public SensitivityLabelUpdateKind op() { + return this.op; + } + + /** + * Set the op property: The op property. + * + * @param op the op value to set. + * @return the SensitivityLabelUpdateInner object itself. + */ + public SensitivityLabelUpdateInner withOp(SensitivityLabelUpdateKind op) { + this.op = op; + return this; + } + + /** + * Get the schema property: Schema name of the column to update. + * + * @return the schema value. + */ + public String schema() { + return this.schema; + } + + /** + * Set the schema property: Schema name of the column to update. + * + * @param schema the schema value to set. + * @return the SensitivityLabelUpdateInner object itself. + */ + public SensitivityLabelUpdateInner withSchema(String schema) { + this.schema = schema; + return this; + } + + /** + * Get the table property: Table name of the column to update. + * + * @return the table value. + */ + public String table() { + return this.table; + } + + /** + * Set the table property: Table name of the column to update. + * + * @param table the table value to set. + * @return the SensitivityLabelUpdateInner object itself. + */ + public SensitivityLabelUpdateInner withTable(String table) { + this.table = table; + return this; + } + + /** + * Get the column property: Column name to update. + * + * @return the column value. + */ + public String column() { + return this.column; + } + + /** + * Set the column property: Column name to update. + * + * @param column the column value to set. + * @return the SensitivityLabelUpdateInner object itself. + */ + public SensitivityLabelUpdateInner withColumn(String column) { + this.column = column; + return this; + } + + /** + * Get the sensitivityLabel property: The sensitivity label information to apply on a column. + * + * @return the sensitivityLabel value. + */ + public SensitivityLabelInner sensitivityLabel() { + return this.sensitivityLabel; + } + + /** + * Set the sensitivityLabel property: The sensitivity label information to apply on a column. + * + * @param sensitivityLabel the sensitivityLabel value to set. + * @return the SensitivityLabelUpdateInner object itself. + */ + public SensitivityLabelUpdateInner withSensitivityLabel(SensitivityLabelInner sensitivityLabel) { + this.sensitivityLabel = sensitivityLabel; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sensitivityLabel() != null) { + sensitivityLabel().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ServerBlobAuditingPolicyInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ServerBlobAuditingPolicyInner.java new file mode 100644 index 0000000000000..63d413b6b572b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ServerBlobAuditingPolicyInner.java @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.BlobAuditingPolicyState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.UUID; + +/** A server blob auditing policy. */ +@JsonFlatten +@Fluent +public class ServerBlobAuditingPolicyInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerBlobAuditingPolicyInner.class); + + /* + * Specifies the state of the policy. If state is Enabled, storageEndpoint + * or isAzureMonitorTargetEnabled are required. + */ + @JsonProperty(value = "properties.state") + 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 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 the state property: Specifies the state of the policy. If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled are required. + * + * @return the state value. + */ + public BlobAuditingPolicyState state() { + return this.state; + } + + /** + * Set the state property: Specifies the state of the policy. If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled are required. + * + * @param state the state value to set. + * @return the ServerBlobAuditingPolicyInner object itself. + */ + public ServerBlobAuditingPolicyInner withState(BlobAuditingPolicyState state) { + this.state = state; + return this; + } + + /** + * Get the storageEndpoint property: 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 the storageEndpoint property: 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 ServerBlobAuditingPolicyInner object itself. + */ + public ServerBlobAuditingPolicyInner withStorageEndpoint(String storageEndpoint) { + this.storageEndpoint = storageEndpoint; + return this; + } + + /** + * Get the storageAccountAccessKey property: 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 the storageAccountAccessKey property: 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 ServerBlobAuditingPolicyInner object itself. + */ + public ServerBlobAuditingPolicyInner withStorageAccountAccessKey(String storageAccountAccessKey) { + this.storageAccountAccessKey = storageAccountAccessKey; + return this; + } + + /** + * Get the retentionDays property: 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 the retentionDays property: Specifies the number of days to keep in the audit logs in the storage account. + * + * @param retentionDays the retentionDays value to set. + * @return the ServerBlobAuditingPolicyInner object itself. + */ + public ServerBlobAuditingPolicyInner withRetentionDays(Integer retentionDays) { + this.retentionDays = retentionDays; + return this; + } + + /** + * Get the auditActionsAndGroups property: 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 the auditActionsAndGroups property: 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 ServerBlobAuditingPolicyInner object itself. + */ + public ServerBlobAuditingPolicyInner withAuditActionsAndGroups(List auditActionsAndGroups) { + this.auditActionsAndGroups = auditActionsAndGroups; + return this; + } + + /** + * Get the storageAccountSubscriptionId property: Specifies the blob storage subscription Id. + * + * @return the storageAccountSubscriptionId value. + */ + public UUID storageAccountSubscriptionId() { + return this.storageAccountSubscriptionId; + } + + /** + * Set the storageAccountSubscriptionId property: Specifies the blob storage subscription Id. + * + * @param storageAccountSubscriptionId the storageAccountSubscriptionId value to set. + * @return the ServerBlobAuditingPolicyInner object itself. + */ + public ServerBlobAuditingPolicyInner withStorageAccountSubscriptionId(UUID storageAccountSubscriptionId) { + this.storageAccountSubscriptionId = storageAccountSubscriptionId; + return this; + } + + /** + * Get the isStorageSecondaryKeyInUse property: Specifies whether storageAccountAccessKey value is the storage's + * secondary key. + * + * @return the isStorageSecondaryKeyInUse value. + */ + public Boolean isStorageSecondaryKeyInUse() { + return this.isStorageSecondaryKeyInUse; + } + + /** + * Set the isStorageSecondaryKeyInUse property: Specifies whether storageAccountAccessKey value is the storage's + * secondary key. + * + * @param isStorageSecondaryKeyInUse the isStorageSecondaryKeyInUse value to set. + * @return the ServerBlobAuditingPolicyInner object itself. + */ + public ServerBlobAuditingPolicyInner withIsStorageSecondaryKeyInUse(Boolean isStorageSecondaryKeyInUse) { + this.isStorageSecondaryKeyInUse = isStorageSecondaryKeyInUse; + return this; + } + + /** + * Get the isAzureMonitorTargetEnabled property: 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 the isAzureMonitorTargetEnabled property: 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 ServerBlobAuditingPolicyInner object itself. + */ + public ServerBlobAuditingPolicyInner withIsAzureMonitorTargetEnabled(Boolean isAzureMonitorTargetEnabled) { + this.isAzureMonitorTargetEnabled = isAzureMonitorTargetEnabled; + return this; + } + + /** + * Get the queueDelayMs property: 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 the queueDelayMs property: 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 ServerBlobAuditingPolicyInner object itself. + */ + public ServerBlobAuditingPolicyInner withQueueDelayMs(Integer queueDelayMs) { + this.queueDelayMs = queueDelayMs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ServerSecurityAlertPolicyInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ServerSecurityAlertPolicyInner.java new file mode 100644 index 0000000000000..55a27f5fa02df --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ServerSecurityAlertPolicyInner.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.SecurityAlertPolicyState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Workspace managed Sql server security alert policy. */ +@JsonFlatten +@Fluent +public class ServerSecurityAlertPolicyInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerSecurityAlertPolicyInner.class); + + /* + * Specifies the state of the policy, whether it is enabled or disabled or + * a policy has not been applied yet on the specific server + */ + @JsonProperty(value = "properties.state") + private SecurityAlertPolicyState state; + + /* + * Specifies an array of alerts that are disabled. Allowed values are: + * Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, + * Data_Exfiltration, Unsafe_Action + */ + @JsonProperty(value = "properties.disabledAlerts") + private List disabledAlerts; + + /* + * Specifies an array of e-mail addresses to which the alert is sent. + */ + @JsonProperty(value = "properties.emailAddresses") + private List emailAddresses; + + /* + * Specifies that the alert is sent to the account administrators. + */ + @JsonProperty(value = "properties.emailAccountAdmins") + private Boolean emailAccountAdmins; + + /* + * Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). This blob storage will hold + * all Threat Detection audit logs. + */ + @JsonProperty(value = "properties.storageEndpoint") + private String storageEndpoint; + + /* + * Specifies the identifier key of the Threat Detection audit storage + * account. + */ + @JsonProperty(value = "properties.storageAccountAccessKey") + private String storageAccountAccessKey; + + /* + * Specifies the number of days to keep in the Threat Detection audit logs. + */ + @JsonProperty(value = "properties.retentionDays") + private Integer retentionDays; + + /* + * Specifies the UTC creation time of the policy. + */ + @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationTime; + + /** + * Get the state property: Specifies the state of the policy, whether it is enabled or disabled or a policy has not + * been applied yet on the specific server. + * + * @return the state value. + */ + public SecurityAlertPolicyState state() { + return this.state; + } + + /** + * Set the state property: Specifies the state of the policy, whether it is enabled or disabled or a policy has not + * been applied yet on the specific server. + * + * @param state the state value to set. + * @return the ServerSecurityAlertPolicyInner object itself. + */ + public ServerSecurityAlertPolicyInner withState(SecurityAlertPolicyState state) { + this.state = state; + return this; + } + + /** + * Get the disabledAlerts property: Specifies an array of alerts that are disabled. Allowed values are: + * Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action. + * + * @return the disabledAlerts value. + */ + public List disabledAlerts() { + return this.disabledAlerts; + } + + /** + * Set the disabledAlerts property: Specifies an array of alerts that are disabled. Allowed values are: + * Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action. + * + * @param disabledAlerts the disabledAlerts value to set. + * @return the ServerSecurityAlertPolicyInner object itself. + */ + public ServerSecurityAlertPolicyInner withDisabledAlerts(List disabledAlerts) { + this.disabledAlerts = disabledAlerts; + return this; + } + + /** + * Get the emailAddresses property: Specifies an array of e-mail addresses to which the alert is sent. + * + * @return the emailAddresses value. + */ + public List emailAddresses() { + return this.emailAddresses; + } + + /** + * Set the emailAddresses property: Specifies an array of e-mail addresses to which the alert is sent. + * + * @param emailAddresses the emailAddresses value to set. + * @return the ServerSecurityAlertPolicyInner object itself. + */ + public ServerSecurityAlertPolicyInner withEmailAddresses(List emailAddresses) { + this.emailAddresses = emailAddresses; + return this; + } + + /** + * Get the emailAccountAdmins property: Specifies that the alert is sent to the account administrators. + * + * @return the emailAccountAdmins value. + */ + public Boolean emailAccountAdmins() { + return this.emailAccountAdmins; + } + + /** + * Set the emailAccountAdmins property: Specifies that the alert is sent to the account administrators. + * + * @param emailAccountAdmins the emailAccountAdmins value to set. + * @return the ServerSecurityAlertPolicyInner object itself. + */ + public ServerSecurityAlertPolicyInner withEmailAccountAdmins(Boolean emailAccountAdmins) { + this.emailAccountAdmins = emailAccountAdmins; + return this; + } + + /** + * Get the storageEndpoint property: Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. + * + * @return the storageEndpoint value. + */ + public String storageEndpoint() { + return this.storageEndpoint; + } + + /** + * Set the storageEndpoint property: Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. + * + * @param storageEndpoint the storageEndpoint value to set. + * @return the ServerSecurityAlertPolicyInner object itself. + */ + public ServerSecurityAlertPolicyInner withStorageEndpoint(String storageEndpoint) { + this.storageEndpoint = storageEndpoint; + return this; + } + + /** + * Get the storageAccountAccessKey property: Specifies the identifier key of the Threat Detection audit storage + * account. + * + * @return the storageAccountAccessKey value. + */ + public String storageAccountAccessKey() { + return this.storageAccountAccessKey; + } + + /** + * Set the storageAccountAccessKey property: Specifies the identifier key of the Threat Detection audit storage + * account. + * + * @param storageAccountAccessKey the storageAccountAccessKey value to set. + * @return the ServerSecurityAlertPolicyInner object itself. + */ + public ServerSecurityAlertPolicyInner withStorageAccountAccessKey(String storageAccountAccessKey) { + this.storageAccountAccessKey = storageAccountAccessKey; + return this; + } + + /** + * Get the retentionDays property: Specifies the number of days to keep in the Threat Detection audit logs. + * + * @return the retentionDays value. + */ + public Integer retentionDays() { + return this.retentionDays; + } + + /** + * Set the retentionDays property: Specifies the number of days to keep in the Threat Detection audit logs. + * + * @param retentionDays the retentionDays value to set. + * @return the ServerSecurityAlertPolicyInner object itself. + */ + public ServerSecurityAlertPolicyInner withRetentionDays(Integer retentionDays) { + this.retentionDays = retentionDays; + return this; + } + + /** + * Get the creationTime property: Specifies the UTC creation time of the policy. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.creationTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ServerUsageInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ServerUsageInner.java new file mode 100644 index 0000000000000..b0b54048526c6 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ServerUsageInner.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Represents server metrics. */ +@Immutable +public final class ServerUsageInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerUsageInner.class); + + /* + * Name of the server usage metric. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The name of the resource. + */ + @JsonProperty(value = "resourceName", access = JsonProperty.Access.WRITE_ONLY) + private String resourceName; + + /* + * The metric display name. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /* + * The current value of the metric. + */ + @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) + private Double currentValue; + + /* + * The current limit of the metric. + */ + @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) + private Double limit; + + /* + * The units of the metric. + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private String unit; + + /* + * The next reset time for the metric (ISO8601 format). + */ + @JsonProperty(value = "nextResetTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime nextResetTime; + + /** + * Get the name property: Name of the server usage metric. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the resourceName property: The name of the resource. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Get the displayName property: The metric display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the currentValue property: The current value of the metric. + * + * @return the currentValue value. + */ + public Double currentValue() { + return this.currentValue; + } + + /** + * Get the limit property: The current limit of the metric. + * + * @return the limit value. + */ + public Double limit() { + return this.limit; + } + + /** + * Get the unit property: The units of the metric. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Get the nextResetTime property: The next reset time for the metric (ISO8601 format). + * + * @return the nextResetTime value. + */ + public OffsetDateTime nextResetTime() { + return this.nextResetTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ServerVulnerabilityAssessmentInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ServerVulnerabilityAssessmentInner.java new file mode 100644 index 0000000000000..ef87b21a30960 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/ServerVulnerabilityAssessmentInner.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentRecurringScansProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A server vulnerability assessment. */ +@JsonFlatten +@Fluent +public class ServerVulnerabilityAssessmentInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerVulnerabilityAssessmentInner.class); + + /* + * A blob storage container path to hold the scan results (e.g. + * https://myStorage.blob.core.windows.net/VaScans/). + */ + @JsonProperty(value = "properties.storageContainerPath") + private String storageContainerPath; + + /* + * A shared access signature (SAS Key) that has read and write access to + * the blob container specified in 'storageContainerPath' parameter. If + * 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is + * required. + */ + @JsonProperty(value = "properties.storageContainerSasKey") + private String storageContainerSasKey; + + /* + * Specifies the identifier key of the storage account for vulnerability + * assessment scan results. If 'StorageContainerSasKey' isn't specified, + * storageAccountAccessKey is required. + */ + @JsonProperty(value = "properties.storageAccountAccessKey") + private String storageAccountAccessKey; + + /* + * The recurring scans settings + */ + @JsonProperty(value = "properties.recurringScans") + private VulnerabilityAssessmentRecurringScansProperties recurringScans; + + /** + * Get the storageContainerPath property: A blob storage container path to hold the scan results (e.g. + * https://myStorage.blob.core.windows.net/VaScans/). + * + * @return the storageContainerPath value. + */ + public String storageContainerPath() { + return this.storageContainerPath; + } + + /** + * Set the storageContainerPath property: A blob storage container path to hold the scan results (e.g. + * https://myStorage.blob.core.windows.net/VaScans/). + * + * @param storageContainerPath the storageContainerPath value to set. + * @return the ServerVulnerabilityAssessmentInner object itself. + */ + public ServerVulnerabilityAssessmentInner withStorageContainerPath(String storageContainerPath) { + this.storageContainerPath = storageContainerPath; + return this; + } + + /** + * Get the storageContainerSasKey property: A shared access signature (SAS Key) that has read and write access to + * the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, + * StorageContainerSasKey is required. + * + * @return the storageContainerSasKey value. + */ + public String storageContainerSasKey() { + return this.storageContainerSasKey; + } + + /** + * Set the storageContainerSasKey property: A shared access signature (SAS Key) that has read and write access to + * the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, + * StorageContainerSasKey is required. + * + * @param storageContainerSasKey the storageContainerSasKey value to set. + * @return the ServerVulnerabilityAssessmentInner object itself. + */ + public ServerVulnerabilityAssessmentInner withStorageContainerSasKey(String storageContainerSasKey) { + this.storageContainerSasKey = storageContainerSasKey; + return this; + } + + /** + * Get the storageAccountAccessKey property: Specifies the identifier key of the storage account for vulnerability + * assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required. + * + * @return the storageAccountAccessKey value. + */ + public String storageAccountAccessKey() { + return this.storageAccountAccessKey; + } + + /** + * Set the storageAccountAccessKey property: Specifies the identifier key of the storage account for vulnerability + * assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required. + * + * @param storageAccountAccessKey the storageAccountAccessKey value to set. + * @return the ServerVulnerabilityAssessmentInner object itself. + */ + public ServerVulnerabilityAssessmentInner withStorageAccountAccessKey(String storageAccountAccessKey) { + this.storageAccountAccessKey = storageAccountAccessKey; + return this; + } + + /** + * Get the recurringScans property: The recurring scans settings. + * + * @return the recurringScans value. + */ + public VulnerabilityAssessmentRecurringScansProperties recurringScans() { + return this.recurringScans; + } + + /** + * Set the recurringScans property: The recurring scans settings. + * + * @param recurringScans the recurringScans value to set. + * @return the ServerVulnerabilityAssessmentInner object itself. + */ + public ServerVulnerabilityAssessmentInner withRecurringScans( + VulnerabilityAssessmentRecurringScansProperties recurringScans) { + this.recurringScans = recurringScans; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (recurringScans() != null) { + recurringScans().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolBlobAuditingPolicyInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolBlobAuditingPolicyInner.java new file mode 100644 index 0000000000000..a0ed034e6f590 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolBlobAuditingPolicyInner.java @@ -0,0 +1,458 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.BlobAuditingPolicyState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.UUID; + +/** A Sql pool blob auditing policy. */ +@JsonFlatten +@Fluent +public class SqlPoolBlobAuditingPolicyInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolBlobAuditingPolicyInner.class); + + /* + * Resource kind. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private String kind; + + /* + * Specifies the state of the policy. If state is Enabled, storageEndpoint + * or isAzureMonitorTargetEnabled are required. + */ + @JsonProperty(value = "properties.state") + private BlobAuditingPolicyState state; + + /* + * Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). If state is Enabled, + * storageEndpoint 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, storageAccountAccessKey is + * required. + */ + @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 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; + + /** + * Get the kind property: Resource kind. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Get the state property: Specifies the state of the policy. If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled are required. + * + * @return the state value. + */ + public BlobAuditingPolicyState state() { + return this.state; + } + + /** + * Set the state property: Specifies the state of the policy. If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled are required. + * + * @param state the state value to set. + * @return the SqlPoolBlobAuditingPolicyInner object itself. + */ + public SqlPoolBlobAuditingPolicyInner withState(BlobAuditingPolicyState state) { + this.state = state; + return this; + } + + /** + * Get the storageEndpoint property: Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint is required. + * + * @return the storageEndpoint value. + */ + public String storageEndpoint() { + return this.storageEndpoint; + } + + /** + * Set the storageEndpoint property: Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint is required. + * + * @param storageEndpoint the storageEndpoint value to set. + * @return the SqlPoolBlobAuditingPolicyInner object itself. + */ + public SqlPoolBlobAuditingPolicyInner withStorageEndpoint(String storageEndpoint) { + this.storageEndpoint = storageEndpoint; + return this; + } + + /** + * Get the storageAccountAccessKey property: Specifies the identifier key of the auditing storage account. If state + * is Enabled and storageEndpoint is specified, storageAccountAccessKey is required. + * + * @return the storageAccountAccessKey value. + */ + public String storageAccountAccessKey() { + return this.storageAccountAccessKey; + } + + /** + * Set the storageAccountAccessKey property: Specifies the identifier key of the auditing storage account. If state + * is Enabled and storageEndpoint is specified, storageAccountAccessKey is required. + * + * @param storageAccountAccessKey the storageAccountAccessKey value to set. + * @return the SqlPoolBlobAuditingPolicyInner object itself. + */ + public SqlPoolBlobAuditingPolicyInner withStorageAccountAccessKey(String storageAccountAccessKey) { + this.storageAccountAccessKey = storageAccountAccessKey; + return this; + } + + /** + * Get the retentionDays property: 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 the retentionDays property: Specifies the number of days to keep in the audit logs in the storage account. + * + * @param retentionDays the retentionDays value to set. + * @return the SqlPoolBlobAuditingPolicyInner object itself. + */ + public SqlPoolBlobAuditingPolicyInner withRetentionDays(Integer retentionDays) { + this.retentionDays = retentionDays; + return this; + } + + /** + * Get the auditActionsAndGroups property: 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 the auditActionsAndGroups property: 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 SqlPoolBlobAuditingPolicyInner object itself. + */ + public SqlPoolBlobAuditingPolicyInner withAuditActionsAndGroups(List auditActionsAndGroups) { + this.auditActionsAndGroups = auditActionsAndGroups; + return this; + } + + /** + * Get the storageAccountSubscriptionId property: Specifies the blob storage subscription Id. + * + * @return the storageAccountSubscriptionId value. + */ + public UUID storageAccountSubscriptionId() { + return this.storageAccountSubscriptionId; + } + + /** + * Set the storageAccountSubscriptionId property: Specifies the blob storage subscription Id. + * + * @param storageAccountSubscriptionId the storageAccountSubscriptionId value to set. + * @return the SqlPoolBlobAuditingPolicyInner object itself. + */ + public SqlPoolBlobAuditingPolicyInner withStorageAccountSubscriptionId(UUID storageAccountSubscriptionId) { + this.storageAccountSubscriptionId = storageAccountSubscriptionId; + return this; + } + + /** + * Get the isStorageSecondaryKeyInUse property: Specifies whether storageAccountAccessKey value is the storage's + * secondary key. + * + * @return the isStorageSecondaryKeyInUse value. + */ + public Boolean isStorageSecondaryKeyInUse() { + return this.isStorageSecondaryKeyInUse; + } + + /** + * Set the isStorageSecondaryKeyInUse property: Specifies whether storageAccountAccessKey value is the storage's + * secondary key. + * + * @param isStorageSecondaryKeyInUse the isStorageSecondaryKeyInUse value to set. + * @return the SqlPoolBlobAuditingPolicyInner object itself. + */ + public SqlPoolBlobAuditingPolicyInner withIsStorageSecondaryKeyInUse(Boolean isStorageSecondaryKeyInUse) { + this.isStorageSecondaryKeyInUse = isStorageSecondaryKeyInUse; + return this; + } + + /** + * Get the isAzureMonitorTargetEnabled property: 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 the isAzureMonitorTargetEnabled property: 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 SqlPoolBlobAuditingPolicyInner object itself. + */ + public SqlPoolBlobAuditingPolicyInner withIsAzureMonitorTargetEnabled(Boolean isAzureMonitorTargetEnabled) { + this.isAzureMonitorTargetEnabled = isAzureMonitorTargetEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolColumnInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolColumnInner.java new file mode 100644 index 0000000000000..d73a10956ecff --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolColumnInner.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.ColumnDataType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A Sql pool column resource. */ +@JsonFlatten +@Fluent +public class SqlPoolColumnInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolColumnInner.class); + + /* + * The column data type. + */ + @JsonProperty(value = "properties.columnType") + private ColumnDataType columnType; + + /* + * Indicates whether column value is computed or not + */ + @JsonProperty(value = "properties.isComputed", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isComputed; + + /** + * Get the columnType property: The column data type. + * + * @return the columnType value. + */ + public ColumnDataType columnType() { + return this.columnType; + } + + /** + * Set the columnType property: The column data type. + * + * @param columnType the columnType value to set. + * @return the SqlPoolColumnInner object itself. + */ + public SqlPoolColumnInner withColumnType(ColumnDataType columnType) { + this.columnType = columnType; + return this; + } + + /** + * Get the isComputed property: Indicates whether column value is computed or not. + * + * @return the isComputed value. + */ + public Boolean isComputed() { + return this.isComputed; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolConnectionPolicyInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolConnectionPolicyInner.java new file mode 100644 index 0000000000000..f4c02013de79e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolConnectionPolicyInner.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A Sql pool connection policy. */ +@JsonFlatten +@Fluent +public class SqlPoolConnectionPolicyInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolConnectionPolicyInner.class); + + /* + * Resource kind. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private String kind; + + /* + * Resource location. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /* + * The state of security access. + */ + @JsonProperty(value = "properties.securityEnabledAccess") + private String securityEnabledAccess; + + /* + * The fully qualified host name of the auditing proxy. + */ + @JsonProperty(value = "properties.proxyDnsName") + private String proxyDnsName; + + /* + * The port number of the auditing proxy. + */ + @JsonProperty(value = "properties.proxyPort") + private String proxyPort; + + /* + * The visibility of the auditing proxy. + */ + @JsonProperty(value = "properties.visibility") + private String visibility; + + /* + * Whether server default is enabled or disabled. + */ + @JsonProperty(value = "properties.useServerDefault") + private String useServerDefault; + + /* + * The state of proxy redirection. + */ + @JsonProperty(value = "properties.redirectionState") + private String redirectionState; + + /* + * The connection policy state. + */ + @JsonProperty(value = "properties.state") + private String state; + + /** + * Get the kind property: Resource kind. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Get the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the securityEnabledAccess property: The state of security access. + * + * @return the securityEnabledAccess value. + */ + public String securityEnabledAccess() { + return this.securityEnabledAccess; + } + + /** + * Set the securityEnabledAccess property: The state of security access. + * + * @param securityEnabledAccess the securityEnabledAccess value to set. + * @return the SqlPoolConnectionPolicyInner object itself. + */ + public SqlPoolConnectionPolicyInner withSecurityEnabledAccess(String securityEnabledAccess) { + this.securityEnabledAccess = securityEnabledAccess; + return this; + } + + /** + * Get the proxyDnsName property: The fully qualified host name of the auditing proxy. + * + * @return the proxyDnsName value. + */ + public String proxyDnsName() { + return this.proxyDnsName; + } + + /** + * Set the proxyDnsName property: The fully qualified host name of the auditing proxy. + * + * @param proxyDnsName the proxyDnsName value to set. + * @return the SqlPoolConnectionPolicyInner object itself. + */ + public SqlPoolConnectionPolicyInner withProxyDnsName(String proxyDnsName) { + this.proxyDnsName = proxyDnsName; + return this; + } + + /** + * Get the proxyPort property: The port number of the auditing proxy. + * + * @return the proxyPort value. + */ + public String proxyPort() { + return this.proxyPort; + } + + /** + * Set the proxyPort property: The port number of the auditing proxy. + * + * @param proxyPort the proxyPort value to set. + * @return the SqlPoolConnectionPolicyInner object itself. + */ + public SqlPoolConnectionPolicyInner withProxyPort(String proxyPort) { + this.proxyPort = proxyPort; + return this; + } + + /** + * Get the visibility property: The visibility of the auditing proxy. + * + * @return the visibility value. + */ + public String visibility() { + return this.visibility; + } + + /** + * Set the visibility property: The visibility of the auditing proxy. + * + * @param visibility the visibility value to set. + * @return the SqlPoolConnectionPolicyInner object itself. + */ + public SqlPoolConnectionPolicyInner withVisibility(String visibility) { + this.visibility = visibility; + return this; + } + + /** + * Get the useServerDefault property: Whether server default is enabled or disabled. + * + * @return the useServerDefault value. + */ + public String useServerDefault() { + return this.useServerDefault; + } + + /** + * Set the useServerDefault property: Whether server default is enabled or disabled. + * + * @param useServerDefault the useServerDefault value to set. + * @return the SqlPoolConnectionPolicyInner object itself. + */ + public SqlPoolConnectionPolicyInner withUseServerDefault(String useServerDefault) { + this.useServerDefault = useServerDefault; + return this; + } + + /** + * Get the redirectionState property: The state of proxy redirection. + * + * @return the redirectionState value. + */ + public String redirectionState() { + return this.redirectionState; + } + + /** + * Set the redirectionState property: The state of proxy redirection. + * + * @param redirectionState the redirectionState value to set. + * @return the SqlPoolConnectionPolicyInner object itself. + */ + public SqlPoolConnectionPolicyInner withRedirectionState(String redirectionState) { + this.redirectionState = redirectionState; + return this; + } + + /** + * Get the state property: The connection policy state. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Set the state property: The connection policy state. + * + * @param state the state value to set. + * @return the SqlPoolConnectionPolicyInner object itself. + */ + public SqlPoolConnectionPolicyInner withState(String state) { + this.state = state; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolInner.java new file mode 100644 index 0000000000000..5b32c9704607a --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolInner.java @@ -0,0 +1,334 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.Sku; +import com.azure.resourcemanager.synapse.models.StorageAccountType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** A SQL Analytics pool. */ +@JsonFlatten +@Fluent +public class SqlPoolInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolInner.class); + + /* + * SQL pool SKU + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * Maximum size in bytes + */ + @JsonProperty(value = "properties.maxSizeBytes") + private Long maxSizeBytes; + + /* + * Collation mode + */ + @JsonProperty(value = "properties.collation") + private String collation; + + /* + * Source database to create from + */ + @JsonProperty(value = "properties.sourceDatabaseId") + private String sourceDatabaseId; + + /* + * Backup database to restore from + */ + @JsonProperty(value = "properties.recoverableDatabaseId") + private String recoverableDatabaseId; + + /* + * Resource state + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /* + * Resource status + */ + @JsonProperty(value = "properties.status") + private String status; + + /* + * Snapshot time to restore + */ + @JsonProperty(value = "properties.restorePointInTime") + private String restorePointInTime; + + /* + * What is this? + */ + @JsonProperty(value = "properties.createMode") + private String createMode; + + /* + * Date the SQL pool was created + */ + @JsonProperty(value = "properties.creationDate") + private OffsetDateTime creationDate; + + /* + * The storage account type used to store backups for this sql pool. + */ + @JsonProperty(value = "properties.storageAccountType") + private StorageAccountType storageAccountType; + + /** + * Get the sku property: SQL pool SKU. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: SQL pool SKU. + * + * @param sku the sku value to set. + * @return the SqlPoolInner object itself. + */ + public SqlPoolInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the maxSizeBytes property: Maximum size in bytes. + * + * @return the maxSizeBytes value. + */ + public Long maxSizeBytes() { + return this.maxSizeBytes; + } + + /** + * Set the maxSizeBytes property: Maximum size in bytes. + * + * @param maxSizeBytes the maxSizeBytes value to set. + * @return the SqlPoolInner object itself. + */ + public SqlPoolInner withMaxSizeBytes(Long maxSizeBytes) { + this.maxSizeBytes = maxSizeBytes; + return this; + } + + /** + * Get the collation property: Collation mode. + * + * @return the collation value. + */ + public String collation() { + return this.collation; + } + + /** + * Set the collation property: Collation mode. + * + * @param collation the collation value to set. + * @return the SqlPoolInner object itself. + */ + public SqlPoolInner withCollation(String collation) { + this.collation = collation; + return this; + } + + /** + * Get the sourceDatabaseId property: Source database to create from. + * + * @return the sourceDatabaseId value. + */ + public String sourceDatabaseId() { + return this.sourceDatabaseId; + } + + /** + * Set the sourceDatabaseId property: Source database to create from. + * + * @param sourceDatabaseId the sourceDatabaseId value to set. + * @return the SqlPoolInner object itself. + */ + public SqlPoolInner withSourceDatabaseId(String sourceDatabaseId) { + this.sourceDatabaseId = sourceDatabaseId; + return this; + } + + /** + * Get the recoverableDatabaseId property: Backup database to restore from. + * + * @return the recoverableDatabaseId value. + */ + public String recoverableDatabaseId() { + return this.recoverableDatabaseId; + } + + /** + * Set the recoverableDatabaseId property: Backup database to restore from. + * + * @param recoverableDatabaseId the recoverableDatabaseId value to set. + * @return the SqlPoolInner object itself. + */ + public SqlPoolInner withRecoverableDatabaseId(String recoverableDatabaseId) { + this.recoverableDatabaseId = recoverableDatabaseId; + return this; + } + + /** + * Get the provisioningState property: Resource state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: Resource state. + * + * @param provisioningState the provisioningState value to set. + * @return the SqlPoolInner object itself. + */ + public SqlPoolInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the status property: Resource status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Resource status. + * + * @param status the status value to set. + * @return the SqlPoolInner object itself. + */ + public SqlPoolInner withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the restorePointInTime property: Snapshot time to restore. + * + * @return the restorePointInTime value. + */ + public String restorePointInTime() { + return this.restorePointInTime; + } + + /** + * Set the restorePointInTime property: Snapshot time to restore. + * + * @param restorePointInTime the restorePointInTime value to set. + * @return the SqlPoolInner object itself. + */ + public SqlPoolInner withRestorePointInTime(String restorePointInTime) { + this.restorePointInTime = restorePointInTime; + return this; + } + + /** + * Get the createMode property: What is this?. + * + * @return the createMode value. + */ + public String createMode() { + return this.createMode; + } + + /** + * Set the createMode property: What is this?. + * + * @param createMode the createMode value to set. + * @return the SqlPoolInner object itself. + */ + public SqlPoolInner withCreateMode(String createMode) { + this.createMode = createMode; + return this; + } + + /** + * Get the creationDate property: Date the SQL pool was created. + * + * @return the creationDate value. + */ + public OffsetDateTime creationDate() { + return this.creationDate; + } + + /** + * Set the creationDate property: Date the SQL pool was created. + * + * @param creationDate the creationDate value to set. + * @return the SqlPoolInner object itself. + */ + public SqlPoolInner withCreationDate(OffsetDateTime creationDate) { + this.creationDate = creationDate; + return this; + } + + /** + * Get the storageAccountType property: The storage account type used to store backups for this sql pool. + * + * @return the storageAccountType value. + */ + public StorageAccountType storageAccountType() { + return this.storageAccountType; + } + + /** + * Set the storageAccountType property: The storage account type used to store backups for this sql pool. + * + * @param storageAccountType the storageAccountType value to set. + * @return the SqlPoolInner object itself. + */ + public SqlPoolInner withStorageAccountType(StorageAccountType storageAccountType) { + this.storageAccountType = storageAccountType; + return this; + } + + /** {@inheritDoc} */ + @Override + public SqlPoolInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SqlPoolInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolOperationInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolOperationInner.java new file mode 100644 index 0000000000000..e585596b33806 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolOperationInner.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.ManagementOperationState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** A Sql pool operation. */ +@JsonFlatten +@Immutable +public class SqlPoolOperationInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolOperationInner.class); + + /* + * The name of the Sql pool the operation is being performed on. + */ + @JsonProperty(value = "properties.databaseName", access = JsonProperty.Access.WRITE_ONLY) + private String databaseName; + + /* + * The name of operation. + */ + @JsonProperty(value = "properties.operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /* + * The friendly name of operation. + */ + @JsonProperty(value = "properties.operationFriendlyName", access = JsonProperty.Access.WRITE_ONLY) + private String operationFriendlyName; + + /* + * The percentage of the operation completed. + */ + @JsonProperty(value = "properties.percentComplete", access = JsonProperty.Access.WRITE_ONLY) + private Integer percentComplete; + + /* + * The name of the server. + */ + @JsonProperty(value = "properties.serverName", access = JsonProperty.Access.WRITE_ONLY) + private String serverName; + + /* + * The operation start time. + */ + @JsonProperty(value = "properties.startTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTime; + + /* + * The operation state. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private ManagementOperationState state; + + /* + * The operation error code. + */ + @JsonProperty(value = "properties.errorCode", access = JsonProperty.Access.WRITE_ONLY) + private Integer errorCode; + + /* + * The operation error description. + */ + @JsonProperty(value = "properties.errorDescription", access = JsonProperty.Access.WRITE_ONLY) + private String errorDescription; + + /* + * The operation error severity. + */ + @JsonProperty(value = "properties.errorSeverity", access = JsonProperty.Access.WRITE_ONLY) + private Integer errorSeverity; + + /* + * Whether or not the error is a user error. + */ + @JsonProperty(value = "properties.isUserError", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isUserError; + + /* + * The estimated completion time of the operation. + */ + @JsonProperty(value = "properties.estimatedCompletionTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime estimatedCompletionTime; + + /* + * The operation description. + */ + @JsonProperty(value = "properties.description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * Whether the operation can be cancelled. + */ + @JsonProperty(value = "properties.isCancellable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isCancellable; + + /** + * Get the databaseName property: The name of the Sql pool the operation is being performed on. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Get the operation property: The name of operation. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the operationFriendlyName property: The friendly name of operation. + * + * @return the operationFriendlyName value. + */ + public String operationFriendlyName() { + return this.operationFriendlyName; + } + + /** + * Get the percentComplete property: The percentage of the operation completed. + * + * @return the percentComplete value. + */ + public Integer percentComplete() { + return this.percentComplete; + } + + /** + * Get the serverName property: The name of the server. + * + * @return the serverName value. + */ + public String serverName() { + return this.serverName; + } + + /** + * Get the startTime property: The operation start time. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the state property: The operation state. + * + * @return the state value. + */ + public ManagementOperationState state() { + return this.state; + } + + /** + * Get the errorCode property: The operation error code. + * + * @return the errorCode value. + */ + public Integer errorCode() { + return this.errorCode; + } + + /** + * Get the errorDescription property: The operation error description. + * + * @return the errorDescription value. + */ + public String errorDescription() { + return this.errorDescription; + } + + /** + * Get the errorSeverity property: The operation error severity. + * + * @return the errorSeverity value. + */ + public Integer errorSeverity() { + return this.errorSeverity; + } + + /** + * Get the isUserError property: Whether or not the error is a user error. + * + * @return the isUserError value. + */ + public Boolean isUserError() { + return this.isUserError; + } + + /** + * Get the estimatedCompletionTime property: The estimated completion time of the operation. + * + * @return the estimatedCompletionTime value. + */ + public OffsetDateTime estimatedCompletionTime() { + return this.estimatedCompletionTime; + } + + /** + * Get the description property: The operation description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the isCancellable property: Whether the operation can be cancelled. + * + * @return the isCancellable value. + */ + public Boolean isCancellable() { + return this.isCancellable; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolSecurityAlertPolicyInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolSecurityAlertPolicyInner.java new file mode 100644 index 0000000000000..26d8f63e1b38b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolSecurityAlertPolicyInner.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.SecurityAlertPolicyState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** A Sql pool security alert policy. */ +@JsonFlatten +@Fluent +public class SqlPoolSecurityAlertPolicyInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolSecurityAlertPolicyInner.class); + + /* + * Specifies the state of the policy, whether it is enabled or disabled or + * a policy has not been applied yet on the specific Sql pool. + */ + @JsonProperty(value = "properties.state") + private SecurityAlertPolicyState state; + + /* + * Specifies an array of alerts that are disabled. Allowed values are: + * Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, + * Data_Exfiltration, Unsafe_Action + */ + @JsonProperty(value = "properties.disabledAlerts") + private List disabledAlerts; + + /* + * Specifies an array of e-mail addresses to which the alert is sent. + */ + @JsonProperty(value = "properties.emailAddresses") + private List emailAddresses; + + /* + * Specifies that the alert is sent to the account administrators. + */ + @JsonProperty(value = "properties.emailAccountAdmins") + private Boolean emailAccountAdmins; + + /* + * Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). This blob storage will hold + * all Threat Detection audit logs. + */ + @JsonProperty(value = "properties.storageEndpoint") + private String storageEndpoint; + + /* + * Specifies the identifier key of the Threat Detection audit storage + * account. + */ + @JsonProperty(value = "properties.storageAccountAccessKey") + private String storageAccountAccessKey; + + /* + * Specifies the number of days to keep in the Threat Detection audit logs. + */ + @JsonProperty(value = "properties.retentionDays") + private Integer retentionDays; + + /* + * Specifies the UTC creation time of the policy. + */ + @JsonProperty(value = "properties.creationTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime creationTime; + + /** + * Get the state property: Specifies the state of the policy, whether it is enabled or disabled or a policy has not + * been applied yet on the specific Sql pool. + * + * @return the state value. + */ + public SecurityAlertPolicyState state() { + return this.state; + } + + /** + * Set the state property: Specifies the state of the policy, whether it is enabled or disabled or a policy has not + * been applied yet on the specific Sql pool. + * + * @param state the state value to set. + * @return the SqlPoolSecurityAlertPolicyInner object itself. + */ + public SqlPoolSecurityAlertPolicyInner withState(SecurityAlertPolicyState state) { + this.state = state; + return this; + } + + /** + * Get the disabledAlerts property: Specifies an array of alerts that are disabled. Allowed values are: + * Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action. + * + * @return the disabledAlerts value. + */ + public List disabledAlerts() { + return this.disabledAlerts; + } + + /** + * Set the disabledAlerts property: Specifies an array of alerts that are disabled. Allowed values are: + * Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action. + * + * @param disabledAlerts the disabledAlerts value to set. + * @return the SqlPoolSecurityAlertPolicyInner object itself. + */ + public SqlPoolSecurityAlertPolicyInner withDisabledAlerts(List disabledAlerts) { + this.disabledAlerts = disabledAlerts; + return this; + } + + /** + * Get the emailAddresses property: Specifies an array of e-mail addresses to which the alert is sent. + * + * @return the emailAddresses value. + */ + public List emailAddresses() { + return this.emailAddresses; + } + + /** + * Set the emailAddresses property: Specifies an array of e-mail addresses to which the alert is sent. + * + * @param emailAddresses the emailAddresses value to set. + * @return the SqlPoolSecurityAlertPolicyInner object itself. + */ + public SqlPoolSecurityAlertPolicyInner withEmailAddresses(List emailAddresses) { + this.emailAddresses = emailAddresses; + return this; + } + + /** + * Get the emailAccountAdmins property: Specifies that the alert is sent to the account administrators. + * + * @return the emailAccountAdmins value. + */ + public Boolean emailAccountAdmins() { + return this.emailAccountAdmins; + } + + /** + * Set the emailAccountAdmins property: Specifies that the alert is sent to the account administrators. + * + * @param emailAccountAdmins the emailAccountAdmins value to set. + * @return the SqlPoolSecurityAlertPolicyInner object itself. + */ + public SqlPoolSecurityAlertPolicyInner withEmailAccountAdmins(Boolean emailAccountAdmins) { + this.emailAccountAdmins = emailAccountAdmins; + return this; + } + + /** + * Get the storageEndpoint property: Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. + * + * @return the storageEndpoint value. + */ + public String storageEndpoint() { + return this.storageEndpoint; + } + + /** + * Set the storageEndpoint property: Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. + * + * @param storageEndpoint the storageEndpoint value to set. + * @return the SqlPoolSecurityAlertPolicyInner object itself. + */ + public SqlPoolSecurityAlertPolicyInner withStorageEndpoint(String storageEndpoint) { + this.storageEndpoint = storageEndpoint; + return this; + } + + /** + * Get the storageAccountAccessKey property: Specifies the identifier key of the Threat Detection audit storage + * account. + * + * @return the storageAccountAccessKey value. + */ + public String storageAccountAccessKey() { + return this.storageAccountAccessKey; + } + + /** + * Set the storageAccountAccessKey property: Specifies the identifier key of the Threat Detection audit storage + * account. + * + * @param storageAccountAccessKey the storageAccountAccessKey value to set. + * @return the SqlPoolSecurityAlertPolicyInner object itself. + */ + public SqlPoolSecurityAlertPolicyInner withStorageAccountAccessKey(String storageAccountAccessKey) { + this.storageAccountAccessKey = storageAccountAccessKey; + return this; + } + + /** + * Get the retentionDays property: Specifies the number of days to keep in the Threat Detection audit logs. + * + * @return the retentionDays value. + */ + public Integer retentionDays() { + return this.retentionDays; + } + + /** + * Set the retentionDays property: Specifies the number of days to keep in the Threat Detection audit logs. + * + * @param retentionDays the retentionDays value to set. + * @return the SqlPoolSecurityAlertPolicyInner object itself. + */ + public SqlPoolSecurityAlertPolicyInner withRetentionDays(Integer retentionDays) { + this.retentionDays = retentionDays; + return this; + } + + /** + * Get the creationTime property: Specifies the UTC creation time of the policy. + * + * @return the creationTime value. + */ + public OffsetDateTime creationTime() { + return this.creationTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolUsageInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolUsageInner.java new file mode 100644 index 0000000000000..3479ef2dbe173 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolUsageInner.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The Sql pool usages. */ +@Immutable +public final class SqlPoolUsageInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolUsageInner.class); + + /* + * The name of the usage metric. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The name of the resource. + */ + @JsonProperty(value = "resourceName", access = JsonProperty.Access.WRITE_ONLY) + private String resourceName; + + /* + * The usage metric display name. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /* + * The current value of the usage metric. + */ + @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) + private Double currentValue; + + /* + * The current limit of the usage metric. + */ + @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) + private Double limit; + + /* + * The units of the usage metric. + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private String unit; + + /* + * The next reset time for the usage metric (ISO8601 format). + */ + @JsonProperty(value = "nextResetTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime nextResetTime; + + /** + * Get the name property: The name of the usage metric. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the resourceName property: The name of the resource. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Get the displayName property: The usage metric display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the currentValue property: The current value of the usage metric. + * + * @return the currentValue value. + */ + public Double currentValue() { + return this.currentValue; + } + + /** + * Get the limit property: The current limit of the usage metric. + * + * @return the limit value. + */ + public Double limit() { + return this.limit; + } + + /** + * Get the unit property: The units of the usage metric. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Get the nextResetTime property: The next reset time for the usage metric (ISO8601 format). + * + * @return the nextResetTime value. + */ + public OffsetDateTime nextResetTime() { + return this.nextResetTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolVulnerabilityAssessmentInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolVulnerabilityAssessmentInner.java new file mode 100644 index 0000000000000..f2d62658833a1 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolVulnerabilityAssessmentInner.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentRecurringScansProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A Sql pool vulnerability assessment. */ +@JsonFlatten +@Fluent +public class SqlPoolVulnerabilityAssessmentInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolVulnerabilityAssessmentInner.class); + + /* + * A blob storage container path to hold the scan results (e.g. + * https://myStorage.blob.core.windows.net/VaScans/). It is required if + * server level vulnerability assessment policy doesn't set + */ + @JsonProperty(value = "properties.storageContainerPath") + private String storageContainerPath; + + /* + * A shared access signature (SAS Key) that has write access to the blob + * container specified in 'storageContainerPath' parameter. If + * 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is + * required. + */ + @JsonProperty(value = "properties.storageContainerSasKey") + private String storageContainerSasKey; + + /* + * Specifies the identifier key of the storage account for vulnerability + * assessment scan results. If 'StorageContainerSasKey' isn't specified, + * storageAccountAccessKey is required. + */ + @JsonProperty(value = "properties.storageAccountAccessKey") + private String storageAccountAccessKey; + + /* + * The recurring scans settings + */ + @JsonProperty(value = "properties.recurringScans") + private VulnerabilityAssessmentRecurringScansProperties recurringScans; + + /** + * Get the storageContainerPath property: A blob storage container path to hold the scan results (e.g. + * https://myStorage.blob.core.windows.net/VaScans/). It is required if server level vulnerability assessment policy + * doesn't set. + * + * @return the storageContainerPath value. + */ + public String storageContainerPath() { + return this.storageContainerPath; + } + + /** + * Set the storageContainerPath property: A blob storage container path to hold the scan results (e.g. + * https://myStorage.blob.core.windows.net/VaScans/). It is required if server level vulnerability assessment policy + * doesn't set. + * + * @param storageContainerPath the storageContainerPath value to set. + * @return the SqlPoolVulnerabilityAssessmentInner object itself. + */ + public SqlPoolVulnerabilityAssessmentInner withStorageContainerPath(String storageContainerPath) { + this.storageContainerPath = storageContainerPath; + return this; + } + + /** + * Get the storageContainerSasKey property: A shared access signature (SAS Key) that has write access to the blob + * container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, + * StorageContainerSasKey is required. + * + * @return the storageContainerSasKey value. + */ + public String storageContainerSasKey() { + return this.storageContainerSasKey; + } + + /** + * Set the storageContainerSasKey property: A shared access signature (SAS Key) that has write access to the blob + * container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, + * StorageContainerSasKey is required. + * + * @param storageContainerSasKey the storageContainerSasKey value to set. + * @return the SqlPoolVulnerabilityAssessmentInner object itself. + */ + public SqlPoolVulnerabilityAssessmentInner withStorageContainerSasKey(String storageContainerSasKey) { + this.storageContainerSasKey = storageContainerSasKey; + return this; + } + + /** + * Get the storageAccountAccessKey property: Specifies the identifier key of the storage account for vulnerability + * assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required. + * + * @return the storageAccountAccessKey value. + */ + public String storageAccountAccessKey() { + return this.storageAccountAccessKey; + } + + /** + * Set the storageAccountAccessKey property: Specifies the identifier key of the storage account for vulnerability + * assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required. + * + * @param storageAccountAccessKey the storageAccountAccessKey value to set. + * @return the SqlPoolVulnerabilityAssessmentInner object itself. + */ + public SqlPoolVulnerabilityAssessmentInner withStorageAccountAccessKey(String storageAccountAccessKey) { + this.storageAccountAccessKey = storageAccountAccessKey; + return this; + } + + /** + * Get the recurringScans property: The recurring scans settings. + * + * @return the recurringScans value. + */ + public VulnerabilityAssessmentRecurringScansProperties recurringScans() { + return this.recurringScans; + } + + /** + * Set the recurringScans property: The recurring scans settings. + * + * @param recurringScans the recurringScans value to set. + * @return the SqlPoolVulnerabilityAssessmentInner object itself. + */ + public SqlPoolVulnerabilityAssessmentInner withRecurringScans( + VulnerabilityAssessmentRecurringScansProperties recurringScans) { + this.recurringScans = recurringScans; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (recurringScans() != null) { + recurringScans().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolVulnerabilityAssessmentRuleBaselineInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolVulnerabilityAssessmentRuleBaselineInner.java new file mode 100644 index 0000000000000..25201498e11a2 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolVulnerabilityAssessmentRuleBaselineInner.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.SqlPoolVulnerabilityAssessmentRuleBaselineItem; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A Sql pool vulnerability assessment rule baseline. */ +@JsonFlatten +@Fluent +public class SqlPoolVulnerabilityAssessmentRuleBaselineInner extends ProxyResource { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(SqlPoolVulnerabilityAssessmentRuleBaselineInner.class); + + /* + * The rule baseline result + */ + @JsonProperty(value = "properties.baselineResults") + private List baselineResults; + + /** + * Get the baselineResults property: The rule baseline result. + * + * @return the baselineResults value. + */ + public List baselineResults() { + return this.baselineResults; + } + + /** + * Set the baselineResults property: The rule baseline result. + * + * @param baselineResults the baselineResults value to set. + * @return the SqlPoolVulnerabilityAssessmentRuleBaselineInner object itself. + */ + public SqlPoolVulnerabilityAssessmentRuleBaselineInner withBaselineResults( + List baselineResults) { + this.baselineResults = baselineResults; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (baselineResults() != null) { + baselineResults().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolVulnerabilityAssessmentScansExportInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolVulnerabilityAssessmentScansExportInner.java new file mode 100644 index 0000000000000..31b5b84d7fc32 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SqlPoolVulnerabilityAssessmentScansExportInner.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A Sql pool Vulnerability Assessment scan export resource. */ +@JsonFlatten +@Immutable +public class SqlPoolVulnerabilityAssessmentScansExportInner extends ProxyResource { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(SqlPoolVulnerabilityAssessmentScansExportInner.class); + + /* + * Location of the exported report (e.g. + * https://myStorage.blob.core.windows.net/VaScans/scans/serverName/databaseName/scan_scanId.xlsx). + */ + @JsonProperty(value = "properties.exportedReportLocation", access = JsonProperty.Access.WRITE_ONLY) + private String exportedReportLocation; + + /** + * Get the exportedReportLocation property: Location of the exported report (e.g. + * https://myStorage.blob.core.windows.net/VaScans/scans/serverName/databaseName/scan_scanId.xlsx). + * + * @return the exportedReportLocation value. + */ + public String exportedReportLocation() { + return this.exportedReportLocation; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SsisObjectMetadataListResponseInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SsisObjectMetadataListResponseInner.java new file mode 100644 index 0000000000000..f083625e6bbff --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SsisObjectMetadataListResponseInner.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.SsisObjectMetadata; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of SSIS object metadata. */ +@Fluent +public final class SsisObjectMetadataListResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SsisObjectMetadataListResponseInner.class); + + /* + * List of SSIS object metadata. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The link to the next page of results, if any remaining results exist. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of SSIS object metadata. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of SSIS object metadata. + * + * @param value the value value to set. + * @return the SsisObjectMetadataListResponseInner object itself. + */ + public SsisObjectMetadataListResponseInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of results, if any remaining results exist. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of results, if any remaining results exist. + * + * @param nextLink the nextLink value to set. + * @return the SsisObjectMetadataListResponseInner object itself. + */ + public SsisObjectMetadataListResponseInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SsisObjectMetadataStatusResponseInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SsisObjectMetadataStatusResponseInner.java new file mode 100644 index 0000000000000..3e888f71eff27 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/SsisObjectMetadataStatusResponseInner.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The status of the operation. */ +@Fluent +public final class SsisObjectMetadataStatusResponseInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SsisObjectMetadataStatusResponseInner.class); + + /* + * The status of the operation. + */ + @JsonProperty(value = "status") + private String status; + + /* + * The operation name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The operation properties. + */ + @JsonProperty(value = "properties") + private String properties; + + /* + * The operation error message. + */ + @JsonProperty(value = "error") + private String error; + + /** + * Get the status property: The status of the operation. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: The status of the operation. + * + * @param status the status value to set. + * @return the SsisObjectMetadataStatusResponseInner object itself. + */ + public SsisObjectMetadataStatusResponseInner withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the name property: The operation name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The operation name. + * + * @param name the name value to set. + * @return the SsisObjectMetadataStatusResponseInner object itself. + */ + public SsisObjectMetadataStatusResponseInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the properties property: The operation properties. + * + * @return the properties value. + */ + public String properties() { + return this.properties; + } + + /** + * Set the properties property: The operation properties. + * + * @param properties the properties value to set. + * @return the SsisObjectMetadataStatusResponseInner object itself. + */ + public SsisObjectMetadataStatusResponseInner withProperties(String properties) { + this.properties = properties; + return this; + } + + /** + * Get the error property: The operation error message. + * + * @return the error value. + */ + public String error() { + return this.error; + } + + /** + * Set the error property: The operation error message. + * + * @param error the error value to set. + * @return the SsisObjectMetadataStatusResponseInner object itself. + */ + public SsisObjectMetadataStatusResponseInner withError(String error) { + this.error = error; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/TransparentDataEncryptionInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/TransparentDataEncryptionInner.java new file mode 100644 index 0000000000000..a69a5b5536166 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/TransparentDataEncryptionInner.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.TransparentDataEncryptionStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Represents a Sql pool transparent data encryption configuration. */ +@JsonFlatten +@Fluent +public class TransparentDataEncryptionInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TransparentDataEncryptionInner.class); + + /* + * Resource location. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /* + * The status of the database transparent data encryption. + */ + @JsonProperty(value = "properties.status") + private TransparentDataEncryptionStatus status; + + /** + * Get the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the status property: The status of the database transparent data encryption. + * + * @return the status value. + */ + public TransparentDataEncryptionStatus status() { + return this.status; + } + + /** + * Set the status property: The status of the database transparent data encryption. + * + * @param status the status value to set. + * @return the TransparentDataEncryptionInner object itself. + */ + public TransparentDataEncryptionInner withStatus(TransparentDataEncryptionStatus status) { + this.status = status; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/VulnerabilityAssessmentScanRecordInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/VulnerabilityAssessmentScanRecordInner.java new file mode 100644 index 0000000000000..0a395ea3d9ec8 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/VulnerabilityAssessmentScanRecordInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentScanError; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentScanState; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentScanTriggerType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** A vulnerability assessment scan record. */ +@JsonFlatten +@Immutable +public class VulnerabilityAssessmentScanRecordInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VulnerabilityAssessmentScanRecordInner.class); + + /* + * The scan ID. + */ + @JsonProperty(value = "properties.scanId", access = JsonProperty.Access.WRITE_ONLY) + private String scanId; + + /* + * The scan trigger type. + */ + @JsonProperty(value = "properties.triggerType", access = JsonProperty.Access.WRITE_ONLY) + private VulnerabilityAssessmentScanTriggerType triggerType; + + /* + * The scan status. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private VulnerabilityAssessmentScanState state; + + /* + * The scan start time (UTC). + */ + @JsonProperty(value = "properties.startTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTime; + + /* + * The scan end time (UTC). + */ + @JsonProperty(value = "properties.endTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime endTime; + + /* + * The scan errors. + */ + @JsonProperty(value = "properties.errors", access = JsonProperty.Access.WRITE_ONLY) + private List errors; + + /* + * The scan results storage container path. + */ + @JsonProperty(value = "properties.storageContainerPath", access = JsonProperty.Access.WRITE_ONLY) + private String storageContainerPath; + + /* + * The number of failed security checks. + */ + @JsonProperty(value = "properties.numberOfFailedSecurityChecks", access = JsonProperty.Access.WRITE_ONLY) + private Integer numberOfFailedSecurityChecks; + + /** + * Get the scanId property: The scan ID. + * + * @return the scanId value. + */ + public String scanId() { + return this.scanId; + } + + /** + * Get the triggerType property: The scan trigger type. + * + * @return the triggerType value. + */ + public VulnerabilityAssessmentScanTriggerType triggerType() { + return this.triggerType; + } + + /** + * Get the state property: The scan status. + * + * @return the state value. + */ + public VulnerabilityAssessmentScanState state() { + return this.state; + } + + /** + * Get the startTime property: The scan start time (UTC). + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: The scan end time (UTC). + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Get the errors property: The scan errors. + * + * @return the errors value. + */ + public List errors() { + return this.errors; + } + + /** + * Get the storageContainerPath property: The scan results storage container path. + * + * @return the storageContainerPath value. + */ + public String storageContainerPath() { + return this.storageContainerPath; + } + + /** + * Get the numberOfFailedSecurityChecks property: The number of failed security checks. + * + * @return the numberOfFailedSecurityChecks value. + */ + public Integer numberOfFailedSecurityChecks() { + return this.numberOfFailedSecurityChecks; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (errors() != null) { + errors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/WorkloadClassifierInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/WorkloadClassifierInner.java new file mode 100644 index 0000000000000..8aca81dcf0b3b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/WorkloadClassifierInner.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Workload classifier operations for a data warehouse. */ +@JsonFlatten +@Fluent +public class WorkloadClassifierInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadClassifierInner.class); + + /* + * The workload classifier member name. + */ + @JsonProperty(value = "properties.memberName") + private String memberName; + + /* + * The workload classifier label. + */ + @JsonProperty(value = "properties.label") + private String label; + + /* + * The workload classifier context. + */ + @JsonProperty(value = "properties.context") + private String context; + + /* + * The workload classifier start time for classification. + */ + @JsonProperty(value = "properties.startTime") + private String startTime; + + /* + * The workload classifier end time for classification. + */ + @JsonProperty(value = "properties.endTime") + private String endTime; + + /* + * The workload classifier importance. + */ + @JsonProperty(value = "properties.importance") + private String importance; + + /** + * Get the memberName property: The workload classifier member name. + * + * @return the memberName value. + */ + public String memberName() { + return this.memberName; + } + + /** + * Set the memberName property: The workload classifier member name. + * + * @param memberName the memberName value to set. + * @return the WorkloadClassifierInner object itself. + */ + public WorkloadClassifierInner withMemberName(String memberName) { + this.memberName = memberName; + return this; + } + + /** + * Get the label property: The workload classifier label. + * + * @return the label value. + */ + public String label() { + return this.label; + } + + /** + * Set the label property: The workload classifier label. + * + * @param label the label value to set. + * @return the WorkloadClassifierInner object itself. + */ + public WorkloadClassifierInner withLabel(String label) { + this.label = label; + return this; + } + + /** + * Get the context property: The workload classifier context. + * + * @return the context value. + */ + public String context() { + return this.context; + } + + /** + * Set the context property: The workload classifier context. + * + * @param context the context value to set. + * @return the WorkloadClassifierInner object itself. + */ + public WorkloadClassifierInner withContext(String context) { + this.context = context; + return this; + } + + /** + * Get the startTime property: The workload classifier start time for classification. + * + * @return the startTime value. + */ + public String startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The workload classifier start time for classification. + * + * @param startTime the startTime value to set. + * @return the WorkloadClassifierInner object itself. + */ + public WorkloadClassifierInner withStartTime(String startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The workload classifier end time for classification. + * + * @return the endTime value. + */ + public String endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The workload classifier end time for classification. + * + * @param endTime the endTime value to set. + * @return the WorkloadClassifierInner object itself. + */ + public WorkloadClassifierInner withEndTime(String endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the importance property: The workload classifier importance. + * + * @return the importance value. + */ + public String importance() { + return this.importance; + } + + /** + * Set the importance property: The workload classifier importance. + * + * @param importance the importance value to set. + * @return the WorkloadClassifierInner object itself. + */ + public WorkloadClassifierInner withImportance(String importance) { + this.importance = importance; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/WorkloadGroupInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/WorkloadGroupInner.java new file mode 100644 index 0000000000000..899ef45caadbe --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/WorkloadGroupInner.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Workload group operations for a sql pool. */ +@JsonFlatten +@Fluent +public class WorkloadGroupInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadGroupInner.class); + + /* + * The workload group minimum percentage resource. + */ + @JsonProperty(value = "properties.minResourcePercent") + private Integer minResourcePercent; + + /* + * The workload group cap percentage resource. + */ + @JsonProperty(value = "properties.maxResourcePercent") + private Integer maxResourcePercent; + + /* + * The workload group request minimum grant percentage. + */ + @JsonProperty(value = "properties.minResourcePercentPerRequest") + private Double minResourcePercentPerRequest; + + /* + * The workload group request maximum grant percentage. + */ + @JsonProperty(value = "properties.maxResourcePercentPerRequest") + private Double maxResourcePercentPerRequest; + + /* + * The workload group importance level. + */ + @JsonProperty(value = "properties.importance") + private String importance; + + /* + * The workload group query execution timeout. + */ + @JsonProperty(value = "properties.queryExecutionTimeout") + private Integer queryExecutionTimeout; + + /** + * Get the minResourcePercent property: The workload group minimum percentage resource. + * + * @return the minResourcePercent value. + */ + public Integer minResourcePercent() { + return this.minResourcePercent; + } + + /** + * Set the minResourcePercent property: The workload group minimum percentage resource. + * + * @param minResourcePercent the minResourcePercent value to set. + * @return the WorkloadGroupInner object itself. + */ + public WorkloadGroupInner withMinResourcePercent(Integer minResourcePercent) { + this.minResourcePercent = minResourcePercent; + return this; + } + + /** + * Get the maxResourcePercent property: The workload group cap percentage resource. + * + * @return the maxResourcePercent value. + */ + public Integer maxResourcePercent() { + return this.maxResourcePercent; + } + + /** + * Set the maxResourcePercent property: The workload group cap percentage resource. + * + * @param maxResourcePercent the maxResourcePercent value to set. + * @return the WorkloadGroupInner object itself. + */ + public WorkloadGroupInner withMaxResourcePercent(Integer maxResourcePercent) { + this.maxResourcePercent = maxResourcePercent; + return this; + } + + /** + * Get the minResourcePercentPerRequest property: The workload group request minimum grant percentage. + * + * @return the minResourcePercentPerRequest value. + */ + public Double minResourcePercentPerRequest() { + return this.minResourcePercentPerRequest; + } + + /** + * Set the minResourcePercentPerRequest property: The workload group request minimum grant percentage. + * + * @param minResourcePercentPerRequest the minResourcePercentPerRequest value to set. + * @return the WorkloadGroupInner object itself. + */ + public WorkloadGroupInner withMinResourcePercentPerRequest(Double minResourcePercentPerRequest) { + this.minResourcePercentPerRequest = minResourcePercentPerRequest; + return this; + } + + /** + * Get the maxResourcePercentPerRequest property: The workload group request maximum grant percentage. + * + * @return the maxResourcePercentPerRequest value. + */ + public Double maxResourcePercentPerRequest() { + return this.maxResourcePercentPerRequest; + } + + /** + * Set the maxResourcePercentPerRequest property: The workload group request maximum grant percentage. + * + * @param maxResourcePercentPerRequest the maxResourcePercentPerRequest value to set. + * @return the WorkloadGroupInner object itself. + */ + public WorkloadGroupInner withMaxResourcePercentPerRequest(Double maxResourcePercentPerRequest) { + this.maxResourcePercentPerRequest = maxResourcePercentPerRequest; + return this; + } + + /** + * Get the importance property: The workload group importance level. + * + * @return the importance value. + */ + public String importance() { + return this.importance; + } + + /** + * Set the importance property: The workload group importance level. + * + * @param importance the importance value to set. + * @return the WorkloadGroupInner object itself. + */ + public WorkloadGroupInner withImportance(String importance) { + this.importance = importance; + return this; + } + + /** + * Get the queryExecutionTimeout property: The workload group query execution timeout. + * + * @return the queryExecutionTimeout value. + */ + public Integer queryExecutionTimeout() { + return this.queryExecutionTimeout; + } + + /** + * Set the queryExecutionTimeout property: The workload group query execution timeout. + * + * @param queryExecutionTimeout the queryExecutionTimeout value to set. + * @return the WorkloadGroupInner object itself. + */ + public WorkloadGroupInner withQueryExecutionTimeout(Integer queryExecutionTimeout) { + this.queryExecutionTimeout = queryExecutionTimeout; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/WorkspaceAadAdminInfoInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/WorkspaceAadAdminInfoInner.java new file mode 100644 index 0000000000000..ed2aeb0afebe3 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/WorkspaceAadAdminInfoInner.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Workspace active directory administrator. */ +@JsonFlatten +@Fluent +public class WorkspaceAadAdminInfoInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkspaceAadAdminInfoInner.class); + + /* + * Tenant ID of the workspace active directory administrator + */ + @JsonProperty(value = "properties.tenantId") + private String tenantId; + + /* + * Login of the workspace active directory administrator + */ + @JsonProperty(value = "properties.login") + private String login; + + /* + * Workspace active directory administrator type + */ + @JsonProperty(value = "properties.administratorType") + private String administratorType; + + /* + * Object ID of the workspace active directory administrator + */ + @JsonProperty(value = "properties.sid") + private String sid; + + /** + * Get the tenantId property: Tenant ID of the workspace active directory administrator. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: Tenant ID of the workspace active directory administrator. + * + * @param tenantId the tenantId value to set. + * @return the WorkspaceAadAdminInfoInner object itself. + */ + public WorkspaceAadAdminInfoInner withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the login property: Login of the workspace active directory administrator. + * + * @return the login value. + */ + public String login() { + return this.login; + } + + /** + * Set the login property: Login of the workspace active directory administrator. + * + * @param login the login value to set. + * @return the WorkspaceAadAdminInfoInner object itself. + */ + public WorkspaceAadAdminInfoInner withLogin(String login) { + this.login = login; + return this; + } + + /** + * Get the administratorType property: Workspace active directory administrator type. + * + * @return the administratorType value. + */ + public String administratorType() { + return this.administratorType; + } + + /** + * Set the administratorType property: Workspace active directory administrator type. + * + * @param administratorType the administratorType value to set. + * @return the WorkspaceAadAdminInfoInner object itself. + */ + public WorkspaceAadAdminInfoInner withAdministratorType(String administratorType) { + this.administratorType = administratorType; + return this; + } + + /** + * Get the sid property: Object ID of the workspace active directory administrator. + * + * @return the sid value. + */ + public String sid() { + return this.sid; + } + + /** + * Set the sid property: Object ID of the workspace active directory administrator. + * + * @param sid the sid value to set. + * @return the WorkspaceAadAdminInfoInner object itself. + */ + public WorkspaceAadAdminInfoInner withSid(String sid) { + this.sid = sid; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/WorkspaceInner.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/WorkspaceInner.java new file mode 100644 index 0000000000000..20967b2c507d3 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/WorkspaceInner.java @@ -0,0 +1,489 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.models.DataLakeStorageAccountDetails; +import com.azure.resourcemanager.synapse.models.EncryptionDetails; +import com.azure.resourcemanager.synapse.models.ManagedIdentity; +import com.azure.resourcemanager.synapse.models.ManagedVirtualNetworkSettings; +import com.azure.resourcemanager.synapse.models.PurviewConfiguration; +import com.azure.resourcemanager.synapse.models.VirtualNetworkProfile; +import com.azure.resourcemanager.synapse.models.WorkspaceRepositoryConfiguration; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +/** A workspace. */ +@JsonFlatten +@Fluent +public class WorkspaceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkspaceInner.class); + + /* + * Identity of the workspace + */ + @JsonProperty(value = "identity") + private ManagedIdentity identity; + + /* + * Workspace default data lake storage account details + */ + @JsonProperty(value = "properties.defaultDataLakeStorage") + private DataLakeStorageAccountDetails defaultDataLakeStorage; + + /* + * SQL administrator login password + */ + @JsonProperty(value = "properties.sqlAdministratorLoginPassword") + private String sqlAdministratorLoginPassword; + + /* + * Workspace managed resource group. The resource group name uniquely + * identifies the resource group within the user subscriptionId. The + * resource group name must be no longer than 90 characters long, and must + * be alphanumeric characters (Char.IsLetterOrDigit()) and '-', '_', '(', + * ')' and'.'. Note that the name cannot end with '.' + */ + @JsonProperty(value = "properties.managedResourceGroupName") + private String managedResourceGroupName; + + /* + * Resource provisioning state + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * Login for workspace SQL active directory administrator + */ + @JsonProperty(value = "properties.sqlAdministratorLogin") + private String sqlAdministratorLogin; + + /* + * Virtual Network profile + */ + @JsonProperty(value = "properties.virtualNetworkProfile") + private VirtualNetworkProfile virtualNetworkProfile; + + /* + * Connectivity endpoints + */ + @JsonProperty(value = "properties.connectivityEndpoints") + private Map connectivityEndpoints; + + /* + * Setting this to 'default' will ensure that all compute for this + * workspace is in a virtual network managed on behalf of the user. + */ + @JsonProperty(value = "properties.managedVirtualNetwork") + private String managedVirtualNetwork; + + /* + * Private endpoint connections to the workspace + */ + @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; + + /* + * Git integration settings + */ + @JsonProperty(value = "properties.workspaceRepositoryConfiguration") + private WorkspaceRepositoryConfiguration workspaceRepositoryConfiguration; + + /* + * Purview Configuration + */ + @JsonProperty(value = "properties.purviewConfiguration") + private PurviewConfiguration purviewConfiguration; + + /* + * The ADLA resource ID. + */ + @JsonProperty(value = "properties.adlaResourceId", access = JsonProperty.Access.WRITE_ONLY) + private String adlaResourceId; + + /** + * Get the identity property: Identity of the workspace. + * + * @return the identity value. + */ + public ManagedIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Identity of the workspace. + * + * @param identity the identity value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withIdentity(ManagedIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the defaultDataLakeStorage property: Workspace default data lake storage account details. + * + * @return the defaultDataLakeStorage value. + */ + public DataLakeStorageAccountDetails defaultDataLakeStorage() { + return this.defaultDataLakeStorage; + } + + /** + * Set the defaultDataLakeStorage property: Workspace default data lake storage account details. + * + * @param defaultDataLakeStorage the defaultDataLakeStorage value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withDefaultDataLakeStorage(DataLakeStorageAccountDetails defaultDataLakeStorage) { + this.defaultDataLakeStorage = defaultDataLakeStorage; + return this; + } + + /** + * Get the sqlAdministratorLoginPassword property: SQL administrator login password. + * + * @return the sqlAdministratorLoginPassword value. + */ + public String sqlAdministratorLoginPassword() { + return this.sqlAdministratorLoginPassword; + } + + /** + * Set the sqlAdministratorLoginPassword property: SQL administrator login password. + * + * @param sqlAdministratorLoginPassword the sqlAdministratorLoginPassword value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withSqlAdministratorLoginPassword(String sqlAdministratorLoginPassword) { + this.sqlAdministratorLoginPassword = sqlAdministratorLoginPassword; + return this; + } + + /** + * Get the managedResourceGroupName property: Workspace managed resource group. The resource group name uniquely + * identifies the resource group within the user subscriptionId. The resource group name must be no longer than 90 + * characters long, and must be alphanumeric characters (Char.IsLetterOrDigit()) and '-', '_', '(', ')' and'.'. Note + * that the name cannot end with '.'. + * + * @return the managedResourceGroupName value. + */ + public String managedResourceGroupName() { + return this.managedResourceGroupName; + } + + /** + * Set the managedResourceGroupName property: Workspace managed resource group. The resource group name uniquely + * identifies the resource group within the user subscriptionId. The resource group name must be no longer than 90 + * characters long, and must be alphanumeric characters (Char.IsLetterOrDigit()) and '-', '_', '(', ')' and'.'. Note + * that the name cannot end with '.'. + * + * @param managedResourceGroupName the managedResourceGroupName value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withManagedResourceGroupName(String managedResourceGroupName) { + this.managedResourceGroupName = managedResourceGroupName; + return this; + } + + /** + * Get the provisioningState property: Resource provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the sqlAdministratorLogin property: Login for workspace SQL active directory administrator. + * + * @return the sqlAdministratorLogin value. + */ + public String sqlAdministratorLogin() { + return this.sqlAdministratorLogin; + } + + /** + * Set the sqlAdministratorLogin property: Login for workspace SQL active directory administrator. + * + * @param sqlAdministratorLogin the sqlAdministratorLogin value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withSqlAdministratorLogin(String sqlAdministratorLogin) { + this.sqlAdministratorLogin = sqlAdministratorLogin; + return this; + } + + /** + * Get the virtualNetworkProfile property: Virtual Network profile. + * + * @return the virtualNetworkProfile value. + */ + public VirtualNetworkProfile virtualNetworkProfile() { + return this.virtualNetworkProfile; + } + + /** + * Set the virtualNetworkProfile property: Virtual Network profile. + * + * @param virtualNetworkProfile the virtualNetworkProfile value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withVirtualNetworkProfile(VirtualNetworkProfile virtualNetworkProfile) { + this.virtualNetworkProfile = virtualNetworkProfile; + return this; + } + + /** + * Get the connectivityEndpoints property: Connectivity endpoints. + * + * @return the connectivityEndpoints value. + */ + public Map connectivityEndpoints() { + return this.connectivityEndpoints; + } + + /** + * Set the connectivityEndpoints property: Connectivity endpoints. + * + * @param connectivityEndpoints the connectivityEndpoints value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withConnectivityEndpoints(Map connectivityEndpoints) { + this.connectivityEndpoints = connectivityEndpoints; + return this; + } + + /** + * Get the managedVirtualNetwork property: Setting this to 'default' will ensure that all compute for this workspace + * is in a virtual network managed on behalf of the user. + * + * @return the managedVirtualNetwork value. + */ + public String managedVirtualNetwork() { + return this.managedVirtualNetwork; + } + + /** + * Set the managedVirtualNetwork property: Setting this to 'default' will ensure that all compute for this workspace + * is in a virtual network managed on behalf of the user. + * + * @param managedVirtualNetwork the managedVirtualNetwork value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withManagedVirtualNetwork(String managedVirtualNetwork) { + this.managedVirtualNetwork = managedVirtualNetwork; + return this; + } + + /** + * Get the privateEndpointConnections property: Private endpoint connections to the workspace. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Set the privateEndpointConnections property: Private endpoint connections to the workspace. + * + * @param privateEndpointConnections the privateEndpointConnections value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withPrivateEndpointConnections( + List privateEndpointConnections) { + this.privateEndpointConnections = privateEndpointConnections; + return this; + } + + /** + * Get the encryption property: The encryption details of the workspace. + * + * @return the encryption value. + */ + public EncryptionDetails encryption() { + return this.encryption; + } + + /** + * Set the encryption property: The encryption details of the workspace. + * + * @param encryption the encryption value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withEncryption(EncryptionDetails encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get the workspaceUid property: The workspace unique identifier. + * + * @return the workspaceUid value. + */ + public UUID workspaceUid() { + return this.workspaceUid; + } + + /** + * Get the extraProperties property: Workspace level configs and feature flags. + * + * @return the extraProperties value. + */ + public Map extraProperties() { + return this.extraProperties; + } + + /** + * Get the managedVirtualNetworkSettings property: Managed Virtual Network Settings. + * + * @return the managedVirtualNetworkSettings value. + */ + public ManagedVirtualNetworkSettings managedVirtualNetworkSettings() { + return this.managedVirtualNetworkSettings; + } + + /** + * Set the managedVirtualNetworkSettings property: 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 the workspaceRepositoryConfiguration property: Git integration settings. + * + * @return the workspaceRepositoryConfiguration value. + */ + public WorkspaceRepositoryConfiguration workspaceRepositoryConfiguration() { + return this.workspaceRepositoryConfiguration; + } + + /** + * Set the workspaceRepositoryConfiguration property: Git integration settings. + * + * @param workspaceRepositoryConfiguration the workspaceRepositoryConfiguration value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withWorkspaceRepositoryConfiguration( + WorkspaceRepositoryConfiguration workspaceRepositoryConfiguration) { + this.workspaceRepositoryConfiguration = workspaceRepositoryConfiguration; + return this; + } + + /** + * Get the purviewConfiguration property: Purview Configuration. + * + * @return the purviewConfiguration value. + */ + public PurviewConfiguration purviewConfiguration() { + return this.purviewConfiguration; + } + + /** + * Set the purviewConfiguration property: Purview Configuration. + * + * @param purviewConfiguration the purviewConfiguration value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withPurviewConfiguration(PurviewConfiguration purviewConfiguration) { + this.purviewConfiguration = purviewConfiguration; + return this; + } + + /** + * Get the adlaResourceId property: The ADLA resource ID. + * + * @return the adlaResourceId value. + */ + public String adlaResourceId() { + return this.adlaResourceId; + } + + /** {@inheritDoc} */ + @Override + public WorkspaceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public WorkspaceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (defaultDataLakeStorage() != null) { + defaultDataLakeStorage().validate(); + } + if (virtualNetworkProfile() != null) { + virtualNetworkProfile().validate(); + } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + if (encryption() != null) { + encryption().validate(); + } + if (managedVirtualNetworkSettings() != null) { + managedVirtualNetworkSettings().validate(); + } + if (workspaceRepositoryConfiguration() != null) { + workspaceRepositoryConfiguration().validate(); + } + if (purviewConfiguration() != null) { + purviewConfiguration().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/package-info.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/package-info.java new file mode 100644 index 0000000000000..218b393333eb9 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for SynapseManagementClient. Azure Synapse Analytics Management Client. */ +package com.azure.resourcemanager.synapse.fluent.models; diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/package-info.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/package-info.java new file mode 100644 index 0000000000000..6983c5a62cb53 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for SynapseManagementClient. Azure Synapse Analytics Management Client. */ +package com.azure.resourcemanager.synapse.fluent; diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/AvailableRpOperationImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/AvailableRpOperationImpl.java new file mode 100644 index 0000000000000..97b2225d2d453 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/AvailableRpOperationImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.AvailableRpOperationInner; +import com.azure.resourcemanager.synapse.models.AvailableRpOperation; +import com.azure.resourcemanager.synapse.models.AvailableRpOperationDisplayInfo; +import com.azure.resourcemanager.synapse.models.OperationMetaServiceSpecification; + +public final class AvailableRpOperationImpl implements AvailableRpOperation { + private AvailableRpOperationInner innerObject; + + private final SynapseManager serviceManager; + + AvailableRpOperationImpl(AvailableRpOperationInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public AvailableRpOperationDisplayInfo display() { + return this.innerModel().display(); + } + + public String isDataAction() { + return this.innerModel().isDataAction(); + } + + public String name() { + return this.innerModel().name(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public OperationMetaServiceSpecification serviceSpecification() { + return this.innerModel().serviceSpecification(); + } + + public AvailableRpOperationInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/BigDataPoolResourceInfoImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/BigDataPoolResourceInfoImpl.java new file mode 100644 index 0000000000000..2bc8f80f15647 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/BigDataPoolResourceInfoImpl.java @@ -0,0 +1,361 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.BigDataPoolResourceInfoInner; +import com.azure.resourcemanager.synapse.models.AutoPauseProperties; +import com.azure.resourcemanager.synapse.models.AutoScaleProperties; +import com.azure.resourcemanager.synapse.models.BigDataPoolPatchInfo; +import com.azure.resourcemanager.synapse.models.BigDataPoolResourceInfo; +import com.azure.resourcemanager.synapse.models.DynamicExecutorAllocation; +import com.azure.resourcemanager.synapse.models.LibraryInfo; +import com.azure.resourcemanager.synapse.models.LibraryRequirements; +import com.azure.resourcemanager.synapse.models.NodeSize; +import com.azure.resourcemanager.synapse.models.NodeSizeFamily; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class BigDataPoolResourceInfoImpl + implements BigDataPoolResourceInfo, BigDataPoolResourceInfo.Definition, BigDataPoolResourceInfo.Update { + private BigDataPoolResourceInfoInner innerObject; + + private final SynapseManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public AutoScaleProperties autoScale() { + return this.innerModel().autoScale(); + } + + public OffsetDateTime creationDate() { + return this.innerModel().creationDate(); + } + + public AutoPauseProperties autoPause() { + return this.innerModel().autoPause(); + } + + public Boolean isComputeIsolationEnabled() { + return this.innerModel().isComputeIsolationEnabled(); + } + + public Boolean sessionLevelPackagesEnabled() { + return this.innerModel().sessionLevelPackagesEnabled(); + } + + public Integer cacheSize() { + return this.innerModel().cacheSize(); + } + + public DynamicExecutorAllocation dynamicExecutorAllocation() { + return this.innerModel().dynamicExecutorAllocation(); + } + + public String sparkEventsFolder() { + return this.innerModel().sparkEventsFolder(); + } + + public Integer nodeCount() { + return this.innerModel().nodeCount(); + } + + public LibraryRequirements libraryRequirements() { + return this.innerModel().libraryRequirements(); + } + + public List customLibraries() { + List inner = this.innerModel().customLibraries(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public LibraryRequirements sparkConfigProperties() { + return this.innerModel().sparkConfigProperties(); + } + + public String sparkVersion() { + return this.innerModel().sparkVersion(); + } + + public String defaultSparkLogFolder() { + return this.innerModel().defaultSparkLogFolder(); + } + + public NodeSize nodeSize() { + return this.innerModel().nodeSize(); + } + + public NodeSizeFamily nodeSizeFamily() { + return this.innerModel().nodeSizeFamily(); + } + + public OffsetDateTime lastSucceededTimestamp() { + return this.innerModel().lastSucceededTimestamp(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public BigDataPoolResourceInfoInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String bigDataPoolName; + + private Boolean createForce; + + private BigDataPoolPatchInfo updateBigDataPoolPatchInfo; + + public BigDataPoolResourceInfoImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public BigDataPoolResourceInfo create() { + this.innerObject = + serviceManager + .serviceClient() + .getBigDataPools() + .createOrUpdate( + resourceGroupName, workspaceName, bigDataPoolName, this.innerModel(), createForce, Context.NONE); + return this; + } + + public BigDataPoolResourceInfo create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBigDataPools() + .createOrUpdate( + resourceGroupName, workspaceName, bigDataPoolName, this.innerModel(), createForce, context); + return this; + } + + BigDataPoolResourceInfoImpl(String name, SynapseManager serviceManager) { + this.innerObject = new BigDataPoolResourceInfoInner(); + this.serviceManager = serviceManager; + this.bigDataPoolName = name; + this.createForce = null; + } + + public BigDataPoolResourceInfoImpl update() { + this.updateBigDataPoolPatchInfo = new BigDataPoolPatchInfo(); + return this; + } + + public BigDataPoolResourceInfo apply() { + this.innerObject = + serviceManager + .serviceClient() + .getBigDataPools() + .updateWithResponse( + resourceGroupName, workspaceName, bigDataPoolName, updateBigDataPoolPatchInfo, Context.NONE) + .getValue(); + return this; + } + + public BigDataPoolResourceInfo apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBigDataPools() + .updateWithResponse( + resourceGroupName, workspaceName, bigDataPoolName, updateBigDataPoolPatchInfo, context) + .getValue(); + return this; + } + + BigDataPoolResourceInfoImpl(BigDataPoolResourceInfoInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.bigDataPoolName = Utils.getValueFromIdByName(innerObject.id(), "bigDataPools"); + } + + public BigDataPoolResourceInfo refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getBigDataPools() + .getWithResponse(resourceGroupName, workspaceName, bigDataPoolName, Context.NONE) + .getValue(); + return this; + } + + public BigDataPoolResourceInfo refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getBigDataPools() + .getWithResponse(resourceGroupName, workspaceName, bigDataPoolName, context) + .getValue(); + return this; + } + + public BigDataPoolResourceInfoImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public BigDataPoolResourceInfoImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public BigDataPoolResourceInfoImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateBigDataPoolPatchInfo.withTags(tags); + return this; + } + } + + public BigDataPoolResourceInfoImpl withProvisioningState(String provisioningState) { + this.innerModel().withProvisioningState(provisioningState); + return this; + } + + public BigDataPoolResourceInfoImpl withAutoScale(AutoScaleProperties autoScale) { + this.innerModel().withAutoScale(autoScale); + return this; + } + + public BigDataPoolResourceInfoImpl withCreationDate(OffsetDateTime creationDate) { + this.innerModel().withCreationDate(creationDate); + return this; + } + + public BigDataPoolResourceInfoImpl withAutoPause(AutoPauseProperties autoPause) { + this.innerModel().withAutoPause(autoPause); + return this; + } + + public BigDataPoolResourceInfoImpl withIsComputeIsolationEnabled(Boolean isComputeIsolationEnabled) { + this.innerModel().withIsComputeIsolationEnabled(isComputeIsolationEnabled); + return this; + } + + public BigDataPoolResourceInfoImpl withSessionLevelPackagesEnabled(Boolean sessionLevelPackagesEnabled) { + this.innerModel().withSessionLevelPackagesEnabled(sessionLevelPackagesEnabled); + return this; + } + + public BigDataPoolResourceInfoImpl withCacheSize(Integer cacheSize) { + this.innerModel().withCacheSize(cacheSize); + return this; + } + + public BigDataPoolResourceInfoImpl withDynamicExecutorAllocation( + DynamicExecutorAllocation dynamicExecutorAllocation) { + this.innerModel().withDynamicExecutorAllocation(dynamicExecutorAllocation); + return this; + } + + public BigDataPoolResourceInfoImpl withSparkEventsFolder(String sparkEventsFolder) { + this.innerModel().withSparkEventsFolder(sparkEventsFolder); + return this; + } + + public BigDataPoolResourceInfoImpl withNodeCount(Integer nodeCount) { + this.innerModel().withNodeCount(nodeCount); + return this; + } + + public BigDataPoolResourceInfoImpl withLibraryRequirements(LibraryRequirements libraryRequirements) { + this.innerModel().withLibraryRequirements(libraryRequirements); + return this; + } + + public BigDataPoolResourceInfoImpl withCustomLibraries(List customLibraries) { + this.innerModel().withCustomLibraries(customLibraries); + return this; + } + + public BigDataPoolResourceInfoImpl withSparkConfigProperties(LibraryRequirements sparkConfigProperties) { + this.innerModel().withSparkConfigProperties(sparkConfigProperties); + return this; + } + + public BigDataPoolResourceInfoImpl withSparkVersion(String sparkVersion) { + this.innerModel().withSparkVersion(sparkVersion); + return this; + } + + public BigDataPoolResourceInfoImpl withDefaultSparkLogFolder(String defaultSparkLogFolder) { + this.innerModel().withDefaultSparkLogFolder(defaultSparkLogFolder); + return this; + } + + public BigDataPoolResourceInfoImpl withNodeSize(NodeSize nodeSize) { + this.innerModel().withNodeSize(nodeSize); + return this; + } + + public BigDataPoolResourceInfoImpl withNodeSizeFamily(NodeSizeFamily nodeSizeFamily) { + this.innerModel().withNodeSizeFamily(nodeSizeFamily); + return this; + } + + public BigDataPoolResourceInfoImpl withForce(Boolean force) { + this.createForce = force; + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/BigDataPoolsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/BigDataPoolsClientImpl.java new file mode 100644 index 0000000000000..1dd3cb0b9a9e6 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/BigDataPoolsClientImpl.java @@ -0,0 +1,1444 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.BigDataPoolsClient; +import com.azure.resourcemanager.synapse.fluent.models.BigDataPoolResourceInfoInner; +import com.azure.resourcemanager.synapse.models.BigDataPoolPatchInfo; +import com.azure.resourcemanager.synapse.models.BigDataPoolResourceInfoListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in BigDataPoolsClient. */ +public final class BigDataPoolsClientImpl implements BigDataPoolsClient { + private final ClientLogger logger = new ClientLogger(BigDataPoolsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final BigDataPoolsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of BigDataPoolsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BigDataPoolsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy.create(BigDataPoolsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientBigDataPools to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface BigDataPoolsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/bigDataPools/{bigDataPoolName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("bigDataPoolName") String bigDataPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/bigDataPools/{bigDataPoolName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("bigDataPoolName") String bigDataPoolName, + @BodyParam("application/json") BigDataPoolPatchInfo bigDataPoolPatchInfo, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/bigDataPools/{bigDataPoolName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("bigDataPoolName") String bigDataPoolName, + @QueryParam("force") Boolean force, + @BodyParam("application/json") BigDataPoolResourceInfoInner bigDataPoolInfo, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/bigDataPools/{bigDataPoolName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("bigDataPoolName") String bigDataPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/bigDataPools") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspace( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspaceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get a Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String bigDataPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (bigDataPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bigDataPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + bigDataPoolName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get a Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String bigDataPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (bigDataPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bigDataPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + bigDataPoolName, + accept, + context); + } + + /** + * Get a Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String bigDataPoolName) { + return getWithResponseAsync(resourceGroupName, workspaceName, bigDataPoolName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BigDataPoolResourceInfoInner get(String resourceGroupName, String workspaceName, String bigDataPoolName) { + return getAsync(resourceGroupName, workspaceName, bigDataPoolName).block(); + } + + /** + * Get a Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String bigDataPoolName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, bigDataPoolName, context).block(); + } + + /** + * Patch a Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @param bigDataPoolPatchInfo The updated Big Data pool properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String bigDataPoolName, + BigDataPoolPatchInfo bigDataPoolPatchInfo) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (bigDataPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bigDataPoolName is required and cannot be null.")); + } + if (bigDataPoolPatchInfo == null) { + return Mono + .error(new IllegalArgumentException("Parameter bigDataPoolPatchInfo is required and cannot be null.")); + } else { + bigDataPoolPatchInfo.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + bigDataPoolName, + bigDataPoolPatchInfo, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Patch a Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @param bigDataPoolPatchInfo The updated Big Data pool properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String bigDataPoolName, + BigDataPoolPatchInfo bigDataPoolPatchInfo, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (bigDataPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bigDataPoolName is required and cannot be null.")); + } + if (bigDataPoolPatchInfo == null) { + return Mono + .error(new IllegalArgumentException("Parameter bigDataPoolPatchInfo is required and cannot be null.")); + } else { + bigDataPoolPatchInfo.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + bigDataPoolName, + bigDataPoolPatchInfo, + accept, + context); + } + + /** + * Patch a Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @param bigDataPoolPatchInfo The updated Big Data pool properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String workspaceName, + String bigDataPoolName, + BigDataPoolPatchInfo bigDataPoolPatchInfo) { + return updateWithResponseAsync(resourceGroupName, workspaceName, bigDataPoolName, bigDataPoolPatchInfo) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Patch a Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @param bigDataPoolPatchInfo The updated Big Data pool properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BigDataPoolResourceInfoInner update( + String resourceGroupName, + String workspaceName, + String bigDataPoolName, + BigDataPoolPatchInfo bigDataPoolPatchInfo) { + return updateAsync(resourceGroupName, workspaceName, bigDataPoolName, bigDataPoolPatchInfo).block(); + } + + /** + * Patch a Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @param bigDataPoolPatchInfo The updated Big Data pool properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String workspaceName, + String bigDataPoolName, + BigDataPoolPatchInfo bigDataPoolPatchInfo, + Context context) { + return updateWithResponseAsync(resourceGroupName, workspaceName, bigDataPoolName, bigDataPoolPatchInfo, context) + .block(); + } + + /** + * Create a new Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String bigDataPoolName, + BigDataPoolResourceInfoInner bigDataPoolInfo, + Boolean force) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (bigDataPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bigDataPoolName is required and cannot be null.")); + } + if (bigDataPoolInfo == null) { + return Mono + .error(new IllegalArgumentException("Parameter bigDataPoolInfo is required and cannot be null.")); + } else { + bigDataPoolInfo.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + bigDataPoolName, + force, + bigDataPoolInfo, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create a new Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @param bigDataPoolInfo The Big Data pool to create. + * @param force Whether to stop any running jobs in the Big Data pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String bigDataPoolName, + BigDataPoolResourceInfoInner bigDataPoolInfo, + Boolean force, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (bigDataPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bigDataPoolName is required and cannot be null.")); + } + if (bigDataPoolInfo == null) { + return Mono + .error(new IllegalArgumentException("Parameter bigDataPoolInfo is required and cannot be null.")); + } else { + bigDataPoolInfo.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + bigDataPoolName, + force, + bigDataPoolInfo, + accept, + context); + } + + /** + * Create a new Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, BigDataPoolResourceInfoInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String bigDataPoolName, + BigDataPoolResourceInfoInner bigDataPoolInfo, + Boolean force) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, bigDataPoolName, bigDataPoolInfo, force); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BigDataPoolResourceInfoInner.class, + BigDataPoolResourceInfoInner.class, + Context.NONE); + } + + /** + * Create a new Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @param bigDataPoolInfo The Big Data pool to create. + * @param force Whether to stop any running jobs in the Big Data pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, BigDataPoolResourceInfoInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String bigDataPoolName, + BigDataPoolResourceInfoInner bigDataPoolInfo, + Boolean force, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, bigDataPoolName, bigDataPoolInfo, force, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + BigDataPoolResourceInfoInner.class, + BigDataPoolResourceInfoInner.class, + context); + } + + /** + * Create a new Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, BigDataPoolResourceInfoInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String bigDataPoolName, + BigDataPoolResourceInfoInner bigDataPoolInfo, + Boolean force) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, bigDataPoolName, bigDataPoolInfo, force) + .getSyncPoller(); + } + + /** + * Create a new Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @param bigDataPoolInfo The Big Data pool to create. + * @param force Whether to stop any running jobs in the Big Data pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, BigDataPoolResourceInfoInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String bigDataPoolName, + BigDataPoolResourceInfoInner bigDataPoolInfo, + Boolean force, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, workspaceName, bigDataPoolName, bigDataPoolInfo, force, context) + .getSyncPoller(); + } + + /** + * Create a new Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String bigDataPoolName, + BigDataPoolResourceInfoInner bigDataPoolInfo, + Boolean force) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, bigDataPoolName, bigDataPoolInfo, force) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @param bigDataPoolInfo The Big Data pool to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String bigDataPoolName, + BigDataPoolResourceInfoInner bigDataPoolInfo) { + final Boolean force = null; + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, bigDataPoolName, bigDataPoolInfo, force) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @param bigDataPoolInfo The Big Data pool to create. + * @param force Whether to stop any running jobs in the Big Data pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String bigDataPoolName, + BigDataPoolResourceInfoInner bigDataPoolInfo, + Boolean force, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, workspaceName, bigDataPoolName, bigDataPoolInfo, force, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BigDataPoolResourceInfoInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String bigDataPoolName, + BigDataPoolResourceInfoInner bigDataPoolInfo, + Boolean force) { + return createOrUpdateAsync(resourceGroupName, workspaceName, bigDataPoolName, bigDataPoolInfo, force).block(); + } + + /** + * Create a new Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @param bigDataPoolInfo The Big Data pool to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BigDataPoolResourceInfoInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String bigDataPoolName, + BigDataPoolResourceInfoInner bigDataPoolInfo) { + final Boolean force = null; + return createOrUpdateAsync(resourceGroupName, workspaceName, bigDataPoolName, bigDataPoolInfo, force).block(); + } + + /** + * Create a new Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @param bigDataPoolInfo The Big Data pool to create. + * @param force Whether to stop any running jobs in the Big Data pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BigDataPoolResourceInfoInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String bigDataPoolName, + BigDataPoolResourceInfoInner bigDataPoolInfo, + Boolean force, + Context context) { + return createOrUpdateAsync(resourceGroupName, workspaceName, bigDataPoolName, bigDataPoolInfo, force, context) + .block(); + } + + /** + * Delete a Big Data pool from the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String bigDataPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (bigDataPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bigDataPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + bigDataPoolName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Delete a Big Data pool from the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String bigDataPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (bigDataPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter bigDataPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + bigDataPoolName, + accept, + context); + } + + /** + * Delete a Big Data pool from the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Object> beginDeleteAsync( + String resourceGroupName, String workspaceName, String bigDataPoolName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, workspaceName, bigDataPoolName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Object.class, Object.class, Context.NONE); + } + + /** + * Delete a Big Data pool from the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Object> beginDeleteAsync( + String resourceGroupName, String workspaceName, String bigDataPoolName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, workspaceName, bigDataPoolName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Object.class, Object.class, context); + } + + /** + * Delete a Big Data pool from the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginDelete( + String resourceGroupName, String workspaceName, String bigDataPoolName) { + return beginDeleteAsync(resourceGroupName, workspaceName, bigDataPoolName).getSyncPoller(); + } + + /** + * Delete a Big Data pool from the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginDelete( + String resourceGroupName, String workspaceName, String bigDataPoolName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, bigDataPoolName, context).getSyncPoller(); + } + + /** + * Delete a Big Data pool from the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String bigDataPoolName) { + return beginDeleteAsync(resourceGroupName, workspaceName, bigDataPoolName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Big Data pool from the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String workspaceName, String bigDataPoolName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, bigDataPoolName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Big Data pool from the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Object delete(String resourceGroupName, String workspaceName, String bigDataPoolName) { + return deleteAsync(resourceGroupName, workspaceName, bigDataPoolName).block(); + } + + /** + * Delete a Big Data pool from the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Object delete(String resourceGroupName, String workspaceName, String bigDataPoolName, Context context) { + return deleteAsync(resourceGroupName, workspaceName, bigDataPoolName, context).block(); + } + + /** + * List Big Data pools 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of Big Data pool information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceSinglePageAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByWorkspace( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * List Big Data pools in a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of Big Data pool information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByWorkspace( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List Big Data pools 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of Big Data pool information. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync( + String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); + } + + /** + * List Big Data pools in a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of Big Data pool information. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync( + String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink, context)); + } + + /** + * List Big Data pools 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of Big Data pool information. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName)); + } + + /** + * List Big Data pools in a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of Big Data pool information. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of Big Data pool information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of Big Data pool information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/BigDataPoolsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/BigDataPoolsImpl.java new file mode 100644 index 0000000000000..14270bd27383a --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/BigDataPoolsImpl.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.BigDataPoolsClient; +import com.azure.resourcemanager.synapse.fluent.models.BigDataPoolResourceInfoInner; +import com.azure.resourcemanager.synapse.models.BigDataPoolResourceInfo; +import com.azure.resourcemanager.synapse.models.BigDataPools; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class BigDataPoolsImpl implements BigDataPools { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BigDataPoolsImpl.class); + + private final BigDataPoolsClient innerClient; + + private final SynapseManager serviceManager; + + public BigDataPoolsImpl(BigDataPoolsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public BigDataPoolResourceInfo get(String resourceGroupName, String workspaceName, String bigDataPoolName) { + BigDataPoolResourceInfoInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, bigDataPoolName); + if (inner != null) { + return new BigDataPoolResourceInfoImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String bigDataPoolName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, bigDataPoolName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new BigDataPoolResourceInfoImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Object delete(String resourceGroupName, String workspaceName, String bigDataPoolName) { + return this.serviceClient().delete(resourceGroupName, workspaceName, bigDataPoolName); + } + + public Object delete(String resourceGroupName, String workspaceName, String bigDataPoolName, Context context) { + return this.serviceClient().delete(resourceGroupName, workspaceName, bigDataPoolName, context); + } + + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { + PagedIterable inner = + this.serviceClient().listByWorkspace(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new BigDataPoolResourceInfoImpl(inner1, this.manager())); + } + + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = + this.serviceClient().listByWorkspace(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new BigDataPoolResourceInfoImpl(inner1, this.manager())); + } + + public BigDataPoolResourceInfo getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String bigDataPoolName = Utils.getValueFromIdByName(id, "bigDataPools"); + if (bigDataPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bigDataPools'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, bigDataPoolName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String bigDataPoolName = Utils.getValueFromIdByName(id, "bigDataPools"); + if (bigDataPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bigDataPools'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, bigDataPoolName, context); + } + + public Object deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String bigDataPoolName = Utils.getValueFromIdByName(id, "bigDataPools"); + if (bigDataPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bigDataPools'.", id))); + } + return this.delete(resourceGroupName, workspaceName, bigDataPoolName, Context.NONE); + } + + public Object deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String bigDataPoolName = Utils.getValueFromIdByName(id, "bigDataPools"); + if (bigDataPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'bigDataPools'.", id))); + } + return this.delete(resourceGroupName, workspaceName, bigDataPoolName, context); + } + + private BigDataPoolsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + public BigDataPoolResourceInfoImpl define(String name) { + return new BigDataPoolResourceInfoImpl(name, this.manager()); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/CheckNameAvailabilityResponseImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/CheckNameAvailabilityResponseImpl.java new file mode 100644 index 0000000000000..04a1c6747b13f --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/CheckNameAvailabilityResponseImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.CheckNameAvailabilityResponseInner; +import com.azure.resourcemanager.synapse.models.CheckNameAvailabilityResponse; + +public final class CheckNameAvailabilityResponseImpl implements CheckNameAvailabilityResponse { + private CheckNameAvailabilityResponseInner innerObject; + + private final SynapseManager serviceManager; + + CheckNameAvailabilityResponseImpl(CheckNameAvailabilityResponseInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String message() { + return this.innerModel().message(); + } + + public Boolean available() { + return this.innerModel().available(); + } + + public String reason() { + return this.innerModel().reason(); + } + + public String name() { + return this.innerModel().name(); + } + + public CheckNameAvailabilityResponseInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataMaskingPoliciesClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataMaskingPoliciesClientImpl.java new file mode 100644 index 0000000000000..79c00983a1897 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataMaskingPoliciesClientImpl.java @@ -0,0 +1,454 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.DataMaskingPoliciesClient; +import com.azure.resourcemanager.synapse.fluent.models.DataMaskingPolicyInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DataMaskingPoliciesClient. */ +public final class DataMaskingPoliciesClientImpl implements DataMaskingPoliciesClient { + private final ClientLogger logger = new ClientLogger(DataMaskingPoliciesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DataMaskingPoliciesService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of DataMaskingPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DataMaskingPoliciesClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy.create(DataMaskingPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientDataMaskingPolicies to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface DataMaskingPoliciesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/dataMaskingPolicies/{dataMaskingPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("dataMaskingPolicyName") String dataMaskingPolicyName, + @BodyParam("application/json") DataMaskingPolicyInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/dataMaskingPolicies/{dataMaskingPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("dataMaskingPolicyName") String dataMaskingPolicyName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, DataMaskingPolicyInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String dataMaskingPolicyName = "Default"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + dataMaskingPolicyName, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + DataMaskingPolicyInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String dataMaskingPolicyName = "Default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + dataMaskingPolicyName, + parameters, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, DataMaskingPolicyInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataMaskingPolicyInner createOrUpdate( + String resourceGroupName, String workspaceName, String sqlPoolName, DataMaskingPolicyInner parameters) { + return createOrUpdateAsync(resourceGroupName, workspaceName, sqlPoolName, parameters).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + DataMaskingPolicyInner parameters, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, parameters, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool data masking policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String dataMaskingPolicyName = "Default"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + dataMaskingPolicyName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool data masking policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String dataMaskingPolicyName = "Default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + dataMaskingPolicyName, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool data masking policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String sqlPoolName) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool data masking policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataMaskingPolicyInner get(String resourceGroupName, String workspaceName, String sqlPoolName) { + return getAsync(resourceGroupName, workspaceName, sqlPoolName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool data masking policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, context).block(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataMaskingPoliciesImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataMaskingPoliciesImpl.java new file mode 100644 index 0000000000000..28b89e7c8f5af --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataMaskingPoliciesImpl.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.DataMaskingPoliciesClient; +import com.azure.resourcemanager.synapse.fluent.models.DataMaskingPolicyInner; +import com.azure.resourcemanager.synapse.models.DataMaskingPolicies; +import com.azure.resourcemanager.synapse.models.DataMaskingPolicy; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DataMaskingPoliciesImpl implements DataMaskingPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataMaskingPoliciesImpl.class); + + private final DataMaskingPoliciesClient innerClient; + + private final SynapseManager serviceManager; + + public DataMaskingPoliciesImpl(DataMaskingPoliciesClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public DataMaskingPolicy get(String resourceGroupName, String workspaceName, String sqlPoolName) { + DataMaskingPolicyInner inner = this.serviceClient().get(resourceGroupName, workspaceName, sqlPoolName); + if (inner != null) { + return new DataMaskingPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, sqlPoolName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DataMaskingPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public DataMaskingPolicy getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, sqlPoolName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, sqlPoolName, context); + } + + private DataMaskingPoliciesClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + public DataMaskingPolicyImpl define() { + return new DataMaskingPolicyImpl(this.manager()); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataMaskingPolicyImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataMaskingPolicyImpl.java new file mode 100644 index 0000000000000..32e0051a63373 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataMaskingPolicyImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.DataMaskingPolicyInner; +import com.azure.resourcemanager.synapse.models.DataMaskingPolicy; +import com.azure.resourcemanager.synapse.models.DataMaskingState; + +public final class DataMaskingPolicyImpl + implements DataMaskingPolicy, DataMaskingPolicy.Definition, DataMaskingPolicy.Update { + private DataMaskingPolicyInner innerObject; + + private final SynapseManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public String kind() { + return this.innerModel().kind(); + } + + public String managedBy() { + return this.innerModel().managedBy(); + } + + public DataMaskingState dataMaskingState() { + return this.innerModel().dataMaskingState(); + } + + public String exemptPrincipals() { + return this.innerModel().exemptPrincipals(); + } + + public String applicationPrincipals() { + return this.innerModel().applicationPrincipals(); + } + + public String maskingLevel() { + return this.innerModel().maskingLevel(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public DataMaskingPolicyInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String sqlPoolName; + + public DataMaskingPolicyImpl withExistingSqlPool( + String resourceGroupName, String workspaceName, String sqlPoolName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + this.sqlPoolName = sqlPoolName; + return this; + } + + public DataMaskingPolicy create() { + this.innerObject = + serviceManager + .serviceClient() + .getDataMaskingPolicies() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, sqlPoolName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public DataMaskingPolicy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDataMaskingPolicies() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, sqlPoolName, this.innerModel(), context) + .getValue(); + return this; + } + + DataMaskingPolicyImpl(SynapseManager serviceManager) { + this.innerObject = new DataMaskingPolicyInner(); + this.serviceManager = serviceManager; + } + + public DataMaskingPolicyImpl update() { + return this; + } + + public DataMaskingPolicy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDataMaskingPolicies() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, sqlPoolName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public DataMaskingPolicy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDataMaskingPolicies() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, sqlPoolName, this.innerModel(), context) + .getValue(); + return this; + } + + DataMaskingPolicyImpl(DataMaskingPolicyInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.sqlPoolName = Utils.getValueFromIdByName(innerObject.id(), "sqlPools"); + } + + public DataMaskingPolicy refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDataMaskingPolicies() + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, Context.NONE) + .getValue(); + return this; + } + + public DataMaskingPolicy refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDataMaskingPolicies() + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, context) + .getValue(); + return this; + } + + public DataMaskingPolicyImpl withDataMaskingState(DataMaskingState dataMaskingState) { + this.innerModel().withDataMaskingState(dataMaskingState); + return this; + } + + public DataMaskingPolicyImpl withExemptPrincipals(String exemptPrincipals) { + this.innerModel().withExemptPrincipals(exemptPrincipals); + return this; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataMaskingRuleImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataMaskingRuleImpl.java new file mode 100644 index 0000000000000..be624f0d1a271 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataMaskingRuleImpl.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.DataMaskingRuleInner; +import com.azure.resourcemanager.synapse.models.DataMaskingFunction; +import com.azure.resourcemanager.synapse.models.DataMaskingRule; +import com.azure.resourcemanager.synapse.models.DataMaskingRuleState; + +public final class DataMaskingRuleImpl implements DataMaskingRule, DataMaskingRule.Definition, DataMaskingRule.Update { + private DataMaskingRuleInner innerObject; + + private final SynapseManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public String kind() { + return this.innerModel().kind(); + } + + public String idPropertiesId() { + return this.innerModel().idPropertiesId(); + } + + public String aliasName() { + return this.innerModel().aliasName(); + } + + public DataMaskingRuleState ruleState() { + return this.innerModel().ruleState(); + } + + public String schemaName() { + return this.innerModel().schemaName(); + } + + public String tableName() { + return this.innerModel().tableName(); + } + + public String columnName() { + return this.innerModel().columnName(); + } + + public DataMaskingFunction maskingFunction() { + return this.innerModel().maskingFunction(); + } + + public String numberFrom() { + return this.innerModel().numberFrom(); + } + + public String numberTo() { + return this.innerModel().numberTo(); + } + + public String prefixSize() { + return this.innerModel().prefixSize(); + } + + public String suffixSize() { + return this.innerModel().suffixSize(); + } + + public String replacementString() { + return this.innerModel().replacementString(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public DataMaskingRuleInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String sqlPoolName; + + private String dataMaskingRuleName; + + public DataMaskingRuleImpl withExistingSqlPool(String resourceGroupName, String workspaceName, String sqlPoolName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + this.sqlPoolName = sqlPoolName; + return this; + } + + public DataMaskingRule create() { + this.innerObject = + serviceManager + .serviceClient() + .getDataMaskingRules() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, sqlPoolName, dataMaskingRuleName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public DataMaskingRule create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDataMaskingRules() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, sqlPoolName, dataMaskingRuleName, this.innerModel(), context) + .getValue(); + return this; + } + + DataMaskingRuleImpl(String name, SynapseManager serviceManager) { + this.innerObject = new DataMaskingRuleInner(); + this.serviceManager = serviceManager; + this.dataMaskingRuleName = name; + } + + public DataMaskingRuleImpl update() { + return this; + } + + public DataMaskingRule apply() { + this.innerObject = + serviceManager + .serviceClient() + .getDataMaskingRules() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, sqlPoolName, dataMaskingRuleName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public DataMaskingRule apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDataMaskingRules() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, sqlPoolName, dataMaskingRuleName, this.innerModel(), context) + .getValue(); + return this; + } + + DataMaskingRuleImpl(DataMaskingRuleInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.sqlPoolName = Utils.getValueFromIdByName(innerObject.id(), "sqlPools"); + this.dataMaskingRuleName = Utils.getValueFromIdByName(innerObject.id(), "rules"); + } + + public DataMaskingRule refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getDataMaskingRules() + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, dataMaskingRuleName, Context.NONE) + .getValue(); + return this; + } + + public DataMaskingRule refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getDataMaskingRules() + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, dataMaskingRuleName, context) + .getValue(); + return this; + } + + public DataMaskingRuleImpl withAliasName(String aliasName) { + this.innerModel().withAliasName(aliasName); + return this; + } + + public DataMaskingRuleImpl withRuleState(DataMaskingRuleState ruleState) { + this.innerModel().withRuleState(ruleState); + return this; + } + + public DataMaskingRuleImpl withSchemaName(String schemaName) { + this.innerModel().withSchemaName(schemaName); + return this; + } + + public DataMaskingRuleImpl withTableName(String tableName) { + this.innerModel().withTableName(tableName); + return this; + } + + public DataMaskingRuleImpl withColumnName(String columnName) { + this.innerModel().withColumnName(columnName); + return this; + } + + public DataMaskingRuleImpl withMaskingFunction(DataMaskingFunction maskingFunction) { + this.innerModel().withMaskingFunction(maskingFunction); + return this; + } + + public DataMaskingRuleImpl withNumberFrom(String numberFrom) { + this.innerModel().withNumberFrom(numberFrom); + return this; + } + + public DataMaskingRuleImpl withNumberTo(String numberTo) { + this.innerModel().withNumberTo(numberTo); + return this; + } + + public DataMaskingRuleImpl withPrefixSize(String prefixSize) { + this.innerModel().withPrefixSize(prefixSize); + return this; + } + + public DataMaskingRuleImpl withSuffixSize(String suffixSize) { + this.innerModel().withSuffixSize(suffixSize); + return this; + } + + public DataMaskingRuleImpl withReplacementString(String replacementString) { + this.innerModel().withReplacementString(replacementString); + return this; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataMaskingRulesClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataMaskingRulesClientImpl.java new file mode 100644 index 0000000000000..740d363ff57bd --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataMaskingRulesClientImpl.java @@ -0,0 +1,725 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.DataMaskingRulesClient; +import com.azure.resourcemanager.synapse.fluent.models.DataMaskingRuleInner; +import com.azure.resourcemanager.synapse.models.DataMaskingRuleListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DataMaskingRulesClient. */ +public final class DataMaskingRulesClientImpl implements DataMaskingRulesClient { + private final ClientLogger logger = new ClientLogger(DataMaskingRulesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final DataMaskingRulesService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of DataMaskingRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DataMaskingRulesClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy.create(DataMaskingRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientDataMaskingRules to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface DataMaskingRulesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules" + + "/{dataMaskingRuleName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("dataMaskingPolicyName") String dataMaskingPolicyName, + @PathParam("dataMaskingRuleName") String dataMaskingRuleName, + @BodyParam("application/json") DataMaskingRuleInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules" + + "/{dataMaskingRuleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("dataMaskingPolicyName") String dataMaskingPolicyName, + @PathParam("dataMaskingRuleName") String dataMaskingRuleName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySqlPool( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("dataMaskingPolicyName") String dataMaskingPolicyName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Sql pool data masking rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String dataMaskingRuleName, + DataMaskingRuleInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (dataMaskingRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataMaskingRuleName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String dataMaskingPolicyName = "Default"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + dataMaskingPolicyName, + dataMaskingRuleName, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Sql pool data masking rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String dataMaskingRuleName, + DataMaskingRuleInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (dataMaskingRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataMaskingRuleName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String dataMaskingPolicyName = "Default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + dataMaskingPolicyName, + dataMaskingRuleName, + parameters, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Sql pool data masking rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String dataMaskingRuleName, + DataMaskingRuleInner parameters) { + return createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, dataMaskingRuleName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Sql pool data masking rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataMaskingRuleInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String dataMaskingRuleName, + DataMaskingRuleInner parameters) { + return createOrUpdateAsync(resourceGroupName, workspaceName, sqlPoolName, dataMaskingRuleName, parameters) + .block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Sql pool data masking rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String dataMaskingRuleName, + DataMaskingRuleInner parameters, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, dataMaskingRuleName, parameters, context) + .block(); + } + + /** + * Gets the specific 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific Sql pool data masking rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String dataMaskingRuleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (dataMaskingRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataMaskingRuleName is required and cannot be null.")); + } + final String dataMaskingPolicyName = "Default"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + dataMaskingPolicyName, + dataMaskingRuleName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the specific 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific Sql pool data masking rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String dataMaskingRuleName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (dataMaskingRuleName == null) { + return Mono + .error(new IllegalArgumentException("Parameter dataMaskingRuleName is required and cannot be null.")); + } + final String dataMaskingPolicyName = "Default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + dataMaskingPolicyName, + dataMaskingRuleName, + accept, + context); + } + + /** + * Gets the specific 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific Sql pool data masking rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String dataMaskingRuleName) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, dataMaskingRuleName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the specific 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific Sql pool data masking rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataMaskingRuleInner get( + String resourceGroupName, String workspaceName, String sqlPoolName, String dataMaskingRuleName) { + return getAsync(resourceGroupName, workspaceName, sqlPoolName, dataMaskingRuleName).block(); + } + + /** + * Gets the specific 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific Sql pool data masking rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String dataMaskingRuleName, + Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, dataMaskingRuleName, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool data masking rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySqlPoolSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String dataMaskingPolicyName = "Default"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listBySqlPool( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + dataMaskingPolicyName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool data masking rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySqlPoolSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String dataMaskingPolicyName = "Default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySqlPool( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + dataMaskingPolicyName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool data masking rules. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySqlPoolAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + return new PagedFlux<>(() -> listBySqlPoolSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool data masking rules. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySqlPoolAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return new PagedFlux<>( + () -> listBySqlPoolSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool data masking rules. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySqlPool( + String resourceGroupName, String workspaceName, String sqlPoolName) { + return new PagedIterable<>(listBySqlPoolAsync(resourceGroupName, workspaceName, sqlPoolName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool data masking rules. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySqlPool( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return new PagedIterable<>(listBySqlPoolAsync(resourceGroupName, workspaceName, sqlPoolName, context)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataMaskingRulesImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataMaskingRulesImpl.java new file mode 100644 index 0000000000000..8d20ab8e3d35e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataMaskingRulesImpl.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.DataMaskingRulesClient; +import com.azure.resourcemanager.synapse.fluent.models.DataMaskingRuleInner; +import com.azure.resourcemanager.synapse.models.DataMaskingRule; +import com.azure.resourcemanager.synapse.models.DataMaskingRules; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class DataMaskingRulesImpl implements DataMaskingRules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataMaskingRulesImpl.class); + + private final DataMaskingRulesClient innerClient; + + private final SynapseManager serviceManager; + + public DataMaskingRulesImpl(DataMaskingRulesClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public DataMaskingRule get( + String resourceGroupName, String workspaceName, String sqlPoolName, String dataMaskingRuleName) { + DataMaskingRuleInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, sqlPoolName, dataMaskingRuleName); + if (inner != null) { + return new DataMaskingRuleImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String dataMaskingRuleName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, dataMaskingRuleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DataMaskingRuleImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listBySqlPool( + String resourceGroupName, String workspaceName, String sqlPoolName) { + PagedIterable inner = + this.serviceClient().listBySqlPool(resourceGroupName, workspaceName, sqlPoolName); + return Utils.mapPage(inner, inner1 -> new DataMaskingRuleImpl(inner1, this.manager())); + } + + public PagedIterable listBySqlPool( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + PagedIterable inner = + this.serviceClient().listBySqlPool(resourceGroupName, workspaceName, sqlPoolName, context); + return Utils.mapPage(inner, inner1 -> new DataMaskingRuleImpl(inner1, this.manager())); + } + + public DataMaskingRule getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + String dataMaskingRuleName = Utils.getValueFromIdByName(id, "rules"); + if (dataMaskingRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rules'.", id))); + } + return this + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, dataMaskingRuleName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + String dataMaskingRuleName = Utils.getValueFromIdByName(id, "rules"); + if (dataMaskingRuleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rules'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, sqlPoolName, dataMaskingRuleName, context); + } + + private DataMaskingRulesClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + public DataMaskingRuleImpl define(String name) { + return new DataMaskingRuleImpl(name, this.manager()); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataWarehouseUserActivitiesImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataWarehouseUserActivitiesImpl.java new file mode 100644 index 0000000000000..081e09e898cfe --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/DataWarehouseUserActivitiesImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.DataWarehouseUserActivitiesInner; +import com.azure.resourcemanager.synapse.models.DataWarehouseUserActivities; + +public final class DataWarehouseUserActivitiesImpl implements DataWarehouseUserActivities { + private DataWarehouseUserActivitiesInner innerObject; + + private final SynapseManager serviceManager; + + DataWarehouseUserActivitiesImpl(DataWarehouseUserActivitiesInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public Integer activeQueriesCount() { + return this.innerModel().activeQueriesCount(); + } + + public DataWarehouseUserActivitiesInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/EncryptionProtectorImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/EncryptionProtectorImpl.java new file mode 100644 index 0000000000000..5b664013400a7 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/EncryptionProtectorImpl.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.EncryptionProtectorInner; +import com.azure.resourcemanager.synapse.models.EncryptionProtector; +import com.azure.resourcemanager.synapse.models.EncryptionProtectorName; +import com.azure.resourcemanager.synapse.models.ServerKeyType; + +public final class EncryptionProtectorImpl + implements EncryptionProtector, EncryptionProtector.Definition, EncryptionProtector.Update { + private EncryptionProtectorInner innerObject; + + private final SynapseManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String kind() { + return this.innerModel().kind(); + } + + public String location() { + return this.innerModel().location(); + } + + public String subregion() { + return this.innerModel().subregion(); + } + + public String serverKeyName() { + return this.innerModel().serverKeyName(); + } + + public ServerKeyType serverKeyType() { + return this.innerModel().serverKeyType(); + } + + public String uri() { + return this.innerModel().uri(); + } + + public String thumbprint() { + return this.innerModel().thumbprint(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public EncryptionProtectorInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private EncryptionProtectorName encryptionProtectorName; + + public EncryptionProtectorImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public EncryptionProtector create() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceManagedSqlServerEncryptionProtectors() + .createOrUpdate( + resourceGroupName, workspaceName, encryptionProtectorName, this.innerModel(), Context.NONE); + return this; + } + + public EncryptionProtector create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceManagedSqlServerEncryptionProtectors() + .createOrUpdate(resourceGroupName, workspaceName, encryptionProtectorName, this.innerModel(), context); + return this; + } + + EncryptionProtectorImpl(EncryptionProtectorName name, SynapseManager serviceManager) { + this.innerObject = new EncryptionProtectorInner(); + this.serviceManager = serviceManager; + this.encryptionProtectorName = name; + } + + public EncryptionProtectorImpl update() { + return this; + } + + public EncryptionProtector apply() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceManagedSqlServerEncryptionProtectors() + .createOrUpdate( + resourceGroupName, workspaceName, encryptionProtectorName, this.innerModel(), Context.NONE); + return this; + } + + public EncryptionProtector apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceManagedSqlServerEncryptionProtectors() + .createOrUpdate(resourceGroupName, workspaceName, encryptionProtectorName, this.innerModel(), context); + return this; + } + + EncryptionProtectorImpl(EncryptionProtectorInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.encryptionProtectorName = + EncryptionProtectorName.fromString(Utils.getValueFromIdByName(innerObject.id(), "encryptionProtector")); + } + + public EncryptionProtector refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceManagedSqlServerEncryptionProtectors() + .getWithResponse(resourceGroupName, workspaceName, encryptionProtectorName, Context.NONE) + .getValue(); + return this; + } + + public EncryptionProtector refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceManagedSqlServerEncryptionProtectors() + .getWithResponse(resourceGroupName, workspaceName, encryptionProtectorName, context) + .getValue(); + return this; + } + + public void revalidate() { + serviceManager + .workspaceManagedSqlServerEncryptionProtectors() + .revalidate(resourceGroupName, workspaceName, encryptionProtectorName); + } + + public void revalidate(Context context) { + serviceManager + .workspaceManagedSqlServerEncryptionProtectors() + .revalidate(resourceGroupName, workspaceName, encryptionProtectorName, context); + } + + public EncryptionProtectorImpl withServerKeyName(String serverKeyName) { + this.innerModel().withServerKeyName(serverKeyName); + return this; + } + + public EncryptionProtectorImpl withServerKeyType(ServerKeyType serverKeyType) { + this.innerModel().withServerKeyType(serverKeyType); + return this; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ExtendedServerBlobAuditingPolicyImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ExtendedServerBlobAuditingPolicyImpl.java new file mode 100644 index 0000000000000..0000873908ccf --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ExtendedServerBlobAuditingPolicyImpl.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.ExtendedServerBlobAuditingPolicyInner; +import com.azure.resourcemanager.synapse.models.BlobAuditingPolicyName; +import com.azure.resourcemanager.synapse.models.BlobAuditingPolicyState; +import com.azure.resourcemanager.synapse.models.ExtendedServerBlobAuditingPolicy; +import java.util.Collections; +import java.util.List; +import java.util.UUID; + +public final class ExtendedServerBlobAuditingPolicyImpl + implements ExtendedServerBlobAuditingPolicy, + ExtendedServerBlobAuditingPolicy.Definition, + ExtendedServerBlobAuditingPolicy.Update { + private ExtendedServerBlobAuditingPolicyInner innerObject; + + private final SynapseManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String predicateExpression() { + return this.innerModel().predicateExpression(); + } + + public BlobAuditingPolicyState state() { + return this.innerModel().state(); + } + + public String storageEndpoint() { + return this.innerModel().storageEndpoint(); + } + + public String storageAccountAccessKey() { + return this.innerModel().storageAccountAccessKey(); + } + + public Integer retentionDays() { + return this.innerModel().retentionDays(); + } + + public List auditActionsAndGroups() { + List inner = this.innerModel().auditActionsAndGroups(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public UUID storageAccountSubscriptionId() { + return this.innerModel().storageAccountSubscriptionId(); + } + + public Boolean isStorageSecondaryKeyInUse() { + return this.innerModel().isStorageSecondaryKeyInUse(); + } + + public Boolean isAzureMonitorTargetEnabled() { + return this.innerModel().isAzureMonitorTargetEnabled(); + } + + public Integer queueDelayMs() { + return this.innerModel().queueDelayMs(); + } + + public ExtendedServerBlobAuditingPolicyInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private BlobAuditingPolicyName blobAuditingPolicyName; + + public ExtendedServerBlobAuditingPolicyImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public ExtendedServerBlobAuditingPolicy create() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceManagedSqlServerExtendedBlobAuditingPolicies() + .createOrUpdate( + resourceGroupName, workspaceName, blobAuditingPolicyName, this.innerModel(), Context.NONE); + return this; + } + + public ExtendedServerBlobAuditingPolicy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceManagedSqlServerExtendedBlobAuditingPolicies() + .createOrUpdate(resourceGroupName, workspaceName, blobAuditingPolicyName, this.innerModel(), context); + return this; + } + + ExtendedServerBlobAuditingPolicyImpl(BlobAuditingPolicyName name, SynapseManager serviceManager) { + this.innerObject = new ExtendedServerBlobAuditingPolicyInner(); + this.serviceManager = serviceManager; + this.blobAuditingPolicyName = name; + } + + public ExtendedServerBlobAuditingPolicyImpl update() { + return this; + } + + public ExtendedServerBlobAuditingPolicy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceManagedSqlServerExtendedBlobAuditingPolicies() + .createOrUpdate( + resourceGroupName, workspaceName, blobAuditingPolicyName, this.innerModel(), Context.NONE); + return this; + } + + public ExtendedServerBlobAuditingPolicy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceManagedSqlServerExtendedBlobAuditingPolicies() + .createOrUpdate(resourceGroupName, workspaceName, blobAuditingPolicyName, this.innerModel(), context); + return this; + } + + ExtendedServerBlobAuditingPolicyImpl( + ExtendedServerBlobAuditingPolicyInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.blobAuditingPolicyName = + BlobAuditingPolicyName.fromString(Utils.getValueFromIdByName(innerObject.id(), "extendedAuditingSettings")); + } + + public ExtendedServerBlobAuditingPolicy refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceManagedSqlServerExtendedBlobAuditingPolicies() + .getWithResponse(resourceGroupName, workspaceName, blobAuditingPolicyName, Context.NONE) + .getValue(); + return this; + } + + public ExtendedServerBlobAuditingPolicy refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceManagedSqlServerExtendedBlobAuditingPolicies() + .getWithResponse(resourceGroupName, workspaceName, blobAuditingPolicyName, context) + .getValue(); + return this; + } + + public ExtendedServerBlobAuditingPolicyImpl withPredicateExpression(String predicateExpression) { + this.innerModel().withPredicateExpression(predicateExpression); + return this; + } + + public ExtendedServerBlobAuditingPolicyImpl withState(BlobAuditingPolicyState state) { + this.innerModel().withState(state); + return this; + } + + public ExtendedServerBlobAuditingPolicyImpl withStorageEndpoint(String storageEndpoint) { + this.innerModel().withStorageEndpoint(storageEndpoint); + return this; + } + + public ExtendedServerBlobAuditingPolicyImpl withStorageAccountAccessKey(String storageAccountAccessKey) { + this.innerModel().withStorageAccountAccessKey(storageAccountAccessKey); + return this; + } + + public ExtendedServerBlobAuditingPolicyImpl withRetentionDays(Integer retentionDays) { + this.innerModel().withRetentionDays(retentionDays); + return this; + } + + public ExtendedServerBlobAuditingPolicyImpl withAuditActionsAndGroups(List auditActionsAndGroups) { + this.innerModel().withAuditActionsAndGroups(auditActionsAndGroups); + return this; + } + + public ExtendedServerBlobAuditingPolicyImpl withStorageAccountSubscriptionId(UUID storageAccountSubscriptionId) { + this.innerModel().withStorageAccountSubscriptionId(storageAccountSubscriptionId); + return this; + } + + public ExtendedServerBlobAuditingPolicyImpl withIsStorageSecondaryKeyInUse(Boolean isStorageSecondaryKeyInUse) { + this.innerModel().withIsStorageSecondaryKeyInUse(isStorageSecondaryKeyInUse); + return this; + } + + public ExtendedServerBlobAuditingPolicyImpl withIsAzureMonitorTargetEnabled(Boolean isAzureMonitorTargetEnabled) { + this.innerModel().withIsAzureMonitorTargetEnabled(isAzureMonitorTargetEnabled); + return this; + } + + public ExtendedServerBlobAuditingPolicyImpl withQueueDelayMs(Integer queueDelayMs) { + this.innerModel().withQueueDelayMs(queueDelayMs); + return this; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ExtendedSqlPoolBlobAuditingPoliciesClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ExtendedSqlPoolBlobAuditingPoliciesClientImpl.java new file mode 100644 index 0000000000000..7f9dece515068 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ExtendedSqlPoolBlobAuditingPoliciesClientImpl.java @@ -0,0 +1,771 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.ExtendedSqlPoolBlobAuditingPoliciesClient; +import com.azure.resourcemanager.synapse.fluent.models.ExtendedSqlPoolBlobAuditingPolicyInner; +import com.azure.resourcemanager.synapse.models.ExtendedSqlPoolBlobAuditingPolicyListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ExtendedSqlPoolBlobAuditingPoliciesClient. + */ +public final class ExtendedSqlPoolBlobAuditingPoliciesClientImpl implements ExtendedSqlPoolBlobAuditingPoliciesClient { + private final ClientLogger logger = new ClientLogger(ExtendedSqlPoolBlobAuditingPoliciesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ExtendedSqlPoolBlobAuditingPoliciesService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of ExtendedSqlPoolBlobAuditingPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExtendedSqlPoolBlobAuditingPoliciesClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + ExtendedSqlPoolBlobAuditingPoliciesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientExtendedSqlPoolBlobAuditingPolicies to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface ExtendedSqlPoolBlobAuditingPoliciesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/extendedAuditingSettings/{blobAuditingPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("blobAuditingPolicyName") String blobAuditingPolicyName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/extendedAuditingSettings/{blobAuditingPolicyName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("blobAuditingPolicyName") String blobAuditingPolicyName, + @BodyParam("application/json") ExtendedSqlPoolBlobAuditingPolicyInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/extendedAuditingSettings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySqlPool( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySqlPoolNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended Sql pool's blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String blobAuditingPolicyName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + blobAuditingPolicyName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended Sql pool's blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String blobAuditingPolicyName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + blobAuditingPolicyName, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended Sql pool's blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended Sql pool's blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExtendedSqlPoolBlobAuditingPolicyInner get( + String resourceGroupName, String workspaceName, String sqlPoolName) { + return getAsync(resourceGroupName, workspaceName, sqlPoolName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended Sql pool's blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended Sql pool blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + ExtendedSqlPoolBlobAuditingPolicyInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String blobAuditingPolicyName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + blobAuditingPolicyName, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended Sql pool blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + ExtendedSqlPoolBlobAuditingPolicyInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String blobAuditingPolicyName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + blobAuditingPolicyName, + parameters, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended Sql pool blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + ExtendedSqlPoolBlobAuditingPolicyInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended Sql pool blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExtendedSqlPoolBlobAuditingPolicyInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + ExtendedSqlPoolBlobAuditingPolicyInner parameters) { + return createOrUpdateAsync(resourceGroupName, workspaceName, sqlPoolName, parameters).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended Sql pool blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + ExtendedSqlPoolBlobAuditingPolicyInner parameters, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, parameters, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of sql pool extended auditing settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySqlPoolSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listBySqlPool( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of sql pool extended auditing settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySqlPoolSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySqlPool( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of sql pool extended auditing settings. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySqlPoolAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + return new PagedFlux<>( + () -> listBySqlPoolSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName), + nextLink -> listBySqlPoolNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of sql pool extended auditing settings. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySqlPoolAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return new PagedFlux<>( + () -> listBySqlPoolSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName, context), + nextLink -> listBySqlPoolNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of sql pool extended auditing settings. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySqlPool( + String resourceGroupName, String workspaceName, String sqlPoolName) { + return new PagedIterable<>(listBySqlPoolAsync(resourceGroupName, workspaceName, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of sql pool extended auditing settings. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySqlPool( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return new PagedIterable<>(listBySqlPoolAsync(resourceGroupName, workspaceName, sqlPoolName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of sql pool extended auditing settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySqlPoolNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listBySqlPoolNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of sql pool extended auditing settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySqlPoolNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySqlPoolNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ExtendedSqlPoolBlobAuditingPoliciesImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ExtendedSqlPoolBlobAuditingPoliciesImpl.java new file mode 100644 index 0000000000000..6a9126f6bd54c --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ExtendedSqlPoolBlobAuditingPoliciesImpl.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.ExtendedSqlPoolBlobAuditingPoliciesClient; +import com.azure.resourcemanager.synapse.fluent.models.ExtendedSqlPoolBlobAuditingPolicyInner; +import com.azure.resourcemanager.synapse.models.ExtendedSqlPoolBlobAuditingPolicies; +import com.azure.resourcemanager.synapse.models.ExtendedSqlPoolBlobAuditingPolicy; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ExtendedSqlPoolBlobAuditingPoliciesImpl implements ExtendedSqlPoolBlobAuditingPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtendedSqlPoolBlobAuditingPoliciesImpl.class); + + private final ExtendedSqlPoolBlobAuditingPoliciesClient innerClient; + + private final SynapseManager serviceManager; + + public ExtendedSqlPoolBlobAuditingPoliciesImpl( + ExtendedSqlPoolBlobAuditingPoliciesClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ExtendedSqlPoolBlobAuditingPolicy get(String resourceGroupName, String workspaceName, String sqlPoolName) { + ExtendedSqlPoolBlobAuditingPolicyInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, sqlPoolName); + if (inner != null) { + return new ExtendedSqlPoolBlobAuditingPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, sqlPoolName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExtendedSqlPoolBlobAuditingPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listBySqlPool( + String resourceGroupName, String workspaceName, String sqlPoolName) { + PagedIterable inner = + this.serviceClient().listBySqlPool(resourceGroupName, workspaceName, sqlPoolName); + return Utils.mapPage(inner, inner1 -> new ExtendedSqlPoolBlobAuditingPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listBySqlPool( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + PagedIterable inner = + this.serviceClient().listBySqlPool(resourceGroupName, workspaceName, sqlPoolName, context); + return Utils.mapPage(inner, inner1 -> new ExtendedSqlPoolBlobAuditingPolicyImpl(inner1, this.manager())); + } + + public ExtendedSqlPoolBlobAuditingPolicy getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, sqlPoolName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, sqlPoolName, context); + } + + private ExtendedSqlPoolBlobAuditingPoliciesClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + public ExtendedSqlPoolBlobAuditingPolicyImpl define() { + return new ExtendedSqlPoolBlobAuditingPolicyImpl(this.manager()); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ExtendedSqlPoolBlobAuditingPolicyImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ExtendedSqlPoolBlobAuditingPolicyImpl.java new file mode 100644 index 0000000000000..335e626f5a762 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ExtendedSqlPoolBlobAuditingPolicyImpl.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.ExtendedSqlPoolBlobAuditingPolicyInner; +import com.azure.resourcemanager.synapse.models.BlobAuditingPolicyState; +import com.azure.resourcemanager.synapse.models.ExtendedSqlPoolBlobAuditingPolicy; +import java.util.Collections; +import java.util.List; +import java.util.UUID; + +public final class ExtendedSqlPoolBlobAuditingPolicyImpl + implements ExtendedSqlPoolBlobAuditingPolicy, + ExtendedSqlPoolBlobAuditingPolicy.Definition, + ExtendedSqlPoolBlobAuditingPolicy.Update { + private ExtendedSqlPoolBlobAuditingPolicyInner innerObject; + + private final SynapseManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String predicateExpression() { + return this.innerModel().predicateExpression(); + } + + public BlobAuditingPolicyState state() { + return this.innerModel().state(); + } + + public String storageEndpoint() { + return this.innerModel().storageEndpoint(); + } + + public String storageAccountAccessKey() { + return this.innerModel().storageAccountAccessKey(); + } + + public Integer retentionDays() { + return this.innerModel().retentionDays(); + } + + public List auditActionsAndGroups() { + List inner = this.innerModel().auditActionsAndGroups(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public UUID storageAccountSubscriptionId() { + return this.innerModel().storageAccountSubscriptionId(); + } + + public Boolean isStorageSecondaryKeyInUse() { + return this.innerModel().isStorageSecondaryKeyInUse(); + } + + public Boolean isAzureMonitorTargetEnabled() { + return this.innerModel().isAzureMonitorTargetEnabled(); + } + + public Integer queueDelayMs() { + return this.innerModel().queueDelayMs(); + } + + public ExtendedSqlPoolBlobAuditingPolicyInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String sqlPoolName; + + public ExtendedSqlPoolBlobAuditingPolicyImpl withExistingSqlPool( + String resourceGroupName, String workspaceName, String sqlPoolName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + this.sqlPoolName = sqlPoolName; + return this; + } + + public ExtendedSqlPoolBlobAuditingPolicy create() { + this.innerObject = + serviceManager + .serviceClient() + .getExtendedSqlPoolBlobAuditingPolicies() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, sqlPoolName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ExtendedSqlPoolBlobAuditingPolicy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExtendedSqlPoolBlobAuditingPolicies() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, sqlPoolName, this.innerModel(), context) + .getValue(); + return this; + } + + ExtendedSqlPoolBlobAuditingPolicyImpl(SynapseManager serviceManager) { + this.innerObject = new ExtendedSqlPoolBlobAuditingPolicyInner(); + this.serviceManager = serviceManager; + } + + public ExtendedSqlPoolBlobAuditingPolicyImpl update() { + return this; + } + + public ExtendedSqlPoolBlobAuditingPolicy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getExtendedSqlPoolBlobAuditingPolicies() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, sqlPoolName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ExtendedSqlPoolBlobAuditingPolicy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExtendedSqlPoolBlobAuditingPolicies() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, sqlPoolName, this.innerModel(), context) + .getValue(); + return this; + } + + ExtendedSqlPoolBlobAuditingPolicyImpl( + ExtendedSqlPoolBlobAuditingPolicyInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.sqlPoolName = Utils.getValueFromIdByName(innerObject.id(), "sqlPools"); + } + + public ExtendedSqlPoolBlobAuditingPolicy refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getExtendedSqlPoolBlobAuditingPolicies() + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, Context.NONE) + .getValue(); + return this; + } + + public ExtendedSqlPoolBlobAuditingPolicy refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getExtendedSqlPoolBlobAuditingPolicies() + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, context) + .getValue(); + return this; + } + + public ExtendedSqlPoolBlobAuditingPolicyImpl withPredicateExpression(String predicateExpression) { + this.innerModel().withPredicateExpression(predicateExpression); + return this; + } + + public ExtendedSqlPoolBlobAuditingPolicyImpl withState(BlobAuditingPolicyState state) { + this.innerModel().withState(state); + return this; + } + + public ExtendedSqlPoolBlobAuditingPolicyImpl withStorageEndpoint(String storageEndpoint) { + this.innerModel().withStorageEndpoint(storageEndpoint); + return this; + } + + public ExtendedSqlPoolBlobAuditingPolicyImpl withStorageAccountAccessKey(String storageAccountAccessKey) { + this.innerModel().withStorageAccountAccessKey(storageAccountAccessKey); + return this; + } + + public ExtendedSqlPoolBlobAuditingPolicyImpl withRetentionDays(Integer retentionDays) { + this.innerModel().withRetentionDays(retentionDays); + return this; + } + + public ExtendedSqlPoolBlobAuditingPolicyImpl withAuditActionsAndGroups(List auditActionsAndGroups) { + this.innerModel().withAuditActionsAndGroups(auditActionsAndGroups); + return this; + } + + public ExtendedSqlPoolBlobAuditingPolicyImpl withStorageAccountSubscriptionId(UUID storageAccountSubscriptionId) { + this.innerModel().withStorageAccountSubscriptionId(storageAccountSubscriptionId); + return this; + } + + public ExtendedSqlPoolBlobAuditingPolicyImpl withIsStorageSecondaryKeyInUse(Boolean isStorageSecondaryKeyInUse) { + this.innerModel().withIsStorageSecondaryKeyInUse(isStorageSecondaryKeyInUse); + return this; + } + + public ExtendedSqlPoolBlobAuditingPolicyImpl withIsAzureMonitorTargetEnabled(Boolean isAzureMonitorTargetEnabled) { + this.innerModel().withIsAzureMonitorTargetEnabled(isAzureMonitorTargetEnabled); + return this; + } + + public ExtendedSqlPoolBlobAuditingPolicyImpl withQueueDelayMs(Integer queueDelayMs) { + this.innerModel().withQueueDelayMs(queueDelayMs); + return this; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/GeoBackupPolicyImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/GeoBackupPolicyImpl.java new file mode 100644 index 0000000000000..ec64ca7345cd1 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/GeoBackupPolicyImpl.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.GeoBackupPolicyInner; +import com.azure.resourcemanager.synapse.models.GeoBackupPolicy; +import com.azure.resourcemanager.synapse.models.GeoBackupPolicyName; +import com.azure.resourcemanager.synapse.models.GeoBackupPolicyState; + +public final class GeoBackupPolicyImpl implements GeoBackupPolicy, GeoBackupPolicy.Definition, GeoBackupPolicy.Update { + private GeoBackupPolicyInner innerObject; + + private final SynapseManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String kind() { + return this.innerModel().kind(); + } + + public String location() { + return this.innerModel().location(); + } + + public GeoBackupPolicyState state() { + return this.innerModel().state(); + } + + public String storageType() { + return this.innerModel().storageType(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public GeoBackupPolicyInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String sqlPoolName; + + private GeoBackupPolicyName geoBackupPolicyName; + + public GeoBackupPolicyImpl withExistingSqlPool(String resourceGroupName, String workspaceName, String sqlPoolName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + this.sqlPoolName = sqlPoolName; + return this; + } + + public GeoBackupPolicy create() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolGeoBackupPolicies() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, sqlPoolName, geoBackupPolicyName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public GeoBackupPolicy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolGeoBackupPolicies() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, sqlPoolName, geoBackupPolicyName, this.innerModel(), context) + .getValue(); + return this; + } + + GeoBackupPolicyImpl(GeoBackupPolicyName name, SynapseManager serviceManager) { + this.innerObject = new GeoBackupPolicyInner(); + this.serviceManager = serviceManager; + this.geoBackupPolicyName = name; + } + + public GeoBackupPolicyImpl update() { + return this; + } + + public GeoBackupPolicy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolGeoBackupPolicies() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, sqlPoolName, geoBackupPolicyName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public GeoBackupPolicy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolGeoBackupPolicies() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, sqlPoolName, geoBackupPolicyName, this.innerModel(), context) + .getValue(); + return this; + } + + GeoBackupPolicyImpl(GeoBackupPolicyInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.sqlPoolName = Utils.getValueFromIdByName(innerObject.id(), "sqlPools"); + this.geoBackupPolicyName = + GeoBackupPolicyName.fromString(Utils.getValueFromIdByName(innerObject.id(), "geoBackupPolicies")); + } + + public GeoBackupPolicy refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolGeoBackupPolicies() + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, geoBackupPolicyName, Context.NONE) + .getValue(); + return this; + } + + public GeoBackupPolicy refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolGeoBackupPolicies() + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, geoBackupPolicyName, context) + .getValue(); + return this; + } + + public GeoBackupPolicyImpl withState(GeoBackupPolicyState state) { + this.innerModel().withState(state); + return this; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeAuthKeysImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeAuthKeysImpl.java new file mode 100644 index 0000000000000..7d3839e686638 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeAuthKeysImpl.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeAuthKeysInner; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeAuthKeys; + +public final class IntegrationRuntimeAuthKeysImpl implements IntegrationRuntimeAuthKeys { + private IntegrationRuntimeAuthKeysInner innerObject; + + private final SynapseManager serviceManager; + + IntegrationRuntimeAuthKeysImpl(IntegrationRuntimeAuthKeysInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String authKey1() { + return this.innerModel().authKey1(); + } + + public String authKey2() { + return this.innerModel().authKey2(); + } + + public IntegrationRuntimeAuthKeysInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeAuthKeysOperationsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeAuthKeysOperationsClientImpl.java new file mode 100644 index 0000000000000..c14297dfd3ba9 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeAuthKeysOperationsClientImpl.java @@ -0,0 +1,478 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.IntegrationRuntimeAuthKeysOperationsClient; +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeAuthKeysInner; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeRegenerateKeyParameters; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * IntegrationRuntimeAuthKeysOperationsClient. + */ +public final class IntegrationRuntimeAuthKeysOperationsClientImpl + implements IntegrationRuntimeAuthKeysOperationsClient { + private final ClientLogger logger = new ClientLogger(IntegrationRuntimeAuthKeysOperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final IntegrationRuntimeAuthKeysOperationsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of IntegrationRuntimeAuthKeysOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IntegrationRuntimeAuthKeysOperationsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + IntegrationRuntimeAuthKeysOperationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientIntegrationRuntimeAuthKeysOperations to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface IntegrationRuntimeAuthKeysOperationsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/regenerateAuthKey") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regenerate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("integrationRuntimeName") String integrationRuntimeName, + @BodyParam("application/json") IntegrationRuntimeRegenerateKeyParameters regenerateKeyParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/listAuthKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("integrationRuntimeName") String integrationRuntimeName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Regenerate the authentication key for 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 regenerateKeyParameters The parameters for regenerating integration runtime authentication key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the integration runtime authentication keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + IntegrationRuntimeRegenerateKeyParameters regenerateKeyParameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + if (regenerateKeyParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter regenerateKeyParameters is required and cannot be null.")); + } else { + regenerateKeyParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .regenerate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + regenerateKeyParameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Regenerate the authentication key for 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 regenerateKeyParameters The parameters for regenerating integration runtime authentication key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the integration runtime authentication keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + IntegrationRuntimeRegenerateKeyParameters regenerateKeyParameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + if (regenerateKeyParameters == null) { + return Mono + .error( + new IllegalArgumentException("Parameter regenerateKeyParameters is required and cannot be null.")); + } else { + regenerateKeyParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .regenerate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + regenerateKeyParameters, + accept, + context); + } + + /** + * Regenerate the authentication key for 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 regenerateKeyParameters The parameters for regenerating integration runtime authentication key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the integration runtime authentication keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regenerateAsync( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + IntegrationRuntimeRegenerateKeyParameters regenerateKeyParameters) { + return regenerateWithResponseAsync( + resourceGroupName, workspaceName, integrationRuntimeName, regenerateKeyParameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Regenerate the authentication key for 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 regenerateKeyParameters The parameters for regenerating integration runtime authentication key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the integration runtime authentication keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IntegrationRuntimeAuthKeysInner regenerate( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + IntegrationRuntimeRegenerateKeyParameters regenerateKeyParameters) { + return regenerateAsync(resourceGroupName, workspaceName, integrationRuntimeName, regenerateKeyParameters) + .block(); + } + + /** + * Regenerate the authentication key for 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 regenerateKeyParameters The parameters for regenerating integration runtime authentication key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the integration runtime authentication keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response regenerateWithResponse( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + IntegrationRuntimeRegenerateKeyParameters regenerateKeyParameters, + Context context) { + return regenerateWithResponseAsync( + resourceGroupName, workspaceName, integrationRuntimeName, regenerateKeyParameters, context) + .block(); + } + + /** + * List authentication keys 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the integration runtime authentication keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * List authentication keys 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the integration runtime authentication keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + accept, + context); + } + + /** + * List authentication keys 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the integration runtime authentication keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return listWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * List authentication keys 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the integration runtime authentication keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IntegrationRuntimeAuthKeysInner list( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return listAsync(resourceGroupName, workspaceName, integrationRuntimeName).block(); + } + + /** + * List authentication keys 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the integration runtime authentication keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + return listWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName, context).block(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeAuthKeysOperationsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeAuthKeysOperationsImpl.java new file mode 100644 index 0000000000000..9eaaf6e310c1a --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeAuthKeysOperationsImpl.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.IntegrationRuntimeAuthKeysOperationsClient; +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeAuthKeysInner; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeAuthKeys; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeAuthKeysOperations; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeRegenerateKeyParameters; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class IntegrationRuntimeAuthKeysOperationsImpl implements IntegrationRuntimeAuthKeysOperations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IntegrationRuntimeAuthKeysOperationsImpl.class); + + private final IntegrationRuntimeAuthKeysOperationsClient innerClient; + + private final SynapseManager serviceManager; + + public IntegrationRuntimeAuthKeysOperationsImpl( + IntegrationRuntimeAuthKeysOperationsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public IntegrationRuntimeAuthKeys regenerate( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + IntegrationRuntimeRegenerateKeyParameters regenerateKeyParameters) { + IntegrationRuntimeAuthKeysInner inner = + this + .serviceClient() + .regenerate(resourceGroupName, workspaceName, integrationRuntimeName, regenerateKeyParameters); + if (inner != null) { + return new IntegrationRuntimeAuthKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response regenerateWithResponse( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + IntegrationRuntimeRegenerateKeyParameters regenerateKeyParameters, + Context context) { + Response inner = + this + .serviceClient() + .regenerateWithResponse( + resourceGroupName, workspaceName, integrationRuntimeName, regenerateKeyParameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IntegrationRuntimeAuthKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public IntegrationRuntimeAuthKeys list( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + IntegrationRuntimeAuthKeysInner inner = + this.serviceClient().list(resourceGroupName, workspaceName, integrationRuntimeName); + if (inner != null) { + return new IntegrationRuntimeAuthKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, workspaceName, integrationRuntimeName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IntegrationRuntimeAuthKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private IntegrationRuntimeAuthKeysOperationsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeConnectionInfoImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeConnectionInfoImpl.java new file mode 100644 index 0000000000000..053a980bcf089 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeConnectionInfoImpl.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeConnectionInfoInner; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeConnectionInfo; +import java.util.Collections; +import java.util.Map; + +public final class IntegrationRuntimeConnectionInfoImpl implements IntegrationRuntimeConnectionInfo { + private IntegrationRuntimeConnectionInfoInner innerObject; + + private final SynapseManager serviceManager; + + IntegrationRuntimeConnectionInfoImpl( + IntegrationRuntimeConnectionInfoInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String serviceToken() { + return this.innerModel().serviceToken(); + } + + public String identityCertThumbprint() { + return this.innerModel().identityCertThumbprint(); + } + + public String hostServiceUri() { + return this.innerModel().hostServiceUri(); + } + + public String version() { + return this.innerModel().version(); + } + + public String publicKey() { + return this.innerModel().publicKey(); + } + + public Boolean isIdentityCertExprired() { + return this.innerModel().isIdentityCertExprired(); + } + + public Map additionalProperties() { + Map inner = this.innerModel().additionalProperties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public IntegrationRuntimeConnectionInfoInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeConnectionInfosClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeConnectionInfosClientImpl.java new file mode 100644 index 0000000000000..1d1a68d3dec62 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeConnectionInfosClientImpl.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.IntegrationRuntimeConnectionInfosClient; +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeConnectionInfoInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in IntegrationRuntimeConnectionInfosClient. + */ +public final class IntegrationRuntimeConnectionInfosClientImpl implements IntegrationRuntimeConnectionInfosClient { + private final ClientLogger logger = new ClientLogger(IntegrationRuntimeConnectionInfosClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final IntegrationRuntimeConnectionInfosService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of IntegrationRuntimeConnectionInfosClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IntegrationRuntimeConnectionInfosClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + IntegrationRuntimeConnectionInfosService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientIntegrationRuntimeConnectionInfos to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface IntegrationRuntimeConnectionInfosService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/getConnectionInfo") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("integrationRuntimeName") String integrationRuntimeName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get connection info for 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection info for an integration runtime. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get connection info for 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection info for an integration runtime. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + accept, + context); + } + + /** + * Get connection info for 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection info for an integration runtime. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return getWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get connection info for 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection info for an integration runtime. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IntegrationRuntimeConnectionInfoInner get( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return getAsync(resourceGroupName, workspaceName, integrationRuntimeName).block(); + } + + /** + * Get connection info for 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection info for an integration runtime. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName, context).block(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeConnectionInfosImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeConnectionInfosImpl.java new file mode 100644 index 0000000000000..4bea1c56d28ca --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeConnectionInfosImpl.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.IntegrationRuntimeConnectionInfosClient; +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeConnectionInfoInner; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeConnectionInfo; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeConnectionInfos; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class IntegrationRuntimeConnectionInfosImpl implements IntegrationRuntimeConnectionInfos { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IntegrationRuntimeConnectionInfosImpl.class); + + private final IntegrationRuntimeConnectionInfosClient innerClient; + + private final SynapseManager serviceManager; + + public IntegrationRuntimeConnectionInfosImpl( + IntegrationRuntimeConnectionInfosClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public IntegrationRuntimeConnectionInfo get( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + IntegrationRuntimeConnectionInfoInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, integrationRuntimeName); + if (inner != null) { + return new IntegrationRuntimeConnectionInfoImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, integrationRuntimeName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IntegrationRuntimeConnectionInfoImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private IntegrationRuntimeConnectionInfosClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeCredentialsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeCredentialsClientImpl.java new file mode 100644 index 0000000000000..545032d4c7247 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeCredentialsClientImpl.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.IntegrationRuntimeCredentialsClient; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in IntegrationRuntimeCredentialsClient. */ +public final class IntegrationRuntimeCredentialsClientImpl implements IntegrationRuntimeCredentialsClient { + private final ClientLogger logger = new ClientLogger(IntegrationRuntimeCredentialsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final IntegrationRuntimeCredentialsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of IntegrationRuntimeCredentialsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IntegrationRuntimeCredentialsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + IntegrationRuntimeCredentialsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientIntegrationRuntimeCredentials to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface IntegrationRuntimeCredentialsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/syncCredentials") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> sync( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("integrationRuntimeName") String integrationRuntimeName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Force the integration runtime to synchronize credentials across integration runtime nodes, and this will override + * the credentials across all worker nodes with those available on the dispatcher node. If you already have the + * latest credential backup file, you should manually import it (preferred) on any self-hosted integration runtime + * node than using this API directly. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> syncWithResponseAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .sync( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Force the integration runtime to synchronize credentials across integration runtime nodes, and this will override + * the credentials across all worker nodes with those available on the dispatcher node. If you already have the + * latest credential backup file, you should manually import it (preferred) on any self-hosted integration runtime + * node than using this API directly. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> syncWithResponseAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .sync( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + accept, + context); + } + + /** + * Force the integration runtime to synchronize credentials across integration runtime nodes, and this will override + * the credentials across all worker nodes with those available on the dispatcher node. If you already have the + * latest credential backup file, you should manually import it (preferred) on any self-hosted integration runtime + * node than using this API directly. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono syncAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return syncWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Force the integration runtime to synchronize credentials across integration runtime nodes, and this will override + * the credentials across all worker nodes with those available on the dispatcher node. If you already have the + * latest credential backup file, you should manually import it (preferred) on any self-hosted integration runtime + * node than using this API directly. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void sync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + syncAsync(resourceGroupName, workspaceName, integrationRuntimeName).block(); + } + + /** + * Force the integration runtime to synchronize credentials across integration runtime nodes, and this will override + * the credentials across all worker nodes with those available on the dispatcher node. If you already have the + * latest credential backup file, you should manually import it (preferred) on any self-hosted integration runtime + * node than using this API directly. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response syncWithResponse( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + return syncWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName, context).block(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeCredentialsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeCredentialsImpl.java new file mode 100644 index 0000000000000..6650b8ec3c8cd --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeCredentialsImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.IntegrationRuntimeCredentialsClient; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeCredentials; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class IntegrationRuntimeCredentialsImpl implements IntegrationRuntimeCredentials { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IntegrationRuntimeCredentialsImpl.class); + + private final IntegrationRuntimeCredentialsClient innerClient; + + private final SynapseManager serviceManager; + + public IntegrationRuntimeCredentialsImpl( + IntegrationRuntimeCredentialsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void sync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + this.serviceClient().sync(resourceGroupName, workspaceName, integrationRuntimeName); + } + + public Response syncWithResponse( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + return this.serviceClient().syncWithResponse(resourceGroupName, workspaceName, integrationRuntimeName, context); + } + + private IntegrationRuntimeCredentialsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeMonitoringDataImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeMonitoringDataImpl.java new file mode 100644 index 0000000000000..302aa9c86ec0d --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeMonitoringDataImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeMonitoringDataInner; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeMonitoringData; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeNodeMonitoringData; +import java.util.Collections; +import java.util.List; + +public final class IntegrationRuntimeMonitoringDataImpl implements IntegrationRuntimeMonitoringData { + private IntegrationRuntimeMonitoringDataInner innerObject; + + private final SynapseManager serviceManager; + + IntegrationRuntimeMonitoringDataImpl( + IntegrationRuntimeMonitoringDataInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public List nodes() { + List inner = this.innerModel().nodes(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public IntegrationRuntimeMonitoringDataInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeMonitoringDatasClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeMonitoringDatasClientImpl.java new file mode 100644 index 0000000000000..fc8a10bf4a7e6 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeMonitoringDatasClientImpl.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.IntegrationRuntimeMonitoringDatasClient; +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeMonitoringDataInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in IntegrationRuntimeMonitoringDatasClient. + */ +public final class IntegrationRuntimeMonitoringDatasClientImpl implements IntegrationRuntimeMonitoringDatasClient { + private final ClientLogger logger = new ClientLogger(IntegrationRuntimeMonitoringDatasClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final IntegrationRuntimeMonitoringDatasService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of IntegrationRuntimeMonitoringDatasClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IntegrationRuntimeMonitoringDatasClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + IntegrationRuntimeMonitoringDatasService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientIntegrationRuntimeMonitoringDatas to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface IntegrationRuntimeMonitoringDatasService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/monitoringData") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("integrationRuntimeName") String integrationRuntimeName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get monitoring data for 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return monitoring data for an integration runtime. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get monitoring data for 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return monitoring data for an integration runtime. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + accept, + context); + } + + /** + * Get monitoring data for 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return monitoring data for an integration runtime. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return listWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get monitoring data for 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return monitoring data for an integration runtime. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IntegrationRuntimeMonitoringDataInner list( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return listAsync(resourceGroupName, workspaceName, integrationRuntimeName).block(); + } + + /** + * Get monitoring data for 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return monitoring data for an integration runtime. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + return listWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName, context).block(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeMonitoringDatasImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeMonitoringDatasImpl.java new file mode 100644 index 0000000000000..d5ca441b37947 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeMonitoringDatasImpl.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.IntegrationRuntimeMonitoringDatasClient; +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeMonitoringDataInner; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeMonitoringData; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeMonitoringDatas; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class IntegrationRuntimeMonitoringDatasImpl implements IntegrationRuntimeMonitoringDatas { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IntegrationRuntimeMonitoringDatasImpl.class); + + private final IntegrationRuntimeMonitoringDatasClient innerClient; + + private final SynapseManager serviceManager; + + public IntegrationRuntimeMonitoringDatasImpl( + IntegrationRuntimeMonitoringDatasClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public IntegrationRuntimeMonitoringData list( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + IntegrationRuntimeMonitoringDataInner inner = + this.serviceClient().list(resourceGroupName, workspaceName, integrationRuntimeName); + if (inner != null) { + return new IntegrationRuntimeMonitoringDataImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, workspaceName, integrationRuntimeName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IntegrationRuntimeMonitoringDataImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private IntegrationRuntimeMonitoringDatasClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeNodeIpAddressImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeNodeIpAddressImpl.java new file mode 100644 index 0000000000000..bef87bae477ef --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeNodeIpAddressImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeNodeIpAddressInner; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeNodeIpAddress; + +public final class IntegrationRuntimeNodeIpAddressImpl implements IntegrationRuntimeNodeIpAddress { + private IntegrationRuntimeNodeIpAddressInner innerObject; + + private final SynapseManager serviceManager; + + IntegrationRuntimeNodeIpAddressImpl( + IntegrationRuntimeNodeIpAddressInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String ipAddress() { + return this.innerModel().ipAddress(); + } + + public IntegrationRuntimeNodeIpAddressInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeNodeIpAddressOperationsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeNodeIpAddressOperationsClientImpl.java new file mode 100644 index 0000000000000..b0602e4869ed0 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeNodeIpAddressOperationsClientImpl.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.IntegrationRuntimeNodeIpAddressOperationsClient; +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeNodeIpAddressInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * IntegrationRuntimeNodeIpAddressOperationsClient. + */ +public final class IntegrationRuntimeNodeIpAddressOperationsClientImpl + implements IntegrationRuntimeNodeIpAddressOperationsClient { + private final ClientLogger logger = new ClientLogger(IntegrationRuntimeNodeIpAddressOperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final IntegrationRuntimeNodeIpAddressOperationsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of IntegrationRuntimeNodeIpAddressOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IntegrationRuntimeNodeIpAddressOperationsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + IntegrationRuntimeNodeIpAddressOperationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientIntegrationRuntimeNodeIpAddressOperations to + * be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface IntegrationRuntimeNodeIpAddressOperationsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/nodes/{nodeName}/ipAddress") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("integrationRuntimeName") String integrationRuntimeName, + @PathParam("nodeName") String nodeName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the IP address of an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IP address of an integration runtime node. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, String nodeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + if (nodeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + nodeName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the IP address of an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IP address of an integration runtime node. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String nodeName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + if (nodeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + nodeName, + accept, + context); + } + + /** + * Get the IP address of an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IP address of an integration runtime node. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, String nodeName) { + return getWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName, nodeName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the IP address of an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IP address of an integration runtime node. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IntegrationRuntimeNodeIpAddressInner get( + String resourceGroupName, String workspaceName, String integrationRuntimeName, String nodeName) { + return getAsync(resourceGroupName, workspaceName, integrationRuntimeName, nodeName).block(); + } + + /** + * Get the IP address of an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IP address of an integration runtime node. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String nodeName, + Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName, nodeName, context) + .block(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeNodeIpAddressOperationsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeNodeIpAddressOperationsImpl.java new file mode 100644 index 0000000000000..9ebe5732b2e78 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeNodeIpAddressOperationsImpl.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.IntegrationRuntimeNodeIpAddressOperationsClient; +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeNodeIpAddressInner; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeNodeIpAddress; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeNodeIpAddressOperations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class IntegrationRuntimeNodeIpAddressOperationsImpl implements IntegrationRuntimeNodeIpAddressOperations { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(IntegrationRuntimeNodeIpAddressOperationsImpl.class); + + private final IntegrationRuntimeNodeIpAddressOperationsClient innerClient; + + private final SynapseManager serviceManager; + + public IntegrationRuntimeNodeIpAddressOperationsImpl( + IntegrationRuntimeNodeIpAddressOperationsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public IntegrationRuntimeNodeIpAddress get( + String resourceGroupName, String workspaceName, String integrationRuntimeName, String nodeName) { + IntegrationRuntimeNodeIpAddressInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, integrationRuntimeName, nodeName); + if (inner != null) { + return new IntegrationRuntimeNodeIpAddressImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String nodeName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, workspaceName, integrationRuntimeName, nodeName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IntegrationRuntimeNodeIpAddressImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private IntegrationRuntimeNodeIpAddressOperationsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeNodesClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeNodesClientImpl.java new file mode 100644 index 0000000000000..1c3f1fdbe4f47 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeNodesClientImpl.java @@ -0,0 +1,721 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.IntegrationRuntimeNodesClient; +import com.azure.resourcemanager.synapse.fluent.models.SelfHostedIntegrationRuntimeNodeInner; +import com.azure.resourcemanager.synapse.models.UpdateIntegrationRuntimeNodeRequest; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in IntegrationRuntimeNodesClient. */ +public final class IntegrationRuntimeNodesClientImpl implements IntegrationRuntimeNodesClient { + private final ClientLogger logger = new ClientLogger(IntegrationRuntimeNodesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final IntegrationRuntimeNodesService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of IntegrationRuntimeNodesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IntegrationRuntimeNodesClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create(IntegrationRuntimeNodesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientIntegrationRuntimeNodes to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface IntegrationRuntimeNodesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/nodes/{nodeName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("integrationRuntimeName") String integrationRuntimeName, + @PathParam("nodeName") String nodeName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/nodes/{nodeName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("integrationRuntimeName") String integrationRuntimeName, + @PathParam("nodeName") String nodeName, + @BodyParam("application/json") UpdateIntegrationRuntimeNodeRequest updateIntegrationRuntimeNodeRequest, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/nodes/{nodeName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("integrationRuntimeName") String integrationRuntimeName, + @PathParam("nodeName") String nodeName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an integration runtime node. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, String nodeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + if (nodeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + nodeName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an integration runtime node. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String nodeName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + if (nodeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + nodeName, + accept, + context); + } + + /** + * Get an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an integration runtime node. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, String nodeName) { + return getWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName, nodeName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an integration runtime node. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SelfHostedIntegrationRuntimeNodeInner get( + String resourceGroupName, String workspaceName, String integrationRuntimeName, String nodeName) { + return getAsync(resourceGroupName, workspaceName, integrationRuntimeName, nodeName).block(); + } + + /** + * Get an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an integration runtime node. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String nodeName, + Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName, nodeName, context) + .block(); + } + + /** + * Create an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @param updateIntegrationRuntimeNodeRequest The parameters for updating an integration runtime node. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of Self-hosted integration runtime node. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String nodeName, + UpdateIntegrationRuntimeNodeRequest updateIntegrationRuntimeNodeRequest) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + if (nodeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeName is required and cannot be null.")); + } + if (updateIntegrationRuntimeNodeRequest == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter updateIntegrationRuntimeNodeRequest is required and cannot be null.")); + } else { + updateIntegrationRuntimeNodeRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + nodeName, + updateIntegrationRuntimeNodeRequest, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @param updateIntegrationRuntimeNodeRequest The parameters for updating an integration runtime node. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of Self-hosted integration runtime node. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String nodeName, + UpdateIntegrationRuntimeNodeRequest updateIntegrationRuntimeNodeRequest, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + if (nodeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeName is required and cannot be null.")); + } + if (updateIntegrationRuntimeNodeRequest == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter updateIntegrationRuntimeNodeRequest is required and cannot be null.")); + } else { + updateIntegrationRuntimeNodeRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + nodeName, + updateIntegrationRuntimeNodeRequest, + accept, + context); + } + + /** + * Create an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @param updateIntegrationRuntimeNodeRequest The parameters for updating an integration runtime node. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of Self-hosted integration runtime node. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String nodeName, + UpdateIntegrationRuntimeNodeRequest updateIntegrationRuntimeNodeRequest) { + return updateWithResponseAsync( + resourceGroupName, workspaceName, integrationRuntimeName, nodeName, updateIntegrationRuntimeNodeRequest) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @param updateIntegrationRuntimeNodeRequest The parameters for updating an integration runtime node. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of Self-hosted integration runtime node. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SelfHostedIntegrationRuntimeNodeInner update( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String nodeName, + UpdateIntegrationRuntimeNodeRequest updateIntegrationRuntimeNodeRequest) { + return updateAsync( + resourceGroupName, workspaceName, integrationRuntimeName, nodeName, updateIntegrationRuntimeNodeRequest) + .block(); + } + + /** + * Create an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @param updateIntegrationRuntimeNodeRequest The parameters for updating an integration runtime node. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of Self-hosted integration runtime node. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String nodeName, + UpdateIntegrationRuntimeNodeRequest updateIntegrationRuntimeNodeRequest, + Context context) { + return updateWithResponseAsync( + resourceGroupName, + workspaceName, + integrationRuntimeName, + nodeName, + updateIntegrationRuntimeNodeRequest, + context) + .block(); + } + + /** + * Delete an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, String nodeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + if (nodeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + nodeName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Delete an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String nodeName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + if (nodeName == null) { + return Mono.error(new IllegalArgumentException("Parameter nodeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + nodeName, + accept, + context); + } + + /** + * Delete an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, String nodeName) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName, nodeName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String integrationRuntimeName, String nodeName) { + deleteAsync(resourceGroupName, workspaceName, integrationRuntimeName, nodeName).block(); + } + + /** + * Delete an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String nodeName, + Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName, nodeName, context) + .block(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeNodesImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeNodesImpl.java new file mode 100644 index 0000000000000..91f86e032dfe1 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeNodesImpl.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.IntegrationRuntimeNodesClient; +import com.azure.resourcemanager.synapse.fluent.models.SelfHostedIntegrationRuntimeNodeInner; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeNodes; +import com.azure.resourcemanager.synapse.models.SelfHostedIntegrationRuntimeNode; +import com.azure.resourcemanager.synapse.models.UpdateIntegrationRuntimeNodeRequest; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class IntegrationRuntimeNodesImpl implements IntegrationRuntimeNodes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IntegrationRuntimeNodesImpl.class); + + private final IntegrationRuntimeNodesClient innerClient; + + private final SynapseManager serviceManager; + + public IntegrationRuntimeNodesImpl(IntegrationRuntimeNodesClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public SelfHostedIntegrationRuntimeNode get( + String resourceGroupName, String workspaceName, String integrationRuntimeName, String nodeName) { + SelfHostedIntegrationRuntimeNodeInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, integrationRuntimeName, nodeName); + if (inner != null) { + return new SelfHostedIntegrationRuntimeNodeImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String nodeName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, workspaceName, integrationRuntimeName, nodeName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SelfHostedIntegrationRuntimeNodeImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SelfHostedIntegrationRuntimeNode update( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String nodeName, + UpdateIntegrationRuntimeNodeRequest updateIntegrationRuntimeNodeRequest) { + SelfHostedIntegrationRuntimeNodeInner inner = + this + .serviceClient() + .update( + resourceGroupName, + workspaceName, + integrationRuntimeName, + nodeName, + updateIntegrationRuntimeNodeRequest); + if (inner != null) { + return new SelfHostedIntegrationRuntimeNodeImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response updateWithResponse( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String nodeName, + UpdateIntegrationRuntimeNodeRequest updateIntegrationRuntimeNodeRequest, + Context context) { + Response inner = + this + .serviceClient() + .updateWithResponse( + resourceGroupName, + workspaceName, + integrationRuntimeName, + nodeName, + updateIntegrationRuntimeNodeRequest, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SelfHostedIntegrationRuntimeNodeImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String workspaceName, String integrationRuntimeName, String nodeName) { + this.serviceClient().delete(resourceGroupName, workspaceName, integrationRuntimeName, nodeName); + } + + public Response deleteWithResponse( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String nodeName, + Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, workspaceName, integrationRuntimeName, nodeName, context); + } + + private IntegrationRuntimeNodesClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeObjectMetadatasClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeObjectMetadatasClientImpl.java new file mode 100644 index 0000000000000..06fc87ea4724f --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeObjectMetadatasClientImpl.java @@ -0,0 +1,599 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.IntegrationRuntimeObjectMetadatasClient; +import com.azure.resourcemanager.synapse.fluent.models.SsisObjectMetadataListResponseInner; +import com.azure.resourcemanager.synapse.fluent.models.SsisObjectMetadataStatusResponseInner; +import com.azure.resourcemanager.synapse.models.GetSsisObjectMetadataRequest; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in IntegrationRuntimeObjectMetadatasClient. + */ +public final class IntegrationRuntimeObjectMetadatasClientImpl implements IntegrationRuntimeObjectMetadatasClient { + private final ClientLogger logger = new ClientLogger(IntegrationRuntimeObjectMetadatasClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final IntegrationRuntimeObjectMetadatasService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of IntegrationRuntimeObjectMetadatasClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IntegrationRuntimeObjectMetadatasClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + IntegrationRuntimeObjectMetadatasService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientIntegrationRuntimeObjectMetadatas to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface IntegrationRuntimeObjectMetadatasService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/getObjectMetadata") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("integrationRuntimeName") String integrationRuntimeName, + @BodyParam("application/json") GetSsisObjectMetadataRequest getMetadataRequest, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/refreshObjectMetadata") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> refresh( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("integrationRuntimeName") String integrationRuntimeName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get object metadata from 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 getMetadataRequest The parameters for getting a SSIS object metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object metadata from an integration runtime. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + GetSsisObjectMetadataRequest getMetadataRequest) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + if (getMetadataRequest != null) { + getMetadataRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + getMetadataRequest, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get object metadata from 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 getMetadataRequest The parameters for getting a SSIS object metadata. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object metadata from an integration runtime. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + GetSsisObjectMetadataRequest getMetadataRequest, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + if (getMetadataRequest != null) { + getMetadataRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + getMetadataRequest, + accept, + context); + } + + /** + * Get object metadata from 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 getMetadataRequest The parameters for getting a SSIS object metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object metadata from an integration runtime. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + GetSsisObjectMetadataRequest getMetadataRequest) { + return listWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName, getMetadataRequest) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get object metadata from 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object metadata from an integration runtime. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + final GetSsisObjectMetadataRequest getMetadataRequest = null; + return listWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName, getMetadataRequest) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get object metadata from 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object metadata from an integration runtime. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SsisObjectMetadataListResponseInner list( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + final GetSsisObjectMetadataRequest getMetadataRequest = null; + return listAsync(resourceGroupName, workspaceName, integrationRuntimeName, getMetadataRequest).block(); + } + + /** + * Get object metadata from 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 getMetadataRequest The parameters for getting a SSIS object metadata. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object metadata from an integration runtime. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + GetSsisObjectMetadataRequest getMetadataRequest, + Context context) { + return listWithResponseAsync( + resourceGroupName, workspaceName, integrationRuntimeName, getMetadataRequest, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> refreshWithResponseAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .refresh( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> refreshWithResponseAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .refresh( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SsisObjectMetadataStatusResponseInner> + beginRefreshAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + Mono>> mono = + refreshWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SsisObjectMetadataStatusResponseInner.class, + SsisObjectMetadataStatusResponseInner.class, + Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SsisObjectMetadataStatusResponseInner> + beginRefreshAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + refreshWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SsisObjectMetadataStatusResponseInner.class, + SsisObjectMetadataStatusResponseInner.class, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SsisObjectMetadataStatusResponseInner> + beginRefresh(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return beginRefreshAsync(resourceGroupName, workspaceName, integrationRuntimeName).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SsisObjectMetadataStatusResponseInner> + beginRefresh(String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + return beginRefreshAsync(resourceGroupName, workspaceName, integrationRuntimeName, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono refreshAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return beginRefreshAsync(resourceGroupName, workspaceName, integrationRuntimeName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono refreshAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + return beginRefreshAsync(resourceGroupName, workspaceName, integrationRuntimeName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SsisObjectMetadataStatusResponseInner refresh( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return refreshAsync(resourceGroupName, workspaceName, integrationRuntimeName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SsisObjectMetadataStatusResponseInner refresh( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + return refreshAsync(resourceGroupName, workspaceName, integrationRuntimeName, context).block(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeObjectMetadatasImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeObjectMetadatasImpl.java new file mode 100644 index 0000000000000..2f188bd9dea5f --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeObjectMetadatasImpl.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.IntegrationRuntimeObjectMetadatasClient; +import com.azure.resourcemanager.synapse.fluent.models.SsisObjectMetadataListResponseInner; +import com.azure.resourcemanager.synapse.fluent.models.SsisObjectMetadataStatusResponseInner; +import com.azure.resourcemanager.synapse.models.GetSsisObjectMetadataRequest; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeObjectMetadatas; +import com.azure.resourcemanager.synapse.models.SsisObjectMetadataListResponse; +import com.azure.resourcemanager.synapse.models.SsisObjectMetadataStatusResponse; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class IntegrationRuntimeObjectMetadatasImpl implements IntegrationRuntimeObjectMetadatas { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IntegrationRuntimeObjectMetadatasImpl.class); + + private final IntegrationRuntimeObjectMetadatasClient innerClient; + + private final SynapseManager serviceManager; + + public IntegrationRuntimeObjectMetadatasImpl( + IntegrationRuntimeObjectMetadatasClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public SsisObjectMetadataListResponse list( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + SsisObjectMetadataListResponseInner inner = + this.serviceClient().list(resourceGroupName, workspaceName, integrationRuntimeName); + if (inner != null) { + return new SsisObjectMetadataListResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + GetSsisObjectMetadataRequest getMetadataRequest, + Context context) { + Response inner = + this + .serviceClient() + .listWithResponse( + resourceGroupName, workspaceName, integrationRuntimeName, getMetadataRequest, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SsisObjectMetadataListResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SsisObjectMetadataStatusResponse refresh( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + SsisObjectMetadataStatusResponseInner inner = + this.serviceClient().refresh(resourceGroupName, workspaceName, integrationRuntimeName); + if (inner != null) { + return new SsisObjectMetadataStatusResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public SsisObjectMetadataStatusResponse refresh( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + SsisObjectMetadataStatusResponseInner inner = + this.serviceClient().refresh(resourceGroupName, workspaceName, integrationRuntimeName, context); + if (inner != null) { + return new SsisObjectMetadataStatusResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private IntegrationRuntimeObjectMetadatasClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeResourceImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeResourceImpl.java new file mode 100644 index 0000000000000..73085df4a842f --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeResourceImpl.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeResourceInner; +import com.azure.resourcemanager.synapse.models.IntegrationRuntime; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeAutoUpdate; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeResource; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeStatusResponse; +import com.azure.resourcemanager.synapse.models.UpdateIntegrationRuntimeRequest; + +public final class IntegrationRuntimeResourceImpl + implements IntegrationRuntimeResource, IntegrationRuntimeResource.Definition, IntegrationRuntimeResource.Update { + private IntegrationRuntimeResourceInner innerObject; + + private final SynapseManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public IntegrationRuntime properties() { + return this.innerModel().properties(); + } + + public IntegrationRuntimeResourceInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String integrationRuntimeName; + + private String createIfMatch; + + private UpdateIntegrationRuntimeRequest updateUpdateIntegrationRuntimeRequest; + + public IntegrationRuntimeResourceImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public IntegrationRuntimeResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getIntegrationRuntimes() + .create( + resourceGroupName, + workspaceName, + integrationRuntimeName, + this.innerModel(), + createIfMatch, + Context.NONE); + return this; + } + + public IntegrationRuntimeResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIntegrationRuntimes() + .create( + resourceGroupName, + workspaceName, + integrationRuntimeName, + this.innerModel(), + createIfMatch, + context); + return this; + } + + IntegrationRuntimeResourceImpl(String name, SynapseManager serviceManager) { + this.innerObject = new IntegrationRuntimeResourceInner(); + this.serviceManager = serviceManager; + this.integrationRuntimeName = name; + this.createIfMatch = null; + } + + public IntegrationRuntimeResourceImpl update() { + this.updateUpdateIntegrationRuntimeRequest = new UpdateIntegrationRuntimeRequest(); + return this; + } + + public IntegrationRuntimeResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getIntegrationRuntimes() + .updateWithResponse( + resourceGroupName, + workspaceName, + integrationRuntimeName, + updateUpdateIntegrationRuntimeRequest, + Context.NONE) + .getValue(); + return this; + } + + public IntegrationRuntimeResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIntegrationRuntimes() + .updateWithResponse( + resourceGroupName, + workspaceName, + integrationRuntimeName, + updateUpdateIntegrationRuntimeRequest, + context) + .getValue(); + return this; + } + + IntegrationRuntimeResourceImpl(IntegrationRuntimeResourceInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.integrationRuntimeName = Utils.getValueFromIdByName(innerObject.id(), "integrationRuntimes"); + } + + public IntegrationRuntimeResource refresh() { + String localIfNoneMatch = null; + this.innerObject = + serviceManager + .serviceClient() + .getIntegrationRuntimes() + .getWithResponse( + resourceGroupName, workspaceName, integrationRuntimeName, localIfNoneMatch, Context.NONE) + .getValue(); + return this; + } + + public IntegrationRuntimeResource refresh(Context context) { + String localIfNoneMatch = null; + this.innerObject = + serviceManager + .serviceClient() + .getIntegrationRuntimes() + .getWithResponse(resourceGroupName, workspaceName, integrationRuntimeName, localIfNoneMatch, context) + .getValue(); + return this; + } + + public void upgrade() { + serviceManager.integrationRuntimes().upgrade(resourceGroupName, workspaceName, integrationRuntimeName); + } + + public Response upgradeWithResponse(Context context) { + return serviceManager + .integrationRuntimes() + .upgradeWithResponse(resourceGroupName, workspaceName, integrationRuntimeName, context); + } + + public IntegrationRuntimeStatusResponse start() { + return serviceManager.integrationRuntimes().start(resourceGroupName, workspaceName, integrationRuntimeName); + } + + public IntegrationRuntimeStatusResponse start(Context context) { + return serviceManager + .integrationRuntimes() + .start(resourceGroupName, workspaceName, integrationRuntimeName, context); + } + + public void stop() { + serviceManager.integrationRuntimes().stop(resourceGroupName, workspaceName, integrationRuntimeName); + } + + public void stop(Context context) { + serviceManager.integrationRuntimes().stop(resourceGroupName, workspaceName, integrationRuntimeName, context); + } + + public void enableInteractiveQuery() { + serviceManager + .integrationRuntimes() + .enableInteractiveQuery(resourceGroupName, workspaceName, integrationRuntimeName); + } + + public void enableInteractiveQuery(Context context) { + serviceManager + .integrationRuntimes() + .enableInteractiveQuery(resourceGroupName, workspaceName, integrationRuntimeName, context); + } + + public void disableInteractiveQuery() { + serviceManager + .integrationRuntimes() + .disableInteractiveQuery(resourceGroupName, workspaceName, integrationRuntimeName); + } + + public void disableInteractiveQuery(Context context) { + serviceManager + .integrationRuntimes() + .disableInteractiveQuery(resourceGroupName, workspaceName, integrationRuntimeName, context); + } + + public IntegrationRuntimeResourceImpl withProperties(IntegrationRuntime properties) { + this.innerModel().withProperties(properties); + return this; + } + + public IntegrationRuntimeResourceImpl withIfMatch(String ifMatch) { + this.createIfMatch = ifMatch; + return this; + } + + public IntegrationRuntimeResourceImpl withAutoUpdate(IntegrationRuntimeAutoUpdate autoUpdate) { + this.updateUpdateIntegrationRuntimeRequest.withAutoUpdate(autoUpdate); + return this; + } + + public IntegrationRuntimeResourceImpl withUpdateDelayOffset(String updateDelayOffset) { + this.updateUpdateIntegrationRuntimeRequest.withUpdateDelayOffset(updateDelayOffset); + return this; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeStatusOperationsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeStatusOperationsClientImpl.java new file mode 100644 index 0000000000000..d60964f5735ec --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeStatusOperationsClientImpl.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.IntegrationRuntimeStatusOperationsClient; +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeStatusResponseInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in IntegrationRuntimeStatusOperationsClient. + */ +public final class IntegrationRuntimeStatusOperationsClientImpl implements IntegrationRuntimeStatusOperationsClient { + private final ClientLogger logger = new ClientLogger(IntegrationRuntimeStatusOperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final IntegrationRuntimeStatusOperationsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of IntegrationRuntimeStatusOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IntegrationRuntimeStatusOperationsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + IntegrationRuntimeStatusOperationsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientIntegrationRuntimeStatusOperations to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface IntegrationRuntimeStatusOperationsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/getStatus") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("integrationRuntimeName") String integrationRuntimeName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the integration runtime status. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the integration runtime status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the integration runtime status. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the integration runtime status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + accept, + context); + } + + /** + * Get the integration runtime status. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the integration runtime status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return getWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the integration runtime status. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the integration runtime status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IntegrationRuntimeStatusResponseInner get( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return getAsync(resourceGroupName, workspaceName, integrationRuntimeName).block(); + } + + /** + * Get the integration runtime status. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the integration runtime status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName, context).block(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeStatusOperationsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeStatusOperationsImpl.java new file mode 100644 index 0000000000000..d87e5702593fb --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeStatusOperationsImpl.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.IntegrationRuntimeStatusOperationsClient; +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeStatusResponseInner; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeStatusOperations; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeStatusResponse; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class IntegrationRuntimeStatusOperationsImpl implements IntegrationRuntimeStatusOperations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IntegrationRuntimeStatusOperationsImpl.class); + + private final IntegrationRuntimeStatusOperationsClient innerClient; + + private final SynapseManager serviceManager; + + public IntegrationRuntimeStatusOperationsImpl( + IntegrationRuntimeStatusOperationsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public IntegrationRuntimeStatusResponse get( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + IntegrationRuntimeStatusResponseInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, integrationRuntimeName); + if (inner != null) { + return new IntegrationRuntimeStatusResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, integrationRuntimeName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IntegrationRuntimeStatusResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private IntegrationRuntimeStatusOperationsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeStatusResponseImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeStatusResponseImpl.java new file mode 100644 index 0000000000000..7a262553bae9a --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimeStatusResponseImpl.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeStatusResponseInner; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeStatus; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeStatusResponse; + +public final class IntegrationRuntimeStatusResponseImpl implements IntegrationRuntimeStatusResponse { + private IntegrationRuntimeStatusResponseInner innerObject; + + private final SynapseManager serviceManager; + + IntegrationRuntimeStatusResponseImpl( + IntegrationRuntimeStatusResponseInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public IntegrationRuntimeStatus properties() { + return this.innerModel().properties(); + } + + public IntegrationRuntimeStatusResponseInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimesClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimesClientImpl.java new file mode 100644 index 0000000000000..906054a2ab06d --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimesClientImpl.java @@ -0,0 +1,2807 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.IntegrationRuntimesClient; +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeResourceInner; +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeStatusResponseInner; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeListResponse; +import com.azure.resourcemanager.synapse.models.UpdateIntegrationRuntimeRequest; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in IntegrationRuntimesClient. */ +public final class IntegrationRuntimesClientImpl implements IntegrationRuntimesClient { + private final ClientLogger logger = new ClientLogger(IntegrationRuntimesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final IntegrationRuntimesService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of IntegrationRuntimesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IntegrationRuntimesClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy.create(IntegrationRuntimesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientIntegrationRuntimes to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface IntegrationRuntimesService { + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/integrationRuntimes/{integrationRuntimeName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("integrationRuntimeName") String integrationRuntimeName, + @BodyParam("application/json") UpdateIntegrationRuntimeRequest updateIntegrationRuntimeRequest, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/integrationRuntimes/{integrationRuntimeName}") + @ExpectedResponses({200, 304}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("integrationRuntimeName") String integrationRuntimeName, + @HeaderParam("If-None-Match") String ifNoneMatch, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/integrationRuntimes/{integrationRuntimeName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("integrationRuntimeName") String integrationRuntimeName, + @HeaderParam("If-Match") String ifMatch, + @BodyParam("application/json") IntegrationRuntimeResourceInner integrationRuntime, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/integrationRuntimes/{integrationRuntimeName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("integrationRuntimeName") String integrationRuntimeName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/upgrade") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> upgrade( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("integrationRuntimeName") String integrationRuntimeName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/integrationRuntimes") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspace( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("integrationRuntimeName") String integrationRuntimeName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/stop") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> stop( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("integrationRuntimeName") String integrationRuntimeName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/enableInteractiveQuery") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> enableInteractiveQuery( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("integrationRuntimeName") String integrationRuntimeName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/disableInteractiveQuery") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> disableInteractiveQuery( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("integrationRuntimeName") String integrationRuntimeName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspaceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Update 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 updateIntegrationRuntimeRequest The parameters for updating an integration runtime. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + UpdateIntegrationRuntimeRequest updateIntegrationRuntimeRequest) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + if (updateIntegrationRuntimeRequest == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter updateIntegrationRuntimeRequest is required and cannot be null.")); + } else { + updateIntegrationRuntimeRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + updateIntegrationRuntimeRequest, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Update 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 updateIntegrationRuntimeRequest The parameters for updating an integration runtime. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + UpdateIntegrationRuntimeRequest updateIntegrationRuntimeRequest, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + if (updateIntegrationRuntimeRequest == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter updateIntegrationRuntimeRequest is required and cannot be null.")); + } else { + updateIntegrationRuntimeRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + updateIntegrationRuntimeRequest, + accept, + context); + } + + /** + * Update 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 updateIntegrationRuntimeRequest The parameters for updating an integration runtime. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + UpdateIntegrationRuntimeRequest updateIntegrationRuntimeRequest) { + return updateWithResponseAsync( + resourceGroupName, workspaceName, integrationRuntimeName, updateIntegrationRuntimeRequest) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update 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 updateIntegrationRuntimeRequest The parameters for updating an integration runtime. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IntegrationRuntimeResourceInner update( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + UpdateIntegrationRuntimeRequest updateIntegrationRuntimeRequest) { + return updateAsync(resourceGroupName, workspaceName, integrationRuntimeName, updateIntegrationRuntimeRequest) + .block(); + } + + /** + * Update 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 updateIntegrationRuntimeRequest The parameters for updating an integration runtime. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + UpdateIntegrationRuntimeRequest updateIntegrationRuntimeRequest, + Context context) { + return updateWithResponseAsync( + resourceGroupName, workspaceName, integrationRuntimeName, updateIntegrationRuntimeRequest, context) + .block(); + } + + /** + * Get 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 ifNoneMatch ETag of the integration runtime entity. Should only be specified for get. If the ETag matches + * the existing entity tag, or if * was provided, then no content will be returned. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an integration runtime. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, String ifNoneMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + ifNoneMatch, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get 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 ifNoneMatch ETag of the integration runtime entity. Should only be specified for get. If the ETag matches + * the existing entity tag, or if * was provided, then no content will be returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an integration runtime. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String ifNoneMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + ifNoneMatch, + accept, + context); + } + + /** + * Get 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 ifNoneMatch ETag of the integration runtime entity. Should only be specified for get. If the ETag matches + * the existing entity tag, or if * was provided, then no content will be returned. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an integration runtime. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, String ifNoneMatch) { + return getWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName, ifNoneMatch) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an integration runtime. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + final String ifNoneMatch = null; + return getWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName, ifNoneMatch) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an integration runtime. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IntegrationRuntimeResourceInner get( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + final String ifNoneMatch = null; + return getAsync(resourceGroupName, workspaceName, integrationRuntimeName, ifNoneMatch).block(); + } + + /** + * Get 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 ifNoneMatch ETag of the integration runtime entity. Should only be specified for get. If the ETag matches + * the existing entity tag, or if * was provided, then no content will be returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an integration runtime. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String ifNoneMatch, + Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName, ifNoneMatch, context) + .block(); + } + + /** + * Create 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 integrationRuntime Integration runtime resource definition. + * @param ifMatch ETag of the integration runtime entity. Should only be specified for update, for which it should + * match existing entity or can be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + IntegrationRuntimeResourceInner integrationRuntime, + String ifMatch) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + if (integrationRuntime == null) { + return Mono + .error(new IllegalArgumentException("Parameter integrationRuntime is required and cannot be null.")); + } else { + integrationRuntime.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + ifMatch, + integrationRuntime, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create 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 integrationRuntime Integration runtime resource definition. + * @param ifMatch ETag of the integration runtime entity. Should only be specified for update, for which it should + * match existing entity or can be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + IntegrationRuntimeResourceInner integrationRuntime, + String ifMatch, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + if (integrationRuntime == null) { + return Mono + .error(new IllegalArgumentException("Parameter integrationRuntime is required and cannot be null.")); + } else { + integrationRuntime.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + ifMatch, + integrationRuntime, + accept, + context); + } + + /** + * Create 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 integrationRuntime Integration runtime resource definition. + * @param ifMatch ETag of the integration runtime entity. Should only be specified for update, for which it should + * match existing entity or can be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, IntegrationRuntimeResourceInner> beginCreateAsync( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + IntegrationRuntimeResourceInner integrationRuntime, + String ifMatch) { + Mono>> mono = + createWithResponseAsync( + resourceGroupName, workspaceName, integrationRuntimeName, integrationRuntime, ifMatch); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + IntegrationRuntimeResourceInner.class, + IntegrationRuntimeResourceInner.class, + Context.NONE); + } + + /** + * Create 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 integrationRuntime Integration runtime resource definition. + * @param ifMatch ETag of the integration runtime entity. Should only be specified for update, for which it should + * match existing entity or can be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, IntegrationRuntimeResourceInner> beginCreateAsync( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + IntegrationRuntimeResourceInner integrationRuntime, + String ifMatch, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, workspaceName, integrationRuntimeName, integrationRuntime, ifMatch, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + IntegrationRuntimeResourceInner.class, + IntegrationRuntimeResourceInner.class, + context); + } + + /** + * Create 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 integrationRuntime Integration runtime resource definition. + * @param ifMatch ETag of the integration runtime entity. Should only be specified for update, for which it should + * match existing entity or can be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, IntegrationRuntimeResourceInner> beginCreate( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + IntegrationRuntimeResourceInner integrationRuntime, + String ifMatch) { + return beginCreateAsync(resourceGroupName, workspaceName, integrationRuntimeName, integrationRuntime, ifMatch) + .getSyncPoller(); + } + + /** + * Create 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 integrationRuntime Integration runtime resource definition. + * @param ifMatch ETag of the integration runtime entity. Should only be specified for update, for which it should + * match existing entity or can be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, IntegrationRuntimeResourceInner> beginCreate( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + IntegrationRuntimeResourceInner integrationRuntime, + String ifMatch, + Context context) { + return beginCreateAsync( + resourceGroupName, workspaceName, integrationRuntimeName, integrationRuntime, ifMatch, context) + .getSyncPoller(); + } + + /** + * Create 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 integrationRuntime Integration runtime resource definition. + * @param ifMatch ETag of the integration runtime entity. Should only be specified for update, for which it should + * match existing entity or can be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + IntegrationRuntimeResourceInner integrationRuntime, + String ifMatch) { + return beginCreateAsync(resourceGroupName, workspaceName, integrationRuntimeName, integrationRuntime, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create 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 integrationRuntime Integration runtime resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + IntegrationRuntimeResourceInner integrationRuntime) { + final String ifMatch = null; + return beginCreateAsync(resourceGroupName, workspaceName, integrationRuntimeName, integrationRuntime, ifMatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create 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 integrationRuntime Integration runtime resource definition. + * @param ifMatch ETag of the integration runtime entity. Should only be specified for update, for which it should + * match existing entity or can be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + IntegrationRuntimeResourceInner integrationRuntime, + String ifMatch, + Context context) { + return beginCreateAsync( + resourceGroupName, workspaceName, integrationRuntimeName, integrationRuntime, ifMatch, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create 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 integrationRuntime Integration runtime resource definition. + * @param ifMatch ETag of the integration runtime entity. Should only be specified for update, for which it should + * match existing entity or can be * for unconditional update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IntegrationRuntimeResourceInner create( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + IntegrationRuntimeResourceInner integrationRuntime, + String ifMatch) { + return createAsync(resourceGroupName, workspaceName, integrationRuntimeName, integrationRuntime, ifMatch) + .block(); + } + + /** + * Create 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 integrationRuntime Integration runtime resource definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IntegrationRuntimeResourceInner create( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + IntegrationRuntimeResourceInner integrationRuntime) { + final String ifMatch = null; + return createAsync(resourceGroupName, workspaceName, integrationRuntimeName, integrationRuntime, ifMatch) + .block(); + } + + /** + * Create 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 integrationRuntime Integration runtime resource definition. + * @param ifMatch ETag of the integration runtime entity. Should only be specified for update, for which it should + * match existing entity or can be * for unconditional update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime resource type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IntegrationRuntimeResourceInner create( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + IntegrationRuntimeResourceInner integrationRuntime, + String ifMatch, + Context context) { + return createAsync( + resourceGroupName, workspaceName, integrationRuntimeName, integrationRuntime, ifMatch, context) + .block(); + } + + /** + * Delete 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Delete 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + accept, + context); + } + + /** + * Delete 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return beginDeleteAsync(resourceGroupName, workspaceName, integrationRuntimeName).getSyncPoller(); + } + + /** + * Delete 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, integrationRuntimeName, context).getSyncPoller(); + } + + /** + * Delete 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return beginDeleteAsync(resourceGroupName, workspaceName, integrationRuntimeName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, integrationRuntimeName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + deleteAsync(resourceGroupName, workspaceName, integrationRuntimeName).block(); + } + + /** + * Delete 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + deleteAsync(resourceGroupName, workspaceName, integrationRuntimeName, context).block(); + } + + /** + * Upgrade 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> upgradeWithResponseAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .upgrade( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Upgrade 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> upgradeWithResponseAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .upgrade( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + accept, + context); + } + + /** + * Upgrade 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono upgradeAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return upgradeWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Upgrade 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void upgrade(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + upgradeAsync(resourceGroupName, workspaceName, integrationRuntimeName).block(); + } + + /** + * Upgrade 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response upgradeWithResponse( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + return upgradeWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName, context).block(); + } + + /** + * List all integration runtimes. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of integration runtime resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceSinglePageAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByWorkspace( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * List all integration runtimes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of integration runtime resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByWorkspace( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all integration runtimes. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of integration runtime resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync( + String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); + } + + /** + * List all integration runtimes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of integration runtime resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync( + String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink, context)); + } + + /** + * List all integration runtimes. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of integration runtime resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName)); + } + + /** + * List all integration runtimes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of integration runtime resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .start( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, IntegrationRuntimeStatusResponseInner> + beginStartAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + Mono>> mono = + startWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + IntegrationRuntimeStatusResponseInner.class, + IntegrationRuntimeStatusResponseInner.class, + Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, IntegrationRuntimeStatusResponseInner> + beginStartAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + startWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + IntegrationRuntimeStatusResponseInner.class, + IntegrationRuntimeStatusResponseInner.class, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, IntegrationRuntimeStatusResponseInner> + beginStart(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return beginStartAsync(resourceGroupName, workspaceName, integrationRuntimeName).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, IntegrationRuntimeStatusResponseInner> + beginStart(String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + return beginStartAsync(resourceGroupName, workspaceName, integrationRuntimeName, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return beginStartAsync(resourceGroupName, workspaceName, integrationRuntimeName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + return beginStartAsync(resourceGroupName, workspaceName, integrationRuntimeName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IntegrationRuntimeStatusResponseInner start( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return startAsync(resourceGroupName, workspaceName, integrationRuntimeName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime status response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IntegrationRuntimeStatusResponseInner start( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + return startAsync(resourceGroupName, workspaceName, integrationRuntimeName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .stop( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> stopWithResponseAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .stop( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStopAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + Mono>> mono = + stopWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginStopAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + stopWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStop( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return beginStopAsync(resourceGroupName, workspaceName, integrationRuntimeName).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginStop( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + return beginStopAsync(resourceGroupName, workspaceName, integrationRuntimeName, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return beginStopAsync(resourceGroupName, workspaceName, integrationRuntimeName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + return beginStopAsync(resourceGroupName, workspaceName, integrationRuntimeName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + stopAsync(resourceGroupName, workspaceName, integrationRuntimeName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + stopAsync(resourceGroupName, workspaceName, integrationRuntimeName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> enableInteractiveQueryWithResponseAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .enableInteractiveQuery( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> enableInteractiveQueryWithResponseAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .enableInteractiveQuery( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginEnableInteractiveQueryAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + Mono>> mono = + enableInteractiveQueryWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginEnableInteractiveQueryAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + enableInteractiveQueryWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginEnableInteractiveQuery( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return beginEnableInteractiveQueryAsync(resourceGroupName, workspaceName, integrationRuntimeName) + .getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginEnableInteractiveQuery( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + return beginEnableInteractiveQueryAsync(resourceGroupName, workspaceName, integrationRuntimeName, context) + .getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono enableInteractiveQueryAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return beginEnableInteractiveQueryAsync(resourceGroupName, workspaceName, integrationRuntimeName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono enableInteractiveQueryAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + return beginEnableInteractiveQueryAsync(resourceGroupName, workspaceName, integrationRuntimeName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void enableInteractiveQuery(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + enableInteractiveQueryAsync(resourceGroupName, workspaceName, integrationRuntimeName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void enableInteractiveQuery( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + enableInteractiveQueryAsync(resourceGroupName, workspaceName, integrationRuntimeName, context).block(); + } + + /** + * Disable 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> disableInteractiveQueryWithResponseAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .disableInteractiveQuery( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Disable 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> disableInteractiveQueryWithResponseAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (integrationRuntimeName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .disableInteractiveQuery( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + integrationRuntimeName, + accept, + context); + } + + /** + * Disable 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDisableInteractiveQueryAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + Mono>> mono = + disableInteractiveQueryWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Disable 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDisableInteractiveQueryAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + disableInteractiveQueryWithResponseAsync(resourceGroupName, workspaceName, integrationRuntimeName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Disable 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDisableInteractiveQuery( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return beginDisableInteractiveQueryAsync(resourceGroupName, workspaceName, integrationRuntimeName) + .getSyncPoller(); + } + + /** + * Disable 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDisableInteractiveQuery( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + return beginDisableInteractiveQueryAsync(resourceGroupName, workspaceName, integrationRuntimeName, context) + .getSyncPoller(); + } + + /** + * Disable 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono disableInteractiveQueryAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + return beginDisableInteractiveQueryAsync(resourceGroupName, workspaceName, integrationRuntimeName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disable 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono disableInteractiveQueryAsync( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + return beginDisableInteractiveQueryAsync(resourceGroupName, workspaceName, integrationRuntimeName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Disable 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void disableInteractiveQuery(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + disableInteractiveQueryAsync(resourceGroupName, workspaceName, integrationRuntimeName).block(); + } + + /** + * Disable 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void disableInteractiveQuery( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + disableInteractiveQueryAsync(resourceGroupName, workspaceName, integrationRuntimeName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of integration runtime resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of integration runtime resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimesImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimesImpl.java new file mode 100644 index 0000000000000..bdc82e909d9be --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IntegrationRuntimesImpl.java @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.IntegrationRuntimesClient; +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeResourceInner; +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeStatusResponseInner; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeResource; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeStatusResponse; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimes; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class IntegrationRuntimesImpl implements IntegrationRuntimes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IntegrationRuntimesImpl.class); + + private final IntegrationRuntimesClient innerClient; + + private final SynapseManager serviceManager; + + public IntegrationRuntimesImpl(IntegrationRuntimesClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public IntegrationRuntimeResource get( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + IntegrationRuntimeResourceInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, integrationRuntimeName); + if (inner != null) { + return new IntegrationRuntimeResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String ifNoneMatch, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, workspaceName, integrationRuntimeName, ifNoneMatch, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IntegrationRuntimeResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + this.serviceClient().delete(resourceGroupName, workspaceName, integrationRuntimeName); + } + + public void delete(String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + this.serviceClient().delete(resourceGroupName, workspaceName, integrationRuntimeName, context); + } + + public void upgrade(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + this.serviceClient().upgrade(resourceGroupName, workspaceName, integrationRuntimeName); + } + + public Response upgradeWithResponse( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + return this + .serviceClient() + .upgradeWithResponse(resourceGroupName, workspaceName, integrationRuntimeName, context); + } + + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { + PagedIterable inner = + this.serviceClient().listByWorkspace(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new IntegrationRuntimeResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = + this.serviceClient().listByWorkspace(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new IntegrationRuntimeResourceImpl(inner1, this.manager())); + } + + public IntegrationRuntimeStatusResponse start( + String resourceGroupName, String workspaceName, String integrationRuntimeName) { + IntegrationRuntimeStatusResponseInner inner = + this.serviceClient().start(resourceGroupName, workspaceName, integrationRuntimeName); + if (inner != null) { + return new IntegrationRuntimeStatusResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public IntegrationRuntimeStatusResponse start( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + IntegrationRuntimeStatusResponseInner inner = + this.serviceClient().start(resourceGroupName, workspaceName, integrationRuntimeName, context); + if (inner != null) { + return new IntegrationRuntimeStatusResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public void stop(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + this.serviceClient().stop(resourceGroupName, workspaceName, integrationRuntimeName); + } + + public void stop(String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + this.serviceClient().stop(resourceGroupName, workspaceName, integrationRuntimeName, context); + } + + public void enableInteractiveQuery(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + this.serviceClient().enableInteractiveQuery(resourceGroupName, workspaceName, integrationRuntimeName); + } + + public void enableInteractiveQuery( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + this.serviceClient().enableInteractiveQuery(resourceGroupName, workspaceName, integrationRuntimeName, context); + } + + public void disableInteractiveQuery(String resourceGroupName, String workspaceName, String integrationRuntimeName) { + this.serviceClient().disableInteractiveQuery(resourceGroupName, workspaceName, integrationRuntimeName); + } + + public void disableInteractiveQuery( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) { + this.serviceClient().disableInteractiveQuery(resourceGroupName, workspaceName, integrationRuntimeName, context); + } + + public IntegrationRuntimeResource getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String integrationRuntimeName = Utils.getValueFromIdByName(id, "integrationRuntimes"); + if (integrationRuntimeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'integrationRuntimes'.", id))); + } + String localIfNoneMatch = null; + return this + .getWithResponse(resourceGroupName, workspaceName, integrationRuntimeName, localIfNoneMatch, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, String ifNoneMatch, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String integrationRuntimeName = Utils.getValueFromIdByName(id, "integrationRuntimes"); + if (integrationRuntimeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'integrationRuntimes'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, integrationRuntimeName, ifNoneMatch, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String integrationRuntimeName = Utils.getValueFromIdByName(id, "integrationRuntimes"); + if (integrationRuntimeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'integrationRuntimes'.", id))); + } + this.delete(resourceGroupName, workspaceName, integrationRuntimeName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String integrationRuntimeName = Utils.getValueFromIdByName(id, "integrationRuntimes"); + if (integrationRuntimeName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'integrationRuntimes'.", id))); + } + this.delete(resourceGroupName, workspaceName, integrationRuntimeName, context); + } + + private IntegrationRuntimesClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + public IntegrationRuntimeResourceImpl define(String name) { + return new IntegrationRuntimeResourceImpl(name, this.manager()); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IpFirewallRuleInfoImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IpFirewallRuleInfoImpl.java new file mode 100644 index 0000000000000..378c6f96ef587 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IpFirewallRuleInfoImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.IpFirewallRuleInfoInner; +import com.azure.resourcemanager.synapse.models.IpFirewallRuleInfo; +import com.azure.resourcemanager.synapse.models.ProvisioningState; + +public final class IpFirewallRuleInfoImpl + implements IpFirewallRuleInfo, IpFirewallRuleInfo.Definition, IpFirewallRuleInfo.Update { + private IpFirewallRuleInfoInner innerObject; + + private final SynapseManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String endIpAddress() { + return this.innerModel().endIpAddress(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String startIpAddress() { + return this.innerModel().startIpAddress(); + } + + public IpFirewallRuleInfoInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String ruleName; + + public IpFirewallRuleInfoImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public IpFirewallRuleInfo create() { + this.innerObject = + serviceManager + .serviceClient() + .getIpFirewallRules() + .createOrUpdate(resourceGroupName, workspaceName, ruleName, this.innerModel(), Context.NONE); + return this; + } + + public IpFirewallRuleInfo create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIpFirewallRules() + .createOrUpdate(resourceGroupName, workspaceName, ruleName, this.innerModel(), context); + return this; + } + + IpFirewallRuleInfoImpl(String name, SynapseManager serviceManager) { + this.innerObject = new IpFirewallRuleInfoInner(); + this.serviceManager = serviceManager; + this.ruleName = name; + } + + public IpFirewallRuleInfoImpl update() { + return this; + } + + public IpFirewallRuleInfo apply() { + this.innerObject = + serviceManager + .serviceClient() + .getIpFirewallRules() + .createOrUpdate(resourceGroupName, workspaceName, ruleName, this.innerModel(), Context.NONE); + return this; + } + + public IpFirewallRuleInfo apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIpFirewallRules() + .createOrUpdate(resourceGroupName, workspaceName, ruleName, this.innerModel(), context); + return this; + } + + IpFirewallRuleInfoImpl(IpFirewallRuleInfoInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.ruleName = Utils.getValueFromIdByName(innerObject.id(), "firewallRules"); + } + + public IpFirewallRuleInfo refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getIpFirewallRules() + .getWithResponse(resourceGroupName, workspaceName, ruleName, Context.NONE) + .getValue(); + return this; + } + + public IpFirewallRuleInfo refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getIpFirewallRules() + .getWithResponse(resourceGroupName, workspaceName, ruleName, context) + .getValue(); + return this; + } + + public IpFirewallRuleInfoImpl withEndIpAddress(String endIpAddress) { + this.innerModel().withEndIpAddress(endIpAddress); + return this; + } + + public IpFirewallRuleInfoImpl withStartIpAddress(String startIpAddress) { + this.innerModel().withStartIpAddress(startIpAddress); + return this; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IpFirewallRulesClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IpFirewallRulesClientImpl.java new file mode 100644 index 0000000000000..a2e25ebd451cf --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IpFirewallRulesClientImpl.java @@ -0,0 +1,1418 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.IpFirewallRulesClient; +import com.azure.resourcemanager.synapse.fluent.models.IpFirewallRuleInfoInner; +import com.azure.resourcemanager.synapse.fluent.models.ReplaceAllFirewallRulesOperationResponseInner; +import com.azure.resourcemanager.synapse.models.IpFirewallRuleInfoListResult; +import com.azure.resourcemanager.synapse.models.ReplaceAllIpFirewallRulesRequest; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in IpFirewallRulesClient. */ +public final class IpFirewallRulesClientImpl implements IpFirewallRulesClient { + private final ClientLogger logger = new ClientLogger(IpFirewallRulesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final IpFirewallRulesService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of IpFirewallRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IpFirewallRulesClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy.create(IpFirewallRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientIpFirewallRules to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface IpFirewallRulesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/firewallRules") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspace( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/firewallRules/{ruleName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("ruleName") String ruleName, + @BodyParam("application/json") IpFirewallRuleInfoInner ipFirewallRuleInfo, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/firewallRules/{ruleName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("ruleName") String ruleName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/firewallRules/{ruleName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("ruleName") String ruleName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/replaceAllIpFirewallRules") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> replaceAll( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @BodyParam("application/json") ReplaceAllIpFirewallRulesRequest request, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspaceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns a list of firewall rules. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of IP firewall rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceSinglePageAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByWorkspace( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns a list of firewall rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of IP firewall rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByWorkspace( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns a list of firewall rules. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of IP firewall rules. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); + } + + /** + * Returns a list of firewall rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of IP firewall rules. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync( + String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns a list of firewall rules. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of IP firewall rules. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName)); + } + + /** + * Returns a list of firewall rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of IP firewall rules. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Creates or updates a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @param ipFirewallRuleInfo IP firewall rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return iP firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, String ruleName, IpFirewallRuleInfoInner ipFirewallRuleInfo) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (ipFirewallRuleInfo == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipFirewallRuleInfo is required and cannot be null.")); + } else { + ipFirewallRuleInfo.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + ruleName, + ipFirewallRuleInfo, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @param ipFirewallRuleInfo IP firewall rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return iP firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String ruleName, + IpFirewallRuleInfoInner ipFirewallRuleInfo, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + if (ipFirewallRuleInfo == null) { + return Mono + .error(new IllegalArgumentException("Parameter ipFirewallRuleInfo is required and cannot be null.")); + } else { + ipFirewallRuleInfo.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + ruleName, + ipFirewallRuleInfo, + accept, + context); + } + + /** + * Creates or updates a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @param ipFirewallRuleInfo IP firewall rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return iP firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, IpFirewallRuleInfoInner> beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, String ruleName, IpFirewallRuleInfoInner ipFirewallRuleInfo) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, ruleName, ipFirewallRuleInfo); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + IpFirewallRuleInfoInner.class, + IpFirewallRuleInfoInner.class, + Context.NONE); + } + + /** + * Creates or updates a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @param ipFirewallRuleInfo IP firewall rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return iP firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, IpFirewallRuleInfoInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String ruleName, + IpFirewallRuleInfoInner ipFirewallRuleInfo, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, ruleName, ipFirewallRuleInfo, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + IpFirewallRuleInfoInner.class, + IpFirewallRuleInfoInner.class, + context); + } + + /** + * Creates or updates a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @param ipFirewallRuleInfo IP firewall rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return iP firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, IpFirewallRuleInfoInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, String ruleName, IpFirewallRuleInfoInner ipFirewallRuleInfo) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, ruleName, ipFirewallRuleInfo).getSyncPoller(); + } + + /** + * Creates or updates a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @param ipFirewallRuleInfo IP firewall rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return iP firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, IpFirewallRuleInfoInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String ruleName, + IpFirewallRuleInfoInner ipFirewallRuleInfo, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, ruleName, ipFirewallRuleInfo, context) + .getSyncPoller(); + } + + /** + * Creates or updates a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @param ipFirewallRuleInfo IP firewall rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return iP firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, String ruleName, IpFirewallRuleInfoInner ipFirewallRuleInfo) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, ruleName, ipFirewallRuleInfo) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @param ipFirewallRuleInfo IP firewall rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return iP firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String ruleName, + IpFirewallRuleInfoInner ipFirewallRuleInfo, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, ruleName, ipFirewallRuleInfo, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @param ipFirewallRuleInfo IP firewall rule properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return iP firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpFirewallRuleInfoInner createOrUpdate( + String resourceGroupName, String workspaceName, String ruleName, IpFirewallRuleInfoInner ipFirewallRuleInfo) { + return createOrUpdateAsync(resourceGroupName, workspaceName, ruleName, ipFirewallRuleInfo).block(); + } + + /** + * Creates or updates a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @param ipFirewallRuleInfo IP firewall rule properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return iP firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpFirewallRuleInfoInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String ruleName, + IpFirewallRuleInfoInner ipFirewallRuleInfo, + Context context) { + return createOrUpdateAsync(resourceGroupName, workspaceName, ruleName, ipFirewallRuleInfo, context).block(); + } + + /** + * Deletes a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String ruleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + ruleName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String ruleName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + ruleName, + accept, + context); + } + + /** + * Deletes a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Object> beginDeleteAsync( + String resourceGroupName, String workspaceName, String ruleName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, ruleName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Object.class, Object.class, Context.NONE); + } + + /** + * Deletes a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Object> beginDeleteAsync( + String resourceGroupName, String workspaceName, String ruleName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, workspaceName, ruleName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Object.class, Object.class, context); + } + + /** + * Deletes a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginDelete( + String resourceGroupName, String workspaceName, String ruleName) { + return beginDeleteAsync(resourceGroupName, workspaceName, ruleName).getSyncPoller(); + } + + /** + * Deletes a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginDelete( + String resourceGroupName, String workspaceName, String ruleName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, ruleName, context).getSyncPoller(); + } + + /** + * Deletes a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String ruleName) { + return beginDeleteAsync(resourceGroupName, workspaceName, ruleName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String ruleName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, ruleName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Object delete(String resourceGroupName, String workspaceName, String ruleName) { + return deleteAsync(resourceGroupName, workspaceName, ruleName).block(); + } + + /** + * Deletes a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Object delete(String resourceGroupName, String workspaceName, String ruleName, Context context) { + return deleteAsync(resourceGroupName, workspaceName, ruleName, context).block(); + } + + /** + * Get a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String ruleName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + ruleName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String ruleName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (ruleName == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + ruleName, + accept, + context); + } + + /** + * Get a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String ruleName) { + return getWithResponseAsync(resourceGroupName, workspaceName, ruleName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IpFirewallRuleInfoInner get(String resourceGroupName, String workspaceName, String ruleName) { + return getAsync(resourceGroupName, workspaceName, ruleName).block(); + } + + /** + * Get a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a firewall rule. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String ruleName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, ruleName, context).block(); + } + + /** + * Replaces firewall rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param request Replace all IP firewall rules request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing operation for replacing the firewall rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> replaceAllWithResponseAsync( + String resourceGroupName, String workspaceName, ReplaceAllIpFirewallRulesRequest request) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .replaceAll( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + request, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Replaces firewall rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param request Replace all IP firewall rules request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing operation for replacing the firewall rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> replaceAllWithResponseAsync( + String resourceGroupName, String workspaceName, ReplaceAllIpFirewallRulesRequest request, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .replaceAll( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + request, + accept, + context); + } + + /** + * Replaces firewall rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param request Replace all IP firewall rules request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing operation for replacing the firewall rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux< + PollResult, ReplaceAllFirewallRulesOperationResponseInner> + beginReplaceAllAsync(String resourceGroupName, String workspaceName, ReplaceAllIpFirewallRulesRequest request) { + Mono>> mono = replaceAllWithResponseAsync(resourceGroupName, workspaceName, request); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplaceAllFirewallRulesOperationResponseInner.class, + ReplaceAllFirewallRulesOperationResponseInner.class, + Context.NONE); + } + + /** + * Replaces firewall rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param request Replace all IP firewall rules request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing operation for replacing the firewall rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux< + PollResult, ReplaceAllFirewallRulesOperationResponseInner> + beginReplaceAllAsync( + String resourceGroupName, String workspaceName, ReplaceAllIpFirewallRulesRequest request, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + replaceAllWithResponseAsync(resourceGroupName, workspaceName, request, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ReplaceAllFirewallRulesOperationResponseInner.class, + ReplaceAllFirewallRulesOperationResponseInner.class, + context); + } + + /** + * Replaces firewall rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param request Replace all IP firewall rules request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing operation for replacing the firewall rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller< + PollResult, ReplaceAllFirewallRulesOperationResponseInner> + beginReplaceAll(String resourceGroupName, String workspaceName, ReplaceAllIpFirewallRulesRequest request) { + return beginReplaceAllAsync(resourceGroupName, workspaceName, request).getSyncPoller(); + } + + /** + * Replaces firewall rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param request Replace all IP firewall rules request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing operation for replacing the firewall rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller< + PollResult, ReplaceAllFirewallRulesOperationResponseInner> + beginReplaceAll( + String resourceGroupName, String workspaceName, ReplaceAllIpFirewallRulesRequest request, Context context) { + return beginReplaceAllAsync(resourceGroupName, workspaceName, request, context).getSyncPoller(); + } + + /** + * Replaces firewall rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param request Replace all IP firewall rules request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing operation for replacing the firewall rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono replaceAllAsync( + String resourceGroupName, String workspaceName, ReplaceAllIpFirewallRulesRequest request) { + return beginReplaceAllAsync(resourceGroupName, workspaceName, request) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Replaces firewall rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param request Replace all IP firewall rules request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing operation for replacing the firewall rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono replaceAllAsync( + String resourceGroupName, String workspaceName, ReplaceAllIpFirewallRulesRequest request, Context context) { + return beginReplaceAllAsync(resourceGroupName, workspaceName, request, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Replaces firewall rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param request Replace all IP firewall rules request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing operation for replacing the firewall rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplaceAllFirewallRulesOperationResponseInner replaceAll( + String resourceGroupName, String workspaceName, ReplaceAllIpFirewallRulesRequest request) { + return replaceAllAsync(resourceGroupName, workspaceName, request).block(); + } + + /** + * Replaces firewall rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param request Replace all IP firewall rules request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing operation for replacing the firewall rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplaceAllFirewallRulesOperationResponseInner replaceAll( + String resourceGroupName, String workspaceName, ReplaceAllIpFirewallRulesRequest request, Context context) { + return replaceAllAsync(resourceGroupName, workspaceName, request, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of IP firewall rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of IP firewall rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IpFirewallRulesImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IpFirewallRulesImpl.java new file mode 100644 index 0000000000000..f74899e28f576 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/IpFirewallRulesImpl.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.IpFirewallRulesClient; +import com.azure.resourcemanager.synapse.fluent.models.IpFirewallRuleInfoInner; +import com.azure.resourcemanager.synapse.fluent.models.ReplaceAllFirewallRulesOperationResponseInner; +import com.azure.resourcemanager.synapse.models.IpFirewallRuleInfo; +import com.azure.resourcemanager.synapse.models.IpFirewallRules; +import com.azure.resourcemanager.synapse.models.ReplaceAllFirewallRulesOperationResponse; +import com.azure.resourcemanager.synapse.models.ReplaceAllIpFirewallRulesRequest; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class IpFirewallRulesImpl implements IpFirewallRules { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpFirewallRulesImpl.class); + + private final IpFirewallRulesClient innerClient; + + private final SynapseManager serviceManager; + + public IpFirewallRulesImpl(IpFirewallRulesClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { + PagedIterable inner = + this.serviceClient().listByWorkspace(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new IpFirewallRuleInfoImpl(inner1, this.manager())); + } + + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = + this.serviceClient().listByWorkspace(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new IpFirewallRuleInfoImpl(inner1, this.manager())); + } + + public Object delete(String resourceGroupName, String workspaceName, String ruleName) { + return this.serviceClient().delete(resourceGroupName, workspaceName, ruleName); + } + + public Object delete(String resourceGroupName, String workspaceName, String ruleName, Context context) { + return this.serviceClient().delete(resourceGroupName, workspaceName, ruleName, context); + } + + public IpFirewallRuleInfo get(String resourceGroupName, String workspaceName, String ruleName) { + IpFirewallRuleInfoInner inner = this.serviceClient().get(resourceGroupName, workspaceName, ruleName); + if (inner != null) { + return new IpFirewallRuleInfoImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String ruleName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, ruleName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new IpFirewallRuleInfoImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ReplaceAllFirewallRulesOperationResponse replaceAll( + String resourceGroupName, String workspaceName, ReplaceAllIpFirewallRulesRequest request) { + ReplaceAllFirewallRulesOperationResponseInner inner = + this.serviceClient().replaceAll(resourceGroupName, workspaceName, request); + if (inner != null) { + return new ReplaceAllFirewallRulesOperationResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public ReplaceAllFirewallRulesOperationResponse replaceAll( + String resourceGroupName, String workspaceName, ReplaceAllIpFirewallRulesRequest request, Context context) { + ReplaceAllFirewallRulesOperationResponseInner inner = + this.serviceClient().replaceAll(resourceGroupName, workspaceName, request, context); + if (inner != null) { + return new ReplaceAllFirewallRulesOperationResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public IpFirewallRuleInfo getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String ruleName = Utils.getValueFromIdByName(id, "firewallRules"); + if (ruleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'firewallRules'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, ruleName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String ruleName = Utils.getValueFromIdByName(id, "firewallRules"); + if (ruleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'firewallRules'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, ruleName, context); + } + + public Object deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String ruleName = Utils.getValueFromIdByName(id, "firewallRules"); + if (ruleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'firewallRules'.", id))); + } + return this.delete(resourceGroupName, workspaceName, ruleName, Context.NONE); + } + + public Object deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String ruleName = Utils.getValueFromIdByName(id, "firewallRules"); + if (ruleName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'firewallRules'.", id))); + } + return this.delete(resourceGroupName, workspaceName, ruleName, context); + } + + private IpFirewallRulesClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + public IpFirewallRuleInfoImpl define(String name) { + return new IpFirewallRuleInfoImpl(name, this.manager()); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KeyImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KeyImpl.java new file mode 100644 index 0000000000000..12705007e006d --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KeyImpl.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.KeyInner; +import com.azure.resourcemanager.synapse.models.Key; + +public final class KeyImpl implements Key, Key.Definition, Key.Update { + private KeyInner innerObject; + + private final SynapseManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public Boolean isActiveCmk() { + return this.innerModel().isActiveCmk(); + } + + public String keyVaultUrl() { + return this.innerModel().keyVaultUrl(); + } + + public KeyInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String keyName; + + public KeyImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public Key create() { + this.innerObject = + serviceManager + .serviceClient() + .getKeys() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, keyName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Key create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getKeys() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, keyName, this.innerModel(), context) + .getValue(); + return this; + } + + KeyImpl(String name, SynapseManager serviceManager) { + this.innerObject = new KeyInner(); + this.serviceManager = serviceManager; + this.keyName = name; + } + + public KeyImpl update() { + return this; + } + + public Key apply() { + this.innerObject = + serviceManager + .serviceClient() + .getKeys() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, keyName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public Key apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getKeys() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, keyName, this.innerModel(), context) + .getValue(); + return this; + } + + KeyImpl(KeyInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.keyName = Utils.getValueFromIdByName(innerObject.id(), "keys"); + } + + public Key refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getKeys() + .getWithResponse(resourceGroupName, workspaceName, keyName, Context.NONE) + .getValue(); + return this; + } + + public Key refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getKeys() + .getWithResponse(resourceGroupName, workspaceName, keyName, context) + .getValue(); + return this; + } + + public KeyImpl withIsActiveCmk(Boolean isActiveCmk) { + this.innerModel().withIsActiveCmk(isActiveCmk); + return this; + } + + public KeyImpl withKeyVaultUrl(String keyVaultUrl) { + this.innerModel().withKeyVaultUrl(keyVaultUrl); + return this; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KeysClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KeysClientImpl.java new file mode 100644 index 0000000000000..ab1493c448397 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KeysClientImpl.java @@ -0,0 +1,893 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.KeysClient; +import com.azure.resourcemanager.synapse.fluent.models.KeyInner; +import com.azure.resourcemanager.synapse.models.KeyInfoListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in KeysClient. */ +public final class KeysClientImpl implements KeysClient { + private final ClientLogger logger = new ClientLogger(KeysClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final KeysService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of KeysClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + KeysClientImpl(SynapseManagementClientImpl client) { + this.service = RestProxy.create(KeysService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientKeys to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface KeysService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/keys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspace( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/keys/{keyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("keyName") String keyName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/keys/{keyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("keyName") String keyName, + @BodyParam("application/json") KeyInner keyProperties, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/keys/{keyName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("keyName") String keyName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspaceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceSinglePageAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByWorkspace( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByWorkspace( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of keys. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of keys. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of keys. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of keys. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String keyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (keyName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + keyName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String keyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (keyName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + keyName, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String keyName) { + return getWithResponseAsync(resourceGroupName, workspaceName, keyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KeyInner get(String resourceGroupName, String workspaceName, String keyName) { + return getAsync(resourceGroupName, workspaceName, keyName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String keyName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, keyName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, String keyName, KeyInner keyProperties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (keyName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + } + if (keyProperties == null) { + return Mono.error(new IllegalArgumentException("Parameter keyProperties is required and cannot be null.")); + } else { + keyProperties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + keyName, + keyProperties, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, String keyName, KeyInner keyProperties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (keyName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + } + if (keyProperties == null) { + return Mono.error(new IllegalArgumentException("Parameter keyProperties is required and cannot be null.")); + } else { + keyProperties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + keyName, + keyProperties, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, String keyName, KeyInner keyProperties) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, keyName, keyProperties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KeyInner createOrUpdate( + String resourceGroupName, String workspaceName, String keyName, KeyInner keyProperties) { + return createOrUpdateAsync(resourceGroupName, workspaceName, keyName, keyProperties).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, String workspaceName, String keyName, KeyInner keyProperties, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, keyName, keyProperties, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String keyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (keyName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + keyName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String keyName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (keyName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + keyName, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String keyName) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, keyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public KeyInner delete(String resourceGroupName, String workspaceName, String keyName) { + return deleteAsync(resourceGroupName, workspaceName, keyName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace key. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String keyName, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, keyName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of keys. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KeysImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KeysImpl.java new file mode 100644 index 0000000000000..bc199b1c854bd --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/KeysImpl.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.KeysClient; +import com.azure.resourcemanager.synapse.fluent.models.KeyInner; +import com.azure.resourcemanager.synapse.models.Key; +import com.azure.resourcemanager.synapse.models.Keys; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class KeysImpl implements Keys { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeysImpl.class); + + private final KeysClient innerClient; + + private final SynapseManager serviceManager; + + public KeysImpl(KeysClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().listByWorkspace(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new KeyImpl(inner1, this.manager())); + } + + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = this.serviceClient().listByWorkspace(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new KeyImpl(inner1, this.manager())); + } + + public Key get(String resourceGroupName, String workspaceName, String keyName) { + KeyInner inner = this.serviceClient().get(resourceGroupName, workspaceName, keyName); + if (inner != null) { + return new KeyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String keyName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, keyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new KeyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Key delete(String resourceGroupName, String workspaceName, String keyName) { + KeyInner inner = this.serviceClient().delete(resourceGroupName, workspaceName, keyName); + if (inner != null) { + return new KeyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String keyName, Context context) { + Response inner = + this.serviceClient().deleteWithResponse(resourceGroupName, workspaceName, keyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new KeyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Key getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String keyName = Utils.getValueFromIdByName(id, "keys"); + if (keyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'keys'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, keyName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String keyName = Utils.getValueFromIdByName(id, "keys"); + if (keyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'keys'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, keyName, context); + } + + public Key deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String keyName = Utils.getValueFromIdByName(id, "keys"); + if (keyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'keys'.", id))); + } + return this.deleteWithResponse(resourceGroupName, workspaceName, keyName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String keyName = Utils.getValueFromIdByName(id, "keys"); + if (keyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'keys'.", id))); + } + return this.deleteWithResponse(resourceGroupName, workspaceName, keyName, context); + } + + private KeysClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + public KeyImpl define(String name) { + return new KeyImpl(name, this.manager()); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/LibrariesClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/LibrariesClientImpl.java new file mode 100644 index 0000000000000..4ecac6fdec016 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/LibrariesClientImpl.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.LibrariesClient; +import com.azure.resourcemanager.synapse.fluent.models.LibraryResourceInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LibrariesClient. */ +public final class LibrariesClientImpl implements LibrariesClient { + private final ClientLogger logger = new ClientLogger(LibrariesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LibrariesService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of LibrariesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LibrariesClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy.create(LibrariesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientLibraries to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface LibrariesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/libraries/{libraryName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("libraryName") String libraryName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get library by name in a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param libraryName Library name. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return library by name in a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String libraryName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (libraryName == null) { + return Mono.error(new IllegalArgumentException("Parameter libraryName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + libraryName, + workspaceName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get library by name in a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param libraryName Library name. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return library by name in a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String libraryName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (libraryName == null) { + return Mono.error(new IllegalArgumentException("Parameter libraryName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + libraryName, + workspaceName, + accept, + context); + } + + /** + * Get library by name in a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param libraryName Library name. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return library by name in a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String libraryName, String workspaceName) { + return getWithResponseAsync(resourceGroupName, libraryName, workspaceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get library by name in a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param libraryName Library name. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return library by name in a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LibraryResourceInner get(String resourceGroupName, String libraryName, String workspaceName) { + return getAsync(resourceGroupName, libraryName, workspaceName).block(); + } + + /** + * Get library by name in a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param libraryName Library name. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return library by name in a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String libraryName, String workspaceName, Context context) { + return getWithResponseAsync(resourceGroupName, libraryName, workspaceName, context).block(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/LibrariesImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/LibrariesImpl.java new file mode 100644 index 0000000000000..4de34d7190b75 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/LibrariesImpl.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.LibrariesClient; +import com.azure.resourcemanager.synapse.fluent.models.LibraryResourceInner; +import com.azure.resourcemanager.synapse.models.Libraries; +import com.azure.resourcemanager.synapse.models.LibraryResource; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LibrariesImpl implements Libraries { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LibrariesImpl.class); + + private final LibrariesClient innerClient; + + private final SynapseManager serviceManager; + + public LibrariesImpl(LibrariesClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public LibraryResource get(String resourceGroupName, String libraryName, String workspaceName) { + LibraryResourceInner inner = this.serviceClient().get(resourceGroupName, libraryName, workspaceName); + if (inner != null) { + return new LibraryResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String libraryName, String workspaceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, libraryName, workspaceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LibraryResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private LibrariesClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/LibrariesOperationsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/LibrariesOperationsClientImpl.java new file mode 100644 index 0000000000000..fd4d7edc8f91e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/LibrariesOperationsClientImpl.java @@ -0,0 +1,339 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.LibrariesOperationsClient; +import com.azure.resourcemanager.synapse.fluent.models.LibraryResourceInner; +import com.azure.resourcemanager.synapse.models.LibraryListResponse; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LibrariesOperationsClient. */ +public final class LibrariesOperationsClientImpl implements LibrariesOperationsClient { + private final ClientLogger logger = new ClientLogger(LibrariesOperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final LibrariesOperationsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of LibrariesOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LibrariesOperationsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy.create(LibrariesOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientLibrariesOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface LibrariesOperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/libraries") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspace( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspaceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List libraries 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Library resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceSinglePageAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByWorkspace( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * List libraries in a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Library resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByWorkspace( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List libraries 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Library resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); + } + + /** + * List libraries in a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Library resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync( + String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink, context)); + } + + /** + * List libraries 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Library resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName)); + } + + /** + * List libraries in a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Library resources. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Library resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Library resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/LibrariesOperationsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/LibrariesOperationsImpl.java new file mode 100644 index 0000000000000..164a8d5389e70 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/LibrariesOperationsImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.LibrariesOperationsClient; +import com.azure.resourcemanager.synapse.fluent.models.LibraryResourceInner; +import com.azure.resourcemanager.synapse.models.LibrariesOperations; +import com.azure.resourcemanager.synapse.models.LibraryResource; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class LibrariesOperationsImpl implements LibrariesOperations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LibrariesOperationsImpl.class); + + private final LibrariesOperationsClient innerClient; + + private final SynapseManager serviceManager; + + public LibrariesOperationsImpl(LibrariesOperationsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { + PagedIterable inner = + this.serviceClient().listByWorkspace(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new LibraryResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = + this.serviceClient().listByWorkspace(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new LibraryResourceImpl(inner1, this.manager())); + } + + private LibrariesOperationsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/LibraryResourceImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/LibraryResourceImpl.java new file mode 100644 index 0000000000000..c40c9d406c836 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/LibraryResourceImpl.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.LibraryResourceInner; +import com.azure.resourcemanager.synapse.models.LibraryResource; +import java.time.OffsetDateTime; + +public final class LibraryResourceImpl implements LibraryResource { + private LibraryResourceInner innerObject; + + private final SynapseManager serviceManager; + + LibraryResourceImpl(LibraryResourceInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public String namePropertiesName() { + return this.innerModel().namePropertiesName(); + } + + public String path() { + return this.innerModel().path(); + } + + public String containerName() { + return this.innerModel().containerName(); + } + + public OffsetDateTime uploadedTimestamp() { + return this.innerModel().uploadedTimestamp(); + } + + public String typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public String provisioningStatus() { + return this.innerModel().provisioningStatus(); + } + + public String creatorId() { + return this.innerModel().creatorId(); + } + + public LibraryResourceInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/MaintenanceWindowOptionsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/MaintenanceWindowOptionsImpl.java new file mode 100644 index 0000000000000..b73a6f64ba415 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/MaintenanceWindowOptionsImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.MaintenanceWindowOptionsInner; +import com.azure.resourcemanager.synapse.models.MaintenanceWindowOptions; +import com.azure.resourcemanager.synapse.models.MaintenanceWindowTimeRange; +import java.util.Collections; +import java.util.List; + +public final class MaintenanceWindowOptionsImpl implements MaintenanceWindowOptions { + private MaintenanceWindowOptionsInner innerObject; + + private final SynapseManager serviceManager; + + MaintenanceWindowOptionsImpl(MaintenanceWindowOptionsInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public Boolean isEnabled() { + return this.innerModel().isEnabled(); + } + + public List maintenanceWindowCycles() { + List inner = this.innerModel().maintenanceWindowCycles(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Integer minDurationInMinutes() { + return this.innerModel().minDurationInMinutes(); + } + + public Integer defaultDurationInMinutes() { + return this.innerModel().defaultDurationInMinutes(); + } + + public Integer minCycles() { + return this.innerModel().minCycles(); + } + + public Integer timeGranularityInMinutes() { + return this.innerModel().timeGranularityInMinutes(); + } + + public Boolean allowMultipleMaintenanceWindowsPerCycle() { + return this.innerModel().allowMultipleMaintenanceWindowsPerCycle(); + } + + public MaintenanceWindowOptionsInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/MaintenanceWindowsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/MaintenanceWindowsImpl.java new file mode 100644 index 0000000000000..2c932eb6a1b60 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/MaintenanceWindowsImpl.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.MaintenanceWindowsInner; +import com.azure.resourcemanager.synapse.models.MaintenanceWindowTimeRange; +import com.azure.resourcemanager.synapse.models.MaintenanceWindows; +import java.util.Collections; +import java.util.List; + +public final class MaintenanceWindowsImpl implements MaintenanceWindows { + private MaintenanceWindowsInner innerObject; + + private final SynapseManager serviceManager; + + MaintenanceWindowsImpl(MaintenanceWindowsInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public List timeRanges() { + List inner = this.innerModel().timeRanges(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public MaintenanceWindowsInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ManagedIdentitySqlControlSettingsModelImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ManagedIdentitySqlControlSettingsModelImpl.java new file mode 100644 index 0000000000000..388d127b9865a --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ManagedIdentitySqlControlSettingsModelImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.ManagedIdentitySqlControlSettingsModelInner; +import com.azure.resourcemanager.synapse.models.ManagedIdentitySqlControlSettingsModel; +import com.azure.resourcemanager.synapse.models.ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentity; + +public final class ManagedIdentitySqlControlSettingsModelImpl implements ManagedIdentitySqlControlSettingsModel { + private ManagedIdentitySqlControlSettingsModelInner innerObject; + + private final SynapseManager serviceManager; + + ManagedIdentitySqlControlSettingsModelImpl( + ManagedIdentitySqlControlSettingsModelInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentity + grantSqlControlToManagedIdentity() { + return this.innerModel().grantSqlControlToManagedIdentity(); + } + + public ManagedIdentitySqlControlSettingsModelInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/MetadataSyncConfigImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/MetadataSyncConfigImpl.java new file mode 100644 index 0000000000000..a9fd1a0447ae6 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/MetadataSyncConfigImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.MetadataSyncConfigInner; +import com.azure.resourcemanager.synapse.models.MetadataSyncConfig; + +public final class MetadataSyncConfigImpl implements MetadataSyncConfig { + private MetadataSyncConfigInner innerObject; + + private final SynapseManager serviceManager; + + MetadataSyncConfigImpl(MetadataSyncConfigInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public Boolean enabled() { + return this.innerModel().enabled(); + } + + public Integer syncIntervalInMinutes() { + return this.innerModel().syncIntervalInMinutes(); + } + + public MetadataSyncConfigInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/OperationResourceImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/OperationResourceImpl.java new file mode 100644 index 0000000000000..22353381c4540 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/OperationResourceImpl.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.OperationResourceInner; +import com.azure.resourcemanager.synapse.models.OperationResource; +import com.azure.resourcemanager.synapse.models.OperationStatus; +import java.time.OffsetDateTime; + +public final class OperationResourceImpl implements OperationResource { + private OperationResourceInner innerObject; + + private final SynapseManager serviceManager; + + OperationResourceImpl(OperationResourceInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public OperationStatus status() { + return this.innerModel().status(); + } + + public Object properties() { + return this.innerModel().properties(); + } + + public ManagementError error() { + return this.innerModel().error(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public Float percentComplete() { + return this.innerModel().percentComplete(); + } + + public OperationResourceInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/OperationsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..fcf71fb1e2784 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/OperationsClientImpl.java @@ -0,0 +1,661 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.OperationsClient; +import com.azure.resourcemanager.synapse.fluent.models.AvailableRpOperationInner; +import com.azure.resourcemanager.synapse.fluent.models.CheckNameAvailabilityResponseInner; +import com.azure.resourcemanager.synapse.fluent.models.OperationResourceInner; +import com.azure.resourcemanager.synapse.models.CheckNameAvailabilityRequest; +import java.util.List; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Synapse/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") CheckNameAvailabilityRequest request, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Synapse/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> list( + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/operationResults/{operationId}") + @ExpectedResponses({200, 201, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getLocationHeaderResult( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/operationStatuses/{operationId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getAzureAsyncHeaderResult( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Check whether a workspace name is available. + * + * @param request The check request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a response saying whether the workspace name is available. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + CheckNameAvailabilityRequest request) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + request, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Check whether a workspace name is available. + * + * @param request The check request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a response saying whether the workspace name is available. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + CheckNameAvailabilityRequest request, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .checkNameAvailability( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + request, + accept, + context); + } + + /** + * Check whether a workspace name is available. + * + * @param request The check request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a response saying whether the workspace name is available. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync(CheckNameAvailabilityRequest request) { + return checkNameAvailabilityWithResponseAsync(request) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Check whether a workspace name is available. + * + * @param request The check request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a response saying whether the workspace name is available. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameAvailabilityResponseInner checkNameAvailability(CheckNameAvailabilityRequest request) { + return checkNameAvailabilityAsync(request).block(); + } + + /** + * Check whether a workspace name is available. + * + * @param request The check request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a response saying whether the workspace name is available. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + CheckNameAvailabilityRequest request, Context context) { + return checkNameAvailabilityWithResponseAsync(request, context).block(); + } + + /** + * Get all available operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listWithResponseAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), accept, context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get all available operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listWithResponseAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.list(this.client.getEndpoint(), accept, context); + } + + /** + * Get all available operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAsync() { + return listWithResponseAsync() + .flatMap( + (Response> res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get all available operations. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List list() { + return listAsync().block(); + } + + /** + * Get all available operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response> listWithResponse(Context context) { + return listWithResponseAsync(context).block(); + } + + /** + * 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. + * @param operationId Operation ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of an operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getLocationHeaderResultWithResponseAsync( + String resourceGroupName, String workspaceName, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getLocationHeaderResult( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + operationId, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + * @param operationId Operation ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of an operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getLocationHeaderResultWithResponseAsync( + String resourceGroupName, String workspaceName, String operationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getLocationHeaderResult( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + operationId, + accept, + context); + } + + /** + * 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. + * @param operationId Operation ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of an operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getLocationHeaderResultAsync( + String resourceGroupName, String workspaceName, String operationId) { + return getLocationHeaderResultWithResponseAsync(resourceGroupName, workspaceName, operationId) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * 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. + * @param operationId Operation ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void getLocationHeaderResult(String resourceGroupName, String workspaceName, String operationId) { + getLocationHeaderResultAsync(resourceGroupName, workspaceName, operationId).block(); + } + + /** + * 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. + * @param operationId Operation ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of an operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLocationHeaderResultWithResponse( + String resourceGroupName, String workspaceName, String operationId, Context context) { + return getLocationHeaderResultWithResponseAsync(resourceGroupName, workspaceName, operationId, context).block(); + } + + /** + * 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. + * @param operationId Operation ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAzureAsyncHeaderResultWithResponseAsync( + String resourceGroupName, String workspaceName, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getAzureAsyncHeaderResult( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + operationId, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + * @param operationId Operation ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getAzureAsyncHeaderResultWithResponseAsync( + String resourceGroupName, String workspaceName, String operationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getAzureAsyncHeaderResult( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + operationId, + accept, + context); + } + + /** + * 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. + * @param operationId Operation ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAzureAsyncHeaderResultAsync( + String resourceGroupName, String workspaceName, String operationId) { + return getAzureAsyncHeaderResultWithResponseAsync(resourceGroupName, workspaceName, operationId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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. + * @param operationId Operation ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationResourceInner getAzureAsyncHeaderResult( + String resourceGroupName, String workspaceName, String operationId) { + return getAzureAsyncHeaderResultAsync(resourceGroupName, workspaceName, operationId).block(); + } + + /** + * 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. + * @param operationId Operation ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAzureAsyncHeaderResultWithResponse( + String resourceGroupName, String workspaceName, String operationId, Context context) { + return getAzureAsyncHeaderResultWithResponseAsync(resourceGroupName, workspaceName, operationId, context) + .block(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/OperationsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..d63419bf37843 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/OperationsImpl.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.OperationsClient; +import com.azure.resourcemanager.synapse.fluent.models.AvailableRpOperationInner; +import com.azure.resourcemanager.synapse.fluent.models.CheckNameAvailabilityResponseInner; +import com.azure.resourcemanager.synapse.fluent.models.OperationResourceInner; +import com.azure.resourcemanager.synapse.models.AvailableRpOperation; +import com.azure.resourcemanager.synapse.models.CheckNameAvailabilityRequest; +import com.azure.resourcemanager.synapse.models.CheckNameAvailabilityResponse; +import com.azure.resourcemanager.synapse.models.OperationResource; +import com.azure.resourcemanager.synapse.models.Operations; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final SynapseManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public CheckNameAvailabilityResponse checkNameAvailability(CheckNameAvailabilityRequest request) { + CheckNameAvailabilityResponseInner inner = this.serviceClient().checkNameAvailability(request); + if (inner != null) { + return new CheckNameAvailabilityResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + CheckNameAvailabilityRequest request, Context context) { + Response inner = + this.serviceClient().checkNameAvailabilityWithResponse(request, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CheckNameAvailabilityResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public List list() { + List inner = this.serviceClient().list(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new AvailableRpOperationImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public Response> listWithResponse(Context context) { + Response> inner = this.serviceClient().listWithResponse(context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + inner + .getValue() + .stream() + .map(inner1 -> new AvailableRpOperationImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return null; + } + } + + public void getLocationHeaderResult(String resourceGroupName, String workspaceName, String operationId) { + this.serviceClient().getLocationHeaderResult(resourceGroupName, workspaceName, operationId); + } + + public Response getLocationHeaderResultWithResponse( + String resourceGroupName, String workspaceName, String operationId, Context context) { + return this + .serviceClient() + .getLocationHeaderResultWithResponse(resourceGroupName, workspaceName, operationId, context); + } + + public OperationResource getAzureAsyncHeaderResult( + String resourceGroupName, String workspaceName, String operationId) { + OperationResourceInner inner = + this.serviceClient().getAzureAsyncHeaderResult(resourceGroupName, workspaceName, operationId); + if (inner != null) { + return new OperationResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getAzureAsyncHeaderResultWithResponse( + String resourceGroupName, String workspaceName, String operationId, Context context) { + Response inner = + this + .serviceClient() + .getAzureAsyncHeaderResultWithResponse(resourceGroupName, workspaceName, operationId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new OperationResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionForPrivateLinkHubImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionForPrivateLinkHubImpl.java new file mode 100644 index 0000000000000..04cd1bbf45327 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionForPrivateLinkHubImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.PrivateEndpointConnectionForPrivateLinkHubInner; +import com.azure.resourcemanager.synapse.models.PrivateEndpointConnectionForPrivateLinkHub; +import com.azure.resourcemanager.synapse.models.PrivateEndpointConnectionProperties; + +public final class PrivateEndpointConnectionForPrivateLinkHubImpl + implements PrivateEndpointConnectionForPrivateLinkHub { + private PrivateEndpointConnectionForPrivateLinkHubInner innerObject; + + private final SynapseManager serviceManager; + + PrivateEndpointConnectionForPrivateLinkHubImpl( + PrivateEndpointConnectionForPrivateLinkHubInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public PrivateEndpointConnectionProperties properties() { + return this.innerModel().properties(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public PrivateEndpointConnectionForPrivateLinkHubInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 0000000000000..b83a7626df77e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.synapse.models.PrivateEndpoint; +import com.azure.resourcemanager.synapse.models.PrivateEndpointConnection; +import com.azure.resourcemanager.synapse.models.PrivateLinkServiceConnectionState; + +public final class PrivateEndpointConnectionImpl + implements PrivateEndpointConnection, PrivateEndpointConnection.Definition { + private PrivateEndpointConnectionInner innerObject; + + private final SynapseManager serviceManager; + + PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public PrivateEndpoint privateEndpoint() { + return this.innerModel().privateEndpoint(); + } + + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String privateEndpointConnectionName; + + public PrivateEndpointConnectionImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public PrivateEndpointConnection create() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .create( + resourceGroupName, workspaceName, privateEndpointConnectionName, this.innerModel(), Context.NONE); + return this; + } + + public PrivateEndpointConnection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .create(resourceGroupName, workspaceName, privateEndpointConnectionName, this.innerModel(), context); + return this; + } + + PrivateEndpointConnectionImpl(String name, SynapseManager serviceManager) { + this.innerObject = new PrivateEndpointConnectionInner(); + this.serviceManager = serviceManager; + this.privateEndpointConnectionName = name; + } + + public PrivateEndpointConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, context) + .getValue(); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.innerModel().withPrivateEndpoint(privateEndpoint); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.innerModel().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionsClientImpl.java new file mode 100644 index 0000000000000..3463597388e60 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,1174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.synapse.fluent.models.OperationResourceInner; +import com.azure.resourcemanager.synapse.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.synapse.models.PrivateEndpointConnectionList; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { + private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateEndpointConnectionsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientPrivateEndpointConnections to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface PrivateEndpointConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @BodyParam("application/json") PrivateEndpointConnectionInner request, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/privateEndpointConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + privateEndpointConnectionName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + privateEndpointConnectionName, + accept, + context); + } + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + return getAsync(resourceGroupName, workspaceName, privateEndpointConnectionName).block(); + } + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, context).block(); + } + + /** + * 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 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner request) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + privateEndpointConnectionName, + request, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @param request Request body of private endpoint connection to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner request, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (request == null) { + return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); + } else { + request.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + privateEndpointConnectionName, + request, + accept, + context); + } + + /** + * 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 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateEndpointConnectionInner> beginCreateAsync( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner request) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, request); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + Context.NONE); + } + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @param request Request body of private endpoint connection to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, PrivateEndpointConnectionInner> beginCreateAsync( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner request, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, request, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + context); + } + + /** + * 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 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateEndpointConnectionInner> beginCreate( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner request) { + return beginCreateAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, request) + .getSyncPoller(); + } + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @param request Request body of private endpoint connection to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateEndpointConnectionInner> beginCreate( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner request, + Context context) { + return beginCreateAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, request, context) + .getSyncPoller(); + } + + /** + * 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 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner request) { + return beginCreateAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, request) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @param request Request body of private endpoint connection to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner request, + Context context) { + return beginCreateAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, request, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner create( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner request) { + return createAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, request).block(); + } + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @param request Request body of private endpoint connection to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner create( + String resourceGroupName, + String workspaceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner request, + Context context) { + return createAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, request, context).block(); + } + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + privateEndpointConnectionName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + privateEndpointConnectionName, + accept, + context); + } + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OperationResourceInner> beginDeleteAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationResourceInner.class, + OperationResourceInner.class, + Context.NONE); + } + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, OperationResourceInner> beginDeleteAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationResourceInner.class, + OperationResourceInner.class, + context); + } + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OperationResourceInner> beginDelete( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, workspaceName, privateEndpointConnectionName).getSyncPoller(); + } + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OperationResourceInner> beginDelete( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, context) + .getSyncPoller(); + } + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, workspaceName, privateEndpointConnectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationResourceInner delete( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + return deleteAsync(resourceGroupName, workspaceName, privateEndpointConnectionName).block(); + } + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationResourceInner delete( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + return deleteAsync(resourceGroupName, workspaceName, privateEndpointConnectionName, context).block(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 0000000000000..af77b7142e35d --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.synapse.fluent.models.OperationResourceInner; +import com.azure.resourcemanager.synapse.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.synapse.models.OperationResource; +import com.azure.resourcemanager.synapse.models.PrivateEndpointConnection; +import com.azure.resourcemanager.synapse.models.PrivateEndpointConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsImpl.class); + + private final PrivateEndpointConnectionsClient innerClient; + + private final SynapseManager serviceManager; + + public PrivateEndpointConnectionsImpl(PrivateEndpointConnectionsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PrivateEndpointConnection get( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public OperationResource delete( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName) { + OperationResourceInner inner = + this.serviceClient().delete(resourceGroupName, workspaceName, privateEndpointConnectionName); + if (inner != null) { + return new OperationResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationResource delete( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) { + OperationResourceInner inner = + this.serviceClient().delete(resourceGroupName, workspaceName, privateEndpointConnectionName, context); + if (inner != null) { + return new OperationResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PrivateEndpointConnection getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this + .getWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, context); + } + + public OperationResource deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this.delete(resourceGroupName, workspaceName, privateEndpointConnectionName, Context.NONE); + } + + public OperationResource deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this.delete(resourceGroupName, workspaceName, privateEndpointConnectionName, context); + } + + private PrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + public PrivateEndpointConnectionImpl define(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionsPrivateLinkHubsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionsPrivateLinkHubsClientImpl.java new file mode 100644 index 0000000000000..67ef0861f862e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionsPrivateLinkHubsClientImpl.java @@ -0,0 +1,352 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.PrivateEndpointConnectionsPrivateLinkHubsClient; +import com.azure.resourcemanager.synapse.fluent.models.PrivateEndpointConnectionForPrivateLinkHubInner; +import com.azure.resourcemanager.synapse.models.PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * PrivateEndpointConnectionsPrivateLinkHubsClient. + */ +public final class PrivateEndpointConnectionsPrivateLinkHubsClientImpl + implements PrivateEndpointConnectionsPrivateLinkHubsClient { + private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsPrivateLinkHubsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateEndpointConnectionsPrivateLinkHubsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsPrivateLinkHubsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsPrivateLinkHubsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + PrivateEndpointConnectionsPrivateLinkHubsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientPrivateEndpointConnectionsPrivateLinkHubs to + * be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface PrivateEndpointConnectionsPrivateLinkHubsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse" + + "/privateLinkHubs/{privateLinkHubName}/privateEndpointConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateLinkHubName") String privateLinkHubName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all PrivateEndpointConnections in the PrivateLinkHub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String privateLinkHubName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateLinkHubName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateLinkHubName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + privateLinkHubName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all PrivateEndpointConnections in the PrivateLinkHub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String privateLinkHubName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateLinkHubName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateLinkHubName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + privateLinkHubName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all PrivateEndpointConnections in the PrivateLinkHub. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String privateLinkHubName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateLinkHubName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all PrivateEndpointConnections in the PrivateLinkHub. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String privateLinkHubName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateLinkHubName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all PrivateEndpointConnections in the PrivateLinkHub. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String privateLinkHubName) { + return new PagedIterable<>(listAsync(resourceGroupName, privateLinkHubName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all PrivateEndpointConnections in the PrivateLinkHub. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String privateLinkHubName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, privateLinkHubName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionsPrivateLinkHubsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionsPrivateLinkHubsImpl.java new file mode 100644 index 0000000000000..f03ebe0ffb50d --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateEndpointConnectionsPrivateLinkHubsImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.PrivateEndpointConnectionsPrivateLinkHubsClient; +import com.azure.resourcemanager.synapse.fluent.models.PrivateEndpointConnectionForPrivateLinkHubInner; +import com.azure.resourcemanager.synapse.models.PrivateEndpointConnectionForPrivateLinkHub; +import com.azure.resourcemanager.synapse.models.PrivateEndpointConnectionsPrivateLinkHubs; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateEndpointConnectionsPrivateLinkHubsImpl implements PrivateEndpointConnectionsPrivateLinkHubs { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionsPrivateLinkHubsImpl.class); + + private final PrivateEndpointConnectionsPrivateLinkHubsClient innerClient; + + private final SynapseManager serviceManager; + + public PrivateEndpointConnectionsPrivateLinkHubsImpl( + PrivateEndpointConnectionsPrivateLinkHubsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String resourceGroupName, String privateLinkHubName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, privateLinkHubName); + return Utils + .mapPage(inner, inner1 -> new PrivateEndpointConnectionForPrivateLinkHubImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String privateLinkHubName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, privateLinkHubName, context); + return Utils + .mapPage(inner, inner1 -> new PrivateEndpointConnectionForPrivateLinkHubImpl(inner1, this.manager())); + } + + private PrivateEndpointConnectionsPrivateLinkHubsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkHubImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkHubImpl.java new file mode 100644 index 0000000000000..ae205a5bb65f3 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkHubImpl.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.PrivateLinkHubInner; +import com.azure.resourcemanager.synapse.models.PrivateEndpointConnectionForPrivateLinkHubBasic; +import com.azure.resourcemanager.synapse.models.PrivateLinkHub; +import com.azure.resourcemanager.synapse.models.PrivateLinkHubPatchInfo; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public final class PrivateLinkHubImpl implements PrivateLinkHub, PrivateLinkHub.Definition, PrivateLinkHub.Update { + private PrivateLinkHubInner innerObject; + + private final SynapseManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public PrivateLinkHubInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String privateLinkHubName; + + private PrivateLinkHubPatchInfo updatePrivateLinkHubPatchInfo; + + public PrivateLinkHubImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public PrivateLinkHub create() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateLinkHubs() + .createOrUpdateWithResponse(resourceGroupName, privateLinkHubName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public PrivateLinkHub create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateLinkHubs() + .createOrUpdateWithResponse(resourceGroupName, privateLinkHubName, this.innerModel(), context) + .getValue(); + return this; + } + + PrivateLinkHubImpl(String name, SynapseManager serviceManager) { + this.innerObject = new PrivateLinkHubInner(); + this.serviceManager = serviceManager; + this.privateLinkHubName = name; + } + + public PrivateLinkHubImpl update() { + this.updatePrivateLinkHubPatchInfo = new PrivateLinkHubPatchInfo(); + return this; + } + + public PrivateLinkHub apply() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateLinkHubs() + .updateWithResponse(resourceGroupName, privateLinkHubName, updatePrivateLinkHubPatchInfo, Context.NONE) + .getValue(); + return this; + } + + public PrivateLinkHub apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateLinkHubs() + .updateWithResponse(resourceGroupName, privateLinkHubName, updatePrivateLinkHubPatchInfo, context) + .getValue(); + return this; + } + + PrivateLinkHubImpl(PrivateLinkHubInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.privateLinkHubName = Utils.getValueFromIdByName(innerObject.id(), "privateLinkHubs"); + } + + public PrivateLinkHub refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateLinkHubs() + .getByResourceGroupWithResponse(resourceGroupName, privateLinkHubName, Context.NONE) + .getValue(); + return this; + } + + public PrivateLinkHub refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateLinkHubs() + .getByResourceGroupWithResponse(resourceGroupName, privateLinkHubName, context) + .getValue(); + return this; + } + + public PrivateLinkHubImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public PrivateLinkHubImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public PrivateLinkHubImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updatePrivateLinkHubPatchInfo.withTags(tags); + return this; + } + } + + public PrivateLinkHubImpl withProvisioningState(String provisioningState) { + this.innerModel().withProvisioningState(provisioningState); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkHubPrivateLinkResourcesClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkHubPrivateLinkResourcesClientImpl.java new file mode 100644 index 0000000000000..9d878ff146266 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkHubPrivateLinkResourcesClientImpl.java @@ -0,0 +1,532 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.PrivateLinkHubPrivateLinkResourcesClient; +import com.azure.resourcemanager.synapse.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.synapse.models.PrivateLinkResourceListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in PrivateLinkHubPrivateLinkResourcesClient. + */ +public final class PrivateLinkHubPrivateLinkResourcesClientImpl implements PrivateLinkHubPrivateLinkResourcesClient { + private final ClientLogger logger = new ClientLogger(PrivateLinkHubPrivateLinkResourcesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateLinkHubPrivateLinkResourcesService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkHubPrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkHubPrivateLinkResourcesClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + PrivateLinkHubPrivateLinkResourcesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientPrivateLinkHubPrivateLinkResources to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface PrivateLinkHubPrivateLinkResourcesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse" + + "/privateLinkHubs/{privateLinkHubName}/privateLinkResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateLinkHubName") String privateLinkHubName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse" + + "/privateLinkHubs/{privateLinkHubName}/privateLinkResources/{privateLinkResourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateLinkHubName") String privateLinkHubName, + @PathParam("privateLinkResourceName") String privateLinkResourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get all private link resources for a private link hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName The name of the private link hub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link resources for a private link hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String privateLinkHubName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateLinkHubName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateLinkHubName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + privateLinkHubName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get all private link resources for a private link hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName The name of the private link hub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link resources for a private link hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String privateLinkHubName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateLinkHubName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateLinkHubName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + privateLinkHubName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get all private link resources for a private link hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName The name of the private link hub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link resources for a private link hub. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String privateLinkHubName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateLinkHubName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get all private link resources for a private link hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName The name of the private link hub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link resources for a private link hub. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String privateLinkHubName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, privateLinkHubName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get all private link resources for a private link hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName The name of the private link hub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link resources for a private link hub. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String privateLinkHubName) { + return new PagedIterable<>(listAsync(resourceGroupName, privateLinkHubName)); + } + + /** + * Get all private link resources for a private link hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName The name of the private link hub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link resources for a private link hub. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String privateLinkHubName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, privateLinkHubName, context)); + } + + /** + * Get private link resource in private link hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName The name of the private link hub. + * @param privateLinkResourceName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link resource in private link hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateLinkHubName, String privateLinkResourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateLinkHubName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateLinkHubName is required and cannot be null.")); + } + if (privateLinkResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter privateLinkResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + privateLinkHubName, + privateLinkResourceName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get private link resource in private link hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName The name of the private link hub. + * @param privateLinkResourceName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link resource in private link hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String privateLinkHubName, String privateLinkResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateLinkHubName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateLinkHubName is required and cannot be null.")); + } + if (privateLinkResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter privateLinkResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + privateLinkHubName, + privateLinkResourceName, + accept, + context); + } + + /** + * Get private link resource in private link hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName The name of the private link hub. + * @param privateLinkResourceName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link resource in private link hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String privateLinkHubName, String privateLinkResourceName) { + return getWithResponseAsync(resourceGroupName, privateLinkHubName, privateLinkResourceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get private link resource in private link hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName The name of the private link hub. + * @param privateLinkResourceName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link resource in private link hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceInner get( + String resourceGroupName, String privateLinkHubName, String privateLinkResourceName) { + return getAsync(resourceGroupName, privateLinkHubName, privateLinkResourceName).block(); + } + + /** + * Get private link resource in private link hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName The name of the private link hub. + * @param privateLinkResourceName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link resource in private link hub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String privateLinkHubName, String privateLinkResourceName, Context context) { + return getWithResponseAsync(resourceGroupName, privateLinkHubName, privateLinkResourceName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkHubPrivateLinkResourcesImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkHubPrivateLinkResourcesImpl.java new file mode 100644 index 0000000000000..e462c5fe06145 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkHubPrivateLinkResourcesImpl.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.PrivateLinkHubPrivateLinkResourcesClient; +import com.azure.resourcemanager.synapse.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.synapse.models.PrivateLinkHubPrivateLinkResources; +import com.azure.resourcemanager.synapse.models.PrivateLinkResource; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateLinkHubPrivateLinkResourcesImpl implements PrivateLinkHubPrivateLinkResources { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkHubPrivateLinkResourcesImpl.class); + + private final PrivateLinkHubPrivateLinkResourcesClient innerClient; + + private final SynapseManager serviceManager; + + public PrivateLinkHubPrivateLinkResourcesImpl( + PrivateLinkHubPrivateLinkResourcesClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String privateLinkHubName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, privateLinkHubName); + return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String privateLinkHubName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, privateLinkHubName, context); + return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + public PrivateLinkResource get( + String resourceGroupName, String privateLinkHubName, String privateLinkResourceName) { + PrivateLinkResourceInner inner = + this.serviceClient().get(resourceGroupName, privateLinkHubName, privateLinkResourceName); + if (inner != null) { + return new PrivateLinkResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String privateLinkHubName, String privateLinkResourceName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, privateLinkHubName, privateLinkResourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateLinkResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private PrivateLinkHubPrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkHubsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkHubsClientImpl.java new file mode 100644 index 0000000000000..a8124095757cd --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkHubsClientImpl.java @@ -0,0 +1,1361 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.PrivateLinkHubsClient; +import com.azure.resourcemanager.synapse.fluent.models.PrivateLinkHubInner; +import com.azure.resourcemanager.synapse.models.PrivateLinkHubInfoListResult; +import com.azure.resourcemanager.synapse.models.PrivateLinkHubPatchInfo; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateLinkHubsClient. */ +public final class PrivateLinkHubsClientImpl implements PrivateLinkHubsClient { + private final ClientLogger logger = new ClientLogger(PrivateLinkHubsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateLinkHubsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkHubsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkHubsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy.create(PrivateLinkHubsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientPrivateLinkHubs to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface PrivateLinkHubsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse" + + "/privateLinkHubs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse" + + "/privateLinkHubs/{privateLinkHubName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateLinkHubName") String privateLinkHubName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse" + + "/privateLinkHubs/{privateLinkHubName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateLinkHubName") String privateLinkHubName, + @BodyParam("application/json") PrivateLinkHubPatchInfo privateLinkHubPatchInfo, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse" + + "/privateLinkHubs/{privateLinkHubName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateLinkHubName") String privateLinkHubName, + @BodyParam("application/json") PrivateLinkHubInner privateLinkHubInfo, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse" + + "/privateLinkHubs/{privateLinkHubName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("privateLinkHubName") String privateLinkHubName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Synapse/privateLinkHubs") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns a list of privateLinkHubs in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of privateLinkHubs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns a list of privateLinkHubs in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of privateLinkHubs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns a list of privateLinkHubs in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of privateLinkHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Returns a list of privateLinkHubs in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of privateLinkHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns a list of privateLinkHubs in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of privateLinkHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Returns a list of privateLinkHubs in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of privateLinkHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a privateLinkHub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String privateLinkHubName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateLinkHubName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateLinkHubName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + privateLinkHubName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets a privateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a privateLinkHub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String privateLinkHubName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateLinkHubName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateLinkHubName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + privateLinkHubName, + accept, + context); + } + + /** + * Gets 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a privateLinkHub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String privateLinkHubName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, privateLinkHubName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a privateLinkHub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkHubInner getByResourceGroup(String resourceGroupName, String privateLinkHubName) { + return getByResourceGroupAsync(resourceGroupName, privateLinkHubName).block(); + } + + /** + * Gets a privateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a privateLinkHub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String privateLinkHubName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, privateLinkHubName, context).block(); + } + + /** + * Updates a privateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param privateLinkHubPatchInfo PrivateLinkHub patch request properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a privateLinkHub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String privateLinkHubName, PrivateLinkHubPatchInfo privateLinkHubPatchInfo) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateLinkHubName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateLinkHubName is required and cannot be null.")); + } + if (privateLinkHubPatchInfo == null) { + return Mono + .error( + new IllegalArgumentException("Parameter privateLinkHubPatchInfo is required and cannot be null.")); + } else { + privateLinkHubPatchInfo.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + privateLinkHubName, + privateLinkHubPatchInfo, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates a privateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param privateLinkHubPatchInfo PrivateLinkHub patch request properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a privateLinkHub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String privateLinkHubName, + PrivateLinkHubPatchInfo privateLinkHubPatchInfo, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateLinkHubName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateLinkHubName is required and cannot be null.")); + } + if (privateLinkHubPatchInfo == null) { + return Mono + .error( + new IllegalArgumentException("Parameter privateLinkHubPatchInfo is required and cannot be null.")); + } else { + privateLinkHubPatchInfo.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + privateLinkHubName, + privateLinkHubPatchInfo, + accept, + context); + } + + /** + * Updates a privateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param privateLinkHubPatchInfo PrivateLinkHub patch request properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a privateLinkHub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String privateLinkHubName, PrivateLinkHubPatchInfo privateLinkHubPatchInfo) { + return updateWithResponseAsync(resourceGroupName, privateLinkHubName, privateLinkHubPatchInfo) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a privateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param privateLinkHubPatchInfo PrivateLinkHub patch request properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a privateLinkHub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkHubInner update( + String resourceGroupName, String privateLinkHubName, PrivateLinkHubPatchInfo privateLinkHubPatchInfo) { + return updateAsync(resourceGroupName, privateLinkHubName, privateLinkHubPatchInfo).block(); + } + + /** + * Updates a privateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param privateLinkHubPatchInfo PrivateLinkHub patch request properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a privateLinkHub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String privateLinkHubName, + PrivateLinkHubPatchInfo privateLinkHubPatchInfo, + Context context) { + return updateWithResponseAsync(resourceGroupName, privateLinkHubName, privateLinkHubPatchInfo, context).block(); + } + + /** + * Creates or updates a privateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param privateLinkHubInfo PrivateLinkHub create or update request properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a privateLinkHub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String privateLinkHubName, PrivateLinkHubInner privateLinkHubInfo) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateLinkHubName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateLinkHubName is required and cannot be null.")); + } + if (privateLinkHubInfo == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateLinkHubInfo is required and cannot be null.")); + } else { + privateLinkHubInfo.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + privateLinkHubName, + privateLinkHubInfo, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates a privateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param privateLinkHubInfo PrivateLinkHub create or update request properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a privateLinkHub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String privateLinkHubName, PrivateLinkHubInner privateLinkHubInfo, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateLinkHubName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateLinkHubName is required and cannot be null.")); + } + if (privateLinkHubInfo == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateLinkHubInfo is required and cannot be null.")); + } else { + privateLinkHubInfo.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + privateLinkHubName, + privateLinkHubInfo, + accept, + context); + } + + /** + * Creates or updates a privateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param privateLinkHubInfo PrivateLinkHub create or update request properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a privateLinkHub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String privateLinkHubName, PrivateLinkHubInner privateLinkHubInfo) { + return createOrUpdateWithResponseAsync(resourceGroupName, privateLinkHubName, privateLinkHubInfo) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a privateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param privateLinkHubInfo PrivateLinkHub create or update request properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a privateLinkHub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkHubInner createOrUpdate( + String resourceGroupName, String privateLinkHubName, PrivateLinkHubInner privateLinkHubInfo) { + return createOrUpdateAsync(resourceGroupName, privateLinkHubName, privateLinkHubInfo).block(); + } + + /** + * Creates or updates a privateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param privateLinkHubInfo PrivateLinkHub create or update request properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a privateLinkHub. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, String privateLinkHubName, PrivateLinkHubInner privateLinkHubInfo, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, privateLinkHubName, privateLinkHubInfo, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String privateLinkHubName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateLinkHubName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateLinkHubName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + privateLinkHubName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes a privateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String privateLinkHubName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (privateLinkHubName == null) { + return Mono + .error(new IllegalArgumentException("Parameter privateLinkHubName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + privateLinkHubName, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String privateLinkHubName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, privateLinkHubName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a privateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String privateLinkHubName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, privateLinkHubName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String privateLinkHubName) { + return beginDeleteAsync(resourceGroupName, privateLinkHubName).getSyncPoller(); + } + + /** + * Deletes a privateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String privateLinkHubName, Context context) { + return beginDeleteAsync(resourceGroupName, privateLinkHubName, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String privateLinkHubName) { + return beginDeleteAsync(resourceGroupName, privateLinkHubName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a privateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String privateLinkHubName, Context context) { + return beginDeleteAsync(resourceGroupName, privateLinkHubName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String privateLinkHubName) { + deleteAsync(resourceGroupName, privateLinkHubName).block(); + } + + /** + * Deletes a privateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String privateLinkHubName, Context context) { + deleteAsync(resourceGroupName, privateLinkHubName, context).block(); + } + + /** + * Returns a list of privateLinkHubs in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of privateLinkHubs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns a list of privateLinkHubs in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of privateLinkHubs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns a list of privateLinkHubs in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of privateLinkHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns a list of privateLinkHubs in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of privateLinkHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns a list of privateLinkHubs in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of privateLinkHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Returns a list of privateLinkHubs in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of privateLinkHubs. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of privateLinkHubs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of privateLinkHubs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of privateLinkHubs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of privateLinkHubs. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkHubsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkHubsImpl.java new file mode 100644 index 0000000000000..5a356809c9c47 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkHubsImpl.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.PrivateLinkHubsClient; +import com.azure.resourcemanager.synapse.fluent.models.PrivateLinkHubInner; +import com.azure.resourcemanager.synapse.models.PrivateLinkHub; +import com.azure.resourcemanager.synapse.models.PrivateLinkHubs; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateLinkHubsImpl implements PrivateLinkHubs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkHubsImpl.class); + + private final PrivateLinkHubsClient innerClient; + + private final SynapseManager serviceManager; + + public PrivateLinkHubsImpl(PrivateLinkHubsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new PrivateLinkHubImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new PrivateLinkHubImpl(inner1, this.manager())); + } + + public PrivateLinkHub getByResourceGroup(String resourceGroupName, String privateLinkHubName) { + PrivateLinkHubInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, privateLinkHubName); + if (inner != null) { + return new PrivateLinkHubImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String privateLinkHubName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, privateLinkHubName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateLinkHubImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String privateLinkHubName) { + this.serviceClient().delete(resourceGroupName, privateLinkHubName); + } + + public void delete(String resourceGroupName, String privateLinkHubName, Context context) { + this.serviceClient().delete(resourceGroupName, privateLinkHubName, context); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new PrivateLinkHubImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new PrivateLinkHubImpl(inner1, this.manager())); + } + + public PrivateLinkHub getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String privateLinkHubName = Utils.getValueFromIdByName(id, "privateLinkHubs"); + if (privateLinkHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'privateLinkHubs'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, privateLinkHubName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String privateLinkHubName = Utils.getValueFromIdByName(id, "privateLinkHubs"); + if (privateLinkHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'privateLinkHubs'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, privateLinkHubName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String privateLinkHubName = Utils.getValueFromIdByName(id, "privateLinkHubs"); + if (privateLinkHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'privateLinkHubs'.", id))); + } + this.delete(resourceGroupName, privateLinkHubName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String privateLinkHubName = Utils.getValueFromIdByName(id, "privateLinkHubs"); + if (privateLinkHubName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'privateLinkHubs'.", id))); + } + this.delete(resourceGroupName, privateLinkHubName, context); + } + + private PrivateLinkHubsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + public PrivateLinkHubImpl define(String name) { + return new PrivateLinkHubImpl(name, this.manager()); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkResourceImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 0000000000000..1469e63d7d997 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkResourceImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.synapse.models.PrivateLinkResource; +import com.azure.resourcemanager.synapse.models.PrivateLinkResourceProperties; + +public final class PrivateLinkResourceImpl implements PrivateLinkResource { + private PrivateLinkResourceInner innerObject; + + private final SynapseManager serviceManager; + + PrivateLinkResourceImpl(PrivateLinkResourceInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public PrivateLinkResourceProperties properties() { + return this.innerModel().properties(); + } + + public PrivateLinkResourceInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkResourcesClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkResourcesClientImpl.java new file mode 100644 index 0000000000000..a0dcb381c43d1 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkResourcesClientImpl.java @@ -0,0 +1,522 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.synapse.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.synapse.models.PrivateLinkResourceListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */ +public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient { + private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PrivateLinkResourcesService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of PrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinkResourcesClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientPrivateLinkResources to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface PrivateLinkResourcesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/privateLinkResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/privateLinkResources/{privateLinkResourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("privateLinkResourceName") String privateLinkResourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get all private link resources for a workspaces. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link resources for a workspaces. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get all private link resources for a workspaces. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link resources for a workspaces. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get all private link resources for a workspaces. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link resources for a workspaces. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get all private link resources for a workspaces. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link resources for a workspaces. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get all private link resources for a workspaces. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link resources for a workspaces. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); + } + + /** + * Get all private link resources for a workspaces. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link resources for a workspaces. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Get private link resource in workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link resource in workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String privateLinkResourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (privateLinkResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter privateLinkResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + privateLinkResourceName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get private link resource in workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateLinkResourceName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link resource in workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String privateLinkResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (privateLinkResourceName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter privateLinkResourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + privateLinkResourceName, + accept, + context); + } + + /** + * Get private link resource in workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link resource in workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String privateLinkResourceName) { + return getWithResponseAsync(resourceGroupName, workspaceName, privateLinkResourceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get private link resource in workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link resource in workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceInner get( + String resourceGroupName, String workspaceName, String privateLinkResourceName) { + return getAsync(resourceGroupName, workspaceName, privateLinkResourceName).block(); + } + + /** + * Get private link resource in workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateLinkResourceName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link resource in workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String privateLinkResourceName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, privateLinkResourceName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private link resources. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkResourcesImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkResourcesImpl.java new file mode 100644 index 0000000000000..2c6ccabb12876 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/PrivateLinkResourcesImpl.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.synapse.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.synapse.models.PrivateLinkResource; +import com.azure.resourcemanager.synapse.models.PrivateLinkResources; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class PrivateLinkResourcesImpl implements PrivateLinkResources { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourcesImpl.class); + + private final PrivateLinkResourcesClient innerClient; + + private final SynapseManager serviceManager; + + public PrivateLinkResourcesImpl(PrivateLinkResourcesClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + public PrivateLinkResource get(String resourceGroupName, String workspaceName, String privateLinkResourceName) { + PrivateLinkResourceInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, privateLinkResourceName); + if (inner != null) { + return new PrivateLinkResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String privateLinkResourceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, privateLinkResourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateLinkResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private PrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/RecoverableSqlPoolImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/RecoverableSqlPoolImpl.java new file mode 100644 index 0000000000000..2f54aa39c4ff7 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/RecoverableSqlPoolImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.RecoverableSqlPoolInner; +import com.azure.resourcemanager.synapse.models.RecoverableSqlPool; +import java.time.OffsetDateTime; + +public final class RecoverableSqlPoolImpl implements RecoverableSqlPool { + private RecoverableSqlPoolInner innerObject; + + private final SynapseManager serviceManager; + + RecoverableSqlPoolImpl(RecoverableSqlPoolInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String edition() { + return this.innerModel().edition(); + } + + public String serviceLevelObjective() { + return this.innerModel().serviceLevelObjective(); + } + + public String elasticPoolName() { + return this.innerModel().elasticPoolName(); + } + + public OffsetDateTime lastAvailableBackupDate() { + return this.innerModel().lastAvailableBackupDate(); + } + + public RecoverableSqlPoolInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ReplaceAllFirewallRulesOperationResponseImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ReplaceAllFirewallRulesOperationResponseImpl.java new file mode 100644 index 0000000000000..97a8fd2f9405f --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ReplaceAllFirewallRulesOperationResponseImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.ReplaceAllFirewallRulesOperationResponseInner; +import com.azure.resourcemanager.synapse.models.ReplaceAllFirewallRulesOperationResponse; + +public final class ReplaceAllFirewallRulesOperationResponseImpl implements ReplaceAllFirewallRulesOperationResponse { + private ReplaceAllFirewallRulesOperationResponseInner innerObject; + + private final SynapseManager serviceManager; + + ReplaceAllFirewallRulesOperationResponseImpl( + ReplaceAllFirewallRulesOperationResponseInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String operationId() { + return this.innerModel().operationId(); + } + + public ReplaceAllFirewallRulesOperationResponseInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ReplicationLinkImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ReplicationLinkImpl.java new file mode 100644 index 0000000000000..1ba58a8f41074 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ReplicationLinkImpl.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.ReplicationLinkInner; +import com.azure.resourcemanager.synapse.models.ReplicationLink; +import com.azure.resourcemanager.synapse.models.ReplicationRole; +import com.azure.resourcemanager.synapse.models.ReplicationState; +import java.time.OffsetDateTime; + +public final class ReplicationLinkImpl implements ReplicationLink { + private ReplicationLinkInner innerObject; + + private final SynapseManager serviceManager; + + ReplicationLinkImpl(ReplicationLinkInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Boolean isTerminationAllowed() { + return this.innerModel().isTerminationAllowed(); + } + + public String replicationMode() { + return this.innerModel().replicationMode(); + } + + public String partnerServer() { + return this.innerModel().partnerServer(); + } + + public String partnerDatabase() { + return this.innerModel().partnerDatabase(); + } + + public String partnerLocation() { + return this.innerModel().partnerLocation(); + } + + public ReplicationRole role() { + return this.innerModel().role(); + } + + public ReplicationRole partnerRole() { + return this.innerModel().partnerRole(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public Integer percentComplete() { + return this.innerModel().percentComplete(); + } + + public ReplicationState replicationState() { + return this.innerModel().replicationState(); + } + + public ReplicationLinkInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/RestorableDroppedSqlPoolImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/RestorableDroppedSqlPoolImpl.java new file mode 100644 index 0000000000000..91a0ce775bbd4 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/RestorableDroppedSqlPoolImpl.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.RestorableDroppedSqlPoolInner; +import com.azure.resourcemanager.synapse.models.RestorableDroppedSqlPool; +import java.time.OffsetDateTime; + +public final class RestorableDroppedSqlPoolImpl implements RestorableDroppedSqlPool { + private RestorableDroppedSqlPoolInner innerObject; + + private final SynapseManager serviceManager; + + RestorableDroppedSqlPoolImpl(RestorableDroppedSqlPoolInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public String databaseName() { + return this.innerModel().databaseName(); + } + + public String edition() { + return this.innerModel().edition(); + } + + public String maxSizeBytes() { + return this.innerModel().maxSizeBytes(); + } + + public String serviceLevelObjective() { + return this.innerModel().serviceLevelObjective(); + } + + public String elasticPoolName() { + return this.innerModel().elasticPoolName(); + } + + public OffsetDateTime creationDate() { + return this.innerModel().creationDate(); + } + + public OffsetDateTime deletionDate() { + return this.innerModel().deletionDate(); + } + + public OffsetDateTime earliestRestoreDate() { + return this.innerModel().earliestRestoreDate(); + } + + public RestorableDroppedSqlPoolInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/RestorableDroppedSqlPoolsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/RestorableDroppedSqlPoolsClientImpl.java new file mode 100644 index 0000000000000..9cd9f980b10da --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/RestorableDroppedSqlPoolsClientImpl.java @@ -0,0 +1,438 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.RestorableDroppedSqlPoolsClient; +import com.azure.resourcemanager.synapse.fluent.models.RestorableDroppedSqlPoolInner; +import com.azure.resourcemanager.synapse.models.RestorableDroppedSqlPoolListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in RestorableDroppedSqlPoolsClient. */ +public final class RestorableDroppedSqlPoolsClientImpl implements RestorableDroppedSqlPoolsClient { + private final ClientLogger logger = new ClientLogger(RestorableDroppedSqlPoolsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final RestorableDroppedSqlPoolsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of RestorableDroppedSqlPoolsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RestorableDroppedSqlPoolsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + RestorableDroppedSqlPoolsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientRestorableDroppedSqlPools to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface RestorableDroppedSqlPoolsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/restorableDroppedSqlPools/{restorableDroppedSqlPoolId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("restorableDroppedSqlPoolId") String restorableDroppedSqlPoolId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/restorableDroppedSqlPools") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspace( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a deleted sql pool that can be restored. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String restorableDroppedSqlPoolId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (restorableDroppedSqlPoolId == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorableDroppedSqlPoolId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + restorableDroppedSqlPoolId, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a deleted sql pool that can be restored. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String restorableDroppedSqlPoolId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (restorableDroppedSqlPoolId == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter restorableDroppedSqlPoolId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + restorableDroppedSqlPoolId, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a deleted sql pool that can be restored. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String restorableDroppedSqlPoolId) { + return getWithResponseAsync(resourceGroupName, workspaceName, restorableDroppedSqlPoolId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a deleted sql pool that can be restored. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RestorableDroppedSqlPoolInner get( + String resourceGroupName, String workspaceName, String restorableDroppedSqlPoolId) { + return getAsync(resourceGroupName, workspaceName, restorableDroppedSqlPoolId).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a deleted sql pool that can be restored. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String restorableDroppedSqlPoolId, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, restorableDroppedSqlPoolId, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of deleted Sql pools that can be restored. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceSinglePageAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByWorkspace( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of deleted Sql pools that can be restored. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByWorkspace( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of deleted Sql pools that can be restored. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync( + String resourceGroupName, String workspaceName) { + return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of deleted Sql pools that can be restored. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync( + String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of deleted Sql pools that can be restored. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of deleted Sql pools that can be restored. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, context)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/RestorableDroppedSqlPoolsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/RestorableDroppedSqlPoolsImpl.java new file mode 100644 index 0000000000000..74d5692039571 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/RestorableDroppedSqlPoolsImpl.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.RestorableDroppedSqlPoolsClient; +import com.azure.resourcemanager.synapse.fluent.models.RestorableDroppedSqlPoolInner; +import com.azure.resourcemanager.synapse.models.RestorableDroppedSqlPool; +import com.azure.resourcemanager.synapse.models.RestorableDroppedSqlPools; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class RestorableDroppedSqlPoolsImpl implements RestorableDroppedSqlPools { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RestorableDroppedSqlPoolsImpl.class); + + private final RestorableDroppedSqlPoolsClient innerClient; + + private final SynapseManager serviceManager; + + public RestorableDroppedSqlPoolsImpl(RestorableDroppedSqlPoolsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public RestorableDroppedSqlPool get( + String resourceGroupName, String workspaceName, String restorableDroppedSqlPoolId) { + RestorableDroppedSqlPoolInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, restorableDroppedSqlPoolId); + if (inner != null) { + return new RestorableDroppedSqlPoolImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String restorableDroppedSqlPoolId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, restorableDroppedSqlPoolId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RestorableDroppedSqlPoolImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { + PagedIterable inner = + this.serviceClient().listByWorkspace(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new RestorableDroppedSqlPoolImpl(inner1, this.manager())); + } + + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = + this.serviceClient().listByWorkspace(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new RestorableDroppedSqlPoolImpl(inner1, this.manager())); + } + + private RestorableDroppedSqlPoolsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/RestorePointImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/RestorePointImpl.java new file mode 100644 index 0000000000000..328d9e6ae6b3e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/RestorePointImpl.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.RestorePointInner; +import com.azure.resourcemanager.synapse.models.RestorePoint; +import com.azure.resourcemanager.synapse.models.RestorePointType; +import java.time.OffsetDateTime; + +public final class RestorePointImpl implements RestorePoint { + private RestorePointInner innerObject; + + private final SynapseManager serviceManager; + + RestorePointImpl(RestorePointInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public RestorePointType restorePointType() { + return this.innerModel().restorePointType(); + } + + public OffsetDateTime earliestRestoreDate() { + return this.innerModel().earliestRestoreDate(); + } + + public OffsetDateTime restorePointCreationDate() { + return this.innerModel().restorePointCreationDate(); + } + + public String restorePointLabel() { + return this.innerModel().restorePointLabel(); + } + + public RestorePointInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SelfHostedIntegrationRuntimeNodeImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SelfHostedIntegrationRuntimeNodeImpl.java new file mode 100644 index 0000000000000..beb2ced50646c --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SelfHostedIntegrationRuntimeNodeImpl.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.SelfHostedIntegrationRuntimeNodeInner; +import com.azure.resourcemanager.synapse.models.IntegrationRuntimeUpdateResult; +import com.azure.resourcemanager.synapse.models.SelfHostedIntegrationRuntimeNode; +import com.azure.resourcemanager.synapse.models.SelfHostedIntegrationRuntimeNodeStatus; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.Map; + +public final class SelfHostedIntegrationRuntimeNodeImpl implements SelfHostedIntegrationRuntimeNode { + private SelfHostedIntegrationRuntimeNodeInner innerObject; + + private final SynapseManager serviceManager; + + SelfHostedIntegrationRuntimeNodeImpl( + SelfHostedIntegrationRuntimeNodeInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String nodeName() { + return this.innerModel().nodeName(); + } + + public String machineName() { + return this.innerModel().machineName(); + } + + public String hostServiceUri() { + return this.innerModel().hostServiceUri(); + } + + public SelfHostedIntegrationRuntimeNodeStatus status() { + return this.innerModel().status(); + } + + public Map capabilities() { + Map inner = this.innerModel().capabilities(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String versionStatus() { + return this.innerModel().versionStatus(); + } + + public String version() { + return this.innerModel().version(); + } + + public OffsetDateTime registerTime() { + return this.innerModel().registerTime(); + } + + public OffsetDateTime lastConnectTime() { + return this.innerModel().lastConnectTime(); + } + + public OffsetDateTime expiryTime() { + return this.innerModel().expiryTime(); + } + + public OffsetDateTime lastStartTime() { + return this.innerModel().lastStartTime(); + } + + public OffsetDateTime lastStopTime() { + return this.innerModel().lastStopTime(); + } + + public IntegrationRuntimeUpdateResult lastUpdateResult() { + return this.innerModel().lastUpdateResult(); + } + + public OffsetDateTime lastStartUpdateTime() { + return this.innerModel().lastStartUpdateTime(); + } + + public OffsetDateTime lastEndUpdateTime() { + return this.innerModel().lastEndUpdateTime(); + } + + public Boolean isActiveDispatcher() { + return this.innerModel().isActiveDispatcher(); + } + + public Integer concurrentJobsLimit() { + return this.innerModel().concurrentJobsLimit(); + } + + public Integer maxConcurrentJobs() { + return this.innerModel().maxConcurrentJobs(); + } + + public Map additionalProperties() { + Map inner = this.innerModel().additionalProperties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SelfHostedIntegrationRuntimeNodeInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SensitivityLabelImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SensitivityLabelImpl.java new file mode 100644 index 0000000000000..cefd06c505ad3 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SensitivityLabelImpl.java @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.SensitivityLabelInner; +import com.azure.resourcemanager.synapse.models.SensitivityLabel; +import com.azure.resourcemanager.synapse.models.SensitivityLabelRank; + +public final class SensitivityLabelImpl + implements SensitivityLabel, SensitivityLabel.Definition, SensitivityLabel.Update { + private SensitivityLabelInner innerObject; + + private final SynapseManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String managedBy() { + return this.innerModel().managedBy(); + } + + public String schemaName() { + return this.innerModel().schemaName(); + } + + public String tableName() { + return this.innerModel().tableName(); + } + + public String columnName() { + return this.innerModel().columnName(); + } + + public String labelName() { + return this.innerModel().labelName(); + } + + public String labelId() { + return this.innerModel().labelId(); + } + + public String informationType() { + return this.innerModel().informationType(); + } + + public String informationTypeId() { + return this.innerModel().informationTypeId(); + } + + public Boolean isDisabled() { + return this.innerModel().isDisabled(); + } + + public SensitivityLabelRank rank() { + return this.innerModel().rank(); + } + + public SensitivityLabelInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String sqlPoolName; + + private String schemaName; + + private String tableName; + + private String columnName; + + public SensitivityLabelImpl withExistingColumn( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + this.sqlPoolName = sqlPoolName; + this.schemaName = schemaName; + this.tableName = tableName; + this.columnName = columnName; + return this; + } + + public SensitivityLabel create() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolSensitivityLabels() + .createOrUpdateWithResponse( + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + tableName, + columnName, + this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public SensitivityLabel create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolSensitivityLabels() + .createOrUpdateWithResponse( + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + tableName, + columnName, + this.innerModel(), + context) + .getValue(); + return this; + } + + SensitivityLabelImpl(SynapseManager serviceManager) { + this.innerObject = new SensitivityLabelInner(); + this.serviceManager = serviceManager; + } + + public SensitivityLabelImpl update() { + return this; + } + + public SensitivityLabel apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolSensitivityLabels() + .createOrUpdateWithResponse( + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + tableName, + columnName, + this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public SensitivityLabel apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolSensitivityLabels() + .createOrUpdateWithResponse( + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + tableName, + columnName, + this.innerModel(), + context) + .getValue(); + return this; + } + + SensitivityLabelImpl(SensitivityLabelInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.sqlPoolName = Utils.getValueFromIdByName(innerObject.id(), "sqlPools"); + this.schemaName = Utils.getValueFromIdByName(innerObject.id(), "schemas"); + this.tableName = Utils.getValueFromIdByName(innerObject.id(), "tables"); + this.columnName = Utils.getValueFromIdByName(innerObject.id(), "columns"); + } + + public void enableRecommendation() { + serviceManager + .sqlPoolSensitivityLabels() + .enableRecommendation(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName); + } + + public Response enableRecommendationWithResponse(Context context) { + return serviceManager + .sqlPoolSensitivityLabels() + .enableRecommendationWithResponse( + resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName, context); + } + + public void disableRecommendation() { + serviceManager + .sqlPoolSensitivityLabels() + .disableRecommendation(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName); + } + + public Response disableRecommendationWithResponse(Context context) { + return serviceManager + .sqlPoolSensitivityLabels() + .disableRecommendationWithResponse( + resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName, context); + } + + public SensitivityLabelImpl withLabelName(String labelName) { + this.innerModel().withLabelName(labelName); + return this; + } + + public SensitivityLabelImpl withLabelId(String labelId) { + this.innerModel().withLabelId(labelId); + return this; + } + + public SensitivityLabelImpl withInformationType(String informationType) { + this.innerModel().withInformationType(informationType); + return this; + } + + public SensitivityLabelImpl withInformationTypeId(String informationTypeId) { + this.innerModel().withInformationTypeId(informationTypeId); + return this; + } + + public SensitivityLabelImpl withRank(SensitivityLabelRank rank) { + this.innerModel().withRank(rank); + return this; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SensitivityLabelUpdateImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SensitivityLabelUpdateImpl.java new file mode 100644 index 0000000000000..73c9d4b1e53ba --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SensitivityLabelUpdateImpl.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.SensitivityLabelInner; +import com.azure.resourcemanager.synapse.fluent.models.SensitivityLabelUpdateInner; +import com.azure.resourcemanager.synapse.models.SensitivityLabel; +import com.azure.resourcemanager.synapse.models.SensitivityLabelUpdate; +import com.azure.resourcemanager.synapse.models.SensitivityLabelUpdateKind; + +public final class SensitivityLabelUpdateImpl implements SensitivityLabelUpdate { + private SensitivityLabelUpdateInner innerObject; + + private final SynapseManager serviceManager; + + SensitivityLabelUpdateImpl(SensitivityLabelUpdateInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SensitivityLabelUpdateKind op() { + return this.innerModel().op(); + } + + public String schema() { + return this.innerModel().schema(); + } + + public String table() { + return this.innerModel().table(); + } + + public String column() { + return this.innerModel().column(); + } + + public SensitivityLabel sensitivityLabel() { + SensitivityLabelInner inner = this.innerModel().sensitivityLabel(); + if (inner != null) { + return new SensitivityLabelImpl(inner, this.manager()); + } else { + return null; + } + } + + public SensitivityLabelUpdateInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ServerBlobAuditingPolicyImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ServerBlobAuditingPolicyImpl.java new file mode 100644 index 0000000000000..2b6d92399a251 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ServerBlobAuditingPolicyImpl.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.ServerBlobAuditingPolicyInner; +import com.azure.resourcemanager.synapse.models.BlobAuditingPolicyName; +import com.azure.resourcemanager.synapse.models.BlobAuditingPolicyState; +import com.azure.resourcemanager.synapse.models.ServerBlobAuditingPolicy; +import java.util.Collections; +import java.util.List; +import java.util.UUID; + +public final class ServerBlobAuditingPolicyImpl + implements ServerBlobAuditingPolicy, ServerBlobAuditingPolicy.Definition, ServerBlobAuditingPolicy.Update { + private ServerBlobAuditingPolicyInner innerObject; + + private final SynapseManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public BlobAuditingPolicyState state() { + return this.innerModel().state(); + } + + public String storageEndpoint() { + return this.innerModel().storageEndpoint(); + } + + public String storageAccountAccessKey() { + return this.innerModel().storageAccountAccessKey(); + } + + public Integer retentionDays() { + return this.innerModel().retentionDays(); + } + + public List auditActionsAndGroups() { + List inner = this.innerModel().auditActionsAndGroups(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public UUID storageAccountSubscriptionId() { + return this.innerModel().storageAccountSubscriptionId(); + } + + public Boolean isStorageSecondaryKeyInUse() { + return this.innerModel().isStorageSecondaryKeyInUse(); + } + + public Boolean isAzureMonitorTargetEnabled() { + return this.innerModel().isAzureMonitorTargetEnabled(); + } + + public Integer queueDelayMs() { + return this.innerModel().queueDelayMs(); + } + + public ServerBlobAuditingPolicyInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private BlobAuditingPolicyName blobAuditingPolicyName; + + public ServerBlobAuditingPolicyImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public ServerBlobAuditingPolicy create() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceManagedSqlServerBlobAuditingPolicies() + .createOrUpdate( + resourceGroupName, workspaceName, blobAuditingPolicyName, this.innerModel(), Context.NONE); + return this; + } + + public ServerBlobAuditingPolicy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceManagedSqlServerBlobAuditingPolicies() + .createOrUpdate(resourceGroupName, workspaceName, blobAuditingPolicyName, this.innerModel(), context); + return this; + } + + ServerBlobAuditingPolicyImpl(BlobAuditingPolicyName name, SynapseManager serviceManager) { + this.innerObject = new ServerBlobAuditingPolicyInner(); + this.serviceManager = serviceManager; + this.blobAuditingPolicyName = name; + } + + public ServerBlobAuditingPolicyImpl update() { + return this; + } + + public ServerBlobAuditingPolicy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceManagedSqlServerBlobAuditingPolicies() + .createOrUpdate( + resourceGroupName, workspaceName, blobAuditingPolicyName, this.innerModel(), Context.NONE); + return this; + } + + public ServerBlobAuditingPolicy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceManagedSqlServerBlobAuditingPolicies() + .createOrUpdate(resourceGroupName, workspaceName, blobAuditingPolicyName, this.innerModel(), context); + return this; + } + + ServerBlobAuditingPolicyImpl(ServerBlobAuditingPolicyInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.blobAuditingPolicyName = + BlobAuditingPolicyName.fromString(Utils.getValueFromIdByName(innerObject.id(), "auditingSettings")); + } + + public ServerBlobAuditingPolicy refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceManagedSqlServerBlobAuditingPolicies() + .getWithResponse(resourceGroupName, workspaceName, blobAuditingPolicyName, Context.NONE) + .getValue(); + return this; + } + + public ServerBlobAuditingPolicy refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceManagedSqlServerBlobAuditingPolicies() + .getWithResponse(resourceGroupName, workspaceName, blobAuditingPolicyName, context) + .getValue(); + return this; + } + + public ServerBlobAuditingPolicyImpl withState(BlobAuditingPolicyState state) { + this.innerModel().withState(state); + return this; + } + + public ServerBlobAuditingPolicyImpl withStorageEndpoint(String storageEndpoint) { + this.innerModel().withStorageEndpoint(storageEndpoint); + return this; + } + + public ServerBlobAuditingPolicyImpl withStorageAccountAccessKey(String storageAccountAccessKey) { + this.innerModel().withStorageAccountAccessKey(storageAccountAccessKey); + return this; + } + + public ServerBlobAuditingPolicyImpl withRetentionDays(Integer retentionDays) { + this.innerModel().withRetentionDays(retentionDays); + return this; + } + + public ServerBlobAuditingPolicyImpl withAuditActionsAndGroups(List auditActionsAndGroups) { + this.innerModel().withAuditActionsAndGroups(auditActionsAndGroups); + return this; + } + + public ServerBlobAuditingPolicyImpl withStorageAccountSubscriptionId(UUID storageAccountSubscriptionId) { + this.innerModel().withStorageAccountSubscriptionId(storageAccountSubscriptionId); + return this; + } + + public ServerBlobAuditingPolicyImpl withIsStorageSecondaryKeyInUse(Boolean isStorageSecondaryKeyInUse) { + this.innerModel().withIsStorageSecondaryKeyInUse(isStorageSecondaryKeyInUse); + return this; + } + + public ServerBlobAuditingPolicyImpl withIsAzureMonitorTargetEnabled(Boolean isAzureMonitorTargetEnabled) { + this.innerModel().withIsAzureMonitorTargetEnabled(isAzureMonitorTargetEnabled); + return this; + } + + public ServerBlobAuditingPolicyImpl withQueueDelayMs(Integer queueDelayMs) { + this.innerModel().withQueueDelayMs(queueDelayMs); + return this; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ServerSecurityAlertPolicyImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ServerSecurityAlertPolicyImpl.java new file mode 100644 index 0000000000000..31a6e036a8ac8 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ServerSecurityAlertPolicyImpl.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.ServerSecurityAlertPolicyInner; +import com.azure.resourcemanager.synapse.models.SecurityAlertPolicyNameAutoGenerated; +import com.azure.resourcemanager.synapse.models.SecurityAlertPolicyState; +import com.azure.resourcemanager.synapse.models.ServerSecurityAlertPolicy; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class ServerSecurityAlertPolicyImpl + implements ServerSecurityAlertPolicy, ServerSecurityAlertPolicy.Definition, ServerSecurityAlertPolicy.Update { + private ServerSecurityAlertPolicyInner innerObject; + + private final SynapseManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SecurityAlertPolicyState state() { + return this.innerModel().state(); + } + + public List disabledAlerts() { + List inner = this.innerModel().disabledAlerts(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List emailAddresses() { + List inner = this.innerModel().emailAddresses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean emailAccountAdmins() { + return this.innerModel().emailAccountAdmins(); + } + + public String storageEndpoint() { + return this.innerModel().storageEndpoint(); + } + + public String storageAccountAccessKey() { + return this.innerModel().storageAccountAccessKey(); + } + + public Integer retentionDays() { + return this.innerModel().retentionDays(); + } + + public OffsetDateTime creationTime() { + return this.innerModel().creationTime(); + } + + public ServerSecurityAlertPolicyInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private SecurityAlertPolicyNameAutoGenerated securityAlertPolicyName; + + public ServerSecurityAlertPolicyImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public ServerSecurityAlertPolicy create() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceManagedSqlServerSecurityAlertPolicies() + .createOrUpdate( + resourceGroupName, workspaceName, securityAlertPolicyName, this.innerModel(), Context.NONE); + return this; + } + + public ServerSecurityAlertPolicy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceManagedSqlServerSecurityAlertPolicies() + .createOrUpdate(resourceGroupName, workspaceName, securityAlertPolicyName, this.innerModel(), context); + return this; + } + + ServerSecurityAlertPolicyImpl(SecurityAlertPolicyNameAutoGenerated name, SynapseManager serviceManager) { + this.innerObject = new ServerSecurityAlertPolicyInner(); + this.serviceManager = serviceManager; + this.securityAlertPolicyName = name; + } + + public ServerSecurityAlertPolicyImpl update() { + return this; + } + + public ServerSecurityAlertPolicy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceManagedSqlServerSecurityAlertPolicies() + .createOrUpdate( + resourceGroupName, workspaceName, securityAlertPolicyName, this.innerModel(), Context.NONE); + return this; + } + + public ServerSecurityAlertPolicy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceManagedSqlServerSecurityAlertPolicies() + .createOrUpdate(resourceGroupName, workspaceName, securityAlertPolicyName, this.innerModel(), context); + return this; + } + + ServerSecurityAlertPolicyImpl(ServerSecurityAlertPolicyInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.securityAlertPolicyName = + SecurityAlertPolicyNameAutoGenerated + .fromString(Utils.getValueFromIdByName(innerObject.id(), "securityAlertPolicies")); + } + + public ServerSecurityAlertPolicy refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceManagedSqlServerSecurityAlertPolicies() + .getWithResponse(resourceGroupName, workspaceName, securityAlertPolicyName, Context.NONE) + .getValue(); + return this; + } + + public ServerSecurityAlertPolicy refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceManagedSqlServerSecurityAlertPolicies() + .getWithResponse(resourceGroupName, workspaceName, securityAlertPolicyName, context) + .getValue(); + return this; + } + + public ServerSecurityAlertPolicyImpl withState(SecurityAlertPolicyState state) { + this.innerModel().withState(state); + return this; + } + + public ServerSecurityAlertPolicyImpl withDisabledAlerts(List disabledAlerts) { + this.innerModel().withDisabledAlerts(disabledAlerts); + return this; + } + + public ServerSecurityAlertPolicyImpl withEmailAddresses(List emailAddresses) { + this.innerModel().withEmailAddresses(emailAddresses); + return this; + } + + public ServerSecurityAlertPolicyImpl withEmailAccountAdmins(Boolean emailAccountAdmins) { + this.innerModel().withEmailAccountAdmins(emailAccountAdmins); + return this; + } + + public ServerSecurityAlertPolicyImpl withStorageEndpoint(String storageEndpoint) { + this.innerModel().withStorageEndpoint(storageEndpoint); + return this; + } + + public ServerSecurityAlertPolicyImpl withStorageAccountAccessKey(String storageAccountAccessKey) { + this.innerModel().withStorageAccountAccessKey(storageAccountAccessKey); + return this; + } + + public ServerSecurityAlertPolicyImpl withRetentionDays(Integer retentionDays) { + this.innerModel().withRetentionDays(retentionDays); + return this; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ServerUsageImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ServerUsageImpl.java new file mode 100644 index 0000000000000..30b5d50c6c70b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ServerUsageImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.ServerUsageInner; +import com.azure.resourcemanager.synapse.models.ServerUsage; +import java.time.OffsetDateTime; + +public final class ServerUsageImpl implements ServerUsage { + private ServerUsageInner innerObject; + + private final SynapseManager serviceManager; + + ServerUsageImpl(ServerUsageInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String resourceName() { + return this.innerModel().resourceName(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public Double currentValue() { + return this.innerModel().currentValue(); + } + + public Double limit() { + return this.innerModel().limit(); + } + + public String unit() { + return this.innerModel().unit(); + } + + public OffsetDateTime nextResetTime() { + return this.innerModel().nextResetTime(); + } + + public ServerUsageInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ServerVulnerabilityAssessmentImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ServerVulnerabilityAssessmentImpl.java new file mode 100644 index 0000000000000..3c58b85489736 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/ServerVulnerabilityAssessmentImpl.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.ServerVulnerabilityAssessmentInner; +import com.azure.resourcemanager.synapse.models.ServerVulnerabilityAssessment; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentName; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentRecurringScansProperties; + +public final class ServerVulnerabilityAssessmentImpl + implements ServerVulnerabilityAssessment, + ServerVulnerabilityAssessment.Definition, + ServerVulnerabilityAssessment.Update { + private ServerVulnerabilityAssessmentInner innerObject; + + private final SynapseManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String storageContainerPath() { + return this.innerModel().storageContainerPath(); + } + + public String storageContainerSasKey() { + return this.innerModel().storageContainerSasKey(); + } + + public String storageAccountAccessKey() { + return this.innerModel().storageAccountAccessKey(); + } + + public VulnerabilityAssessmentRecurringScansProperties recurringScans() { + return this.innerModel().recurringScans(); + } + + public ServerVulnerabilityAssessmentInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private VulnerabilityAssessmentName vulnerabilityAssessmentName; + + public ServerVulnerabilityAssessmentImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public ServerVulnerabilityAssessment create() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceManagedSqlServerVulnerabilityAssessments() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, vulnerabilityAssessmentName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ServerVulnerabilityAssessment create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceManagedSqlServerVulnerabilityAssessments() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, vulnerabilityAssessmentName, this.innerModel(), context) + .getValue(); + return this; + } + + ServerVulnerabilityAssessmentImpl(VulnerabilityAssessmentName name, SynapseManager serviceManager) { + this.innerObject = new ServerVulnerabilityAssessmentInner(); + this.serviceManager = serviceManager; + this.vulnerabilityAssessmentName = name; + } + + public ServerVulnerabilityAssessmentImpl update() { + return this; + } + + public ServerVulnerabilityAssessment apply() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceManagedSqlServerVulnerabilityAssessments() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, vulnerabilityAssessmentName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ServerVulnerabilityAssessment apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceManagedSqlServerVulnerabilityAssessments() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, vulnerabilityAssessmentName, this.innerModel(), context) + .getValue(); + return this; + } + + ServerVulnerabilityAssessmentImpl(ServerVulnerabilityAssessmentInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.vulnerabilityAssessmentName = + VulnerabilityAssessmentName + .fromString(Utils.getValueFromIdByName(innerObject.id(), "vulnerabilityAssessments")); + } + + public ServerVulnerabilityAssessment refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceManagedSqlServerVulnerabilityAssessments() + .getWithResponse(resourceGroupName, workspaceName, vulnerabilityAssessmentName, Context.NONE) + .getValue(); + return this; + } + + public ServerVulnerabilityAssessment refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaceManagedSqlServerVulnerabilityAssessments() + .getWithResponse(resourceGroupName, workspaceName, vulnerabilityAssessmentName, context) + .getValue(); + return this; + } + + public ServerVulnerabilityAssessmentImpl withStorageContainerPath(String storageContainerPath) { + this.innerModel().withStorageContainerPath(storageContainerPath); + return this; + } + + public ServerVulnerabilityAssessmentImpl withStorageContainerSasKey(String storageContainerSasKey) { + this.innerModel().withStorageContainerSasKey(storageContainerSasKey); + return this; + } + + public ServerVulnerabilityAssessmentImpl withStorageAccountAccessKey(String storageAccountAccessKey) { + this.innerModel().withStorageAccountAccessKey(storageAccountAccessKey); + return this; + } + + public ServerVulnerabilityAssessmentImpl withRecurringScans( + VulnerabilityAssessmentRecurringScansProperties recurringScans) { + this.innerModel().withRecurringScans(recurringScans); + return this; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolBlobAuditingPoliciesClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolBlobAuditingPoliciesClientImpl.java new file mode 100644 index 0000000000000..1ad576b4c35f0 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolBlobAuditingPoliciesClientImpl.java @@ -0,0 +1,756 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.SqlPoolBlobAuditingPoliciesClient; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolBlobAuditingPolicyInner; +import com.azure.resourcemanager.synapse.models.SqlPoolBlobAuditingPolicyListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SqlPoolBlobAuditingPoliciesClient. */ +public final class SqlPoolBlobAuditingPoliciesClientImpl implements SqlPoolBlobAuditingPoliciesClient { + private final ClientLogger logger = new ClientLogger(SqlPoolBlobAuditingPoliciesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SqlPoolBlobAuditingPoliciesService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of SqlPoolBlobAuditingPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlPoolBlobAuditingPoliciesClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + SqlPoolBlobAuditingPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientSqlPoolBlobAuditingPolicies to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface SqlPoolBlobAuditingPoliciesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/auditingSettings/{blobAuditingPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("blobAuditingPolicyName") String blobAuditingPolicyName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/auditingSettings/{blobAuditingPolicyName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("blobAuditingPolicyName") String blobAuditingPolicyName, + @BodyParam("application/json") SqlPoolBlobAuditingPolicyInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/auditingSettings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySqlPool( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySqlPoolNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get a 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String blobAuditingPolicyName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + blobAuditingPolicyName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get a 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String blobAuditingPolicyName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + blobAuditingPolicyName, + accept, + context); + } + + /** + * Get a 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlPoolBlobAuditingPolicyInner get(String resourceGroupName, String workspaceName, String sqlPoolName) { + return getAsync(resourceGroupName, workspaceName, sqlPoolName).block(); + } + + /** + * Get a 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, context).block(); + } + + /** + * Creates or updates a 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 database blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, SqlPoolBlobAuditingPolicyInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String blobAuditingPolicyName = "default"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + blobAuditingPolicyName, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates a 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 database blob auditing policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + SqlPoolBlobAuditingPolicyInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String blobAuditingPolicyName = "default"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + blobAuditingPolicyName, + parameters, + accept, + context); + } + + /** + * Creates or updates a 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 database blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, SqlPoolBlobAuditingPolicyInner parameters) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a 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 database blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlPoolBlobAuditingPolicyInner createOrUpdate( + String resourceGroupName, String workspaceName, String sqlPoolName, SqlPoolBlobAuditingPolicyInner parameters) { + return createOrUpdateAsync(resourceGroupName, workspaceName, sqlPoolName, parameters).block(); + } + + /** + * Creates or updates a 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 database blob auditing policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + SqlPoolBlobAuditingPolicyInner parameters, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, parameters, context) + .block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool auditing settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySqlPoolSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listBySqlPool( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool auditing settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySqlPoolSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySqlPool( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool auditing settings. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySqlPoolAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + return new PagedFlux<>( + () -> listBySqlPoolSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName), + nextLink -> listBySqlPoolNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool auditing settings. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySqlPoolAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return new PagedFlux<>( + () -> listBySqlPoolSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName, context), + nextLink -> listBySqlPoolNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool auditing settings. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySqlPool( + String resourceGroupName, String workspaceName, String sqlPoolName) { + return new PagedIterable<>(listBySqlPoolAsync(resourceGroupName, workspaceName, 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool auditing settings. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySqlPool( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return new PagedIterable<>(listBySqlPoolAsync(resourceGroupName, workspaceName, sqlPoolName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool auditing settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySqlPoolNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listBySqlPoolNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool auditing settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySqlPoolNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySqlPoolNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolBlobAuditingPoliciesImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolBlobAuditingPoliciesImpl.java new file mode 100644 index 0000000000000..07e88e2ecdcf9 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolBlobAuditingPoliciesImpl.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.SqlPoolBlobAuditingPoliciesClient; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolBlobAuditingPolicyInner; +import com.azure.resourcemanager.synapse.models.SqlPoolBlobAuditingPolicies; +import com.azure.resourcemanager.synapse.models.SqlPoolBlobAuditingPolicy; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SqlPoolBlobAuditingPoliciesImpl implements SqlPoolBlobAuditingPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolBlobAuditingPoliciesImpl.class); + + private final SqlPoolBlobAuditingPoliciesClient innerClient; + + private final SynapseManager serviceManager; + + public SqlPoolBlobAuditingPoliciesImpl( + SqlPoolBlobAuditingPoliciesClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public SqlPoolBlobAuditingPolicy get(String resourceGroupName, String workspaceName, String sqlPoolName) { + SqlPoolBlobAuditingPolicyInner inner = this.serviceClient().get(resourceGroupName, workspaceName, sqlPoolName); + if (inner != null) { + return new SqlPoolBlobAuditingPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, sqlPoolName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SqlPoolBlobAuditingPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listBySqlPool( + String resourceGroupName, String workspaceName, String sqlPoolName) { + PagedIterable inner = + this.serviceClient().listBySqlPool(resourceGroupName, workspaceName, sqlPoolName); + return Utils.mapPage(inner, inner1 -> new SqlPoolBlobAuditingPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listBySqlPool( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + PagedIterable inner = + this.serviceClient().listBySqlPool(resourceGroupName, workspaceName, sqlPoolName, context); + return Utils.mapPage(inner, inner1 -> new SqlPoolBlobAuditingPolicyImpl(inner1, this.manager())); + } + + public SqlPoolBlobAuditingPolicy getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, sqlPoolName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, sqlPoolName, context); + } + + private SqlPoolBlobAuditingPoliciesClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + public SqlPoolBlobAuditingPolicyImpl define() { + return new SqlPoolBlobAuditingPolicyImpl(this.manager()); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolBlobAuditingPolicyImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolBlobAuditingPolicyImpl.java new file mode 100644 index 0000000000000..879d04a4f21ca --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolBlobAuditingPolicyImpl.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolBlobAuditingPolicyInner; +import com.azure.resourcemanager.synapse.models.BlobAuditingPolicyState; +import com.azure.resourcemanager.synapse.models.SqlPoolBlobAuditingPolicy; +import java.util.Collections; +import java.util.List; +import java.util.UUID; + +public final class SqlPoolBlobAuditingPolicyImpl + implements SqlPoolBlobAuditingPolicy, SqlPoolBlobAuditingPolicy.Definition, SqlPoolBlobAuditingPolicy.Update { + private SqlPoolBlobAuditingPolicyInner innerObject; + + private final SynapseManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String kind() { + return this.innerModel().kind(); + } + + public BlobAuditingPolicyState state() { + return this.innerModel().state(); + } + + public String storageEndpoint() { + return this.innerModel().storageEndpoint(); + } + + public String storageAccountAccessKey() { + return this.innerModel().storageAccountAccessKey(); + } + + public Integer retentionDays() { + return this.innerModel().retentionDays(); + } + + public List auditActionsAndGroups() { + List inner = this.innerModel().auditActionsAndGroups(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public UUID storageAccountSubscriptionId() { + return this.innerModel().storageAccountSubscriptionId(); + } + + public Boolean isStorageSecondaryKeyInUse() { + return this.innerModel().isStorageSecondaryKeyInUse(); + } + + public Boolean isAzureMonitorTargetEnabled() { + return this.innerModel().isAzureMonitorTargetEnabled(); + } + + public SqlPoolBlobAuditingPolicyInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String sqlPoolName; + + public SqlPoolBlobAuditingPolicyImpl withExistingSqlPool( + String resourceGroupName, String workspaceName, String sqlPoolName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + this.sqlPoolName = sqlPoolName; + return this; + } + + public SqlPoolBlobAuditingPolicy create() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolBlobAuditingPolicies() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, sqlPoolName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SqlPoolBlobAuditingPolicy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolBlobAuditingPolicies() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, sqlPoolName, this.innerModel(), context) + .getValue(); + return this; + } + + SqlPoolBlobAuditingPolicyImpl(SynapseManager serviceManager) { + this.innerObject = new SqlPoolBlobAuditingPolicyInner(); + this.serviceManager = serviceManager; + } + + public SqlPoolBlobAuditingPolicyImpl update() { + return this; + } + + public SqlPoolBlobAuditingPolicy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolBlobAuditingPolicies() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, sqlPoolName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SqlPoolBlobAuditingPolicy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolBlobAuditingPolicies() + .createOrUpdateWithResponse(resourceGroupName, workspaceName, sqlPoolName, this.innerModel(), context) + .getValue(); + return this; + } + + SqlPoolBlobAuditingPolicyImpl(SqlPoolBlobAuditingPolicyInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.sqlPoolName = Utils.getValueFromIdByName(innerObject.id(), "sqlPools"); + } + + public SqlPoolBlobAuditingPolicy refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolBlobAuditingPolicies() + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, Context.NONE) + .getValue(); + return this; + } + + public SqlPoolBlobAuditingPolicy refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolBlobAuditingPolicies() + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, context) + .getValue(); + return this; + } + + public SqlPoolBlobAuditingPolicyImpl withState(BlobAuditingPolicyState state) { + this.innerModel().withState(state); + return this; + } + + public SqlPoolBlobAuditingPolicyImpl withStorageEndpoint(String storageEndpoint) { + this.innerModel().withStorageEndpoint(storageEndpoint); + return this; + } + + public SqlPoolBlobAuditingPolicyImpl withStorageAccountAccessKey(String storageAccountAccessKey) { + this.innerModel().withStorageAccountAccessKey(storageAccountAccessKey); + return this; + } + + public SqlPoolBlobAuditingPolicyImpl withRetentionDays(Integer retentionDays) { + this.innerModel().withRetentionDays(retentionDays); + return this; + } + + public SqlPoolBlobAuditingPolicyImpl withAuditActionsAndGroups(List auditActionsAndGroups) { + this.innerModel().withAuditActionsAndGroups(auditActionsAndGroups); + return this; + } + + public SqlPoolBlobAuditingPolicyImpl withStorageAccountSubscriptionId(UUID storageAccountSubscriptionId) { + this.innerModel().withStorageAccountSubscriptionId(storageAccountSubscriptionId); + return this; + } + + public SqlPoolBlobAuditingPolicyImpl withIsStorageSecondaryKeyInUse(Boolean isStorageSecondaryKeyInUse) { + this.innerModel().withIsStorageSecondaryKeyInUse(isStorageSecondaryKeyInUse); + return this; + } + + public SqlPoolBlobAuditingPolicyImpl withIsAzureMonitorTargetEnabled(Boolean isAzureMonitorTargetEnabled) { + this.innerModel().withIsAzureMonitorTargetEnabled(isAzureMonitorTargetEnabled); + return this; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolColumnImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolColumnImpl.java new file mode 100644 index 0000000000000..aea120a6e5592 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolColumnImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolColumnInner; +import com.azure.resourcemanager.synapse.models.ColumnDataType; +import com.azure.resourcemanager.synapse.models.SqlPoolColumn; + +public final class SqlPoolColumnImpl implements SqlPoolColumn { + private SqlPoolColumnInner innerObject; + + private final SynapseManager serviceManager; + + SqlPoolColumnImpl(SqlPoolColumnInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ColumnDataType columnType() { + return this.innerModel().columnType(); + } + + public Boolean isComputed() { + return this.innerModel().isComputed(); + } + + public SqlPoolColumnInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolColumnsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolColumnsClientImpl.java new file mode 100644 index 0000000000000..768adf09650eb --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolColumnsClientImpl.java @@ -0,0 +1,309 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.SqlPoolColumnsClient; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolColumnInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SqlPoolColumnsClient. */ +public final class SqlPoolColumnsClientImpl implements SqlPoolColumnsClient { + private final ClientLogger logger = new ClientLogger(SqlPoolColumnsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SqlPoolColumnsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of SqlPoolColumnsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlPoolColumnsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy.create(SqlPoolColumnsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientSqlPoolColumns to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface SqlPoolColumnsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}/tables/{tableName}/columns" + + "/{columnName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("schemaName") String schemaName, + @PathParam("tableName") String tableName, + @PathParam("columnName") String columnName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql pool column. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (schemaName == null) { + return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (columnName == null) { + return Mono.error(new IllegalArgumentException("Parameter columnName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + tableName, + columnName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql pool column. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (schemaName == null) { + return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (columnName == null) { + return Mono.error(new IllegalArgumentException("Parameter columnName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + tableName, + columnName, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql pool column. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql pool column. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlPoolColumnInner get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName) { + return getAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql pool column. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + Context context) { + return getWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName, context) + .block(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolColumnsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolColumnsImpl.java new file mode 100644 index 0000000000000..87d48fc2eddc3 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolColumnsImpl.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.SqlPoolColumnsClient; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolColumnInner; +import com.azure.resourcemanager.synapse.models.SqlPoolColumn; +import com.azure.resourcemanager.synapse.models.SqlPoolColumns; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SqlPoolColumnsImpl implements SqlPoolColumns { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolColumnsImpl.class); + + private final SqlPoolColumnsClient innerClient; + + private final SynapseManager serviceManager; + + public SqlPoolColumnsImpl(SqlPoolColumnsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public SqlPoolColumn get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName) { + SqlPoolColumnInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName); + if (inner != null) { + return new SqlPoolColumnImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SqlPoolColumnImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private SqlPoolColumnsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolConnectionPoliciesClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolConnectionPoliciesClientImpl.java new file mode 100644 index 0000000000000..0470696063fc3 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolConnectionPoliciesClientImpl.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.SqlPoolConnectionPoliciesClient; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolConnectionPolicyInner; +import com.azure.resourcemanager.synapse.models.ConnectionPolicyName; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SqlPoolConnectionPoliciesClient. */ +public final class SqlPoolConnectionPoliciesClientImpl implements SqlPoolConnectionPoliciesClient { + private final ClientLogger logger = new ClientLogger(SqlPoolConnectionPoliciesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SqlPoolConnectionPoliciesService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of SqlPoolConnectionPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlPoolConnectionPoliciesClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + SqlPoolConnectionPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientSqlPoolConnectionPolicies to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface SqlPoolConnectionPoliciesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/connectionPolicies/{connectionPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("connectionPolicyName") ConnectionPolicyName connectionPolicyName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get a Sql pool's connection policy, which is used with table auditing. + * + * @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 connectionPolicyName The name of the connection policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's connection policy, which is used with table auditing. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, ConnectionPolicyName connectionPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (connectionPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectionPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + connectionPolicyName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get a Sql pool's connection policy, which is used with table auditing. + * + * @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 connectionPolicyName The name of the connection policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's connection policy, which is used with table auditing. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + ConnectionPolicyName connectionPolicyName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (connectionPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectionPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + connectionPolicyName, + accept, + context); + } + + /** + * Get a Sql pool's connection policy, which is used with table auditing. + * + * @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 connectionPolicyName The name of the connection policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's connection policy, which is used with table auditing. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, ConnectionPolicyName connectionPolicyName) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, connectionPolicyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a Sql pool's connection policy, which is used with table auditing. + * + * @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 connectionPolicyName The name of the connection policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's connection policy, which is used with table auditing. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlPoolConnectionPolicyInner get( + String resourceGroupName, String workspaceName, String sqlPoolName, ConnectionPolicyName connectionPolicyName) { + return getAsync(resourceGroupName, workspaceName, sqlPoolName, connectionPolicyName).block(); + } + + /** + * Get a Sql pool's connection policy, which is used with table auditing. + * + * @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 connectionPolicyName The name of the connection policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's connection policy, which is used with table auditing. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + ConnectionPolicyName connectionPolicyName, + Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, connectionPolicyName, context) + .block(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolConnectionPoliciesImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolConnectionPoliciesImpl.java new file mode 100644 index 0000000000000..d50a2884b0a72 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolConnectionPoliciesImpl.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.SqlPoolConnectionPoliciesClient; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolConnectionPolicyInner; +import com.azure.resourcemanager.synapse.models.ConnectionPolicyName; +import com.azure.resourcemanager.synapse.models.SqlPoolConnectionPolicies; +import com.azure.resourcemanager.synapse.models.SqlPoolConnectionPolicy; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SqlPoolConnectionPoliciesImpl implements SqlPoolConnectionPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolConnectionPoliciesImpl.class); + + private final SqlPoolConnectionPoliciesClient innerClient; + + private final SynapseManager serviceManager; + + public SqlPoolConnectionPoliciesImpl(SqlPoolConnectionPoliciesClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public SqlPoolConnectionPolicy get( + String resourceGroupName, String workspaceName, String sqlPoolName, ConnectionPolicyName connectionPolicyName) { + SqlPoolConnectionPolicyInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, sqlPoolName, connectionPolicyName); + if (inner != null) { + return new SqlPoolConnectionPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + ConnectionPolicyName connectionPolicyName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, connectionPolicyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SqlPoolConnectionPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private SqlPoolConnectionPoliciesClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolConnectionPolicyImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolConnectionPolicyImpl.java new file mode 100644 index 0000000000000..554028446e9c4 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolConnectionPolicyImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolConnectionPolicyInner; +import com.azure.resourcemanager.synapse.models.SqlPoolConnectionPolicy; + +public final class SqlPoolConnectionPolicyImpl implements SqlPoolConnectionPolicy { + private SqlPoolConnectionPolicyInner innerObject; + + private final SynapseManager serviceManager; + + SqlPoolConnectionPolicyImpl(SqlPoolConnectionPolicyInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String kind() { + return this.innerModel().kind(); + } + + public String location() { + return this.innerModel().location(); + } + + public String securityEnabledAccess() { + return this.innerModel().securityEnabledAccess(); + } + + public String proxyDnsName() { + return this.innerModel().proxyDnsName(); + } + + public String proxyPort() { + return this.innerModel().proxyPort(); + } + + public String visibility() { + return this.innerModel().visibility(); + } + + public String useServerDefault() { + return this.innerModel().useServerDefault(); + } + + public String redirectionState() { + return this.innerModel().redirectionState(); + } + + public String state() { + return this.innerModel().state(); + } + + public SqlPoolConnectionPolicyInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolDataWarehouseUserActivitiesClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolDataWarehouseUserActivitiesClientImpl.java new file mode 100644 index 0000000000000..f0c5af0804217 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolDataWarehouseUserActivitiesClientImpl.java @@ -0,0 +1,283 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.SqlPoolDataWarehouseUserActivitiesClient; +import com.azure.resourcemanager.synapse.fluent.models.DataWarehouseUserActivitiesInner; +import com.azure.resourcemanager.synapse.models.DataWarehouseUserActivityName; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SqlPoolDataWarehouseUserActivitiesClient. + */ +public final class SqlPoolDataWarehouseUserActivitiesClientImpl implements SqlPoolDataWarehouseUserActivitiesClient { + private final ClientLogger logger = new ClientLogger(SqlPoolDataWarehouseUserActivitiesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SqlPoolDataWarehouseUserActivitiesService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of SqlPoolDataWarehouseUserActivitiesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlPoolDataWarehouseUserActivitiesClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + SqlPoolDataWarehouseUserActivitiesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientSqlPoolDataWarehouseUserActivities to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface SqlPoolDataWarehouseUserActivitiesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/dataWarehouseUserActivities/{dataWarehouseUserActivityName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("dataWarehouseUserActivityName") DataWarehouseUserActivityName dataWarehouseUserActivityName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the user activities of a SQL pool which includes running and suspended queries. + * + * @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 dataWarehouseUserActivityName The activity name of the Sql pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the user activities of a SQL pool which includes running and suspended queries. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + DataWarehouseUserActivityName dataWarehouseUserActivityName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (dataWarehouseUserActivityName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter dataWarehouseUserActivityName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + dataWarehouseUserActivityName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the user activities of a SQL pool which includes running and suspended queries. + * + * @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 dataWarehouseUserActivityName The activity name of the Sql pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the user activities of a SQL pool which includes running and suspended queries. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + DataWarehouseUserActivityName dataWarehouseUserActivityName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (dataWarehouseUserActivityName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter dataWarehouseUserActivityName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + dataWarehouseUserActivityName, + accept, + context); + } + + /** + * Gets the user activities of a SQL pool which includes running and suspended queries. + * + * @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 dataWarehouseUserActivityName The activity name of the Sql pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the user activities of a SQL pool which includes running and suspended queries. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + DataWarehouseUserActivityName dataWarehouseUserActivityName) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, dataWarehouseUserActivityName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the user activities of a SQL pool which includes running and suspended queries. + * + * @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 dataWarehouseUserActivityName The activity name of the Sql pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the user activities of a SQL pool which includes running and suspended queries. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataWarehouseUserActivitiesInner get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + DataWarehouseUserActivityName dataWarehouseUserActivityName) { + return getAsync(resourceGroupName, workspaceName, sqlPoolName, dataWarehouseUserActivityName).block(); + } + + /** + * Gets the user activities of a SQL pool which includes running and suspended queries. + * + * @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 dataWarehouseUserActivityName The activity name of the Sql pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the user activities of a SQL pool which includes running and suspended queries. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + DataWarehouseUserActivityName dataWarehouseUserActivityName, + Context context) { + return getWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, dataWarehouseUserActivityName, context) + .block(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolDataWarehouseUserActivitiesImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolDataWarehouseUserActivitiesImpl.java new file mode 100644 index 0000000000000..a906528fe61d3 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolDataWarehouseUserActivitiesImpl.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.SqlPoolDataWarehouseUserActivitiesClient; +import com.azure.resourcemanager.synapse.fluent.models.DataWarehouseUserActivitiesInner; +import com.azure.resourcemanager.synapse.models.DataWarehouseUserActivities; +import com.azure.resourcemanager.synapse.models.DataWarehouseUserActivityName; +import com.azure.resourcemanager.synapse.models.SqlPoolDataWarehouseUserActivities; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SqlPoolDataWarehouseUserActivitiesImpl implements SqlPoolDataWarehouseUserActivities { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolDataWarehouseUserActivitiesImpl.class); + + private final SqlPoolDataWarehouseUserActivitiesClient innerClient; + + private final SynapseManager serviceManager; + + public SqlPoolDataWarehouseUserActivitiesImpl( + SqlPoolDataWarehouseUserActivitiesClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public DataWarehouseUserActivities get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + DataWarehouseUserActivityName dataWarehouseUserActivityName) { + DataWarehouseUserActivitiesInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, sqlPoolName, dataWarehouseUserActivityName); + if (inner != null) { + return new DataWarehouseUserActivitiesImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + DataWarehouseUserActivityName dataWarehouseUserActivityName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, dataWarehouseUserActivityName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new DataWarehouseUserActivitiesImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private SqlPoolDataWarehouseUserActivitiesClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolGeoBackupPoliciesClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolGeoBackupPoliciesClientImpl.java new file mode 100644 index 0000000000000..7586480020a13 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolGeoBackupPoliciesClientImpl.java @@ -0,0 +1,709 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.SqlPoolGeoBackupPoliciesClient; +import com.azure.resourcemanager.synapse.fluent.models.GeoBackupPolicyInner; +import com.azure.resourcemanager.synapse.models.GeoBackupPolicyListResult; +import com.azure.resourcemanager.synapse.models.GeoBackupPolicyName; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SqlPoolGeoBackupPoliciesClient. */ +public final class SqlPoolGeoBackupPoliciesClientImpl implements SqlPoolGeoBackupPoliciesClient { + private final ClientLogger logger = new ClientLogger(SqlPoolGeoBackupPoliciesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SqlPoolGeoBackupPoliciesService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of SqlPoolGeoBackupPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlPoolGeoBackupPoliciesClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create(SqlPoolGeoBackupPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientSqlPoolGeoBackupPolicies to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface SqlPoolGeoBackupPoliciesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/geoBackupPolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/geoBackupPolicies/{geoBackupPolicyName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("geoBackupPolicyName") GeoBackupPolicyName geoBackupPolicyName, + @BodyParam("application/json") GeoBackupPolicyInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/geoBackupPolicies/{geoBackupPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("geoBackupPolicyName") GeoBackupPolicyName geoBackupPolicyName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pool geo backup policies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pool geo backup policies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pool geo backup policies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pool geo backup policies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pool geo backup policies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, sqlPoolName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pool geo backup policies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, sqlPoolName, context)); + } + + /** + * Updates a SQL Pool geo backup 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 geoBackupPolicyName The name of the geo backup policy. + * @param parameters The required parameters for creating or updating the geo backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a database geo backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + GeoBackupPolicyName geoBackupPolicyName, + GeoBackupPolicyInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (geoBackupPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter geoBackupPolicyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + geoBackupPolicyName, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates a SQL Pool geo backup 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 geoBackupPolicyName The name of the geo backup policy. + * @param parameters The required parameters for creating or updating the geo backup policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a database geo backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + GeoBackupPolicyName geoBackupPolicyName, + GeoBackupPolicyInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (geoBackupPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter geoBackupPolicyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + geoBackupPolicyName, + parameters, + accept, + context); + } + + /** + * Updates a SQL Pool geo backup 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 geoBackupPolicyName The name of the geo backup policy. + * @param parameters The required parameters for creating or updating the geo backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a database geo backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + GeoBackupPolicyName geoBackupPolicyName, + GeoBackupPolicyInner parameters) { + return createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, geoBackupPolicyName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Updates a SQL Pool geo backup 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 geoBackupPolicyName The name of the geo backup policy. + * @param parameters The required parameters for creating or updating the geo backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a database geo backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GeoBackupPolicyInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + GeoBackupPolicyName geoBackupPolicyName, + GeoBackupPolicyInner parameters) { + return createOrUpdateAsync(resourceGroupName, workspaceName, sqlPoolName, geoBackupPolicyName, parameters) + .block(); + } + + /** + * Updates a SQL Pool geo backup 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 geoBackupPolicyName The name of the geo backup policy. + * @param parameters The required parameters for creating or updating the geo backup policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a database geo backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + GeoBackupPolicyName geoBackupPolicyName, + GeoBackupPolicyInner parameters, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, geoBackupPolicyName, parameters, context) + .block(); + } + + /** + * Get the specified SQL pool geo backup 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 geoBackupPolicyName The name of the geo backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified SQL pool geo backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, GeoBackupPolicyName geoBackupPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (geoBackupPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter geoBackupPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + geoBackupPolicyName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the specified SQL pool geo backup 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 geoBackupPolicyName The name of the geo backup policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified SQL pool geo backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + GeoBackupPolicyName geoBackupPolicyName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (geoBackupPolicyName == null) { + return Mono + .error(new IllegalArgumentException("Parameter geoBackupPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + geoBackupPolicyName, + accept, + context); + } + + /** + * Get the specified SQL pool geo backup 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 geoBackupPolicyName The name of the geo backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified SQL pool geo backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, GeoBackupPolicyName geoBackupPolicyName) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, geoBackupPolicyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified SQL pool geo backup 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 geoBackupPolicyName The name of the geo backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified SQL pool geo backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GeoBackupPolicyInner get( + String resourceGroupName, String workspaceName, String sqlPoolName, GeoBackupPolicyName geoBackupPolicyName) { + return getAsync(resourceGroupName, workspaceName, sqlPoolName, geoBackupPolicyName).block(); + } + + /** + * Get the specified SQL pool geo backup 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 geoBackupPolicyName The name of the geo backup policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified SQL pool geo backup policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + GeoBackupPolicyName geoBackupPolicyName, + Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, geoBackupPolicyName, context) + .block(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolGeoBackupPoliciesImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolGeoBackupPoliciesImpl.java new file mode 100644 index 0000000000000..49620a5b37820 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolGeoBackupPoliciesImpl.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.SqlPoolGeoBackupPoliciesClient; +import com.azure.resourcemanager.synapse.fluent.models.GeoBackupPolicyInner; +import com.azure.resourcemanager.synapse.models.GeoBackupPolicy; +import com.azure.resourcemanager.synapse.models.GeoBackupPolicyName; +import com.azure.resourcemanager.synapse.models.SqlPoolGeoBackupPolicies; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SqlPoolGeoBackupPoliciesImpl implements SqlPoolGeoBackupPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolGeoBackupPoliciesImpl.class); + + private final SqlPoolGeoBackupPoliciesClient innerClient; + + private final SynapseManager serviceManager; + + public SqlPoolGeoBackupPoliciesImpl(SqlPoolGeoBackupPoliciesClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String sqlPoolName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, sqlPoolName); + return Utils.mapPage(inner, inner1 -> new GeoBackupPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, sqlPoolName, context); + return Utils.mapPage(inner, inner1 -> new GeoBackupPolicyImpl(inner1, this.manager())); + } + + public GeoBackupPolicy get( + String resourceGroupName, String workspaceName, String sqlPoolName, GeoBackupPolicyName geoBackupPolicyName) { + GeoBackupPolicyInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, sqlPoolName, geoBackupPolicyName); + if (inner != null) { + return new GeoBackupPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + GeoBackupPolicyName geoBackupPolicyName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, geoBackupPolicyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GeoBackupPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GeoBackupPolicy getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + GeoBackupPolicyName geoBackupPolicyName = + GeoBackupPolicyName.fromString(Utils.getValueFromIdByName(id, "geoBackupPolicies")); + if (geoBackupPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'geoBackupPolicies'.", id))); + } + return this + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, geoBackupPolicyName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + GeoBackupPolicyName geoBackupPolicyName = + GeoBackupPolicyName.fromString(Utils.getValueFromIdByName(id, "geoBackupPolicies")); + if (geoBackupPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'geoBackupPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, sqlPoolName, geoBackupPolicyName, context); + } + + private SqlPoolGeoBackupPoliciesClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + public GeoBackupPolicyImpl define(GeoBackupPolicyName name) { + return new GeoBackupPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolImpl.java new file mode 100644 index 0000000000000..70ce420d5a068 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolImpl.java @@ -0,0 +1,361 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolInner; +import com.azure.resourcemanager.synapse.models.ResourceMoveDefinition; +import com.azure.resourcemanager.synapse.models.Sku; +import com.azure.resourcemanager.synapse.models.SqlPool; +import com.azure.resourcemanager.synapse.models.SqlPoolPatchInfo; +import com.azure.resourcemanager.synapse.models.StorageAccountType; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.Map; + +public final class SqlPoolImpl implements SqlPool, SqlPool.Definition, SqlPool.Update { + private SqlPoolInner innerObject; + + private final SynapseManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Sku sku() { + return this.innerModel().sku(); + } + + public Long maxSizeBytes() { + return this.innerModel().maxSizeBytes(); + } + + public String collation() { + return this.innerModel().collation(); + } + + public String sourceDatabaseId() { + return this.innerModel().sourceDatabaseId(); + } + + public String recoverableDatabaseId() { + return this.innerModel().recoverableDatabaseId(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String status() { + return this.innerModel().status(); + } + + public String restorePointInTime() { + return this.innerModel().restorePointInTime(); + } + + public String createMode() { + return this.innerModel().createMode(); + } + + public OffsetDateTime creationDate() { + return this.innerModel().creationDate(); + } + + public StorageAccountType storageAccountType() { + return this.innerModel().storageAccountType(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public SqlPoolInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String sqlPoolName; + + private SqlPoolPatchInfo updateSqlPoolInfo; + + public SqlPoolImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public SqlPool create() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPools() + .create(resourceGroupName, workspaceName, sqlPoolName, this.innerModel(), Context.NONE); + return this; + } + + public SqlPool create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPools() + .create(resourceGroupName, workspaceName, sqlPoolName, this.innerModel(), context); + return this; + } + + SqlPoolImpl(String name, SynapseManager serviceManager) { + this.innerObject = new SqlPoolInner(); + this.serviceManager = serviceManager; + this.sqlPoolName = name; + } + + public SqlPoolImpl update() { + this.updateSqlPoolInfo = new SqlPoolPatchInfo(); + return this; + } + + public SqlPool apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPools() + .updateWithResponse(resourceGroupName, workspaceName, sqlPoolName, updateSqlPoolInfo, Context.NONE) + .getValue(); + return this; + } + + public SqlPool apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPools() + .updateWithResponse(resourceGroupName, workspaceName, sqlPoolName, updateSqlPoolInfo, context) + .getValue(); + return this; + } + + SqlPoolImpl(SqlPoolInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.sqlPoolName = Utils.getValueFromIdByName(innerObject.id(), "sqlPools"); + } + + public SqlPool refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPools() + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, Context.NONE) + .getValue(); + return this; + } + + public SqlPool refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPools() + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, context) + .getValue(); + return this; + } + + public Object pause() { + return serviceManager.sqlPools().pause(resourceGroupName, workspaceName, sqlPoolName); + } + + public Object pause(Context context) { + return serviceManager.sqlPools().pause(resourceGroupName, workspaceName, sqlPoolName, context); + } + + public Object resume() { + return serviceManager.sqlPools().resume(resourceGroupName, workspaceName, sqlPoolName); + } + + public Object resume(Context context) { + return serviceManager.sqlPools().resume(resourceGroupName, workspaceName, sqlPoolName, context); + } + + public void rename(ResourceMoveDefinition parameters) { + serviceManager.sqlPools().rename(resourceGroupName, workspaceName, sqlPoolName, parameters); + } + + public Response renameWithResponse(ResourceMoveDefinition parameters, Context context) { + return serviceManager + .sqlPools() + .renameWithResponse(resourceGroupName, workspaceName, sqlPoolName, parameters, context); + } + + public SqlPoolImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SqlPoolImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SqlPoolImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateSqlPoolInfo.withTags(tags); + return this; + } + } + + public SqlPoolImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.innerModel().withSku(sku); + return this; + } else { + this.updateSqlPoolInfo.withSku(sku); + return this; + } + } + + public SqlPoolImpl withMaxSizeBytes(Long maxSizeBytes) { + if (isInCreateMode()) { + this.innerModel().withMaxSizeBytes(maxSizeBytes); + return this; + } else { + this.updateSqlPoolInfo.withMaxSizeBytes(maxSizeBytes); + return this; + } + } + + public SqlPoolImpl withCollation(String collation) { + if (isInCreateMode()) { + this.innerModel().withCollation(collation); + return this; + } else { + this.updateSqlPoolInfo.withCollation(collation); + return this; + } + } + + public SqlPoolImpl withSourceDatabaseId(String sourceDatabaseId) { + if (isInCreateMode()) { + this.innerModel().withSourceDatabaseId(sourceDatabaseId); + return this; + } else { + this.updateSqlPoolInfo.withSourceDatabaseId(sourceDatabaseId); + return this; + } + } + + public SqlPoolImpl withRecoverableDatabaseId(String recoverableDatabaseId) { + if (isInCreateMode()) { + this.innerModel().withRecoverableDatabaseId(recoverableDatabaseId); + return this; + } else { + this.updateSqlPoolInfo.withRecoverableDatabaseId(recoverableDatabaseId); + return this; + } + } + + public SqlPoolImpl withProvisioningState(String provisioningState) { + if (isInCreateMode()) { + this.innerModel().withProvisioningState(provisioningState); + return this; + } else { + this.updateSqlPoolInfo.withProvisioningState(provisioningState); + return this; + } + } + + public SqlPoolImpl withStatus(String status) { + if (isInCreateMode()) { + this.innerModel().withStatus(status); + return this; + } else { + this.updateSqlPoolInfo.withStatus(status); + return this; + } + } + + public SqlPoolImpl withRestorePointInTime(String restorePointInTime) { + if (isInCreateMode()) { + this.innerModel().withRestorePointInTime(restorePointInTime); + return this; + } else { + this.updateSqlPoolInfo.withRestorePointInTime(restorePointInTime); + return this; + } + } + + public SqlPoolImpl withCreateMode(String createMode) { + if (isInCreateMode()) { + this.innerModel().withCreateMode(createMode); + return this; + } else { + this.updateSqlPoolInfo.withCreateMode(createMode); + return this; + } + } + + public SqlPoolImpl withCreationDate(OffsetDateTime creationDate) { + if (isInCreateMode()) { + this.innerModel().withCreationDate(creationDate); + return this; + } else { + this.updateSqlPoolInfo.withCreationDate(creationDate); + return this; + } + } + + public SqlPoolImpl withStorageAccountType(StorageAccountType storageAccountType) { + if (isInCreateMode()) { + this.innerModel().withStorageAccountType(storageAccountType); + return this; + } else { + this.updateSqlPoolInfo.withStorageAccountType(storageAccountType); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolMaintenanceWindowOptionsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolMaintenanceWindowOptionsClientImpl.java new file mode 100644 index 0000000000000..3502611140457 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolMaintenanceWindowOptionsClientImpl.java @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.SqlPoolMaintenanceWindowOptionsClient; +import com.azure.resourcemanager.synapse.fluent.models.MaintenanceWindowOptionsInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SqlPoolMaintenanceWindowOptionsClient. */ +public final class SqlPoolMaintenanceWindowOptionsClientImpl implements SqlPoolMaintenanceWindowOptionsClient { + private final ClientLogger logger = new ClientLogger(SqlPoolMaintenanceWindowOptionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SqlPoolMaintenanceWindowOptionsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of SqlPoolMaintenanceWindowOptionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlPoolMaintenanceWindowOptionsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + SqlPoolMaintenanceWindowOptionsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientSqlPoolMaintenanceWindowOptions to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface SqlPoolMaintenanceWindowOptionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/maintenanceWindowOptions/current") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @QueryParam("maintenanceWindowOptionsName") String maintenanceWindowOptionsName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get list of SQL pool's available maintenance windows. + * + * @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 maintenanceWindowOptionsName Maintenance window options name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pool's available maintenance windows. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String maintenanceWindowOptionsName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (maintenanceWindowOptionsName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter maintenanceWindowOptionsName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + maintenanceWindowOptionsName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get list of SQL pool's available maintenance windows. + * + * @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 maintenanceWindowOptionsName Maintenance window options name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pool's available maintenance windows. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String maintenanceWindowOptionsName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (maintenanceWindowOptionsName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter maintenanceWindowOptionsName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + maintenanceWindowOptionsName, + accept, + context); + } + + /** + * Get list of SQL pool's available maintenance windows. + * + * @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 maintenanceWindowOptionsName Maintenance window options name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pool's available maintenance windows. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String maintenanceWindowOptionsName) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, maintenanceWindowOptionsName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get list of SQL pool's available maintenance windows. + * + * @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 maintenanceWindowOptionsName Maintenance window options name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pool's available maintenance windows. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MaintenanceWindowOptionsInner get( + String resourceGroupName, String workspaceName, String sqlPoolName, String maintenanceWindowOptionsName) { + return getAsync(resourceGroupName, workspaceName, sqlPoolName, maintenanceWindowOptionsName).block(); + } + + /** + * Get list of SQL pool's available maintenance windows. + * + * @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 maintenanceWindowOptionsName Maintenance window options name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pool's available maintenance windows. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String maintenanceWindowOptionsName, + Context context) { + return getWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, maintenanceWindowOptionsName, context) + .block(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolMaintenanceWindowOptionsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolMaintenanceWindowOptionsImpl.java new file mode 100644 index 0000000000000..ddbe9d020a04b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolMaintenanceWindowOptionsImpl.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.SqlPoolMaintenanceWindowOptionsClient; +import com.azure.resourcemanager.synapse.fluent.models.MaintenanceWindowOptionsInner; +import com.azure.resourcemanager.synapse.models.MaintenanceWindowOptions; +import com.azure.resourcemanager.synapse.models.SqlPoolMaintenanceWindowOptions; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SqlPoolMaintenanceWindowOptionsImpl implements SqlPoolMaintenanceWindowOptions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolMaintenanceWindowOptionsImpl.class); + + private final SqlPoolMaintenanceWindowOptionsClient innerClient; + + private final SynapseManager serviceManager; + + public SqlPoolMaintenanceWindowOptionsImpl( + SqlPoolMaintenanceWindowOptionsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public MaintenanceWindowOptions get( + String resourceGroupName, String workspaceName, String sqlPoolName, String maintenanceWindowOptionsName) { + MaintenanceWindowOptionsInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, sqlPoolName, maintenanceWindowOptionsName); + if (inner != null) { + return new MaintenanceWindowOptionsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String maintenanceWindowOptionsName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, maintenanceWindowOptionsName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new MaintenanceWindowOptionsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private SqlPoolMaintenanceWindowOptionsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolMaintenanceWindowsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolMaintenanceWindowsClientImpl.java new file mode 100644 index 0000000000000..84350223e36e2 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolMaintenanceWindowsClientImpl.java @@ -0,0 +1,492 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.SqlPoolMaintenanceWindowsClient; +import com.azure.resourcemanager.synapse.fluent.models.MaintenanceWindowsInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SqlPoolMaintenanceWindowsClient. */ +public final class SqlPoolMaintenanceWindowsClientImpl implements SqlPoolMaintenanceWindowsClient { + private final ClientLogger logger = new ClientLogger(SqlPoolMaintenanceWindowsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SqlPoolMaintenanceWindowsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of SqlPoolMaintenanceWindowsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlPoolMaintenanceWindowsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + SqlPoolMaintenanceWindowsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientSqlPoolMaintenanceWindows to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface SqlPoolMaintenanceWindowsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/maintenancewindows/current") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @QueryParam("maintenanceWindowName") String maintenanceWindowName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/maintenancewindows/current") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @QueryParam("maintenanceWindowName") String maintenanceWindowName, + @BodyParam("application/json") MaintenanceWindowsInner parameters, + Context context); + } + + /** + * Get a SQL pool's Maintenance Windows. + * + * @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 maintenanceWindowName Maintenance window name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's Maintenance Windows. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String maintenanceWindowName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (maintenanceWindowName == null) { + return Mono + .error(new IllegalArgumentException("Parameter maintenanceWindowName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + maintenanceWindowName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get a SQL pool's Maintenance Windows. + * + * @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 maintenanceWindowName Maintenance window name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's Maintenance Windows. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String maintenanceWindowName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (maintenanceWindowName == null) { + return Mono + .error(new IllegalArgumentException("Parameter maintenanceWindowName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + maintenanceWindowName, + accept, + context); + } + + /** + * Get a SQL pool's Maintenance Windows. + * + * @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 maintenanceWindowName Maintenance window name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's Maintenance Windows. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String maintenanceWindowName) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, maintenanceWindowName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a SQL pool's Maintenance Windows. + * + * @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 maintenanceWindowName Maintenance window name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's Maintenance Windows. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MaintenanceWindowsInner get( + String resourceGroupName, String workspaceName, String sqlPoolName, String maintenanceWindowName) { + return getAsync(resourceGroupName, workspaceName, sqlPoolName, maintenanceWindowName).block(); + } + + /** + * Get a SQL pool's Maintenance Windows. + * + * @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 maintenanceWindowName Maintenance window name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's Maintenance Windows. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String maintenanceWindowName, + Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, maintenanceWindowName, context) + .block(); + } + + /** + * Creates or updates a Sql pool's maintenance windows settings. + * + * @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 maintenanceWindowName Maintenance window name. + * @param parameters The required parameters for creating or updating Maintenance Windows settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String maintenanceWindowName, + MaintenanceWindowsInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (maintenanceWindowName == null) { + return Mono + .error(new IllegalArgumentException("Parameter maintenanceWindowName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + maintenanceWindowName, + parameters, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates a Sql pool's maintenance windows settings. + * + * @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 maintenanceWindowName Maintenance window name. + * @param parameters The required parameters for creating or updating Maintenance Windows settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String maintenanceWindowName, + MaintenanceWindowsInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (maintenanceWindowName == null) { + return Mono + .error(new IllegalArgumentException("Parameter maintenanceWindowName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + maintenanceWindowName, + parameters, + context); + } + + /** + * Creates or updates a Sql pool's maintenance windows settings. + * + * @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 maintenanceWindowName Maintenance window name. + * @param parameters The required parameters for creating or updating Maintenance Windows settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String maintenanceWindowName, + MaintenanceWindowsInner parameters) { + return createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, maintenanceWindowName, parameters) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Creates or updates a Sql pool's maintenance windows settings. + * + * @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 maintenanceWindowName Maintenance window name. + * @param parameters The required parameters for creating or updating Maintenance Windows settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void createOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String maintenanceWindowName, + MaintenanceWindowsInner parameters) { + createOrUpdateAsync(resourceGroupName, workspaceName, sqlPoolName, maintenanceWindowName, parameters).block(); + } + + /** + * Creates or updates a Sql pool's maintenance windows settings. + * + * @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 maintenanceWindowName Maintenance window name. + * @param parameters The required parameters for creating or updating Maintenance Windows settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String maintenanceWindowName, + MaintenanceWindowsInner parameters, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, maintenanceWindowName, parameters, context) + .block(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolMaintenanceWindowsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolMaintenanceWindowsImpl.java new file mode 100644 index 0000000000000..d0e2d7953e056 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolMaintenanceWindowsImpl.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.SqlPoolMaintenanceWindowsClient; +import com.azure.resourcemanager.synapse.fluent.models.MaintenanceWindowsInner; +import com.azure.resourcemanager.synapse.models.MaintenanceWindows; +import com.azure.resourcemanager.synapse.models.SqlPoolMaintenanceWindows; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SqlPoolMaintenanceWindowsImpl implements SqlPoolMaintenanceWindows { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolMaintenanceWindowsImpl.class); + + private final SqlPoolMaintenanceWindowsClient innerClient; + + private final SynapseManager serviceManager; + + public SqlPoolMaintenanceWindowsImpl(SqlPoolMaintenanceWindowsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public MaintenanceWindows get( + String resourceGroupName, String workspaceName, String sqlPoolName, String maintenanceWindowName) { + MaintenanceWindowsInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, sqlPoolName, maintenanceWindowName); + if (inner != null) { + return new MaintenanceWindowsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String maintenanceWindowName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, maintenanceWindowName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new MaintenanceWindowsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void createOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String maintenanceWindowName, + MaintenanceWindowsInner parameters) { + this + .serviceClient() + .createOrUpdate(resourceGroupName, workspaceName, sqlPoolName, maintenanceWindowName, parameters); + } + + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String maintenanceWindowName, + MaintenanceWindowsInner parameters, + Context context) { + return this + .serviceClient() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, sqlPoolName, maintenanceWindowName, parameters, context); + } + + private SqlPoolMaintenanceWindowsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolMetadataSyncConfigsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolMetadataSyncConfigsClientImpl.java new file mode 100644 index 0000000000000..bde58d0e334e4 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolMetadataSyncConfigsClientImpl.java @@ -0,0 +1,462 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.SqlPoolMetadataSyncConfigsClient; +import com.azure.resourcemanager.synapse.fluent.models.MetadataSyncConfigInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SqlPoolMetadataSyncConfigsClient. */ +public final class SqlPoolMetadataSyncConfigsClientImpl implements SqlPoolMetadataSyncConfigsClient { + private final ClientLogger logger = new ClientLogger(SqlPoolMetadataSyncConfigsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SqlPoolMetadataSyncConfigsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of SqlPoolMetadataSyncConfigsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlPoolMetadataSyncConfigsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + SqlPoolMetadataSyncConfigsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientSqlPoolMetadataSyncConfigs to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface SqlPoolMetadataSyncConfigsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/metadataSync/config") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/metadataSync/config") + @ExpectedResponses({200, 404}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @BodyParam("application/json") MetadataSyncConfigInner metadataSyncConfiguration, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the metadata sync configuration for a SQL pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the metadata sync configuration for a SQL pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context); + } + + /** + * Get 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the metadata sync configuration for a SQL pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String sqlPoolName) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the metadata sync configuration for a SQL pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MetadataSyncConfigInner get(String resourceGroupName, String workspaceName, String sqlPoolName) { + return getAsync(resourceGroupName, workspaceName, sqlPoolName).block(); + } + + /** + * Get 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the metadata sync configuration for a SQL pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, context).block(); + } + + /** + * 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 metadataSyncConfiguration Metadata sync configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration for metadata sync. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + MetadataSyncConfigInner metadataSyncConfiguration) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (metadataSyncConfiguration == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter metadataSyncConfiguration is required and cannot be null.")); + } else { + metadataSyncConfiguration.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + metadataSyncConfiguration, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 metadataSyncConfiguration Metadata sync configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration for metadata sync. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + MetadataSyncConfigInner metadataSyncConfiguration, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (metadataSyncConfiguration == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter metadataSyncConfiguration is required and cannot be null.")); + } else { + metadataSyncConfiguration.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + metadataSyncConfiguration, + accept, + context); + } + + /** + * 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 metadataSyncConfiguration Metadata sync configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration for metadata sync. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + MetadataSyncConfigInner metadataSyncConfiguration) { + return createWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, metadataSyncConfiguration) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 metadataSyncConfiguration Metadata sync configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration for metadata sync. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MetadataSyncConfigInner create( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + MetadataSyncConfigInner metadataSyncConfiguration) { + return createAsync(resourceGroupName, workspaceName, sqlPoolName, metadataSyncConfiguration).block(); + } + + /** + * 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 metadataSyncConfiguration Metadata sync configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration for metadata sync. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + MetadataSyncConfigInner metadataSyncConfiguration, + Context context) { + return createWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, metadataSyncConfiguration, context) + .block(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolMetadataSyncConfigsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolMetadataSyncConfigsImpl.java new file mode 100644 index 0000000000000..130efa00be736 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolMetadataSyncConfigsImpl.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.SqlPoolMetadataSyncConfigsClient; +import com.azure.resourcemanager.synapse.fluent.models.MetadataSyncConfigInner; +import com.azure.resourcemanager.synapse.models.MetadataSyncConfig; +import com.azure.resourcemanager.synapse.models.SqlPoolMetadataSyncConfigs; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SqlPoolMetadataSyncConfigsImpl implements SqlPoolMetadataSyncConfigs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolMetadataSyncConfigsImpl.class); + + private final SqlPoolMetadataSyncConfigsClient innerClient; + + private final SynapseManager serviceManager; + + public SqlPoolMetadataSyncConfigsImpl(SqlPoolMetadataSyncConfigsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public MetadataSyncConfig get(String resourceGroupName, String workspaceName, String sqlPoolName) { + MetadataSyncConfigInner inner = this.serviceClient().get(resourceGroupName, workspaceName, sqlPoolName); + if (inner != null) { + return new MetadataSyncConfigImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, sqlPoolName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new MetadataSyncConfigImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public MetadataSyncConfig create( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + MetadataSyncConfigInner metadataSyncConfiguration) { + MetadataSyncConfigInner inner = + this.serviceClient().create(resourceGroupName, workspaceName, sqlPoolName, metadataSyncConfiguration); + if (inner != null) { + return new MetadataSyncConfigImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + MetadataSyncConfigInner metadataSyncConfiguration, + Context context) { + Response inner = + this + .serviceClient() + .createWithResponse(resourceGroupName, workspaceName, sqlPoolName, metadataSyncConfiguration, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new MetadataSyncConfigImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private SqlPoolMetadataSyncConfigsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolOperationImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolOperationImpl.java new file mode 100644 index 0000000000000..6418db042aa58 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolOperationImpl.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolOperationInner; +import com.azure.resourcemanager.synapse.models.ManagementOperationState; +import com.azure.resourcemanager.synapse.models.SqlPoolOperation; +import java.time.OffsetDateTime; + +public final class SqlPoolOperationImpl implements SqlPoolOperation { + private SqlPoolOperationInner innerObject; + + private final SynapseManager serviceManager; + + SqlPoolOperationImpl(SqlPoolOperationInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String databaseName() { + return this.innerModel().databaseName(); + } + + public String operation() { + return this.innerModel().operation(); + } + + public String operationFriendlyName() { + return this.innerModel().operationFriendlyName(); + } + + public Integer percentComplete() { + return this.innerModel().percentComplete(); + } + + public String serverName() { + return this.innerModel().serverName(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public ManagementOperationState state() { + return this.innerModel().state(); + } + + public Integer errorCode() { + return this.innerModel().errorCode(); + } + + public String errorDescription() { + return this.innerModel().errorDescription(); + } + + public Integer errorSeverity() { + return this.innerModel().errorSeverity(); + } + + public Boolean isUserError() { + return this.innerModel().isUserError(); + } + + public OffsetDateTime estimatedCompletionTime() { + return this.innerModel().estimatedCompletionTime(); + } + + public String description() { + return this.innerModel().description(); + } + + public Boolean isCancellable() { + return this.innerModel().isCancellable(); + } + + public SqlPoolOperationInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolOperationResultsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolOperationResultsClientImpl.java new file mode 100644 index 0000000000000..0a524d411572c --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolOperationResultsClientImpl.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.SqlPoolOperationResultsClient; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SqlPoolOperationResultsClient. */ +public final class SqlPoolOperationResultsClientImpl implements SqlPoolOperationResultsClient { + private final ClientLogger logger = new ClientLogger(SqlPoolOperationResultsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SqlPoolOperationResultsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of SqlPoolOperationResultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlPoolOperationResultsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create(SqlPoolOperationResultsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientSqlPoolOperationResults to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface SqlPoolOperationResultsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/operationResults/{operationId}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getLocationHeaderResult( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the status of a SQL pool operation. + * + * @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 operationId Operation ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a SQL pool operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getLocationHeaderResultWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String operationId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getLocationHeaderResult( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + operationId, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the status of a SQL pool operation. + * + * @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 operationId Operation ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a SQL pool operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getLocationHeaderResultWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String operationId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getLocationHeaderResult( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + operationId, + accept, + context); + } + + /** + * Get the status of a SQL pool operation. + * + * @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 operationId Operation ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a SQL pool operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getLocationHeaderResultAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String operationId) { + return getLocationHeaderResultWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, operationId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the status of a SQL pool operation. + * + * @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 operationId Operation ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a SQL pool operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Object getLocationHeaderResult( + String resourceGroupName, String workspaceName, String sqlPoolName, String operationId) { + return getLocationHeaderResultAsync(resourceGroupName, workspaceName, sqlPoolName, operationId).block(); + } + + /** + * Get the status of a SQL pool operation. + * + * @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 operationId Operation ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a SQL pool operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLocationHeaderResultWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, String operationId, Context context) { + return getLocationHeaderResultWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, operationId, context) + .block(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolOperationResultsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolOperationResultsImpl.java new file mode 100644 index 0000000000000..41af6ae344a75 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolOperationResultsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.SqlPoolOperationResultsClient; +import com.azure.resourcemanager.synapse.models.SqlPoolOperationResults; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SqlPoolOperationResultsImpl implements SqlPoolOperationResults { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolOperationResultsImpl.class); + + private final SqlPoolOperationResultsClient innerClient; + + private final SynapseManager serviceManager; + + public SqlPoolOperationResultsImpl(SqlPoolOperationResultsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Object getLocationHeaderResult( + String resourceGroupName, String workspaceName, String sqlPoolName, String operationId) { + return this.serviceClient().getLocationHeaderResult(resourceGroupName, workspaceName, sqlPoolName, operationId); + } + + public Response getLocationHeaderResultWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, String operationId, Context context) { + return this + .serviceClient() + .getLocationHeaderResultWithResponse(resourceGroupName, workspaceName, sqlPoolName, operationId, context); + } + + private SqlPoolOperationResultsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolOperationsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolOperationsClientImpl.java new file mode 100644 index 0000000000000..85dbf0cf9b2d5 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolOperationsClientImpl.java @@ -0,0 +1,355 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.SqlPoolOperationsClient; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolOperationInner; +import com.azure.resourcemanager.synapse.models.SqlPoolBlobAuditingPolicySqlPoolOperationListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SqlPoolOperationsClient. */ +public final class SqlPoolOperationsClientImpl implements SqlPoolOperationsClient { + private final ClientLogger logger = new ClientLogger(SqlPoolOperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SqlPoolOperationsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of SqlPoolOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlPoolOperationsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy.create(SqlPoolOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientSqlPoolOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface SqlPoolOperationsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list of operations performed on the 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations performed on the SQL pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets a list of operations performed on the 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations performed on the SQL pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of operations performed on the 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations performed on the SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of operations performed on the 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations performed on the SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of operations performed on the 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations performed on the SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, sqlPoolName)); + } + + /** + * Gets a list of operations performed on the 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations performed on the SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, sqlPoolName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a list Sql pool operations request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a list Sql pool operations request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolOperationsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolOperationsImpl.java new file mode 100644 index 0000000000000..d4c4198e10610 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolOperationsImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.SqlPoolOperationsClient; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolOperationInner; +import com.azure.resourcemanager.synapse.models.SqlPoolOperation; +import com.azure.resourcemanager.synapse.models.SqlPoolOperations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SqlPoolOperationsImpl implements SqlPoolOperations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolOperationsImpl.class); + + private final SqlPoolOperationsClient innerClient; + + private final SynapseManager serviceManager; + + public SqlPoolOperationsImpl(SqlPoolOperationsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String sqlPoolName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, sqlPoolName); + return Utils.mapPage(inner, inner1 -> new SqlPoolOperationImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, sqlPoolName, context); + return Utils.mapPage(inner, inner1 -> new SqlPoolOperationImpl(inner1, this.manager())); + } + + private SqlPoolOperationsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolRecommendedSensitivityLabelsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolRecommendedSensitivityLabelsClientImpl.java new file mode 100644 index 0000000000000..60b4d86eb77f3 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolRecommendedSensitivityLabelsClientImpl.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.SqlPoolRecommendedSensitivityLabelsClient; +import com.azure.resourcemanager.synapse.models.RecommendedSensitivityLabelUpdateList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SqlPoolRecommendedSensitivityLabelsClient. + */ +public final class SqlPoolRecommendedSensitivityLabelsClientImpl implements SqlPoolRecommendedSensitivityLabelsClient { + private final ClientLogger logger = new ClientLogger(SqlPoolRecommendedSensitivityLabelsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SqlPoolRecommendedSensitivityLabelsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of SqlPoolRecommendedSensitivityLabelsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlPoolRecommendedSensitivityLabelsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + SqlPoolRecommendedSensitivityLabelsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientSqlPoolRecommendedSensitivityLabels to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface SqlPoolRecommendedSensitivityLabelsService { + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/recommendedSensitivityLabels") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @BodyParam("application/json") RecommendedSensitivityLabelUpdateList parameters, + Context context); + } + + /** + * Update recommended sensitivity labels states of a given SQL Pool using an operations batch. + * + * @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 A list of recommended sensitivity label update operations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + RecommendedSensitivityLabelUpdateList parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + parameters, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Update recommended sensitivity labels states of a given SQL Pool using an operations batch. + * + * @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 A list of recommended sensitivity label update operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + RecommendedSensitivityLabelUpdateList parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + parameters, + context); + } + + /** + * Update recommended sensitivity labels states of a given SQL Pool using an operations batch. + * + * @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 A list of recommended sensitivity label update operations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + RecommendedSensitivityLabelUpdateList parameters) { + return updateWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, parameters) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Update recommended sensitivity labels states of a given SQL Pool using an operations batch. + * + * @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 A list of recommended sensitivity label update operations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void update( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + RecommendedSensitivityLabelUpdateList parameters) { + updateAsync(resourceGroupName, workspaceName, sqlPoolName, parameters).block(); + } + + /** + * Update recommended sensitivity labels states of a given SQL Pool using an operations batch. + * + * @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 A list of recommended sensitivity label update operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + RecommendedSensitivityLabelUpdateList parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, parameters, context).block(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolRecommendedSensitivityLabelsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolRecommendedSensitivityLabelsImpl.java new file mode 100644 index 0000000000000..3cdadeb3320b2 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolRecommendedSensitivityLabelsImpl.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.SqlPoolRecommendedSensitivityLabelsClient; +import com.azure.resourcemanager.synapse.models.RecommendedSensitivityLabelUpdateList; +import com.azure.resourcemanager.synapse.models.SqlPoolRecommendedSensitivityLabels; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SqlPoolRecommendedSensitivityLabelsImpl implements SqlPoolRecommendedSensitivityLabels { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolRecommendedSensitivityLabelsImpl.class); + + private final SqlPoolRecommendedSensitivityLabelsClient innerClient; + + private final SynapseManager serviceManager; + + public SqlPoolRecommendedSensitivityLabelsImpl( + SqlPoolRecommendedSensitivityLabelsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void update( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + RecommendedSensitivityLabelUpdateList parameters) { + this.serviceClient().update(resourceGroupName, workspaceName, sqlPoolName, parameters); + } + + public Response updateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + RecommendedSensitivityLabelUpdateList parameters, + Context context) { + return this + .serviceClient() + .updateWithResponse(resourceGroupName, workspaceName, sqlPoolName, parameters, context); + } + + private SqlPoolRecommendedSensitivityLabelsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolReplicationLinksClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolReplicationLinksClientImpl.java new file mode 100644 index 0000000000000..a6d8ab0b60172 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolReplicationLinksClientImpl.java @@ -0,0 +1,550 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.SqlPoolReplicationLinksClient; +import com.azure.resourcemanager.synapse.fluent.models.ReplicationLinkInner; +import com.azure.resourcemanager.synapse.models.ReplicationLinkListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SqlPoolReplicationLinksClient. */ +public final class SqlPoolReplicationLinksClientImpl implements SqlPoolReplicationLinksClient { + private final ClientLogger logger = new ClientLogger(SqlPoolReplicationLinksClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SqlPoolReplicationLinksService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of SqlPoolReplicationLinksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlPoolReplicationLinksClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create(SqlPoolReplicationLinksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientSqlPoolReplicationLinks to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface SqlPoolReplicationLinksService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/replicationLinks") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/replicationLinks/{linkId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByName( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("linkId") String linkId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists a Sql pool's replication links. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the response to a List Sql pool replication link request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists a Sql pool's replication links. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the response to a List Sql pool replication link request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists a Sql pool's replication links. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the response to a List Sql pool replication link request. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists a Sql pool's replication links. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the response to a List Sql pool replication link request. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists a Sql pool's replication links. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the response to a List Sql pool replication link request. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, sqlPoolName)); + } + + /** + * Lists a Sql pool's replication links. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the response to a List Sql pool replication link request. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, sqlPoolName, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool replication link by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByNameWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String linkId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (linkId == null) { + return Mono.error(new IllegalArgumentException("Parameter linkId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByName( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + linkId, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool replication link by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByNameWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String linkId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (linkId == null) { + return Mono.error(new IllegalArgumentException("Parameter linkId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByName( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + linkId, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool replication link by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByNameAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String linkId) { + return getByNameWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, linkId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool replication link by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicationLinkInner getByName( + String resourceGroupName, String workspaceName, String sqlPoolName, String linkId) { + return getByNameAsync(resourceGroupName, workspaceName, sqlPoolName, linkId).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool replication link by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByNameWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, String linkId, Context context) { + return getByNameWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, linkId, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the response to a List Sql pool replication link request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the response to a List Sql pool replication link request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolReplicationLinksImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolReplicationLinksImpl.java new file mode 100644 index 0000000000000..7f659762449ec --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolReplicationLinksImpl.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.SqlPoolReplicationLinksClient; +import com.azure.resourcemanager.synapse.fluent.models.ReplicationLinkInner; +import com.azure.resourcemanager.synapse.models.ReplicationLink; +import com.azure.resourcemanager.synapse.models.SqlPoolReplicationLinks; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SqlPoolReplicationLinksImpl implements SqlPoolReplicationLinks { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolReplicationLinksImpl.class); + + private final SqlPoolReplicationLinksClient innerClient; + + private final SynapseManager serviceManager; + + public SqlPoolReplicationLinksImpl(SqlPoolReplicationLinksClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String sqlPoolName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, sqlPoolName); + return Utils.mapPage(inner, inner1 -> new ReplicationLinkImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, sqlPoolName, context); + return Utils.mapPage(inner, inner1 -> new ReplicationLinkImpl(inner1, this.manager())); + } + + public ReplicationLink getByName( + String resourceGroupName, String workspaceName, String sqlPoolName, String linkId) { + ReplicationLinkInner inner = + this.serviceClient().getByName(resourceGroupName, workspaceName, sqlPoolName, linkId); + if (inner != null) { + return new ReplicationLinkImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByNameWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, String linkId, Context context) { + Response inner = + this.serviceClient().getByNameWithResponse(resourceGroupName, workspaceName, sqlPoolName, linkId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ReplicationLinkImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private SqlPoolReplicationLinksClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolRestorePointsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolRestorePointsClientImpl.java new file mode 100644 index 0000000000000..1f0a2c045aae4 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolRestorePointsClientImpl.java @@ -0,0 +1,1075 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.SqlPoolRestorePointsClient; +import com.azure.resourcemanager.synapse.fluent.models.RestorePointInner; +import com.azure.resourcemanager.synapse.models.CreateSqlPoolRestorePointDefinition; +import com.azure.resourcemanager.synapse.models.RestorePointListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SqlPoolRestorePointsClient. */ +public final class SqlPoolRestorePointsClientImpl implements SqlPoolRestorePointsClient { + private final ClientLogger logger = new ClientLogger(SqlPoolRestorePointsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SqlPoolRestorePointsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of SqlPoolRestorePointsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlPoolRestorePointsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create(SqlPoolRestorePointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientSqlPoolRestorePoints to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface SqlPoolRestorePointsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/restorePoints") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/restorePoints") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @BodyParam("application/json") CreateSqlPoolRestorePointDefinition parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/restorePoints/{restorePointName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("restorePointName") String restorePointName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/restorePoints/{restorePointName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("restorePointName") String restorePointName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get SQL pool backup information. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool backup information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get SQL pool backup information. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool backup information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get SQL pool backup information. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool backup information. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String sqlPoolName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get SQL pool backup information. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool backup information. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get SQL pool backup information. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool backup information. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String sqlPoolName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, sqlPoolName)); + } + + /** + * Get SQL pool backup information. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool backup information. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, sqlPoolName, context)); + } + + /** + * Creates a restore point for a data warehouse. + * + * @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 definition for creating the restore point of this Sql pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database restore points. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + CreateSqlPoolRestorePointDefinition parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates a restore point for a data warehouse. + * + * @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 definition for creating the restore point of this Sql pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database restore points. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + CreateSqlPoolRestorePointDefinition parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + parameters, + accept, + context); + } + + /** + * Creates a restore point for a data warehouse. + * + * @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 definition for creating the restore point of this Sql pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database restore points. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RestorePointInner> beginCreateAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + CreateSqlPoolRestorePointDefinition parameters) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RestorePointInner.class, RestorePointInner.class, Context.NONE); + } + + /** + * Creates a restore point for a data warehouse. + * + * @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 definition for creating the restore point of this Sql pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database restore points. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, RestorePointInner> beginCreateAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + CreateSqlPoolRestorePointDefinition parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), RestorePointInner.class, RestorePointInner.class, context); + } + + /** + * Creates a restore point for a data warehouse. + * + * @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 definition for creating the restore point of this Sql pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database restore points. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RestorePointInner> beginCreate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + CreateSqlPoolRestorePointDefinition parameters) { + return beginCreateAsync(resourceGroupName, workspaceName, sqlPoolName, parameters).getSyncPoller(); + } + + /** + * Creates a restore point for a data warehouse. + * + * @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 definition for creating the restore point of this Sql pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database restore points. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, RestorePointInner> beginCreate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + CreateSqlPoolRestorePointDefinition parameters, + Context context) { + return beginCreateAsync(resourceGroupName, workspaceName, sqlPoolName, parameters, context).getSyncPoller(); + } + + /** + * Creates a restore point for a data warehouse. + * + * @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 definition for creating the restore point of this Sql pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database restore points. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + CreateSqlPoolRestorePointDefinition parameters) { + return beginCreateAsync(resourceGroupName, workspaceName, sqlPoolName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a restore point for a data warehouse. + * + * @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 definition for creating the restore point of this Sql pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database restore points. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + CreateSqlPoolRestorePointDefinition parameters, + Context context) { + return beginCreateAsync(resourceGroupName, workspaceName, sqlPoolName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates a restore point for a data warehouse. + * + * @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 definition for creating the restore point of this Sql pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database restore points. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RestorePointInner create( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + CreateSqlPoolRestorePointDefinition parameters) { + return createAsync(resourceGroupName, workspaceName, sqlPoolName, parameters).block(); + } + + /** + * Creates a restore point for a data warehouse. + * + * @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 definition for creating the restore point of this Sql pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database restore points. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RestorePointInner create( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + CreateSqlPoolRestorePointDefinition parameters, + Context context) { + return createAsync(resourceGroupName, workspaceName, sqlPoolName, parameters, context).block(); + } + + /** + * 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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a restore point. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (restorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter restorePointName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + restorePointName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a restore point. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (restorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter restorePointName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + restorePointName, + accept, + context); + } + + /** + * 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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a restore point. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, restorePointName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a restore point. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RestorePointInner get( + String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName) { + return getAsync(resourceGroupName, workspaceName, sqlPoolName, restorePointName).block(); + } + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a restore point. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, restorePointName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (restorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter restorePointName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + restorePointName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (restorePointName == null) { + return Mono + .error(new IllegalArgumentException("Parameter restorePointName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + restorePointName, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, restorePointName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName) { + deleteAsync(resourceGroupName, workspaceName, sqlPoolName, restorePointName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName, Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, restorePointName, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of long term retention backups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of long term retention backups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolRestorePointsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolRestorePointsImpl.java new file mode 100644 index 0000000000000..435f57a004f12 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolRestorePointsImpl.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.SqlPoolRestorePointsClient; +import com.azure.resourcemanager.synapse.fluent.models.RestorePointInner; +import com.azure.resourcemanager.synapse.models.CreateSqlPoolRestorePointDefinition; +import com.azure.resourcemanager.synapse.models.RestorePoint; +import com.azure.resourcemanager.synapse.models.SqlPoolRestorePoints; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SqlPoolRestorePointsImpl implements SqlPoolRestorePoints { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolRestorePointsImpl.class); + + private final SqlPoolRestorePointsClient innerClient; + + private final SynapseManager serviceManager; + + public SqlPoolRestorePointsImpl(SqlPoolRestorePointsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String sqlPoolName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, sqlPoolName); + return Utils.mapPage(inner, inner1 -> new RestorePointImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, sqlPoolName, context); + return Utils.mapPage(inner, inner1 -> new RestorePointImpl(inner1, this.manager())); + } + + public RestorePoint create( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + CreateSqlPoolRestorePointDefinition parameters) { + RestorePointInner inner = + this.serviceClient().create(resourceGroupName, workspaceName, sqlPoolName, parameters); + if (inner != null) { + return new RestorePointImpl(inner, this.manager()); + } else { + return null; + } + } + + public RestorePoint create( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + CreateSqlPoolRestorePointDefinition parameters, + Context context) { + RestorePointInner inner = + this.serviceClient().create(resourceGroupName, workspaceName, sqlPoolName, parameters, context); + if (inner != null) { + return new RestorePointImpl(inner, this.manager()); + } else { + return null; + } + } + + public RestorePoint get( + String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName) { + RestorePointInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, sqlPoolName, restorePointName); + if (inner != null) { + return new RestorePointImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, restorePointName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RestorePointImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName) { + this.serviceClient().delete(resourceGroupName, workspaceName, sqlPoolName, restorePointName); + } + + public Response deleteWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName, Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, workspaceName, sqlPoolName, restorePointName, context); + } + + private SqlPoolRestorePointsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolSchemasClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolSchemasClientImpl.java new file mode 100644 index 0000000000000..44f43bbac2733 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolSchemasClientImpl.java @@ -0,0 +1,575 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.Resource; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.SqlPoolSchemasClient; +import com.azure.resourcemanager.synapse.models.SqlPoolSchemaListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SqlPoolSchemasClient. */ +public final class SqlPoolSchemasClientImpl implements SqlPoolSchemasClient { + private final ClientLogger logger = new ClientLogger(SqlPoolSchemasClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SqlPoolSchemasService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of SqlPoolSchemasClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlPoolSchemasClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy.create(SqlPoolSchemasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientSqlPoolSchemas to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface SqlPoolSchemasService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/schemas") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("schemaName") String schemaName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets schemas of a given 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 filter An OData filter expression that filters elements in the collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schemas of a given SQL pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets schemas of a given 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 filter An OData filter expression that filters elements in the collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schemas of a given SQL pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets schemas of a given 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 filter An OData filter expression that filters elements in the collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schemas of a given SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String filter) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets schemas of a given 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schemas of a given SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String sqlPoolName) { + final String filter = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets schemas of a given 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 filter An OData filter expression that filters elements in the collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schemas of a given SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String filter, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets schemas of a given 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schemas of a given SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String sqlPoolName) { + final String filter = null; + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, sqlPoolName, filter)); + } + + /** + * Gets schemas of a given 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 filter An OData filter expression that filters elements in the collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schemas of a given SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, String filter, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, sqlPoolName, filter, context)); + } + + /** + * 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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql Pool schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (schemaName == null) { + return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql Pool schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (schemaName == null) { + return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + accept, + context); + } + + /** + * 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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql Pool schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql Pool schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Resource get(String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName) { + return getAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName).block(); + } + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql Pool schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool schemas. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool schemas. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolSchemasImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolSchemasImpl.java new file mode 100644 index 0000000000000..9a47bd8c893a4 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolSchemasImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.Resource; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.SqlPoolSchemasClient; +import com.azure.resourcemanager.synapse.models.SqlPoolSchemas; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SqlPoolSchemasImpl implements SqlPoolSchemas { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolSchemasImpl.class); + + private final SqlPoolSchemasClient innerClient; + + private final SynapseManager serviceManager; + + public SqlPoolSchemasImpl(SqlPoolSchemasClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String sqlPoolName) { + return this.serviceClient().list(resourceGroupName, workspaceName, sqlPoolName); + } + + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, String filter, Context context) { + return this.serviceClient().list(resourceGroupName, workspaceName, sqlPoolName, filter, context); + } + + public Resource get(String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName) { + return this.serviceClient().get(resourceGroupName, workspaceName, sqlPoolName, schemaName); + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, Context context) { + return this.serviceClient().getWithResponse(resourceGroupName, workspaceName, sqlPoolName, schemaName, context); + } + + private SqlPoolSchemasClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolSecurityAlertPoliciesClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolSecurityAlertPoliciesClientImpl.java new file mode 100644 index 0000000000000..d1bdf23f9cc44 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolSecurityAlertPoliciesClientImpl.java @@ -0,0 +1,819 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.SqlPoolSecurityAlertPoliciesClient; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolSecurityAlertPolicyInner; +import com.azure.resourcemanager.synapse.models.ListSqlPoolSecurityAlertPolicies; +import com.azure.resourcemanager.synapse.models.SecurityAlertPolicyName; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SqlPoolSecurityAlertPoliciesClient. */ +public final class SqlPoolSecurityAlertPoliciesClientImpl implements SqlPoolSecurityAlertPoliciesClient { + private final ClientLogger logger = new ClientLogger(SqlPoolSecurityAlertPoliciesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SqlPoolSecurityAlertPoliciesService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of SqlPoolSecurityAlertPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlPoolSecurityAlertPoliciesClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + SqlPoolSecurityAlertPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientSqlPoolSecurityAlertPolicies to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface SqlPoolSecurityAlertPoliciesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/securityAlertPolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/securityAlertPolicies/{securityAlertPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("securityAlertPolicyName") SecurityAlertPolicyName securityAlertPolicyName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/securityAlertPolicies/{securityAlertPolicyName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("securityAlertPolicyName") SecurityAlertPolicyName securityAlertPolicyName, + @BodyParam("application/json") SqlPoolSecurityAlertPolicyInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool's security alert policies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool's security alert policies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool's security alert policies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool's security alert policies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool's security alert policies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, sqlPoolName)); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool's security alert policies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, sqlPoolName, context)); + } + + /** + * Get a Sql pool's security alert 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 securityAlertPolicyName The name of the security alert policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + SecurityAlertPolicyName securityAlertPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (securityAlertPolicyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter securityAlertPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + securityAlertPolicyName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get a Sql pool's security alert 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 securityAlertPolicyName The name of the security alert policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + SecurityAlertPolicyName securityAlertPolicyName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (securityAlertPolicyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter securityAlertPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + securityAlertPolicyName, + accept, + context); + } + + /** + * Get a Sql pool's security alert 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 securityAlertPolicyName The name of the security alert policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + SecurityAlertPolicyName securityAlertPolicyName) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, securityAlertPolicyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a Sql pool's security alert 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 securityAlertPolicyName The name of the security alert policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlPoolSecurityAlertPolicyInner get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + SecurityAlertPolicyName securityAlertPolicyName) { + return getAsync(resourceGroupName, workspaceName, sqlPoolName, securityAlertPolicyName).block(); + } + + /** + * Get a Sql pool's security alert 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 securityAlertPolicyName The name of the security alert policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + SecurityAlertPolicyName securityAlertPolicyName, + Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, securityAlertPolicyName, context) + .block(); + } + + /** + * Create or update a Sql pool's security alert 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 securityAlertPolicyName The name of the security alert policy. + * @param parameters The Sql pool security alert policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + SecurityAlertPolicyName securityAlertPolicyName, + SqlPoolSecurityAlertPolicyInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (securityAlertPolicyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter securityAlertPolicyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + securityAlertPolicyName, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create or update a Sql pool's security alert 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 securityAlertPolicyName The name of the security alert policy. + * @param parameters The Sql pool security alert policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + SecurityAlertPolicyName securityAlertPolicyName, + SqlPoolSecurityAlertPolicyInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (securityAlertPolicyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter securityAlertPolicyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + securityAlertPolicyName, + parameters, + accept, + context); + } + + /** + * Create or update a Sql pool's security alert 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 securityAlertPolicyName The name of the security alert policy. + * @param parameters The Sql pool security alert policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + SecurityAlertPolicyName securityAlertPolicyName, + SqlPoolSecurityAlertPolicyInner parameters) { + return createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, securityAlertPolicyName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or update a Sql pool's security alert 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 securityAlertPolicyName The name of the security alert policy. + * @param parameters The Sql pool security alert policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlPoolSecurityAlertPolicyInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + SecurityAlertPolicyName securityAlertPolicyName, + SqlPoolSecurityAlertPolicyInner parameters) { + return createOrUpdateAsync(resourceGroupName, workspaceName, sqlPoolName, securityAlertPolicyName, parameters) + .block(); + } + + /** + * Create or update a Sql pool's security alert 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 securityAlertPolicyName The name of the security alert policy. + * @param parameters The Sql pool security alert policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + SecurityAlertPolicyName securityAlertPolicyName, + SqlPoolSecurityAlertPolicyInner parameters, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, securityAlertPolicyName, parameters, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL pool security alert policies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of SQL pool security alert policies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolSecurityAlertPoliciesImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolSecurityAlertPoliciesImpl.java new file mode 100644 index 0000000000000..1d24c3cb387b3 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolSecurityAlertPoliciesImpl.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.SqlPoolSecurityAlertPoliciesClient; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolSecurityAlertPolicyInner; +import com.azure.resourcemanager.synapse.models.SecurityAlertPolicyName; +import com.azure.resourcemanager.synapse.models.SqlPoolSecurityAlertPolicies; +import com.azure.resourcemanager.synapse.models.SqlPoolSecurityAlertPolicy; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SqlPoolSecurityAlertPoliciesImpl implements SqlPoolSecurityAlertPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolSecurityAlertPoliciesImpl.class); + + private final SqlPoolSecurityAlertPoliciesClient innerClient; + + private final SynapseManager serviceManager; + + public SqlPoolSecurityAlertPoliciesImpl( + SqlPoolSecurityAlertPoliciesClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, sqlPoolName); + return Utils.mapPage(inner, inner1 -> new SqlPoolSecurityAlertPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, sqlPoolName, context); + return Utils.mapPage(inner, inner1 -> new SqlPoolSecurityAlertPolicyImpl(inner1, this.manager())); + } + + public SqlPoolSecurityAlertPolicy get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + SecurityAlertPolicyName securityAlertPolicyName) { + SqlPoolSecurityAlertPolicyInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, sqlPoolName, securityAlertPolicyName); + if (inner != null) { + return new SqlPoolSecurityAlertPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + SecurityAlertPolicyName securityAlertPolicyName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, securityAlertPolicyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SqlPoolSecurityAlertPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SqlPoolSecurityAlertPolicy getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + SecurityAlertPolicyName securityAlertPolicyName = + SecurityAlertPolicyName.fromString(Utils.getValueFromIdByName(id, "securityAlertPolicies")); + if (securityAlertPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'securityAlertPolicies'.", + id))); + } + return this + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, securityAlertPolicyName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + SecurityAlertPolicyName securityAlertPolicyName = + SecurityAlertPolicyName.fromString(Utils.getValueFromIdByName(id, "securityAlertPolicies")); + if (securityAlertPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'securityAlertPolicies'.", + id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, sqlPoolName, securityAlertPolicyName, context); + } + + private SqlPoolSecurityAlertPoliciesClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + public SqlPoolSecurityAlertPolicyImpl define(SecurityAlertPolicyName name) { + return new SqlPoolSecurityAlertPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolSecurityAlertPolicyImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolSecurityAlertPolicyImpl.java new file mode 100644 index 0000000000000..b13da0594a53a --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolSecurityAlertPolicyImpl.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolSecurityAlertPolicyInner; +import com.azure.resourcemanager.synapse.models.SecurityAlertPolicyName; +import com.azure.resourcemanager.synapse.models.SecurityAlertPolicyState; +import com.azure.resourcemanager.synapse.models.SqlPoolSecurityAlertPolicy; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class SqlPoolSecurityAlertPolicyImpl + implements SqlPoolSecurityAlertPolicy, SqlPoolSecurityAlertPolicy.Definition, SqlPoolSecurityAlertPolicy.Update { + private SqlPoolSecurityAlertPolicyInner innerObject; + + private final SynapseManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SecurityAlertPolicyState state() { + return this.innerModel().state(); + } + + public List disabledAlerts() { + List inner = this.innerModel().disabledAlerts(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List emailAddresses() { + List inner = this.innerModel().emailAddresses(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public Boolean emailAccountAdmins() { + return this.innerModel().emailAccountAdmins(); + } + + public String storageEndpoint() { + return this.innerModel().storageEndpoint(); + } + + public String storageAccountAccessKey() { + return this.innerModel().storageAccountAccessKey(); + } + + public Integer retentionDays() { + return this.innerModel().retentionDays(); + } + + public OffsetDateTime creationTime() { + return this.innerModel().creationTime(); + } + + public SqlPoolSecurityAlertPolicyInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String sqlPoolName; + + private SecurityAlertPolicyName securityAlertPolicyName; + + public SqlPoolSecurityAlertPolicyImpl withExistingSqlPool( + String resourceGroupName, String workspaceName, String sqlPoolName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + this.sqlPoolName = sqlPoolName; + return this; + } + + public SqlPoolSecurityAlertPolicy create() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolSecurityAlertPolicies() + .createOrUpdateWithResponse( + resourceGroupName, + workspaceName, + sqlPoolName, + securityAlertPolicyName, + this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public SqlPoolSecurityAlertPolicy create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolSecurityAlertPolicies() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, sqlPoolName, securityAlertPolicyName, this.innerModel(), context) + .getValue(); + return this; + } + + SqlPoolSecurityAlertPolicyImpl(SecurityAlertPolicyName name, SynapseManager serviceManager) { + this.innerObject = new SqlPoolSecurityAlertPolicyInner(); + this.serviceManager = serviceManager; + this.securityAlertPolicyName = name; + } + + public SqlPoolSecurityAlertPolicyImpl update() { + return this; + } + + public SqlPoolSecurityAlertPolicy apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolSecurityAlertPolicies() + .createOrUpdateWithResponse( + resourceGroupName, + workspaceName, + sqlPoolName, + securityAlertPolicyName, + this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public SqlPoolSecurityAlertPolicy apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolSecurityAlertPolicies() + .createOrUpdateWithResponse( + resourceGroupName, workspaceName, sqlPoolName, securityAlertPolicyName, this.innerModel(), context) + .getValue(); + return this; + } + + SqlPoolSecurityAlertPolicyImpl(SqlPoolSecurityAlertPolicyInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.sqlPoolName = Utils.getValueFromIdByName(innerObject.id(), "sqlPools"); + this.securityAlertPolicyName = + SecurityAlertPolicyName.fromString(Utils.getValueFromIdByName(innerObject.id(), "securityAlertPolicies")); + } + + public SqlPoolSecurityAlertPolicy refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolSecurityAlertPolicies() + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, securityAlertPolicyName, Context.NONE) + .getValue(); + return this; + } + + public SqlPoolSecurityAlertPolicy refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolSecurityAlertPolicies() + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, securityAlertPolicyName, context) + .getValue(); + return this; + } + + public SqlPoolSecurityAlertPolicyImpl withState(SecurityAlertPolicyState state) { + this.innerModel().withState(state); + return this; + } + + public SqlPoolSecurityAlertPolicyImpl withDisabledAlerts(List disabledAlerts) { + this.innerModel().withDisabledAlerts(disabledAlerts); + return this; + } + + public SqlPoolSecurityAlertPolicyImpl withEmailAddresses(List emailAddresses) { + this.innerModel().withEmailAddresses(emailAddresses); + return this; + } + + public SqlPoolSecurityAlertPolicyImpl withEmailAccountAdmins(Boolean emailAccountAdmins) { + this.innerModel().withEmailAccountAdmins(emailAccountAdmins); + return this; + } + + public SqlPoolSecurityAlertPolicyImpl withStorageEndpoint(String storageEndpoint) { + this.innerModel().withStorageEndpoint(storageEndpoint); + return this; + } + + public SqlPoolSecurityAlertPolicyImpl withStorageAccountAccessKey(String storageAccountAccessKey) { + this.innerModel().withStorageAccountAccessKey(storageAccountAccessKey); + return this; + } + + public SqlPoolSecurityAlertPolicyImpl withRetentionDays(Integer retentionDays) { + this.innerModel().withRetentionDays(retentionDays); + return this; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolSensitivityLabelsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolSensitivityLabelsClientImpl.java new file mode 100644 index 0000000000000..33885363b31ac --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolSensitivityLabelsClientImpl.java @@ -0,0 +1,2295 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.SqlPoolSensitivityLabelsClient; +import com.azure.resourcemanager.synapse.fluent.models.SensitivityLabelInner; +import com.azure.resourcemanager.synapse.models.SensitivityLabelListResult; +import com.azure.resourcemanager.synapse.models.SensitivityLabelSource; +import com.azure.resourcemanager.synapse.models.SensitivityLabelUpdateList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SqlPoolSensitivityLabelsClient. */ +public final class SqlPoolSensitivityLabelsClientImpl implements SqlPoolSensitivityLabelsClient { + private final ClientLogger logger = new ClientLogger(SqlPoolSensitivityLabelsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SqlPoolSensitivityLabelsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of SqlPoolSensitivityLabelsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlPoolSensitivityLabelsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create(SqlPoolSensitivityLabelsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientSqlPoolSensitivityLabels to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface SqlPoolSensitivityLabelsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/currentSensitivityLabels") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCurrent( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/currentSensitivityLabels") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @BodyParam("application/json") SensitivityLabelUpdateList parameters, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/recommendedSensitivityLabels") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listRecommended( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @QueryParam("includeDisabledRecommendations") Boolean includeDisabledRecommendations, + @QueryParam("$skipToken") String skipToken, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}" + + "/sensitivityLabels/{sensitivityLabelSource}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("schemaName") String schemaName, + @PathParam("tableName") String tableName, + @PathParam("columnName") String columnName, + @PathParam("sensitivityLabelSource") String sensitivityLabelSource, + @BodyParam("application/json") SensitivityLabelInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}" + + "/sensitivityLabels/{sensitivityLabelSource}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("schemaName") String schemaName, + @PathParam("tableName") String tableName, + @PathParam("columnName") String columnName, + @PathParam("sensitivityLabelSource") String sensitivityLabelSource, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}" + + "/sensitivityLabels/{sensitivityLabelSource}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("schemaName") String schemaName, + @PathParam("tableName") String tableName, + @PathParam("columnName") String columnName, + @PathParam("sensitivityLabelSource") SensitivityLabelSource sensitivityLabelSource, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}" + + "/sensitivityLabels/{sensitivityLabelSource}/enable") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> enableRecommendation( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("schemaName") String schemaName, + @PathParam("tableName") String tableName, + @PathParam("columnName") String columnName, + @PathParam("sensitivityLabelSource") String sensitivityLabelSource, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}" + + "/sensitivityLabels/{sensitivityLabelSource}/disable") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> disableRecommendation( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("schemaName") String schemaName, + @PathParam("tableName") String tableName, + @PathParam("columnName") String columnName, + @PathParam("sensitivityLabelSource") String sensitivityLabelSource, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCurrentNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listRecommendedNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets SQL pool sensitivity labels. + * + * @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 filter An OData filter expression that filters elements in the collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool sensitivity labels. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCurrentSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listCurrent( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets SQL pool sensitivity labels. + * + * @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 filter An OData filter expression that filters elements in the collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool sensitivity labels. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCurrentSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listCurrent( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets SQL pool sensitivity labels. + * + * @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 filter An OData filter expression that filters elements in the collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool sensitivity labels. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCurrentAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String filter) { + return new PagedFlux<>( + () -> listCurrentSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName, filter), + nextLink -> listCurrentNextSinglePageAsync(nextLink)); + } + + /** + * Gets SQL pool sensitivity labels. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool sensitivity labels. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCurrentAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + final String filter = null; + return new PagedFlux<>( + () -> listCurrentSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName, filter), + nextLink -> listCurrentNextSinglePageAsync(nextLink)); + } + + /** + * Gets SQL pool sensitivity labels. + * + * @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 filter An OData filter expression that filters elements in the collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool sensitivity labels. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCurrentAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String filter, Context context) { + return new PagedFlux<>( + () -> listCurrentSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName, filter, context), + nextLink -> listCurrentNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets SQL pool sensitivity labels. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool sensitivity labels. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCurrent( + String resourceGroupName, String workspaceName, String sqlPoolName) { + final String filter = null; + return new PagedIterable<>(listCurrentAsync(resourceGroupName, workspaceName, sqlPoolName, filter)); + } + + /** + * Gets SQL pool sensitivity labels. + * + * @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 filter An OData filter expression that filters elements in the collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool sensitivity labels. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCurrent( + String resourceGroupName, String workspaceName, String sqlPoolName, String filter, Context context) { + return new PagedIterable<>(listCurrentAsync(resourceGroupName, workspaceName, sqlPoolName, filter, context)); + } + + /** + * Update sensitivity labels of a given SQL Pool using an operations batch. + * + * @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 A list of sensitivity label update operations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, SensitivityLabelUpdateList parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + parameters, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Update sensitivity labels of a given SQL Pool using an operations batch. + * + * @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 A list of sensitivity label update operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + SensitivityLabelUpdateList parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + parameters, + context); + } + + /** + * Update sensitivity labels of a given SQL Pool using an operations batch. + * + * @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 A list of sensitivity label update operations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, SensitivityLabelUpdateList parameters) { + return updateWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, parameters) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Update sensitivity labels of a given SQL Pool using an operations batch. + * + * @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 A list of sensitivity label update operations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void update( + String resourceGroupName, String workspaceName, String sqlPoolName, SensitivityLabelUpdateList parameters) { + updateAsync(resourceGroupName, workspaceName, sqlPoolName, parameters).block(); + } + + /** + * Update sensitivity labels of a given SQL Pool using an operations batch. + * + * @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 A list of sensitivity label update operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + SensitivityLabelUpdateList parameters, + Context context) { + return updateWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, parameters, context).block(); + } + + /** + * Gets sensitivity labels of a given 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 includeDisabledRecommendations Specifies whether to include disabled recommendations or not. + * @param skipToken An OData query option to indicate how many elements to skip in the collection. + * @param filter An OData filter expression that filters elements in the collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sensitivity labels of a given SQL pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRecommendedSinglePageAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + Boolean includeDisabledRecommendations, + String skipToken, + String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listRecommended( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + includeDisabledRecommendations, + skipToken, + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets sensitivity labels of a given 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 includeDisabledRecommendations Specifies whether to include disabled recommendations or not. + * @param skipToken An OData query option to indicate how many elements to skip in the collection. + * @param filter An OData filter expression that filters elements in the collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sensitivity labels of a given SQL pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRecommendedSinglePageAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + Boolean includeDisabledRecommendations, + String skipToken, + String filter, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listRecommended( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + includeDisabledRecommendations, + skipToken, + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets sensitivity labels of a given 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 includeDisabledRecommendations Specifies whether to include disabled recommendations or not. + * @param skipToken An OData query option to indicate how many elements to skip in the collection. + * @param filter An OData filter expression that filters elements in the collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sensitivity labels of a given SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listRecommendedAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + Boolean includeDisabledRecommendations, + String skipToken, + String filter) { + return new PagedFlux<>( + () -> + listRecommendedSinglePageAsync( + resourceGroupName, workspaceName, sqlPoolName, includeDisabledRecommendations, skipToken, filter), + nextLink -> listRecommendedNextSinglePageAsync(nextLink)); + } + + /** + * Gets sensitivity labels of a given 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sensitivity labels of a given SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listRecommendedAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + final Boolean includeDisabledRecommendations = null; + final String skipToken = null; + final String filter = null; + return new PagedFlux<>( + () -> + listRecommendedSinglePageAsync( + resourceGroupName, workspaceName, sqlPoolName, includeDisabledRecommendations, skipToken, filter), + nextLink -> listRecommendedNextSinglePageAsync(nextLink)); + } + + /** + * Gets sensitivity labels of a given 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 includeDisabledRecommendations Specifies whether to include disabled recommendations or not. + * @param skipToken An OData query option to indicate how many elements to skip in the collection. + * @param filter An OData filter expression that filters elements in the collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sensitivity labels of a given SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listRecommendedAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + Boolean includeDisabledRecommendations, + String skipToken, + String filter, + Context context) { + return new PagedFlux<>( + () -> + listRecommendedSinglePageAsync( + resourceGroupName, + workspaceName, + sqlPoolName, + includeDisabledRecommendations, + skipToken, + filter, + context), + nextLink -> listRecommendedNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets sensitivity labels of a given 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sensitivity labels of a given SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRecommended( + String resourceGroupName, String workspaceName, String sqlPoolName) { + final Boolean includeDisabledRecommendations = null; + final String skipToken = null; + final String filter = null; + return new PagedIterable<>( + listRecommendedAsync( + resourceGroupName, workspaceName, sqlPoolName, includeDisabledRecommendations, skipToken, filter)); + } + + /** + * Gets sensitivity labels of a given 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 includeDisabledRecommendations Specifies whether to include disabled recommendations or not. + * @param skipToken An OData query option to indicate how many elements to skip in the collection. + * @param filter An OData filter expression that filters elements in the collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sensitivity labels of a given SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRecommended( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + Boolean includeDisabledRecommendations, + String skipToken, + String filter, + Context context) { + return new PagedIterable<>( + listRecommendedAsync( + resourceGroupName, + workspaceName, + sqlPoolName, + includeDisabledRecommendations, + skipToken, + filter, + context)); + } + + /** + * Creates or updates the sensitivity label of a given column in 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 schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @param parameters The column sensitivity label resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a sensitivity label. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + SensitivityLabelInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (schemaName == null) { + return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (columnName == null) { + return Mono.error(new IllegalArgumentException("Parameter columnName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String sensitivityLabelSource = "current"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + tableName, + columnName, + sensitivityLabelSource, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates the sensitivity label of a given column in 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 schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @param parameters The column sensitivity label resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a sensitivity label. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + SensitivityLabelInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (schemaName == null) { + return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (columnName == null) { + return Mono.error(new IllegalArgumentException("Parameter columnName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String sensitivityLabelSource = "current"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + tableName, + columnName, + sensitivityLabelSource, + parameters, + accept, + context); + } + + /** + * Creates or updates the sensitivity label of a given column in 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 schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @param parameters The column sensitivity label resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a sensitivity label. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + SensitivityLabelInner parameters) { + return createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates the sensitivity label of a given column in 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 schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @param parameters The column sensitivity label resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a sensitivity label. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SensitivityLabelInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + SensitivityLabelInner parameters) { + return createOrUpdateAsync( + resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName, parameters) + .block(); + } + + /** + * Creates or updates the sensitivity label of a given column in 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 schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @param parameters The column sensitivity label resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a sensitivity label. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + SensitivityLabelInner parameters, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName, parameters, context) + .block(); + } + + /** + * Deletes the sensitivity label of a given column in 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 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (schemaName == null) { + return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (columnName == null) { + return Mono.error(new IllegalArgumentException("Parameter columnName is required and cannot be null.")); + } + final String sensitivityLabelSource = "current"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + tableName, + columnName, + sensitivityLabelSource, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes the sensitivity label of a given column in 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 schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (schemaName == null) { + return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (columnName == null) { + return Mono.error(new IllegalArgumentException("Parameter columnName is required and cannot be null.")); + } + final String sensitivityLabelSource = "current"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + tableName, + columnName, + sensitivityLabelSource, + context); + } + + /** + * Deletes the sensitivity label of a given column in 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 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deletes the sensitivity label of a given column in 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 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName) { + deleteAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName).block(); + } + + /** + * Deletes the sensitivity label of a given column in 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 schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + Context context) { + return deleteWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName, context) + .block(); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sensitivity label of a given column. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + SensitivityLabelSource sensitivityLabelSource) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (schemaName == null) { + return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (columnName == null) { + return Mono.error(new IllegalArgumentException("Parameter columnName is required and cannot be null.")); + } + if (sensitivityLabelSource == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sensitivityLabelSource is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + tableName, + columnName, + sensitivityLabelSource, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sensitivity label of a given column. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + SensitivityLabelSource sensitivityLabelSource, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (schemaName == null) { + return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (columnName == null) { + return Mono.error(new IllegalArgumentException("Parameter columnName is required and cannot be null.")); + } + if (sensitivityLabelSource == null) { + return Mono + .error( + new IllegalArgumentException("Parameter sensitivityLabelSource is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + tableName, + columnName, + sensitivityLabelSource, + accept, + context); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sensitivity label of a given column. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + SensitivityLabelSource sensitivityLabelSource) { + return getWithResponseAsync( + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + tableName, + columnName, + sensitivityLabelSource) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sensitivity label of a given column. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SensitivityLabelInner get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + SensitivityLabelSource sensitivityLabelSource) { + return getAsync( + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + tableName, + columnName, + sensitivityLabelSource) + .block(); + } + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sensitivity label of a given column. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + SensitivityLabelSource sensitivityLabelSource, + Context context) { + return getWithResponseAsync( + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + tableName, + columnName, + sensitivityLabelSource, + context) + .block(); + } + + /** + * Enables sensitivity recommendations on a given column (recommendations are enabled by default on all columns). + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> enableRecommendationWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (schemaName == null) { + return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (columnName == null) { + return Mono.error(new IllegalArgumentException("Parameter columnName is required and cannot be null.")); + } + final String sensitivityLabelSource = "recommended"; + return FluxUtil + .withContext( + context -> + service + .enableRecommendation( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + tableName, + columnName, + sensitivityLabelSource, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Enables sensitivity recommendations on a given column (recommendations are enabled by default on all columns). + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> enableRecommendationWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (schemaName == null) { + return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (columnName == null) { + return Mono.error(new IllegalArgumentException("Parameter columnName is required and cannot be null.")); + } + final String sensitivityLabelSource = "recommended"; + context = this.client.mergeContext(context); + return service + .enableRecommendation( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + tableName, + columnName, + sensitivityLabelSource, + context); + } + + /** + * Enables sensitivity recommendations on a given column (recommendations are enabled by default on all columns). + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono enableRecommendationAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName) { + return enableRecommendationWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Enables sensitivity recommendations on a given column (recommendations are enabled by default on all columns). + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void enableRecommendation( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName) { + enableRecommendationAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName) + .block(); + } + + /** + * Enables sensitivity recommendations on a given column (recommendations are enabled by default on all columns). + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response enableRecommendationWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + Context context) { + return enableRecommendationWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName, context) + .block(); + } + + /** + * Disables sensitivity recommendations on 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> disableRecommendationWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (schemaName == null) { + return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (columnName == null) { + return Mono.error(new IllegalArgumentException("Parameter columnName is required and cannot be null.")); + } + final String sensitivityLabelSource = "recommended"; + return FluxUtil + .withContext( + context -> + service + .disableRecommendation( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + tableName, + columnName, + sensitivityLabelSource, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Disables sensitivity recommendations on 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> disableRecommendationWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (schemaName == null) { + return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (columnName == null) { + return Mono.error(new IllegalArgumentException("Parameter columnName is required and cannot be null.")); + } + final String sensitivityLabelSource = "recommended"; + context = this.client.mergeContext(context); + return service + .disableRecommendation( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + tableName, + columnName, + sensitivityLabelSource, + context); + } + + /** + * Disables sensitivity recommendations on 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono disableRecommendationAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName) { + return disableRecommendationWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Disables sensitivity recommendations on 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void disableRecommendation( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName) { + disableRecommendationAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName) + .block(); + } + + /** + * Disables sensitivity recommendations on 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response disableRecommendationWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + Context context) { + return disableRecommendationWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of sensitivity labels. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCurrentNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listCurrentNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of sensitivity labels. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCurrentNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listCurrentNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of sensitivity labels. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRecommendedNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listRecommendedNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of sensitivity labels. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRecommendedNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listRecommendedNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolSensitivityLabelsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolSensitivityLabelsImpl.java new file mode 100644 index 0000000000000..f05fa1bac5d30 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolSensitivityLabelsImpl.java @@ -0,0 +1,336 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.SqlPoolSensitivityLabelsClient; +import com.azure.resourcemanager.synapse.fluent.models.SensitivityLabelInner; +import com.azure.resourcemanager.synapse.models.SensitivityLabel; +import com.azure.resourcemanager.synapse.models.SensitivityLabelSource; +import com.azure.resourcemanager.synapse.models.SensitivityLabelUpdateList; +import com.azure.resourcemanager.synapse.models.SqlPoolSensitivityLabels; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SqlPoolSensitivityLabelsImpl implements SqlPoolSensitivityLabels { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolSensitivityLabelsImpl.class); + + private final SqlPoolSensitivityLabelsClient innerClient; + + private final SynapseManager serviceManager; + + public SqlPoolSensitivityLabelsImpl(SqlPoolSensitivityLabelsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listCurrent( + String resourceGroupName, String workspaceName, String sqlPoolName) { + PagedIterable inner = + this.serviceClient().listCurrent(resourceGroupName, workspaceName, sqlPoolName); + return Utils.mapPage(inner, inner1 -> new SensitivityLabelImpl(inner1, this.manager())); + } + + public PagedIterable listCurrent( + String resourceGroupName, String workspaceName, String sqlPoolName, String filter, Context context) { + PagedIterable inner = + this.serviceClient().listCurrent(resourceGroupName, workspaceName, sqlPoolName, filter, context); + return Utils.mapPage(inner, inner1 -> new SensitivityLabelImpl(inner1, this.manager())); + } + + public void update( + String resourceGroupName, String workspaceName, String sqlPoolName, SensitivityLabelUpdateList parameters) { + this.serviceClient().update(resourceGroupName, workspaceName, sqlPoolName, parameters); + } + + public Response updateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + SensitivityLabelUpdateList parameters, + Context context) { + return this + .serviceClient() + .updateWithResponse(resourceGroupName, workspaceName, sqlPoolName, parameters, context); + } + + public PagedIterable listRecommended( + String resourceGroupName, String workspaceName, String sqlPoolName) { + PagedIterable inner = + this.serviceClient().listRecommended(resourceGroupName, workspaceName, sqlPoolName); + return Utils.mapPage(inner, inner1 -> new SensitivityLabelImpl(inner1, this.manager())); + } + + public PagedIterable listRecommended( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + Boolean includeDisabledRecommendations, + String skipToken, + String filter, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listRecommended( + resourceGroupName, + workspaceName, + sqlPoolName, + includeDisabledRecommendations, + skipToken, + filter, + context); + return Utils.mapPage(inner, inner1 -> new SensitivityLabelImpl(inner1, this.manager())); + } + + public void delete( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName) { + this.serviceClient().delete(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName); + } + + public Response deleteWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + Context context) { + return this + .serviceClient() + .deleteWithResponse( + resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName, context); + } + + public SensitivityLabel get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + SensitivityLabelSource sensitivityLabelSource) { + SensitivityLabelInner inner = + this + .serviceClient() + .get( + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + tableName, + columnName, + sensitivityLabelSource); + if (inner != null) { + return new SensitivityLabelImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + SensitivityLabelSource sensitivityLabelSource, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + tableName, + columnName, + sensitivityLabelSource, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SensitivityLabelImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void enableRecommendation( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName) { + this + .serviceClient() + .enableRecommendation(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName); + } + + public Response enableRecommendationWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + Context context) { + return this + .serviceClient() + .enableRecommendationWithResponse( + resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName, context); + } + + public void disableRecommendation( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName) { + this + .serviceClient() + .disableRecommendation(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName); + } + + public Response disableRecommendationWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + Context context) { + return this + .serviceClient() + .disableRecommendationWithResponse( + resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + String schemaName = Utils.getValueFromIdByName(id, "schemas"); + if (schemaName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'schemas'.", id))); + } + String tableName = Utils.getValueFromIdByName(id, "tables"); + if (tableName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tables'.", id))); + } + String columnName = Utils.getValueFromIdByName(id, "columns"); + if (columnName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'columns'.", id))); + } + this + .deleteWithResponse( + resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName, Context.NONE) + .getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + String schemaName = Utils.getValueFromIdByName(id, "schemas"); + if (schemaName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'schemas'.", id))); + } + String tableName = Utils.getValueFromIdByName(id, "tables"); + if (tableName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'tables'.", id))); + } + String columnName = Utils.getValueFromIdByName(id, "columns"); + if (columnName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'columns'.", id))); + } + return this + .deleteWithResponse( + resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName, context); + } + + private SqlPoolSensitivityLabelsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + public SensitivityLabelImpl define() { + return new SensitivityLabelImpl(this.manager()); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolTableColumnsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolTableColumnsClientImpl.java new file mode 100644 index 0000000000000..2355ee5203870 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolTableColumnsClientImpl.java @@ -0,0 +1,454 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.SqlPoolTableColumnsClient; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolColumnInner; +import com.azure.resourcemanager.synapse.models.SqlPoolColumnListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SqlPoolTableColumnsClient. */ +public final class SqlPoolTableColumnsClientImpl implements SqlPoolTableColumnsClient { + private final ClientLogger logger = new ClientLogger(SqlPoolTableColumnsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SqlPoolTableColumnsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of SqlPoolTableColumnsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlPoolTableColumnsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy.create(SqlPoolTableColumnsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientSqlPoolTableColumns to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface SqlPoolTableColumnsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}/tables/{tableName}/columns") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByTableName( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("schemaName") String schemaName, + @PathParam("tableName") String tableName, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByTableNameNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets columns in a given table in 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 schemaName The name of the schema. + * @param tableName The name of the table. + * @param filter An OData filter expression that filters elements in the collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return columns in a given table in a SQL pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTableNameSinglePageAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (schemaName == null) { + return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByTableName( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + tableName, + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets columns in a given table in 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 schemaName The name of the schema. + * @param tableName The name of the table. + * @param filter An OData filter expression that filters elements in the collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return columns in a given table in a SQL pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTableNameSinglePageAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String filter, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (schemaName == null) { + return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByTableName( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + tableName, + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets columns in a given table in 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 schemaName The name of the schema. + * @param tableName The name of the table. + * @param filter An OData filter expression that filters elements in the collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return columns in a given table in a SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTableNameAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String filter) { + return new PagedFlux<>( + () -> + listByTableNameSinglePageAsync( + resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, filter), + nextLink -> listByTableNameNextSinglePageAsync(nextLink)); + } + + /** + * Gets columns in a given table in 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 schemaName The name of the schema. + * @param tableName The name of the table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return columns in a given table in a SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTableNameAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName) { + final String filter = null; + return new PagedFlux<>( + () -> + listByTableNameSinglePageAsync( + resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, filter), + nextLink -> listByTableNameNextSinglePageAsync(nextLink)); + } + + /** + * Gets columns in a given table in 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 schemaName The name of the schema. + * @param tableName The name of the table. + * @param filter An OData filter expression that filters elements in the collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return columns in a given table in a SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByTableNameAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String filter, + Context context) { + return new PagedFlux<>( + () -> + listByTableNameSinglePageAsync( + resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, filter, context), + nextLink -> listByTableNameNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets columns in a given table in 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 schemaName The name of the schema. + * @param tableName The name of the table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return columns in a given table in a SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByTableName( + String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName) { + final String filter = null; + return new PagedIterable<>( + listByTableNameAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, filter)); + } + + /** + * Gets columns in a given table in 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 schemaName The name of the schema. + * @param tableName The name of the table. + * @param filter An OData filter expression that filters elements in the collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return columns in a given table in a SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByTableName( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String filter, + Context context) { + return new PagedIterable<>( + listByTableNameAsync( + resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, filter, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool columns. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTableNameNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByTableNameNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool columns. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByTableNameNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByTableNameNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolTableColumnsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolTableColumnsImpl.java new file mode 100644 index 0000000000000..b804a05c63bd4 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolTableColumnsImpl.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.SqlPoolTableColumnsClient; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolColumnInner; +import com.azure.resourcemanager.synapse.models.SqlPoolColumn; +import com.azure.resourcemanager.synapse.models.SqlPoolTableColumns; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SqlPoolTableColumnsImpl implements SqlPoolTableColumns { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolTableColumnsImpl.class); + + private final SqlPoolTableColumnsClient innerClient; + + private final SynapseManager serviceManager; + + public SqlPoolTableColumnsImpl(SqlPoolTableColumnsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByTableName( + String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName) { + PagedIterable inner = + this.serviceClient().listByTableName(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName); + return Utils.mapPage(inner, inner1 -> new SqlPoolColumnImpl(inner1, this.manager())); + } + + public PagedIterable listByTableName( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String filter, + Context context) { + PagedIterable inner = + this + .serviceClient() + .listByTableName(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, filter, context); + return Utils.mapPage(inner, inner1 -> new SqlPoolColumnImpl(inner1, this.manager())); + } + + private SqlPoolTableColumnsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolTablesClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolTablesClientImpl.java new file mode 100644 index 0000000000000..00948886fae0e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolTablesClientImpl.java @@ -0,0 +1,637 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.Resource; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.SqlPoolTablesClient; +import com.azure.resourcemanager.synapse.models.SqlPoolTableListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SqlPoolTablesClient. */ +public final class SqlPoolTablesClientImpl implements SqlPoolTablesClient { + private final ClientLogger logger = new ClientLogger(SqlPoolTablesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SqlPoolTablesService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of SqlPoolTablesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlPoolTablesClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy.create(SqlPoolTablesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientSqlPoolTables to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface SqlPoolTablesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}/tables") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySchema( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("schemaName") String schemaName, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}/tables/{tableName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("schemaName") String schemaName, + @PathParam("tableName") String tableName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySchemaNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets tables of a given schema in 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 schemaName The name of the schema. + * @param filter An OData filter expression that filters elements in the collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tables of a given schema in a SQL pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySchemaSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (schemaName == null) { + return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listBySchema( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + filter, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets tables of a given schema in 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 schemaName The name of the schema. + * @param filter An OData filter expression that filters elements in the collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tables of a given schema in a SQL pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySchemaSinglePageAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String filter, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (schemaName == null) { + return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySchema( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets tables of a given schema in 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 schemaName The name of the schema. + * @param filter An OData filter expression that filters elements in the collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tables of a given schema in a SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySchemaAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String filter) { + return new PagedFlux<>( + () -> listBySchemaSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, filter), + nextLink -> listBySchemaNextSinglePageAsync(nextLink)); + } + + /** + * Gets tables of a given schema in 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 schemaName The name of the schema. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tables of a given schema in a SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySchemaAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName) { + final String filter = null; + return new PagedFlux<>( + () -> listBySchemaSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, filter), + nextLink -> listBySchemaNextSinglePageAsync(nextLink)); + } + + /** + * Gets tables of a given schema in 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 schemaName The name of the schema. + * @param filter An OData filter expression that filters elements in the collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tables of a given schema in a SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySchemaAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String filter, + Context context) { + return new PagedFlux<>( + () -> + listBySchemaSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, filter, context), + nextLink -> listBySchemaNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets tables of a given schema in 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 schemaName The name of the schema. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tables of a given schema in a SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySchema( + String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName) { + final String filter = null; + return new PagedIterable<>( + listBySchemaAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, filter)); + } + + /** + * Gets tables of a given schema in 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 schemaName The name of the schema. + * @param filter An OData filter expression that filters elements in the collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tables of a given schema in a SQL pool. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySchema( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String filter, + Context context) { + return new PagedIterable<>( + listBySchemaAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, filter, context)); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql pool table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (schemaName == null) { + return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + tableName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql pool table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (schemaName == null) { + return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + schemaName, + tableName, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql pool table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql pool table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Resource get( + String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName) { + return getAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql pool table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool tables. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySchemaNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listBySchemaNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool tables. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySchemaNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySchemaNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolTablesImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolTablesImpl.java new file mode 100644 index 0000000000000..b0cbc6f01ea1b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolTablesImpl.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.Resource; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.SqlPoolTablesClient; +import com.azure.resourcemanager.synapse.models.SqlPoolTables; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SqlPoolTablesImpl implements SqlPoolTables { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolTablesImpl.class); + + private final SqlPoolTablesClient innerClient; + + private final SynapseManager serviceManager; + + public SqlPoolTablesImpl(SqlPoolTablesClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listBySchema( + String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName) { + return this.serviceClient().listBySchema(resourceGroupName, workspaceName, sqlPoolName, schemaName); + } + + public PagedIterable listBySchema( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String filter, + Context context) { + return this + .serviceClient() + .listBySchema(resourceGroupName, workspaceName, sqlPoolName, schemaName, filter, context); + } + + public Resource get( + String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName) { + return this.serviceClient().get(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName); + } + + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + Context context) { + return this + .serviceClient() + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, context); + } + + private SqlPoolTablesClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolTransparentDataEncryptionsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolTransparentDataEncryptionsClientImpl.java new file mode 100644 index 0000000000000..0be061b5d72b8 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolTransparentDataEncryptionsClientImpl.java @@ -0,0 +1,829 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.SqlPoolTransparentDataEncryptionsClient; +import com.azure.resourcemanager.synapse.fluent.models.TransparentDataEncryptionInner; +import com.azure.resourcemanager.synapse.models.TransparentDataEncryptionListResult; +import com.azure.resourcemanager.synapse.models.TransparentDataEncryptionName; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SqlPoolTransparentDataEncryptionsClient. + */ +public final class SqlPoolTransparentDataEncryptionsClientImpl implements SqlPoolTransparentDataEncryptionsClient { + private final ClientLogger logger = new ClientLogger(SqlPoolTransparentDataEncryptionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SqlPoolTransparentDataEncryptionsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of SqlPoolTransparentDataEncryptionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlPoolTransparentDataEncryptionsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + SqlPoolTransparentDataEncryptionsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientSqlPoolTransparentDataEncryptions to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface SqlPoolTransparentDataEncryptionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/transparentDataEncryption/{transparentDataEncryptionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("transparentDataEncryptionName") TransparentDataEncryptionName transparentDataEncryptionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/transparentDataEncryption/{transparentDataEncryptionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("transparentDataEncryptionName") TransparentDataEncryptionName transparentDataEncryptionName, + @BodyParam("application/json") TransparentDataEncryptionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/transparentDataEncryption") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get a SQL pool's transparent data encryption configuration. + * + * @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 transparentDataEncryptionName The name of the transparent data encryption configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's transparent data encryption configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + TransparentDataEncryptionName transparentDataEncryptionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (transparentDataEncryptionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter transparentDataEncryptionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + transparentDataEncryptionName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get a SQL pool's transparent data encryption configuration. + * + * @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 transparentDataEncryptionName The name of the transparent data encryption configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's transparent data encryption configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + TransparentDataEncryptionName transparentDataEncryptionName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (transparentDataEncryptionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter transparentDataEncryptionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + transparentDataEncryptionName, + accept, + context); + } + + /** + * Get a SQL pool's transparent data encryption configuration. + * + * @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 transparentDataEncryptionName The name of the transparent data encryption configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's transparent data encryption configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + TransparentDataEncryptionName transparentDataEncryptionName) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, transparentDataEncryptionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a SQL pool's transparent data encryption configuration. + * + * @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 transparentDataEncryptionName The name of the transparent data encryption configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's transparent data encryption configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TransparentDataEncryptionInner get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + TransparentDataEncryptionName transparentDataEncryptionName) { + return getAsync(resourceGroupName, workspaceName, sqlPoolName, transparentDataEncryptionName).block(); + } + + /** + * Get a SQL pool's transparent data encryption configuration. + * + * @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 transparentDataEncryptionName The name of the transparent data encryption configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's transparent data encryption configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + TransparentDataEncryptionName transparentDataEncryptionName, + Context context) { + return getWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, transparentDataEncryptionName, context) + .block(); + } + + /** + * Creates or updates a Sql pool's transparent data encryption configuration. + * + * @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 transparentDataEncryptionName The name of the transparent data encryption configuration. + * @param parameters The required parameters for creating or updating transparent data encryption. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Sql pool transparent data encryption configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + TransparentDataEncryptionName transparentDataEncryptionName, + TransparentDataEncryptionInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (transparentDataEncryptionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter transparentDataEncryptionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + transparentDataEncryptionName, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates a Sql pool's transparent data encryption configuration. + * + * @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 transparentDataEncryptionName The name of the transparent data encryption configuration. + * @param parameters The required parameters for creating or updating transparent data encryption. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Sql pool transparent data encryption configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + TransparentDataEncryptionName transparentDataEncryptionName, + TransparentDataEncryptionInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (transparentDataEncryptionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter transparentDataEncryptionName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + transparentDataEncryptionName, + parameters, + accept, + context); + } + + /** + * Creates or updates a Sql pool's transparent data encryption configuration. + * + * @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 transparentDataEncryptionName The name of the transparent data encryption configuration. + * @param parameters The required parameters for creating or updating transparent data encryption. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Sql pool transparent data encryption configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + TransparentDataEncryptionName transparentDataEncryptionName, + TransparentDataEncryptionInner parameters) { + return createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, transparentDataEncryptionName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a Sql pool's transparent data encryption configuration. + * + * @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 transparentDataEncryptionName The name of the transparent data encryption configuration. + * @param parameters The required parameters for creating or updating transparent data encryption. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Sql pool transparent data encryption configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TransparentDataEncryptionInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + TransparentDataEncryptionName transparentDataEncryptionName, + TransparentDataEncryptionInner parameters) { + return createOrUpdateAsync( + resourceGroupName, workspaceName, sqlPoolName, transparentDataEncryptionName, parameters) + .block(); + } + + /** + * Creates or updates a Sql pool's transparent data encryption configuration. + * + * @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 transparentDataEncryptionName The name of the transparent data encryption configuration. + * @param parameters The required parameters for creating or updating transparent data encryption. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a Sql pool transparent data encryption configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + TransparentDataEncryptionName transparentDataEncryptionName, + TransparentDataEncryptionInner parameters, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, transparentDataEncryptionName, parameters, context) + .block(); + } + + /** + * Get list of SQL pool's transparent data encryption configurations. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pool's transparent data encryption configurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get list of SQL pool's transparent data encryption configurations. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pool's transparent data encryption configurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get list of SQL pool's transparent data encryption configurations. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pool's transparent data encryption configurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get list of SQL pool's transparent data encryption configurations. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pool's transparent data encryption configurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get list of SQL pool's transparent data encryption configurations. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pool's transparent data encryption configurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, sqlPoolName)); + } + + /** + * Get list of SQL pool's transparent data encryption configurations. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pool's transparent data encryption configurations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, sqlPoolName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of transparent data encryption configurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of transparent data encryption configurations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolTransparentDataEncryptionsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolTransparentDataEncryptionsImpl.java new file mode 100644 index 0000000000000..4c81a59ec0853 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolTransparentDataEncryptionsImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.SqlPoolTransparentDataEncryptionsClient; +import com.azure.resourcemanager.synapse.fluent.models.TransparentDataEncryptionInner; +import com.azure.resourcemanager.synapse.models.SqlPoolTransparentDataEncryptions; +import com.azure.resourcemanager.synapse.models.TransparentDataEncryption; +import com.azure.resourcemanager.synapse.models.TransparentDataEncryptionName; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SqlPoolTransparentDataEncryptionsImpl implements SqlPoolTransparentDataEncryptions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolTransparentDataEncryptionsImpl.class); + + private final SqlPoolTransparentDataEncryptionsClient innerClient; + + private final SynapseManager serviceManager; + + public SqlPoolTransparentDataEncryptionsImpl( + SqlPoolTransparentDataEncryptionsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public TransparentDataEncryption get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + TransparentDataEncryptionName transparentDataEncryptionName) { + TransparentDataEncryptionInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, sqlPoolName, transparentDataEncryptionName); + if (inner != null) { + return new TransparentDataEncryptionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + TransparentDataEncryptionName transparentDataEncryptionName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, transparentDataEncryptionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TransparentDataEncryptionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, sqlPoolName); + return Utils.mapPage(inner, inner1 -> new TransparentDataEncryptionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, sqlPoolName, context); + return Utils.mapPage(inner, inner1 -> new TransparentDataEncryptionImpl(inner1, this.manager())); + } + + public TransparentDataEncryption getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + TransparentDataEncryptionName transparentDataEncryptionName = + TransparentDataEncryptionName.fromString(Utils.getValueFromIdByName(id, "transparentDataEncryption")); + if (transparentDataEncryptionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'transparentDataEncryption'.", + id))); + } + return this + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, transparentDataEncryptionName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + TransparentDataEncryptionName transparentDataEncryptionName = + TransparentDataEncryptionName.fromString(Utils.getValueFromIdByName(id, "transparentDataEncryption")); + if (transparentDataEncryptionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'transparentDataEncryption'.", + id))); + } + return this + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, transparentDataEncryptionName, context); + } + + private SqlPoolTransparentDataEncryptionsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + public TransparentDataEncryptionImpl define(TransparentDataEncryptionName name) { + return new TransparentDataEncryptionImpl(name, this.manager()); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolUsageImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolUsageImpl.java new file mode 100644 index 0000000000000..0c93cbf40a788 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolUsageImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolUsageInner; +import com.azure.resourcemanager.synapse.models.SqlPoolUsage; +import java.time.OffsetDateTime; + +public final class SqlPoolUsageImpl implements SqlPoolUsage { + private SqlPoolUsageInner innerObject; + + private final SynapseManager serviceManager; + + SqlPoolUsageImpl(SqlPoolUsageInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public String resourceName() { + return this.innerModel().resourceName(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public Double currentValue() { + return this.innerModel().currentValue(); + } + + public Double limit() { + return this.innerModel().limit(); + } + + public String unit() { + return this.innerModel().unit(); + } + + public OffsetDateTime nextResetTime() { + return this.innerModel().nextResetTime(); + } + + public SqlPoolUsageInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolUsagesClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolUsagesClientImpl.java new file mode 100644 index 0000000000000..0d43425307805 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolUsagesClientImpl.java @@ -0,0 +1,353 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.SqlPoolUsagesClient; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolUsageInner; +import com.azure.resourcemanager.synapse.models.SqlPoolUsageListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SqlPoolUsagesClient. */ +public final class SqlPoolUsagesClientImpl implements SqlPoolUsagesClient { + private final ClientLogger logger = new ClientLogger(SqlPoolUsagesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SqlPoolUsagesService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of SqlPoolUsagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlPoolUsagesClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy.create(SqlPoolUsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientSqlPoolUsages to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface SqlPoolUsagesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/usages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets SQL pool usages. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool usages. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets SQL pool usages. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool usages. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets SQL pool usages. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool usages. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, String sqlPoolName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets SQL pool usages. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool usages. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets SQL pool usages. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool usages. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String sqlPoolName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, sqlPoolName)); + } + + /** + * Gets SQL pool usages. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool usages. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, sqlPoolName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a list Sql pool usages request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a list Sql pool usages request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolUsagesImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolUsagesImpl.java new file mode 100644 index 0000000000000..1c9a4c369e566 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolUsagesImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.SqlPoolUsagesClient; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolUsageInner; +import com.azure.resourcemanager.synapse.models.SqlPoolUsage; +import com.azure.resourcemanager.synapse.models.SqlPoolUsages; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SqlPoolUsagesImpl implements SqlPoolUsages { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolUsagesImpl.class); + + private final SqlPoolUsagesClient innerClient; + + private final SynapseManager serviceManager; + + public SqlPoolUsagesImpl(SqlPoolUsagesClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String sqlPoolName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, sqlPoolName); + return Utils.mapPage(inner, inner1 -> new SqlPoolUsageImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, sqlPoolName, context); + return Utils.mapPage(inner, inner1 -> new SqlPoolUsageImpl(inner1, this.manager())); + } + + private SqlPoolUsagesClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentImpl.java new file mode 100644 index 0000000000000..4ae62b7852ef2 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentImpl.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolVulnerabilityAssessmentInner; +import com.azure.resourcemanager.synapse.models.SqlPoolVulnerabilityAssessment; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentName; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentRecurringScansProperties; + +public final class SqlPoolVulnerabilityAssessmentImpl + implements SqlPoolVulnerabilityAssessment, + SqlPoolVulnerabilityAssessment.Definition, + SqlPoolVulnerabilityAssessment.Update { + private SqlPoolVulnerabilityAssessmentInner innerObject; + + private final SynapseManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String storageContainerPath() { + return this.innerModel().storageContainerPath(); + } + + public String storageContainerSasKey() { + return this.innerModel().storageContainerSasKey(); + } + + public String storageAccountAccessKey() { + return this.innerModel().storageAccountAccessKey(); + } + + public VulnerabilityAssessmentRecurringScansProperties recurringScans() { + return this.innerModel().recurringScans(); + } + + public SqlPoolVulnerabilityAssessmentInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String sqlPoolName; + + private VulnerabilityAssessmentName vulnerabilityAssessmentName; + + public SqlPoolVulnerabilityAssessmentImpl withExistingSqlPool( + String resourceGroupName, String workspaceName, String sqlPoolName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + this.sqlPoolName = sqlPoolName; + return this; + } + + public SqlPoolVulnerabilityAssessment create() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolVulnerabilityAssessments() + .createOrUpdateWithResponse( + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public SqlPoolVulnerabilityAssessment create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolVulnerabilityAssessments() + .createOrUpdateWithResponse( + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + this.innerModel(), + context) + .getValue(); + return this; + } + + SqlPoolVulnerabilityAssessmentImpl(VulnerabilityAssessmentName name, SynapseManager serviceManager) { + this.innerObject = new SqlPoolVulnerabilityAssessmentInner(); + this.serviceManager = serviceManager; + this.vulnerabilityAssessmentName = name; + } + + public SqlPoolVulnerabilityAssessmentImpl update() { + return this; + } + + public SqlPoolVulnerabilityAssessment apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolVulnerabilityAssessments() + .createOrUpdateWithResponse( + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public SqlPoolVulnerabilityAssessment apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolVulnerabilityAssessments() + .createOrUpdateWithResponse( + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + this.innerModel(), + context) + .getValue(); + return this; + } + + SqlPoolVulnerabilityAssessmentImpl(SqlPoolVulnerabilityAssessmentInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.sqlPoolName = Utils.getValueFromIdByName(innerObject.id(), "sqlPools"); + this.vulnerabilityAssessmentName = + VulnerabilityAssessmentName + .fromString(Utils.getValueFromIdByName(innerObject.id(), "vulnerabilityAssessments")); + } + + public SqlPoolVulnerabilityAssessment refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolVulnerabilityAssessments() + .getWithResponse( + resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, Context.NONE) + .getValue(); + return this; + } + + public SqlPoolVulnerabilityAssessment refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolVulnerabilityAssessments() + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, context) + .getValue(); + return this; + } + + public SqlPoolVulnerabilityAssessmentImpl withStorageContainerPath(String storageContainerPath) { + this.innerModel().withStorageContainerPath(storageContainerPath); + return this; + } + + public SqlPoolVulnerabilityAssessmentImpl withStorageContainerSasKey(String storageContainerSasKey) { + this.innerModel().withStorageContainerSasKey(storageContainerSasKey); + return this; + } + + public SqlPoolVulnerabilityAssessmentImpl withStorageAccountAccessKey(String storageAccountAccessKey) { + this.innerModel().withStorageAccountAccessKey(storageAccountAccessKey); + return this; + } + + public SqlPoolVulnerabilityAssessmentImpl withRecurringScans( + VulnerabilityAssessmentRecurringScansProperties recurringScans) { + this.innerModel().withRecurringScans(recurringScans); + return this; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentRuleBaselineImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentRuleBaselineImpl.java new file mode 100644 index 0000000000000..c226ba962e80b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentRuleBaselineImpl.java @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolVulnerabilityAssessmentRuleBaselineInner; +import com.azure.resourcemanager.synapse.models.SqlPoolVulnerabilityAssessmentRuleBaseline; +import com.azure.resourcemanager.synapse.models.SqlPoolVulnerabilityAssessmentRuleBaselineItem; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentName; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentPolicyBaselineName; +import java.util.Collections; +import java.util.List; + +public final class SqlPoolVulnerabilityAssessmentRuleBaselineImpl + implements SqlPoolVulnerabilityAssessmentRuleBaseline, + SqlPoolVulnerabilityAssessmentRuleBaseline.Definition, + SqlPoolVulnerabilityAssessmentRuleBaseline.Update { + private SqlPoolVulnerabilityAssessmentRuleBaselineInner innerObject; + + private final SynapseManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public List baselineResults() { + List inner = this.innerModel().baselineResults(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SqlPoolVulnerabilityAssessmentRuleBaselineInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String sqlPoolName; + + private VulnerabilityAssessmentName vulnerabilityAssessmentName; + + private String ruleId; + + private VulnerabilityAssessmentPolicyBaselineName baselineName; + + public SqlPoolVulnerabilityAssessmentRuleBaselineImpl withExistingRule( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + this.sqlPoolName = sqlPoolName; + this.vulnerabilityAssessmentName = vulnerabilityAssessmentName; + this.ruleId = ruleId; + return this; + } + + public SqlPoolVulnerabilityAssessmentRuleBaseline create() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolVulnerabilityAssessmentRuleBaselines() + .createOrUpdateWithResponse( + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + ruleId, + baselineName, + this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public SqlPoolVulnerabilityAssessmentRuleBaseline create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolVulnerabilityAssessmentRuleBaselines() + .createOrUpdateWithResponse( + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + ruleId, + baselineName, + this.innerModel(), + context) + .getValue(); + return this; + } + + SqlPoolVulnerabilityAssessmentRuleBaselineImpl( + VulnerabilityAssessmentPolicyBaselineName name, SynapseManager serviceManager) { + this.innerObject = new SqlPoolVulnerabilityAssessmentRuleBaselineInner(); + this.serviceManager = serviceManager; + this.baselineName = name; + } + + public SqlPoolVulnerabilityAssessmentRuleBaselineImpl update() { + return this; + } + + public SqlPoolVulnerabilityAssessmentRuleBaseline apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolVulnerabilityAssessmentRuleBaselines() + .createOrUpdateWithResponse( + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + ruleId, + baselineName, + this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public SqlPoolVulnerabilityAssessmentRuleBaseline apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolVulnerabilityAssessmentRuleBaselines() + .createOrUpdateWithResponse( + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + ruleId, + baselineName, + this.innerModel(), + context) + .getValue(); + return this; + } + + SqlPoolVulnerabilityAssessmentRuleBaselineImpl( + SqlPoolVulnerabilityAssessmentRuleBaselineInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.sqlPoolName = Utils.getValueFromIdByName(innerObject.id(), "sqlPools"); + this.vulnerabilityAssessmentName = + VulnerabilityAssessmentName + .fromString(Utils.getValueFromIdByName(innerObject.id(), "vulnerabilityAssessments")); + this.ruleId = Utils.getValueFromIdByName(innerObject.id(), "rules"); + this.baselineName = + VulnerabilityAssessmentPolicyBaselineName + .fromString(Utils.getValueFromIdByName(innerObject.id(), "baselines")); + } + + public SqlPoolVulnerabilityAssessmentRuleBaseline refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolVulnerabilityAssessmentRuleBaselines() + .getWithResponse( + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + ruleId, + baselineName, + Context.NONE) + .getValue(); + return this; + } + + public SqlPoolVulnerabilityAssessmentRuleBaseline refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolVulnerabilityAssessmentRuleBaselines() + .getWithResponse( + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + ruleId, + baselineName, + context) + .getValue(); + return this; + } + + public SqlPoolVulnerabilityAssessmentRuleBaselineImpl withBaselineResults( + List baselineResults) { + this.innerModel().withBaselineResults(baselineResults); + return this; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentRuleBaselinesClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentRuleBaselinesClientImpl.java new file mode 100644 index 0000000000000..5c6b9157377b4 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentRuleBaselinesClientImpl.java @@ -0,0 +1,908 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.SqlPoolVulnerabilityAssessmentRuleBaselinesClient; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolVulnerabilityAssessmentRuleBaselineInner; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentName; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentPolicyBaselineName; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * SqlPoolVulnerabilityAssessmentRuleBaselinesClient. + */ +public final class SqlPoolVulnerabilityAssessmentRuleBaselinesClientImpl + implements SqlPoolVulnerabilityAssessmentRuleBaselinesClient { + private final ClientLogger logger = new ClientLogger(SqlPoolVulnerabilityAssessmentRuleBaselinesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SqlPoolVulnerabilityAssessmentRuleBaselinesService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of SqlPoolVulnerabilityAssessmentRuleBaselinesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlPoolVulnerabilityAssessmentRuleBaselinesClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + SqlPoolVulnerabilityAssessmentRuleBaselinesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientSqlPoolVulnerabilityAssessmentRuleBaselines to + * be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface SqlPoolVulnerabilityAssessmentRuleBaselinesService { + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules" + + "/{ruleId}/baselines/{baselineName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("vulnerabilityAssessmentName") VulnerabilityAssessmentName vulnerabilityAssessmentName, + @PathParam("ruleId") String ruleId, + @PathParam("baselineName") VulnerabilityAssessmentPolicyBaselineName baselineName, + @BodyParam("application/json") SqlPoolVulnerabilityAssessmentRuleBaselineInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules" + + "/{ruleId}/baselines/{baselineName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("vulnerabilityAssessmentName") VulnerabilityAssessmentName vulnerabilityAssessmentName, + @PathParam("ruleId") String ruleId, + @PathParam("baselineName") VulnerabilityAssessmentPolicyBaselineName baselineName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules" + + "/{ruleId}/baselines/{baselineName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("vulnerabilityAssessmentName") VulnerabilityAssessmentName vulnerabilityAssessmentName, + @PathParam("ruleId") String ruleId, + @PathParam("baselineName") VulnerabilityAssessmentPolicyBaselineName baselineName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Creates or updates a Sql pool'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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @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 workspace level rule). + * @param parameters The requested rule baseline resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool vulnerability assessment rule baseline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId, + VulnerabilityAssessmentPolicyBaselineName baselineName, + SqlPoolVulnerabilityAssessmentRuleBaselineInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (vulnerabilityAssessmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vulnerabilityAssessmentName is required and cannot be null.")); + } + if (ruleId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + } + if (baselineName == null) { + return Mono.error(new IllegalArgumentException("Parameter baselineName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + ruleId, + baselineName, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates a Sql pool'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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @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 workspace level rule). + * @param parameters The requested rule baseline resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool vulnerability assessment rule baseline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId, + VulnerabilityAssessmentPolicyBaselineName baselineName, + SqlPoolVulnerabilityAssessmentRuleBaselineInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (vulnerabilityAssessmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vulnerabilityAssessmentName is required and cannot be null.")); + } + if (ruleId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + } + if (baselineName == null) { + return Mono.error(new IllegalArgumentException("Parameter baselineName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + ruleId, + baselineName, + parameters, + accept, + context); + } + + /** + * Creates or updates a Sql pool'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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @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 workspace level rule). + * @param parameters The requested rule baseline resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool vulnerability assessment rule baseline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId, + VulnerabilityAssessmentPolicyBaselineName baselineName, + SqlPoolVulnerabilityAssessmentRuleBaselineInner parameters) { + return createOrUpdateWithResponseAsync( + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + ruleId, + baselineName, + parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates a Sql pool'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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @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 workspace level rule). + * @param parameters The requested rule baseline resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool vulnerability assessment rule baseline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlPoolVulnerabilityAssessmentRuleBaselineInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId, + VulnerabilityAssessmentPolicyBaselineName baselineName, + SqlPoolVulnerabilityAssessmentRuleBaselineInner parameters) { + return createOrUpdateAsync( + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + ruleId, + baselineName, + parameters) + .block(); + } + + /** + * Creates or updates a Sql pool'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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @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 workspace level rule). + * @param parameters The requested rule baseline resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool vulnerability assessment rule baseline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId, + VulnerabilityAssessmentPolicyBaselineName baselineName, + SqlPoolVulnerabilityAssessmentRuleBaselineInner parameters, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + ruleId, + baselineName, + parameters, + context) + .block(); + } + + /** + * Removes the database'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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @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 workspace level rule). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId, + VulnerabilityAssessmentPolicyBaselineName baselineName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (vulnerabilityAssessmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vulnerabilityAssessmentName is required and cannot be null.")); + } + if (ruleId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + } + if (baselineName == null) { + return Mono.error(new IllegalArgumentException("Parameter baselineName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + ruleId, + baselineName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Removes the database'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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @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 workspace level rule). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId, + VulnerabilityAssessmentPolicyBaselineName baselineName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (vulnerabilityAssessmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vulnerabilityAssessmentName is required and cannot be null.")); + } + if (ruleId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + } + if (baselineName == null) { + return Mono.error(new IllegalArgumentException("Parameter baselineName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + ruleId, + baselineName, + context); + } + + /** + * Removes the database'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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @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 workspace level rule). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId, + VulnerabilityAssessmentPolicyBaselineName baselineName) { + return deleteWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, ruleId, baselineName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Removes the database'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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @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 workspace level rule). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId, + VulnerabilityAssessmentPolicyBaselineName baselineName) { + deleteAsync(resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, ruleId, baselineName) + .block(); + } + + /** + * Removes the database'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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @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 workspace level rule). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId, + VulnerabilityAssessmentPolicyBaselineName baselineName, + Context context) { + return deleteWithResponseAsync( + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + ruleId, + baselineName, + context) + .block(); + } + + /** + * 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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @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). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SqlPool's vulnerability assessment rule baseline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId, + VulnerabilityAssessmentPolicyBaselineName baselineName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (vulnerabilityAssessmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vulnerabilityAssessmentName is required and cannot be null.")); + } + if (ruleId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + } + if (baselineName == null) { + return Mono.error(new IllegalArgumentException("Parameter baselineName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + ruleId, + baselineName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @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). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SqlPool's vulnerability assessment rule baseline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId, + VulnerabilityAssessmentPolicyBaselineName baselineName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (vulnerabilityAssessmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vulnerabilityAssessmentName is required and cannot be null.")); + } + if (ruleId == null) { + return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + } + if (baselineName == null) { + return Mono.error(new IllegalArgumentException("Parameter baselineName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + ruleId, + baselineName, + accept, + context); + } + + /** + * 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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @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). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SqlPool's vulnerability assessment rule baseline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId, + VulnerabilityAssessmentPolicyBaselineName baselineName) { + return getWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, ruleId, baselineName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @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). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SqlPool's vulnerability assessment rule baseline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlPoolVulnerabilityAssessmentRuleBaselineInner get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId, + VulnerabilityAssessmentPolicyBaselineName baselineName) { + return getAsync( + resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, ruleId, baselineName) + .block(); + } + + /** + * 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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @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). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SqlPool's vulnerability assessment rule baseline. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId, + VulnerabilityAssessmentPolicyBaselineName baselineName, + Context context) { + return getWithResponseAsync( + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + ruleId, + baselineName, + context) + .block(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentRuleBaselinesImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentRuleBaselinesImpl.java new file mode 100644 index 0000000000000..c29626906f809 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentRuleBaselinesImpl.java @@ -0,0 +1,368 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.SqlPoolVulnerabilityAssessmentRuleBaselinesClient; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolVulnerabilityAssessmentRuleBaselineInner; +import com.azure.resourcemanager.synapse.models.SqlPoolVulnerabilityAssessmentRuleBaseline; +import com.azure.resourcemanager.synapse.models.SqlPoolVulnerabilityAssessmentRuleBaselines; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentName; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentPolicyBaselineName; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SqlPoolVulnerabilityAssessmentRuleBaselinesImpl + implements SqlPoolVulnerabilityAssessmentRuleBaselines { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(SqlPoolVulnerabilityAssessmentRuleBaselinesImpl.class); + + private final SqlPoolVulnerabilityAssessmentRuleBaselinesClient innerClient; + + private final SynapseManager serviceManager; + + public SqlPoolVulnerabilityAssessmentRuleBaselinesImpl( + SqlPoolVulnerabilityAssessmentRuleBaselinesClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void delete( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId, + VulnerabilityAssessmentPolicyBaselineName baselineName) { + this + .serviceClient() + .delete(resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, ruleId, baselineName); + } + + public Response deleteWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId, + VulnerabilityAssessmentPolicyBaselineName baselineName, + Context context) { + return this + .serviceClient() + .deleteWithResponse( + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + ruleId, + baselineName, + context); + } + + public SqlPoolVulnerabilityAssessmentRuleBaseline get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId, + VulnerabilityAssessmentPolicyBaselineName baselineName) { + SqlPoolVulnerabilityAssessmentRuleBaselineInner inner = + this + .serviceClient() + .get(resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, ruleId, baselineName); + if (inner != null) { + return new SqlPoolVulnerabilityAssessmentRuleBaselineImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId, + VulnerabilityAssessmentPolicyBaselineName baselineName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + ruleId, + baselineName, + context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SqlPoolVulnerabilityAssessmentRuleBaselineImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SqlPoolVulnerabilityAssessmentRuleBaseline getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + VulnerabilityAssessmentName vulnerabilityAssessmentName = + VulnerabilityAssessmentName.fromString(Utils.getValueFromIdByName(id, "vulnerabilityAssessments")); + if (vulnerabilityAssessmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'vulnerabilityAssessments'.", + id))); + } + String ruleId = Utils.getValueFromIdByName(id, "rules"); + if (ruleId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rules'.", id))); + } + VulnerabilityAssessmentPolicyBaselineName baselineName = + VulnerabilityAssessmentPolicyBaselineName.fromString(Utils.getValueFromIdByName(id, "baselines")); + if (baselineName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'baselines'.", id))); + } + return this + .getWithResponse( + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + ruleId, + baselineName, + Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + VulnerabilityAssessmentName vulnerabilityAssessmentName = + VulnerabilityAssessmentName.fromString(Utils.getValueFromIdByName(id, "vulnerabilityAssessments")); + if (vulnerabilityAssessmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'vulnerabilityAssessments'.", + id))); + } + String ruleId = Utils.getValueFromIdByName(id, "rules"); + if (ruleId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rules'.", id))); + } + VulnerabilityAssessmentPolicyBaselineName baselineName = + VulnerabilityAssessmentPolicyBaselineName.fromString(Utils.getValueFromIdByName(id, "baselines")); + if (baselineName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'baselines'.", id))); + } + return this + .getWithResponse( + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + ruleId, + baselineName, + context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + VulnerabilityAssessmentName vulnerabilityAssessmentName = + VulnerabilityAssessmentName.fromString(Utils.getValueFromIdByName(id, "vulnerabilityAssessments")); + if (vulnerabilityAssessmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'vulnerabilityAssessments'.", + id))); + } + String ruleId = Utils.getValueFromIdByName(id, "rules"); + if (ruleId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rules'.", id))); + } + VulnerabilityAssessmentPolicyBaselineName baselineName = + VulnerabilityAssessmentPolicyBaselineName.fromString(Utils.getValueFromIdByName(id, "baselines")); + if (baselineName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'baselines'.", id))); + } + this + .deleteWithResponse( + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + ruleId, + baselineName, + Context.NONE) + .getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + VulnerabilityAssessmentName vulnerabilityAssessmentName = + VulnerabilityAssessmentName.fromString(Utils.getValueFromIdByName(id, "vulnerabilityAssessments")); + if (vulnerabilityAssessmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'vulnerabilityAssessments'.", + id))); + } + String ruleId = Utils.getValueFromIdByName(id, "rules"); + if (ruleId == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'rules'.", id))); + } + VulnerabilityAssessmentPolicyBaselineName baselineName = + VulnerabilityAssessmentPolicyBaselineName.fromString(Utils.getValueFromIdByName(id, "baselines")); + if (baselineName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'baselines'.", id))); + } + return this + .deleteWithResponse( + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + ruleId, + baselineName, + context); + } + + private SqlPoolVulnerabilityAssessmentRuleBaselinesClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + public SqlPoolVulnerabilityAssessmentRuleBaselineImpl define(VulnerabilityAssessmentPolicyBaselineName name) { + return new SqlPoolVulnerabilityAssessmentRuleBaselineImpl(name, this.manager()); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentScansClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentScansClientImpl.java new file mode 100644 index 0000000000000..632f29912a0ae --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentScansClientImpl.java @@ -0,0 +1,1261 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.SqlPoolVulnerabilityAssessmentScansClient; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolVulnerabilityAssessmentScansExportInner; +import com.azure.resourcemanager.synapse.fluent.models.VulnerabilityAssessmentScanRecordInner; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentName; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentScanRecordListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SqlPoolVulnerabilityAssessmentScansClient. + */ +public final class SqlPoolVulnerabilityAssessmentScansClientImpl implements SqlPoolVulnerabilityAssessmentScansClient { + private final ClientLogger logger = new ClientLogger(SqlPoolVulnerabilityAssessmentScansClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SqlPoolVulnerabilityAssessmentScansService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of SqlPoolVulnerabilityAssessmentScansClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlPoolVulnerabilityAssessmentScansClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + SqlPoolVulnerabilityAssessmentScansService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientSqlPoolVulnerabilityAssessmentScans to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface SqlPoolVulnerabilityAssessmentScansService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + + "/scans") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("vulnerabilityAssessmentName") VulnerabilityAssessmentName vulnerabilityAssessmentName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans" + + "/{scanId}/initiateScan") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> initiateScan( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("vulnerabilityAssessmentName") VulnerabilityAssessmentName vulnerabilityAssessmentName, + @PathParam("scanId") String scanId, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans" + + "/{scanId}/export") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> export( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("vulnerabilityAssessmentName") VulnerabilityAssessmentName vulnerabilityAssessmentName, + @PathParam("scanId") String scanId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans" + + "/{scanId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("vulnerabilityAssessmentName") VulnerabilityAssessmentName vulnerabilityAssessmentName, + @PathParam("scanId") String scanId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the vulnerability assessment scans 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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of vulnerability assessment scan records. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (vulnerabilityAssessmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vulnerabilityAssessmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists the vulnerability assessment scans 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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of vulnerability assessment scan records. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (vulnerabilityAssessmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vulnerabilityAssessmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the vulnerability assessment scans 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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of vulnerability assessment scan records. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the vulnerability assessment scans 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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of vulnerability assessment scan records. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + Context context) { + return new PagedFlux<>( + () -> + listSinglePageAsync( + resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the vulnerability assessment scans 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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of vulnerability assessment scan records. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName) { + return new PagedIterable<>( + listAsync(resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName)); + } + + /** + * Lists the vulnerability assessment scans 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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of vulnerability assessment scan records. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, context)); + } + + /** + * Executes a Vulnerability Assessment database scan. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> initiateScanWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (vulnerabilityAssessmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vulnerabilityAssessmentName is required and cannot be null.")); + } + if (scanId == null) { + return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .initiateScan( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + scanId, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Executes a Vulnerability Assessment database scan. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> initiateScanWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (vulnerabilityAssessmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vulnerabilityAssessmentName is required and cannot be null.")); + } + if (scanId == null) { + return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .initiateScan( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + scanId, + context); + } + + /** + * Executes a Vulnerability Assessment database scan. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginInitiateScanAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId) { + Mono>> mono = + initiateScanWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, scanId); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Executes a Vulnerability Assessment database scan. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginInitiateScanAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + initiateScanWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, scanId, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Executes a Vulnerability Assessment database scan. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginInitiateScan( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId) { + return beginInitiateScanAsync( + resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, scanId) + .getSyncPoller(); + } + + /** + * Executes a Vulnerability Assessment database scan. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginInitiateScan( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId, + Context context) { + return beginInitiateScanAsync( + resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, scanId, context) + .getSyncPoller(); + } + + /** + * Executes a Vulnerability Assessment database scan. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono initiateScanAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId) { + return beginInitiateScanAsync( + resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, scanId) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Executes a Vulnerability Assessment database scan. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono initiateScanAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId, + Context context) { + return beginInitiateScanAsync( + resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, scanId, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Executes a Vulnerability Assessment database scan. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void initiateScan( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId) { + initiateScanAsync(resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, scanId).block(); + } + + /** + * Executes a Vulnerability Assessment database scan. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void initiateScan( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId, + Context context) { + initiateScanAsync(resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, scanId, context) + .block(); + } + + /** + * Convert an existing scan result to a human readable format. If already exists nothing happens. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool Vulnerability Assessment scan export resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> exportWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (vulnerabilityAssessmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vulnerabilityAssessmentName is required and cannot be null.")); + } + if (scanId == null) { + return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .export( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + scanId, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Convert an existing scan result to a human readable format. If already exists nothing happens. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool Vulnerability Assessment scan export resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> exportWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (vulnerabilityAssessmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vulnerabilityAssessmentName is required and cannot be null.")); + } + if (scanId == null) { + return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .export( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + scanId, + accept, + context); + } + + /** + * Convert an existing scan result to a human readable format. If already exists nothing happens. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool Vulnerability Assessment scan export resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono exportAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId) { + return exportWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, scanId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Convert an existing scan result to a human readable format. If already exists nothing happens. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool Vulnerability Assessment scan export resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlPoolVulnerabilityAssessmentScansExportInner export( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId) { + return exportAsync(resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, scanId).block(); + } + + /** + * Convert an existing scan result to a human readable format. If already exists nothing happens. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool Vulnerability Assessment scan export resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response exportWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId, + Context context) { + return exportWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, scanId, context) + .block(); + } + + /** + * 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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vulnerability assessment scan record of a Sql pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (vulnerabilityAssessmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vulnerabilityAssessmentName is required and cannot be null.")); + } + if (scanId == null) { + return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + scanId, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vulnerability assessment scan record of a Sql pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (vulnerabilityAssessmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vulnerabilityAssessmentName is required and cannot be null.")); + } + if (scanId == null) { + return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + scanId, + accept, + context); + } + + /** + * 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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vulnerability assessment scan record of a Sql pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, scanId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vulnerability assessment scan record of a Sql pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public VulnerabilityAssessmentScanRecordInner get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId) { + return getAsync(resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, scanId).block(); + } + + /** + * 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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vulnerability assessment scan record of a Sql pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId, + Context context) { + return getWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, scanId, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of vulnerability assessment scan records. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of vulnerability assessment scan records. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentScansExportImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentScansExportImpl.java new file mode 100644 index 0000000000000..155f346e63bd6 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentScansExportImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolVulnerabilityAssessmentScansExportInner; +import com.azure.resourcemanager.synapse.models.SqlPoolVulnerabilityAssessmentScansExport; + +public final class SqlPoolVulnerabilityAssessmentScansExportImpl implements SqlPoolVulnerabilityAssessmentScansExport { + private SqlPoolVulnerabilityAssessmentScansExportInner innerObject; + + private final SynapseManager serviceManager; + + SqlPoolVulnerabilityAssessmentScansExportImpl( + SqlPoolVulnerabilityAssessmentScansExportInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String exportedReportLocation() { + return this.innerModel().exportedReportLocation(); + } + + public SqlPoolVulnerabilityAssessmentScansExportInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentScansImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentScansImpl.java new file mode 100644 index 0000000000000..4079bc085529b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentScansImpl.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.SqlPoolVulnerabilityAssessmentScansClient; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolVulnerabilityAssessmentScansExportInner; +import com.azure.resourcemanager.synapse.fluent.models.VulnerabilityAssessmentScanRecordInner; +import com.azure.resourcemanager.synapse.models.SqlPoolVulnerabilityAssessmentScans; +import com.azure.resourcemanager.synapse.models.SqlPoolVulnerabilityAssessmentScansExport; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentName; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentScanRecord; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SqlPoolVulnerabilityAssessmentScansImpl implements SqlPoolVulnerabilityAssessmentScans { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolVulnerabilityAssessmentScansImpl.class); + + private final SqlPoolVulnerabilityAssessmentScansClient innerClient; + + private final SynapseManager serviceManager; + + public SqlPoolVulnerabilityAssessmentScansImpl( + SqlPoolVulnerabilityAssessmentScansClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName); + return Utils.mapPage(inner, inner1 -> new VulnerabilityAssessmentScanRecordImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + Context context) { + PagedIterable inner = + this + .serviceClient() + .list(resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, context); + return Utils.mapPage(inner, inner1 -> new VulnerabilityAssessmentScanRecordImpl(inner1, this.manager())); + } + + public void initiateScan( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId) { + this + .serviceClient() + .initiateScan(resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, scanId); + } + + public void initiateScan( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId, + Context context) { + this + .serviceClient() + .initiateScan(resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, scanId, context); + } + + public SqlPoolVulnerabilityAssessmentScansExport export( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId) { + SqlPoolVulnerabilityAssessmentScansExportInner inner = + this + .serviceClient() + .export(resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, scanId); + if (inner != null) { + return new SqlPoolVulnerabilityAssessmentScansExportImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response exportWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId, + Context context) { + Response inner = + this + .serviceClient() + .exportWithResponse( + resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, scanId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SqlPoolVulnerabilityAssessmentScansExportImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public VulnerabilityAssessmentScanRecord get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId) { + VulnerabilityAssessmentScanRecordInner inner = + this + .serviceClient() + .get(resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, scanId); + if (inner != null) { + return new VulnerabilityAssessmentScanRecordImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, scanId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new VulnerabilityAssessmentScanRecordImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private SqlPoolVulnerabilityAssessmentScansClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentsClientImpl.java new file mode 100644 index 0000000000000..5fe7999caef7e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentsClientImpl.java @@ -0,0 +1,1033 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.SqlPoolVulnerabilityAssessmentsClient; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolVulnerabilityAssessmentInner; +import com.azure.resourcemanager.synapse.models.SqlPoolVulnerabilityAssessmentListResult; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentName; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SqlPoolVulnerabilityAssessmentsClient. */ +public final class SqlPoolVulnerabilityAssessmentsClientImpl implements SqlPoolVulnerabilityAssessmentsClient { + private final ClientLogger logger = new ClientLogger(SqlPoolVulnerabilityAssessmentsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SqlPoolVulnerabilityAssessmentsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of SqlPoolVulnerabilityAssessmentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlPoolVulnerabilityAssessmentsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + SqlPoolVulnerabilityAssessmentsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientSqlPoolVulnerabilityAssessments to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface SqlPoolVulnerabilityAssessmentsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/vulnerabilityAssessments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("vulnerabilityAssessmentName") VulnerabilityAssessmentName vulnerabilityAssessmentName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("vulnerabilityAssessmentName") VulnerabilityAssessmentName vulnerabilityAssessmentName, + @BodyParam("application/json") SqlPoolVulnerabilityAssessmentInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("vulnerabilityAssessmentName") VulnerabilityAssessmentName vulnerabilityAssessmentName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists the vulnerability assessment policies associated with 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the Sql pool's vulnerability assessments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists the vulnerability assessment policies associated with 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the Sql pool's vulnerability assessments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the vulnerability assessment policies associated with 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the Sql pool's vulnerability assessments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the vulnerability assessment policies associated with 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the Sql pool's vulnerability assessments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the vulnerability assessment policies associated with 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the Sql pool's vulnerability assessments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, sqlPoolName)); + } + + /** + * Lists the vulnerability assessment policies associated with 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the Sql pool's vulnerability assessments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, sqlPoolName, context)); + } + + /** + * Gets the Sql pool's vulnerability assessment. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Sql pool's vulnerability assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (vulnerabilityAssessmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vulnerabilityAssessmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets the Sql pool's vulnerability assessment. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Sql pool's vulnerability assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (vulnerabilityAssessmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vulnerabilityAssessmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + accept, + context); + } + + /** + * Gets the Sql pool's vulnerability assessment. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Sql pool's vulnerability assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the Sql pool's vulnerability assessment. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Sql pool's vulnerability assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlPoolVulnerabilityAssessmentInner get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName) { + return getAsync(resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName).block(); + } + + /** + * Gets the Sql pool's vulnerability assessment. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Sql pool's vulnerability assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, context) + .block(); + } + + /** + * Creates or updates the Sql pool vulnerability assessment. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param parameters The requested resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool vulnerability assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + SqlPoolVulnerabilityAssessmentInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (vulnerabilityAssessmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vulnerabilityAssessmentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates the Sql pool vulnerability assessment. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param parameters The requested resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool vulnerability assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + SqlPoolVulnerabilityAssessmentInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (vulnerabilityAssessmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vulnerabilityAssessmentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + parameters, + accept, + context); + } + + /** + * Creates or updates the Sql pool vulnerability assessment. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param parameters The requested resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool vulnerability assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + SqlPoolVulnerabilityAssessmentInner parameters) { + return createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates the Sql pool vulnerability assessment. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param parameters The requested resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool vulnerability assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlPoolVulnerabilityAssessmentInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + SqlPoolVulnerabilityAssessmentInner parameters) { + return createOrUpdateAsync( + resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, parameters) + .block(); + } + + /** + * Creates or updates the Sql pool vulnerability assessment. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param parameters The requested resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool vulnerability assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + SqlPoolVulnerabilityAssessmentInner parameters, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, parameters, context) + .block(); + } + + /** + * Removes the database's vulnerability assessment. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (vulnerabilityAssessmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vulnerabilityAssessmentName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Removes the database's vulnerability assessment. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (vulnerabilityAssessmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vulnerabilityAssessmentName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + vulnerabilityAssessmentName, + context); + } + + /** + * Removes the database's vulnerability assessment. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Removes the database's vulnerability assessment. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName) { + deleteAsync(resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName).block(); + } + + /** + * Removes the database's vulnerability assessment. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + Context context) { + return deleteWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, context) + .block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the Sql pool's vulnerability assessments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the Sql pool's vulnerability assessments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentsImpl.java new file mode 100644 index 0000000000000..ebe3a1f6158f0 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolVulnerabilityAssessmentsImpl.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.SqlPoolVulnerabilityAssessmentsClient; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolVulnerabilityAssessmentInner; +import com.azure.resourcemanager.synapse.models.SqlPoolVulnerabilityAssessment; +import com.azure.resourcemanager.synapse.models.SqlPoolVulnerabilityAssessments; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentName; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SqlPoolVulnerabilityAssessmentsImpl implements SqlPoolVulnerabilityAssessments { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolVulnerabilityAssessmentsImpl.class); + + private final SqlPoolVulnerabilityAssessmentsClient innerClient; + + private final SynapseManager serviceManager; + + public SqlPoolVulnerabilityAssessmentsImpl( + SqlPoolVulnerabilityAssessmentsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, sqlPoolName); + return Utils.mapPage(inner, inner1 -> new SqlPoolVulnerabilityAssessmentImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, sqlPoolName, context); + return Utils.mapPage(inner, inner1 -> new SqlPoolVulnerabilityAssessmentImpl(inner1, this.manager())); + } + + public SqlPoolVulnerabilityAssessment get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName) { + SqlPoolVulnerabilityAssessmentInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName); + if (inner != null) { + return new SqlPoolVulnerabilityAssessmentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SqlPoolVulnerabilityAssessmentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName) { + this.serviceClient().delete(resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName); + } + + public Response deleteWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, context); + } + + public SqlPoolVulnerabilityAssessment getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + VulnerabilityAssessmentName vulnerabilityAssessmentName = + VulnerabilityAssessmentName.fromString(Utils.getValueFromIdByName(id, "vulnerabilityAssessments")); + if (vulnerabilityAssessmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'vulnerabilityAssessments'.", + id))); + } + return this + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + VulnerabilityAssessmentName vulnerabilityAssessmentName = + VulnerabilityAssessmentName.fromString(Utils.getValueFromIdByName(id, "vulnerabilityAssessments")); + if (vulnerabilityAssessmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'vulnerabilityAssessments'.", + id))); + } + return this + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + VulnerabilityAssessmentName vulnerabilityAssessmentName = + VulnerabilityAssessmentName.fromString(Utils.getValueFromIdByName(id, "vulnerabilityAssessments")); + if (vulnerabilityAssessmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'vulnerabilityAssessments'.", + id))); + } + this + .deleteWithResponse( + resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, Context.NONE) + .getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + VulnerabilityAssessmentName vulnerabilityAssessmentName = + VulnerabilityAssessmentName.fromString(Utils.getValueFromIdByName(id, "vulnerabilityAssessments")); + if (vulnerabilityAssessmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'vulnerabilityAssessments'.", + id))); + } + return this + .deleteWithResponse(resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, context); + } + + private SqlPoolVulnerabilityAssessmentsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + public SqlPoolVulnerabilityAssessmentImpl define(VulnerabilityAssessmentName name) { + return new SqlPoolVulnerabilityAssessmentImpl(name, this.manager()); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolWorkloadClassifiersClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolWorkloadClassifiersClientImpl.java new file mode 100644 index 0000000000000..3a3bc8bfe91e3 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolWorkloadClassifiersClientImpl.java @@ -0,0 +1,1431 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.SqlPoolWorkloadClassifiersClient; +import com.azure.resourcemanager.synapse.fluent.models.WorkloadClassifierInner; +import com.azure.resourcemanager.synapse.models.WorkloadClassifierListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SqlPoolWorkloadClassifiersClient. */ +public final class SqlPoolWorkloadClassifiersClientImpl implements SqlPoolWorkloadClassifiersClient { + private final ClientLogger logger = new ClientLogger(SqlPoolWorkloadClassifiersClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SqlPoolWorkloadClassifiersService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of SqlPoolWorkloadClassifiersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlPoolWorkloadClassifiersClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + SqlPoolWorkloadClassifiersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientSqlPoolWorkloadClassifiers to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface SqlPoolWorkloadClassifiersService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/workloadGroups/{workloadGroupName}/workloadClassifiers" + + "/{workloadClassifierName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("workloadGroupName") String workloadGroupName, + @PathParam("workloadClassifierName") String workloadClassifierName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/workloadGroups/{workloadGroupName}/workloadClassifiers" + + "/{workloadClassifierName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("workloadGroupName") String workloadGroupName, + @PathParam("workloadClassifierName") String workloadClassifierName, + @BodyParam("application/json") WorkloadClassifierInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/workloadGroups/{workloadGroupName}/workloadClassifiers" + + "/{workloadClassifierName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("workloadGroupName") String workloadGroupName, + @PathParam("workloadClassifierName") String workloadClassifierName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/workloadGroups/{workloadGroupName}/workloadClassifiers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("workloadGroupName") String workloadGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get a workload classifier of Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workload classifier of Sql pool's workload group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (workloadGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadGroupName is required and cannot be null.")); + } + if (workloadClassifierName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadClassifierName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + workloadGroupName, + workloadClassifierName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get a workload classifier of Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workload classifier of Sql pool's workload group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (workloadGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadGroupName is required and cannot be null.")); + } + if (workloadClassifierName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadClassifierName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + workloadGroupName, + workloadClassifierName, + accept, + context); + } + + /** + * Get a workload classifier of Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workload classifier of Sql pool's workload group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName) { + return getWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, workloadClassifierName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a workload classifier of Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workload classifier of Sql pool's workload group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadClassifierInner get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName) { + return getAsync(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, workloadClassifierName) + .block(); + } + + /** + * Get a workload classifier of Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workload classifier of Sql pool's workload group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName, + Context context) { + return getWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, workloadClassifierName, context) + .block(); + } + + /** + * Create Or Update workload classifier for a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @param parameters The properties of the workload classifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workload classifier operations for a data warehouse. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName, + WorkloadClassifierInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (workloadGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadGroupName is required and cannot be null.")); + } + if (workloadClassifierName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadClassifierName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + workloadGroupName, + workloadClassifierName, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create Or Update workload classifier for a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @param parameters The properties of the workload classifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workload classifier operations for a data warehouse. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName, + WorkloadClassifierInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (workloadGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadGroupName is required and cannot be null.")); + } + if (workloadClassifierName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadClassifierName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + workloadGroupName, + workloadClassifierName, + parameters, + accept, + context); + } + + /** + * Create Or Update workload classifier for a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @param parameters The properties of the workload classifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workload classifier operations for a data warehouse. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadClassifierInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName, + WorkloadClassifierInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, workloadClassifierName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadClassifierInner.class, + WorkloadClassifierInner.class, + Context.NONE); + } + + /** + * Create Or Update workload classifier for a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @param parameters The properties of the workload classifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workload classifier operations for a data warehouse. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadClassifierInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName, + WorkloadClassifierInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + workspaceName, + sqlPoolName, + workloadGroupName, + workloadClassifierName, + parameters, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkloadClassifierInner.class, + WorkloadClassifierInner.class, + context); + } + + /** + * Create Or Update workload classifier for a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @param parameters The properties of the workload classifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workload classifier operations for a data warehouse. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadClassifierInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName, + WorkloadClassifierInner parameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, workloadClassifierName, parameters) + .getSyncPoller(); + } + + /** + * Create Or Update workload classifier for a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @param parameters The properties of the workload classifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workload classifier operations for a data warehouse. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadClassifierInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName, + WorkloadClassifierInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, + workspaceName, + sqlPoolName, + workloadGroupName, + workloadClassifierName, + parameters, + context) + .getSyncPoller(); + } + + /** + * Create Or Update workload classifier for a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @param parameters The properties of the workload classifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workload classifier operations for a data warehouse. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName, + WorkloadClassifierInner parameters) { + return beginCreateOrUpdateAsync( + resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, workloadClassifierName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Or Update workload classifier for a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @param parameters The properties of the workload classifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workload classifier operations for a data warehouse. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName, + WorkloadClassifierInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, + workspaceName, + sqlPoolName, + workloadGroupName, + workloadClassifierName, + parameters, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Or Update workload classifier for a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @param parameters The properties of the workload classifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workload classifier operations for a data warehouse. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadClassifierInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName, + WorkloadClassifierInner parameters) { + return createOrUpdateAsync( + resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, workloadClassifierName, parameters) + .block(); + } + + /** + * Create Or Update workload classifier for a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @param parameters The properties of the workload classifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workload classifier operations for a data warehouse. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadClassifierInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName, + WorkloadClassifierInner parameters, + Context context) { + return createOrUpdateAsync( + resourceGroupName, + workspaceName, + sqlPoolName, + workloadGroupName, + workloadClassifierName, + parameters, + context) + .block(); + } + + /** + * Remove workload classifier of a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (workloadGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadGroupName is required and cannot be null.")); + } + if (workloadClassifierName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadClassifierName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + workloadGroupName, + workloadClassifierName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Remove workload classifier of a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (workloadGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadGroupName is required and cannot be null.")); + } + if (workloadClassifierName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter workloadClassifierName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + workloadGroupName, + workloadClassifierName, + context); + } + + /** + * Remove workload classifier of a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName) { + Mono>> mono = + deleteWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, workloadClassifierName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Remove workload classifier of a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, workloadClassifierName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Remove workload classifier of a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName) { + return beginDeleteAsync( + resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, workloadClassifierName) + .getSyncPoller(); + } + + /** + * Remove workload classifier of a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName, + Context context) { + return beginDeleteAsync( + resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, workloadClassifierName, context) + .getSyncPoller(); + } + + /** + * Remove workload classifier of a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName) { + return beginDeleteAsync( + resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, workloadClassifierName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Remove workload classifier of a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName, + Context context) { + return beginDeleteAsync( + resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, workloadClassifierName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Remove workload classifier of a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName) { + deleteAsync(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, workloadClassifierName).block(); + } + + /** + * Remove workload classifier of a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName, + Context context) { + deleteAsync(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, workloadClassifierName, context) + .block(); + } + + /** + * Get list of Sql pool's workload classifier for workload groups. + * + * @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 workloadGroupName The name of the workload group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Sql pool's workload classifier for workload groups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (workloadGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + workloadGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get list of Sql pool's workload classifier for workload groups. + * + * @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 workloadGroupName The name of the workload group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Sql pool's workload classifier for workload groups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (workloadGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + workloadGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get list of Sql pool's workload classifier for workload groups. + * + * @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 workloadGroupName The name of the workload group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Sql pool's workload classifier for workload groups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get list of Sql pool's workload classifier for workload groups. + * + * @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 workloadGroupName The name of the workload group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Sql pool's workload classifier for workload groups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get list of Sql pool's workload classifier for workload groups. + * + * @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 workloadGroupName The name of the workload group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Sql pool's workload classifier for workload groups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName)); + } + + /** + * Get list of Sql pool's workload classifier for workload groups. + * + * @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 workloadGroupName The name of the workload group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Sql pool's workload classifier for workload groups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName, Context context) { + return new PagedIterable<>( + listAsync(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of workload classifiers for a workload group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of workload classifiers for a workload group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolWorkloadClassifiersImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolWorkloadClassifiersImpl.java new file mode 100644 index 0000000000000..679d169846acb --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolWorkloadClassifiersImpl.java @@ -0,0 +1,298 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.SqlPoolWorkloadClassifiersClient; +import com.azure.resourcemanager.synapse.fluent.models.WorkloadClassifierInner; +import com.azure.resourcemanager.synapse.models.SqlPoolWorkloadClassifiers; +import com.azure.resourcemanager.synapse.models.WorkloadClassifier; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SqlPoolWorkloadClassifiersImpl implements SqlPoolWorkloadClassifiers { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolWorkloadClassifiersImpl.class); + + private final SqlPoolWorkloadClassifiersClient innerClient; + + private final SynapseManager serviceManager; + + public SqlPoolWorkloadClassifiersImpl(SqlPoolWorkloadClassifiersClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public WorkloadClassifier get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName) { + WorkloadClassifierInner inner = + this + .serviceClient() + .get(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, workloadClassifierName); + if (inner != null) { + return new WorkloadClassifierImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse( + resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, workloadClassifierName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WorkloadClassifierImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName) { + this + .serviceClient() + .delete(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, workloadClassifierName); + } + + public void delete( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName, + Context context) { + this + .serviceClient() + .delete(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, workloadClassifierName, context); + } + + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName); + return Utils.mapPage(inner, inner1 -> new WorkloadClassifierImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, context); + return Utils.mapPage(inner, inner1 -> new WorkloadClassifierImpl(inner1, this.manager())); + } + + public WorkloadClassifier getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + String workloadGroupName = Utils.getValueFromIdByName(id, "workloadGroups"); + if (workloadGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'workloadGroups'.", id))); + } + String workloadClassifierName = Utils.getValueFromIdByName(id, "workloadClassifiers"); + if (workloadClassifierName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'workloadClassifiers'.", id))); + } + return this + .getWithResponse( + resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, workloadClassifierName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + String workloadGroupName = Utils.getValueFromIdByName(id, "workloadGroups"); + if (workloadGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'workloadGroups'.", id))); + } + String workloadClassifierName = Utils.getValueFromIdByName(id, "workloadClassifiers"); + if (workloadClassifierName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'workloadClassifiers'.", id))); + } + return this + .getWithResponse( + resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, workloadClassifierName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + String workloadGroupName = Utils.getValueFromIdByName(id, "workloadGroups"); + if (workloadGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'workloadGroups'.", id))); + } + String workloadClassifierName = Utils.getValueFromIdByName(id, "workloadClassifiers"); + if (workloadClassifierName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'workloadClassifiers'.", id))); + } + this + .delete( + resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, workloadClassifierName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + String workloadGroupName = Utils.getValueFromIdByName(id, "workloadGroups"); + if (workloadGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'workloadGroups'.", id))); + } + String workloadClassifierName = Utils.getValueFromIdByName(id, "workloadClassifiers"); + if (workloadClassifierName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'workloadClassifiers'.", id))); + } + this.delete(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, workloadClassifierName, context); + } + + private SqlPoolWorkloadClassifiersClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + public WorkloadClassifierImpl define(String name) { + return new WorkloadClassifierImpl(name, this.manager()); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolWorkloadGroupsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolWorkloadGroupsClientImpl.java new file mode 100644 index 0000000000000..cc3d6055ac3e9 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolWorkloadGroupsClientImpl.java @@ -0,0 +1,1219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.SqlPoolWorkloadGroupsClient; +import com.azure.resourcemanager.synapse.fluent.models.WorkloadGroupInner; +import com.azure.resourcemanager.synapse.models.WorkloadGroupListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SqlPoolWorkloadGroupsClient. */ +public final class SqlPoolWorkloadGroupsClientImpl implements SqlPoolWorkloadGroupsClient { + private final ClientLogger logger = new ClientLogger(SqlPoolWorkloadGroupsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SqlPoolWorkloadGroupsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of SqlPoolWorkloadGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlPoolWorkloadGroupsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create(SqlPoolWorkloadGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientSqlPoolWorkloadGroups to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface SqlPoolWorkloadGroupsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/workloadGroups/{workloadGroupName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("workloadGroupName") String workloadGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/workloadGroups/{workloadGroupName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("workloadGroupName") String workloadGroupName, + @BodyParam("application/json") WorkloadGroupInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/workloadGroups/{workloadGroupName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @PathParam("workloadGroupName") String workloadGroupName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/workloadGroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's workload group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (workloadGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + workloadGroupName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's workload group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (workloadGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + workloadGroupName, + accept, + context); + } + + /** + * Get a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's workload group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's workload group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadGroupInner get( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName) { + return getAsync(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName).block(); + } + + /** + * Get a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's workload group. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, context).block(); + } + + /** + * Create Or Update a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param parameters The requested workload group state. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workload group operations for a sql pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + WorkloadGroupInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (workloadGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadGroupName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + workloadGroupName, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create Or Update a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param parameters The requested workload group state. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workload group operations for a sql pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + WorkloadGroupInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (workloadGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadGroupName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + workloadGroupName, + parameters, + accept, + context); + } + + /** + * Create Or Update a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param parameters The requested workload group state. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workload group operations for a sql pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadGroupInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + WorkloadGroupInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), WorkloadGroupInner.class, WorkloadGroupInner.class, Context.NONE); + } + + /** + * Create Or Update a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param parameters The requested workload group state. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workload group operations for a sql pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkloadGroupInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + WorkloadGroupInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), WorkloadGroupInner.class, WorkloadGroupInner.class, context); + } + + /** + * Create Or Update a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param parameters The requested workload group state. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workload group operations for a sql pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadGroupInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + WorkloadGroupInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, parameters) + .getSyncPoller(); + } + + /** + * Create Or Update a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param parameters The requested workload group state. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workload group operations for a sql pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkloadGroupInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + WorkloadGroupInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, parameters, context) + .getSyncPoller(); + } + + /** + * Create Or Update a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param parameters The requested workload group state. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workload group operations for a sql pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + WorkloadGroupInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Or Update a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param parameters The requested workload group state. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workload group operations for a sql pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + WorkloadGroupInner parameters, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create Or Update a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param parameters The requested workload group state. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workload group operations for a sql pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadGroupInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + WorkloadGroupInner parameters) { + return createOrUpdateAsync(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, parameters) + .block(); + } + + /** + * Create Or Update a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param parameters The requested workload group state. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workload group operations for a sql pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkloadGroupInner createOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + WorkloadGroupInner parameters, + Context context) { + return createOrUpdateAsync( + resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, parameters, context) + .block(); + } + + /** + * Remove Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (workloadGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadGroupName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + workloadGroupName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Remove Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (workloadGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter workloadGroupName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + workloadGroupName, + context); + } + + /** + * Remove Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Remove Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Remove Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName) { + return beginDeleteAsync(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName).getSyncPoller(); + } + + /** + * Remove Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, context) + .getSyncPoller(); + } + + /** + * Remove Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName) { + return beginDeleteAsync(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Remove Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Remove Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName) { + deleteAsync(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName).block(); + } + + /** + * Remove Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName, Context context) { + deleteAsync(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, context).block(); + } + + /** + * Get list of Sql pool's workload groups. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Sql pool's workload groups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get list of Sql pool's workload groups. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Sql pool's workload groups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get list of Sql pool's workload groups. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Sql pool's workload groups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get list of Sql pool's workload groups. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Sql pool's workload groups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, sqlPoolName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get list of Sql pool's workload groups. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Sql pool's workload groups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, String sqlPoolName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, sqlPoolName)); + } + + /** + * Get list of Sql pool's workload groups. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Sql pool's workload groups. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, sqlPoolName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of workload groups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of workload groups. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolWorkloadGroupsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolWorkloadGroupsImpl.java new file mode 100644 index 0000000000000..b2d60c5f3f077 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolWorkloadGroupsImpl.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.SqlPoolWorkloadGroupsClient; +import com.azure.resourcemanager.synapse.fluent.models.WorkloadGroupInner; +import com.azure.resourcemanager.synapse.models.SqlPoolWorkloadGroups; +import com.azure.resourcemanager.synapse.models.WorkloadGroup; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SqlPoolWorkloadGroupsImpl implements SqlPoolWorkloadGroups { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolWorkloadGroupsImpl.class); + + private final SqlPoolWorkloadGroupsClient innerClient; + + private final SynapseManager serviceManager; + + public SqlPoolWorkloadGroupsImpl(SqlPoolWorkloadGroupsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public WorkloadGroup get( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName) { + WorkloadGroupInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName); + if (inner != null) { + return new WorkloadGroupImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WorkloadGroupImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName) { + this.serviceClient().delete(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName); + } + + public void delete( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName, Context context) { + this.serviceClient().delete(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, context); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, String sqlPoolName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, sqlPoolName); + return Utils.mapPage(inner, inner1 -> new WorkloadGroupImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, sqlPoolName, context); + return Utils.mapPage(inner, inner1 -> new WorkloadGroupImpl(inner1, this.manager())); + } + + public WorkloadGroup getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + String workloadGroupName = Utils.getValueFromIdByName(id, "workloadGroups"); + if (workloadGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'workloadGroups'.", id))); + } + return this + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + String workloadGroupName = Utils.getValueFromIdByName(id, "workloadGroups"); + if (workloadGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'workloadGroups'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + String workloadGroupName = Utils.getValueFromIdByName(id, "workloadGroups"); + if (workloadGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'workloadGroups'.", id))); + } + this.delete(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + String workloadGroupName = Utils.getValueFromIdByName(id, "workloadGroups"); + if (workloadGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'workloadGroups'.", id))); + } + this.delete(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, context); + } + + private SqlPoolWorkloadGroupsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + public WorkloadGroupImpl define(String name) { + return new WorkloadGroupImpl(name, this.manager()); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolsClientImpl.java new file mode 100644 index 0000000000000..e2a906e845f6d --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolsClientImpl.java @@ -0,0 +1,2034 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.SqlPoolsClient; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolInner; +import com.azure.resourcemanager.synapse.models.ResourceMoveDefinition; +import com.azure.resourcemanager.synapse.models.SqlPoolInfoListResult; +import com.azure.resourcemanager.synapse.models.SqlPoolPatchInfo; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SqlPoolsClient. */ +public final class SqlPoolsClientImpl implements SqlPoolsClient { + private final ClientLogger logger = new ClientLogger(SqlPoolsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SqlPoolsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of SqlPoolsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SqlPoolsClientImpl(SynapseManagementClientImpl client) { + this.service = RestProxy.create(SqlPoolsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientSqlPools to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface SqlPoolsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @BodyParam("application/json") SqlPoolPatchInfo sqlPoolInfo, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}") + @ExpectedResponses({200, 202, 404}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @BodyParam("application/json") SqlPoolInner sqlPoolInfo, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspace( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/pause") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> pause( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/resume") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> resume( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlPools/{sqlPoolName}/move") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> rename( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @BodyParam("application/json") ResourceMoveDefinition parameters, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspaceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get SQL pool properties. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get SQL pool properties. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context); + } + + /** + * Get SQL pool properties. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String sqlPoolName) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get SQL pool properties. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlPoolInner get(String resourceGroupName, String workspaceName, String sqlPoolName) { + return getAsync(resourceGroupName, workspaceName, sqlPoolName).block(); + } + + /** + * Get SQL pool properties. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, context).block(); + } + + /** + * Apply a partial update to 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 sqlPoolInfo The updated SQL pool properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Analytics pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, SqlPoolPatchInfo sqlPoolInfo) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (sqlPoolInfo == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolInfo is required and cannot be null.")); + } else { + sqlPoolInfo.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + sqlPoolInfo, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Apply a partial update to 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 sqlPoolInfo The updated SQL pool properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Analytics pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + SqlPoolPatchInfo sqlPoolInfo, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (sqlPoolInfo == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolInfo is required and cannot be null.")); + } else { + sqlPoolInfo.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + sqlPoolInfo, + accept, + context); + } + + /** + * Apply a partial update to 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 sqlPoolInfo The updated SQL pool properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Analytics pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, SqlPoolPatchInfo sqlPoolInfo) { + return updateWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, sqlPoolInfo) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Apply a partial update to 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 sqlPoolInfo The updated SQL pool properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Analytics pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlPoolInner update( + String resourceGroupName, String workspaceName, String sqlPoolName, SqlPoolPatchInfo sqlPoolInfo) { + return updateAsync(resourceGroupName, workspaceName, sqlPoolName, sqlPoolInfo).block(); + } + + /** + * Apply a partial update to 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 sqlPoolInfo The updated SQL pool properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Analytics pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + SqlPoolPatchInfo sqlPoolInfo, + Context context) { + return updateWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, sqlPoolInfo, context).block(); + } + + /** + * Create 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 sqlPoolInfo The SQL pool to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Analytics pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, SqlPoolInner sqlPoolInfo) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (sqlPoolInfo == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolInfo is required and cannot be null.")); + } else { + sqlPoolInfo.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + sqlPoolInfo, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create 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 sqlPoolInfo The SQL pool to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Analytics pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, SqlPoolInner sqlPoolInfo, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (sqlPoolInfo == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolInfo is required and cannot be null.")); + } else { + sqlPoolInfo.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + sqlPoolInfo, + accept, + context); + } + + /** + * Create 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 sqlPoolInfo The SQL pool to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Analytics pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SqlPoolInner> beginCreateAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, SqlPoolInner sqlPoolInfo) { + Mono>> mono = + createWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, sqlPoolInfo); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SqlPoolInner.class, SqlPoolInner.class, Context.NONE); + } + + /** + * Create 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 sqlPoolInfo The SQL pool to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Analytics pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SqlPoolInner> beginCreateAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, SqlPoolInner sqlPoolInfo, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, sqlPoolInfo, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SqlPoolInner.class, SqlPoolInner.class, context); + } + + /** + * Create 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 sqlPoolInfo The SQL pool to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Analytics pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SqlPoolInner> beginCreate( + String resourceGroupName, String workspaceName, String sqlPoolName, SqlPoolInner sqlPoolInfo) { + return beginCreateAsync(resourceGroupName, workspaceName, sqlPoolName, sqlPoolInfo).getSyncPoller(); + } + + /** + * Create 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 sqlPoolInfo The SQL pool to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Analytics pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SqlPoolInner> beginCreate( + String resourceGroupName, String workspaceName, String sqlPoolName, SqlPoolInner sqlPoolInfo, Context context) { + return beginCreateAsync(resourceGroupName, workspaceName, sqlPoolName, sqlPoolInfo, context).getSyncPoller(); + } + + /** + * Create 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 sqlPoolInfo The SQL pool to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Analytics pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, SqlPoolInner sqlPoolInfo) { + return beginCreateAsync(resourceGroupName, workspaceName, sqlPoolName, sqlPoolInfo) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create 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 sqlPoolInfo The SQL pool to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Analytics pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, SqlPoolInner sqlPoolInfo, Context context) { + return beginCreateAsync(resourceGroupName, workspaceName, sqlPoolName, sqlPoolInfo, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create 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 sqlPoolInfo The SQL pool to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Analytics pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlPoolInner create( + String resourceGroupName, String workspaceName, String sqlPoolName, SqlPoolInner sqlPoolInfo) { + return createAsync(resourceGroupName, workspaceName, sqlPoolName, sqlPoolInfo).block(); + } + + /** + * Create 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 sqlPoolInfo The SQL pool to create. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL Analytics pool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SqlPoolInner create( + String resourceGroupName, String workspaceName, String sqlPoolName, SqlPoolInner sqlPoolInfo, Context context) { + return createAsync(resourceGroupName, workspaceName, sqlPoolName, sqlPoolInfo, context).block(); + } + + /** + * Delete 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Delete 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context); + } + + /** + * Delete 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Object> beginDeleteAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Object.class, Object.class, Context.NONE); + } + + /** + * Delete 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Object> beginDeleteAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Object.class, Object.class, context); + } + + /** + * Delete 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginDelete( + String resourceGroupName, String workspaceName, String sqlPoolName) { + return beginDeleteAsync(resourceGroupName, workspaceName, sqlPoolName).getSyncPoller(); + } + + /** + * Delete 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginDelete( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, sqlPoolName, context).getSyncPoller(); + } + + /** + * Delete 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, String sqlPoolName) { + return beginDeleteAsync(resourceGroupName, workspaceName, sqlPoolName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, sqlPoolName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Object delete(String resourceGroupName, String workspaceName, String sqlPoolName) { + return deleteAsync(resourceGroupName, workspaceName, sqlPoolName).block(); + } + + /** + * Delete 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Object delete(String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return deleteAsync(resourceGroupName, workspaceName, sqlPoolName, context).block(); + } + + /** + * List all SQL pools. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pools. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceSinglePageAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByWorkspace( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * List all SQL pools. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pools. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByWorkspace( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List all SQL pools. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); + } + + /** + * List all SQL pools. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync( + String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink, context)); + } + + /** + * List all SQL pools. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName)); + } + + /** + * List all SQL pools. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pools. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Pause 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> pauseWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .pause( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Pause 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> pauseWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .pause( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context); + } + + /** + * Pause 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Object> beginPauseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + Mono>> mono = pauseWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Object.class, Object.class, Context.NONE); + } + + /** + * Pause 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Object> beginPauseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + pauseWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Object.class, Object.class, context); + } + + /** + * Pause 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginPause( + String resourceGroupName, String workspaceName, String sqlPoolName) { + return beginPauseAsync(resourceGroupName, workspaceName, sqlPoolName).getSyncPoller(); + } + + /** + * Pause 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginPause( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return beginPauseAsync(resourceGroupName, workspaceName, sqlPoolName, context).getSyncPoller(); + } + + /** + * Pause 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono pauseAsync(String resourceGroupName, String workspaceName, String sqlPoolName) { + return beginPauseAsync(resourceGroupName, workspaceName, sqlPoolName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Pause 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono pauseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return beginPauseAsync(resourceGroupName, workspaceName, sqlPoolName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Pause 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Object pause(String resourceGroupName, String workspaceName, String sqlPoolName) { + return pauseAsync(resourceGroupName, workspaceName, sqlPoolName).block(); + } + + /** + * Pause 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Object pause(String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return pauseAsync(resourceGroupName, workspaceName, sqlPoolName, context).block(); + } + + /** + * Resume 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resumeWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .resume( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Resume 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> resumeWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .resume( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context); + } + + /** + * Resume 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Object> beginResumeAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + Mono>> mono = resumeWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Object.class, Object.class, Context.NONE); + } + + /** + * Resume 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Object> beginResumeAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + resumeWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Object.class, Object.class, context); + } + + /** + * Resume 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginResume( + String resourceGroupName, String workspaceName, String sqlPoolName) { + return beginResumeAsync(resourceGroupName, workspaceName, sqlPoolName).getSyncPoller(); + } + + /** + * Resume 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginResume( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return beginResumeAsync(resourceGroupName, workspaceName, sqlPoolName, context).getSyncPoller(); + } + + /** + * Resume 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resumeAsync(String resourceGroupName, String workspaceName, String sqlPoolName) { + return beginResumeAsync(resourceGroupName, workspaceName, sqlPoolName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resume 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resumeAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return beginResumeAsync(resourceGroupName, workspaceName, sqlPoolName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Resume 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Object resume(String resourceGroupName, String workspaceName, String sqlPoolName) { + return resumeAsync(resourceGroupName, workspaceName, sqlPoolName).block(); + } + + /** + * Resume 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Object resume(String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return resumeAsync(resourceGroupName, workspaceName, sqlPoolName, context).block(); + } + + /** + * Rename 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 parameters The resource move definition for renaming this Sql pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> renameWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, ResourceMoveDefinition parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + return FluxUtil + .withContext( + context -> + service + .rename( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + parameters, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Rename 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 parameters The resource move definition for renaming this Sql pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> renameWithResponseAsync( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + ResourceMoveDefinition parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + context = this.client.mergeContext(context); + return service + .rename( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + parameters, + context); + } + + /** + * Rename 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 parameters The resource move definition for renaming this Sql pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono renameAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, ResourceMoveDefinition parameters) { + return renameWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, parameters) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Rename 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 parameters The resource move definition for renaming this Sql pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void rename( + String resourceGroupName, String workspaceName, String sqlPoolName, ResourceMoveDefinition parameters) { + renameAsync(resourceGroupName, workspaceName, sqlPoolName, parameters).block(); + } + + /** + * Rename 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 parameters The resource move definition for renaming this Sql pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response renameWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + ResourceMoveDefinition parameters, + Context context) { + return renameWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, parameters, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pools. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pools. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolsImpl.java new file mode 100644 index 0000000000000..2d56c724d154b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SqlPoolsImpl.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.SqlPoolsClient; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolInner; +import com.azure.resourcemanager.synapse.models.ResourceMoveDefinition; +import com.azure.resourcemanager.synapse.models.SqlPool; +import com.azure.resourcemanager.synapse.models.SqlPools; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SqlPoolsImpl implements SqlPools { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolsImpl.class); + + private final SqlPoolsClient innerClient; + + private final SynapseManager serviceManager; + + public SqlPoolsImpl(SqlPoolsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public SqlPool get(String resourceGroupName, String workspaceName, String sqlPoolName) { + SqlPoolInner inner = this.serviceClient().get(resourceGroupName, workspaceName, sqlPoolName); + if (inner != null) { + return new SqlPoolImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, sqlPoolName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SqlPoolImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Object delete(String resourceGroupName, String workspaceName, String sqlPoolName) { + return this.serviceClient().delete(resourceGroupName, workspaceName, sqlPoolName); + } + + public Object delete(String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return this.serviceClient().delete(resourceGroupName, workspaceName, sqlPoolName, context); + } + + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().listByWorkspace(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new SqlPoolImpl(inner1, this.manager())); + } + + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = + this.serviceClient().listByWorkspace(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new SqlPoolImpl(inner1, this.manager())); + } + + public Object pause(String resourceGroupName, String workspaceName, String sqlPoolName) { + return this.serviceClient().pause(resourceGroupName, workspaceName, sqlPoolName); + } + + public Object pause(String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return this.serviceClient().pause(resourceGroupName, workspaceName, sqlPoolName, context); + } + + public Object resume(String resourceGroupName, String workspaceName, String sqlPoolName) { + return this.serviceClient().resume(resourceGroupName, workspaceName, sqlPoolName); + } + + public Object resume(String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return this.serviceClient().resume(resourceGroupName, workspaceName, sqlPoolName, context); + } + + public void rename( + String resourceGroupName, String workspaceName, String sqlPoolName, ResourceMoveDefinition parameters) { + this.serviceClient().rename(resourceGroupName, workspaceName, sqlPoolName, parameters); + } + + public Response renameWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + ResourceMoveDefinition parameters, + Context context) { + return this + .serviceClient() + .renameWithResponse(resourceGroupName, workspaceName, sqlPoolName, parameters, context); + } + + public SqlPool getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, sqlPoolName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, sqlPoolName, context); + } + + public Object deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + return this.delete(resourceGroupName, workspaceName, sqlPoolName, Context.NONE); + } + + public Object deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools"); + if (sqlPoolName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id))); + } + return this.delete(resourceGroupName, workspaceName, sqlPoolName, context); + } + + private SqlPoolsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + public SqlPoolImpl define(String name) { + return new SqlPoolImpl(name, this.manager()); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SsisObjectMetadataListResponseImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SsisObjectMetadataListResponseImpl.java new file mode 100644 index 0000000000000..f352dfaf080ef --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SsisObjectMetadataListResponseImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.SsisObjectMetadataListResponseInner; +import com.azure.resourcemanager.synapse.models.SsisObjectMetadata; +import com.azure.resourcemanager.synapse.models.SsisObjectMetadataListResponse; +import java.util.Collections; +import java.util.List; + +public final class SsisObjectMetadataListResponseImpl implements SsisObjectMetadataListResponse { + private SsisObjectMetadataListResponseInner innerObject; + + private final SynapseManager serviceManager; + + SsisObjectMetadataListResponseImpl(SsisObjectMetadataListResponseInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public SsisObjectMetadataListResponseInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SsisObjectMetadataStatusResponseImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SsisObjectMetadataStatusResponseImpl.java new file mode 100644 index 0000000000000..fef36fe3dc02d --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SsisObjectMetadataStatusResponseImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.SsisObjectMetadataStatusResponseInner; +import com.azure.resourcemanager.synapse.models.SsisObjectMetadataStatusResponse; + +public final class SsisObjectMetadataStatusResponseImpl implements SsisObjectMetadataStatusResponse { + private SsisObjectMetadataStatusResponseInner innerObject; + + private final SynapseManager serviceManager; + + SsisObjectMetadataStatusResponseImpl( + SsisObjectMetadataStatusResponseInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String status() { + return this.innerModel().status(); + } + + public String name() { + return this.innerModel().name(); + } + + public String properties() { + return this.innerModel().properties(); + } + + public String error() { + return this.innerModel().error(); + } + + public SsisObjectMetadataStatusResponseInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SynapseManagementClientBuilder.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SynapseManagementClientBuilder.java new file mode 100644 index 0000000000000..32531c3b91364 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SynapseManagementClientBuilder.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the SynapseManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {SynapseManagementClientImpl.class}) +public final class SynapseManagementClientBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the SynapseManagementClientBuilder. + */ + public SynapseManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the SynapseManagementClientBuilder. + */ + public SynapseManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the SynapseManagementClientBuilder. + */ + public SynapseManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the SynapseManagementClientBuilder. + */ + public SynapseManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the SynapseManagementClientBuilder. + */ + public SynapseManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the SynapseManagementClientBuilder. + */ + public SynapseManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of SynapseManagementClientImpl with the provided parameters. + * + * @return an instance of SynapseManagementClientImpl. + */ + public SynapseManagementClientImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + SynapseManagementClientImpl client = + new SynapseManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SynapseManagementClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SynapseManagementClientImpl.java new file mode 100644 index 0000000000000..7393de1d17206 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/SynapseManagementClientImpl.java @@ -0,0 +1,1145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.synapse.fluent.BigDataPoolsClient; +import com.azure.resourcemanager.synapse.fluent.DataMaskingPoliciesClient; +import com.azure.resourcemanager.synapse.fluent.DataMaskingRulesClient; +import com.azure.resourcemanager.synapse.fluent.ExtendedSqlPoolBlobAuditingPoliciesClient; +import com.azure.resourcemanager.synapse.fluent.IntegrationRuntimeAuthKeysOperationsClient; +import com.azure.resourcemanager.synapse.fluent.IntegrationRuntimeConnectionInfosClient; +import com.azure.resourcemanager.synapse.fluent.IntegrationRuntimeCredentialsClient; +import com.azure.resourcemanager.synapse.fluent.IntegrationRuntimeMonitoringDatasClient; +import com.azure.resourcemanager.synapse.fluent.IntegrationRuntimeNodeIpAddressOperationsClient; +import com.azure.resourcemanager.synapse.fluent.IntegrationRuntimeNodesClient; +import com.azure.resourcemanager.synapse.fluent.IntegrationRuntimeObjectMetadatasClient; +import com.azure.resourcemanager.synapse.fluent.IntegrationRuntimeStatusOperationsClient; +import com.azure.resourcemanager.synapse.fluent.IntegrationRuntimesClient; +import com.azure.resourcemanager.synapse.fluent.IpFirewallRulesClient; +import com.azure.resourcemanager.synapse.fluent.KeysClient; +import com.azure.resourcemanager.synapse.fluent.LibrariesClient; +import com.azure.resourcemanager.synapse.fluent.LibrariesOperationsClient; +import com.azure.resourcemanager.synapse.fluent.OperationsClient; +import com.azure.resourcemanager.synapse.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.synapse.fluent.PrivateEndpointConnectionsPrivateLinkHubsClient; +import com.azure.resourcemanager.synapse.fluent.PrivateLinkHubPrivateLinkResourcesClient; +import com.azure.resourcemanager.synapse.fluent.PrivateLinkHubsClient; +import com.azure.resourcemanager.synapse.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.synapse.fluent.RestorableDroppedSqlPoolsClient; +import com.azure.resourcemanager.synapse.fluent.SqlPoolBlobAuditingPoliciesClient; +import com.azure.resourcemanager.synapse.fluent.SqlPoolColumnsClient; +import com.azure.resourcemanager.synapse.fluent.SqlPoolConnectionPoliciesClient; +import com.azure.resourcemanager.synapse.fluent.SqlPoolDataWarehouseUserActivitiesClient; +import com.azure.resourcemanager.synapse.fluent.SqlPoolGeoBackupPoliciesClient; +import com.azure.resourcemanager.synapse.fluent.SqlPoolMaintenanceWindowOptionsClient; +import com.azure.resourcemanager.synapse.fluent.SqlPoolMaintenanceWindowsClient; +import com.azure.resourcemanager.synapse.fluent.SqlPoolMetadataSyncConfigsClient; +import com.azure.resourcemanager.synapse.fluent.SqlPoolOperationResultsClient; +import com.azure.resourcemanager.synapse.fluent.SqlPoolOperationsClient; +import com.azure.resourcemanager.synapse.fluent.SqlPoolRecommendedSensitivityLabelsClient; +import com.azure.resourcemanager.synapse.fluent.SqlPoolReplicationLinksClient; +import com.azure.resourcemanager.synapse.fluent.SqlPoolRestorePointsClient; +import com.azure.resourcemanager.synapse.fluent.SqlPoolSchemasClient; +import com.azure.resourcemanager.synapse.fluent.SqlPoolSecurityAlertPoliciesClient; +import com.azure.resourcemanager.synapse.fluent.SqlPoolSensitivityLabelsClient; +import com.azure.resourcemanager.synapse.fluent.SqlPoolTableColumnsClient; +import com.azure.resourcemanager.synapse.fluent.SqlPoolTablesClient; +import com.azure.resourcemanager.synapse.fluent.SqlPoolTransparentDataEncryptionsClient; +import com.azure.resourcemanager.synapse.fluent.SqlPoolUsagesClient; +import com.azure.resourcemanager.synapse.fluent.SqlPoolVulnerabilityAssessmentRuleBaselinesClient; +import com.azure.resourcemanager.synapse.fluent.SqlPoolVulnerabilityAssessmentScansClient; +import com.azure.resourcemanager.synapse.fluent.SqlPoolVulnerabilityAssessmentsClient; +import com.azure.resourcemanager.synapse.fluent.SqlPoolWorkloadClassifiersClient; +import com.azure.resourcemanager.synapse.fluent.SqlPoolWorkloadGroupsClient; +import com.azure.resourcemanager.synapse.fluent.SqlPoolsClient; +import com.azure.resourcemanager.synapse.fluent.SynapseManagementClient; +import com.azure.resourcemanager.synapse.fluent.WorkspaceAadAdminsClient; +import com.azure.resourcemanager.synapse.fluent.WorkspaceManagedIdentitySqlControlSettingsClient; +import com.azure.resourcemanager.synapse.fluent.WorkspaceManagedSqlServerBlobAuditingPoliciesClient; +import com.azure.resourcemanager.synapse.fluent.WorkspaceManagedSqlServerEncryptionProtectorsClient; +import com.azure.resourcemanager.synapse.fluent.WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClient; +import com.azure.resourcemanager.synapse.fluent.WorkspaceManagedSqlServerRecoverableSqlPoolsClient; +import com.azure.resourcemanager.synapse.fluent.WorkspaceManagedSqlServerSecurityAlertPoliciesClient; +import com.azure.resourcemanager.synapse.fluent.WorkspaceManagedSqlServerUsagesClient; +import com.azure.resourcemanager.synapse.fluent.WorkspaceManagedSqlServerVulnerabilityAssessmentsClient; +import com.azure.resourcemanager.synapse.fluent.WorkspaceSqlAadAdminsClient; +import com.azure.resourcemanager.synapse.fluent.WorkspacesClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the SynapseManagementClientImpl type. */ +@ServiceClient(builder = SynapseManagementClientBuilder.class) +public final class SynapseManagementClientImpl implements SynapseManagementClient { + private final ClientLogger logger = new ClientLogger(SynapseManagementClientImpl.class); + + /** The ID of the target subscription. */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The BigDataPoolsClient object to access its operations. */ + private final BigDataPoolsClient bigDataPools; + + /** + * Gets the BigDataPoolsClient object to access its operations. + * + * @return the BigDataPoolsClient object. + */ + public BigDataPoolsClient getBigDataPools() { + return this.bigDataPools; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The IpFirewallRulesClient object to access its operations. */ + private final IpFirewallRulesClient ipFirewallRules; + + /** + * Gets the IpFirewallRulesClient object to access its operations. + * + * @return the IpFirewallRulesClient object. + */ + public IpFirewallRulesClient getIpFirewallRules() { + return this.ipFirewallRules; + } + + /** The SqlPoolsClient object to access its operations. */ + private final SqlPoolsClient sqlPools; + + /** + * Gets the SqlPoolsClient object to access its operations. + * + * @return the SqlPoolsClient object. + */ + public SqlPoolsClient getSqlPools() { + return this.sqlPools; + } + + /** The SqlPoolMetadataSyncConfigsClient object to access its operations. */ + private final SqlPoolMetadataSyncConfigsClient sqlPoolMetadataSyncConfigs; + + /** + * Gets the SqlPoolMetadataSyncConfigsClient object to access its operations. + * + * @return the SqlPoolMetadataSyncConfigsClient object. + */ + public SqlPoolMetadataSyncConfigsClient getSqlPoolMetadataSyncConfigs() { + return this.sqlPoolMetadataSyncConfigs; + } + + /** The SqlPoolOperationResultsClient object to access its operations. */ + private final SqlPoolOperationResultsClient sqlPoolOperationResults; + + /** + * Gets the SqlPoolOperationResultsClient object to access its operations. + * + * @return the SqlPoolOperationResultsClient object. + */ + public SqlPoolOperationResultsClient getSqlPoolOperationResults() { + return this.sqlPoolOperationResults; + } + + /** The SqlPoolGeoBackupPoliciesClient object to access its operations. */ + private final SqlPoolGeoBackupPoliciesClient sqlPoolGeoBackupPolicies; + + /** + * Gets the SqlPoolGeoBackupPoliciesClient object to access its operations. + * + * @return the SqlPoolGeoBackupPoliciesClient object. + */ + public SqlPoolGeoBackupPoliciesClient getSqlPoolGeoBackupPolicies() { + return this.sqlPoolGeoBackupPolicies; + } + + /** The SqlPoolDataWarehouseUserActivitiesClient object to access its operations. */ + private final SqlPoolDataWarehouseUserActivitiesClient sqlPoolDataWarehouseUserActivities; + + /** + * Gets the SqlPoolDataWarehouseUserActivitiesClient object to access its operations. + * + * @return the SqlPoolDataWarehouseUserActivitiesClient object. + */ + public SqlPoolDataWarehouseUserActivitiesClient getSqlPoolDataWarehouseUserActivities() { + return this.sqlPoolDataWarehouseUserActivities; + } + + /** The SqlPoolRestorePointsClient object to access its operations. */ + private final SqlPoolRestorePointsClient sqlPoolRestorePoints; + + /** + * Gets the SqlPoolRestorePointsClient object to access its operations. + * + * @return the SqlPoolRestorePointsClient object. + */ + public SqlPoolRestorePointsClient getSqlPoolRestorePoints() { + return this.sqlPoolRestorePoints; + } + + /** The SqlPoolReplicationLinksClient object to access its operations. */ + private final SqlPoolReplicationLinksClient sqlPoolReplicationLinks; + + /** + * Gets the SqlPoolReplicationLinksClient object to access its operations. + * + * @return the SqlPoolReplicationLinksClient object. + */ + public SqlPoolReplicationLinksClient getSqlPoolReplicationLinks() { + return this.sqlPoolReplicationLinks; + } + + /** The SqlPoolMaintenanceWindowsClient object to access its operations. */ + private final SqlPoolMaintenanceWindowsClient sqlPoolMaintenanceWindows; + + /** + * Gets the SqlPoolMaintenanceWindowsClient object to access its operations. + * + * @return the SqlPoolMaintenanceWindowsClient object. + */ + public SqlPoolMaintenanceWindowsClient getSqlPoolMaintenanceWindows() { + return this.sqlPoolMaintenanceWindows; + } + + /** The SqlPoolMaintenanceWindowOptionsClient object to access its operations. */ + private final SqlPoolMaintenanceWindowOptionsClient sqlPoolMaintenanceWindowOptions; + + /** + * Gets the SqlPoolMaintenanceWindowOptionsClient object to access its operations. + * + * @return the SqlPoolMaintenanceWindowOptionsClient object. + */ + public SqlPoolMaintenanceWindowOptionsClient getSqlPoolMaintenanceWindowOptions() { + return this.sqlPoolMaintenanceWindowOptions; + } + + /** The SqlPoolTransparentDataEncryptionsClient object to access its operations. */ + private final SqlPoolTransparentDataEncryptionsClient sqlPoolTransparentDataEncryptions; + + /** + * Gets the SqlPoolTransparentDataEncryptionsClient object to access its operations. + * + * @return the SqlPoolTransparentDataEncryptionsClient object. + */ + public SqlPoolTransparentDataEncryptionsClient getSqlPoolTransparentDataEncryptions() { + return this.sqlPoolTransparentDataEncryptions; + } + + /** The SqlPoolBlobAuditingPoliciesClient object to access its operations. */ + private final SqlPoolBlobAuditingPoliciesClient sqlPoolBlobAuditingPolicies; + + /** + * Gets the SqlPoolBlobAuditingPoliciesClient object to access its operations. + * + * @return the SqlPoolBlobAuditingPoliciesClient object. + */ + public SqlPoolBlobAuditingPoliciesClient getSqlPoolBlobAuditingPolicies() { + return this.sqlPoolBlobAuditingPolicies; + } + + /** The SqlPoolOperationsClient object to access its operations. */ + private final SqlPoolOperationsClient sqlPoolOperations; + + /** + * Gets the SqlPoolOperationsClient object to access its operations. + * + * @return the SqlPoolOperationsClient object. + */ + public SqlPoolOperationsClient getSqlPoolOperations() { + return this.sqlPoolOperations; + } + + /** The SqlPoolUsagesClient object to access its operations. */ + private final SqlPoolUsagesClient sqlPoolUsages; + + /** + * Gets the SqlPoolUsagesClient object to access its operations. + * + * @return the SqlPoolUsagesClient object. + */ + public SqlPoolUsagesClient getSqlPoolUsages() { + return this.sqlPoolUsages; + } + + /** The SqlPoolSensitivityLabelsClient object to access its operations. */ + private final SqlPoolSensitivityLabelsClient sqlPoolSensitivityLabels; + + /** + * Gets the SqlPoolSensitivityLabelsClient object to access its operations. + * + * @return the SqlPoolSensitivityLabelsClient object. + */ + public SqlPoolSensitivityLabelsClient getSqlPoolSensitivityLabels() { + return this.sqlPoolSensitivityLabels; + } + + /** The SqlPoolRecommendedSensitivityLabelsClient object to access its operations. */ + private final SqlPoolRecommendedSensitivityLabelsClient sqlPoolRecommendedSensitivityLabels; + + /** + * Gets the SqlPoolRecommendedSensitivityLabelsClient object to access its operations. + * + * @return the SqlPoolRecommendedSensitivityLabelsClient object. + */ + public SqlPoolRecommendedSensitivityLabelsClient getSqlPoolRecommendedSensitivityLabels() { + return this.sqlPoolRecommendedSensitivityLabels; + } + + /** The SqlPoolSchemasClient object to access its operations. */ + private final SqlPoolSchemasClient sqlPoolSchemas; + + /** + * Gets the SqlPoolSchemasClient object to access its operations. + * + * @return the SqlPoolSchemasClient object. + */ + public SqlPoolSchemasClient getSqlPoolSchemas() { + return this.sqlPoolSchemas; + } + + /** The SqlPoolTablesClient object to access its operations. */ + private final SqlPoolTablesClient sqlPoolTables; + + /** + * Gets the SqlPoolTablesClient object to access its operations. + * + * @return the SqlPoolTablesClient object. + */ + public SqlPoolTablesClient getSqlPoolTables() { + return this.sqlPoolTables; + } + + /** The SqlPoolTableColumnsClient object to access its operations. */ + private final SqlPoolTableColumnsClient sqlPoolTableColumns; + + /** + * Gets the SqlPoolTableColumnsClient object to access its operations. + * + * @return the SqlPoolTableColumnsClient object. + */ + public SqlPoolTableColumnsClient getSqlPoolTableColumns() { + return this.sqlPoolTableColumns; + } + + /** The SqlPoolConnectionPoliciesClient object to access its operations. */ + private final SqlPoolConnectionPoliciesClient sqlPoolConnectionPolicies; + + /** + * Gets the SqlPoolConnectionPoliciesClient object to access its operations. + * + * @return the SqlPoolConnectionPoliciesClient object. + */ + public SqlPoolConnectionPoliciesClient getSqlPoolConnectionPolicies() { + return this.sqlPoolConnectionPolicies; + } + + /** The SqlPoolVulnerabilityAssessmentsClient object to access its operations. */ + private final SqlPoolVulnerabilityAssessmentsClient sqlPoolVulnerabilityAssessments; + + /** + * Gets the SqlPoolVulnerabilityAssessmentsClient object to access its operations. + * + * @return the SqlPoolVulnerabilityAssessmentsClient object. + */ + public SqlPoolVulnerabilityAssessmentsClient getSqlPoolVulnerabilityAssessments() { + return this.sqlPoolVulnerabilityAssessments; + } + + /** The SqlPoolVulnerabilityAssessmentScansClient object to access its operations. */ + private final SqlPoolVulnerabilityAssessmentScansClient sqlPoolVulnerabilityAssessmentScans; + + /** + * Gets the SqlPoolVulnerabilityAssessmentScansClient object to access its operations. + * + * @return the SqlPoolVulnerabilityAssessmentScansClient object. + */ + public SqlPoolVulnerabilityAssessmentScansClient getSqlPoolVulnerabilityAssessmentScans() { + return this.sqlPoolVulnerabilityAssessmentScans; + } + + /** The SqlPoolSecurityAlertPoliciesClient object to access its operations. */ + private final SqlPoolSecurityAlertPoliciesClient sqlPoolSecurityAlertPolicies; + + /** + * Gets the SqlPoolSecurityAlertPoliciesClient object to access its operations. + * + * @return the SqlPoolSecurityAlertPoliciesClient object. + */ + public SqlPoolSecurityAlertPoliciesClient getSqlPoolSecurityAlertPolicies() { + return this.sqlPoolSecurityAlertPolicies; + } + + /** The SqlPoolVulnerabilityAssessmentRuleBaselinesClient object to access its operations. */ + private final SqlPoolVulnerabilityAssessmentRuleBaselinesClient sqlPoolVulnerabilityAssessmentRuleBaselines; + + /** + * Gets the SqlPoolVulnerabilityAssessmentRuleBaselinesClient object to access its operations. + * + * @return the SqlPoolVulnerabilityAssessmentRuleBaselinesClient object. + */ + public SqlPoolVulnerabilityAssessmentRuleBaselinesClient getSqlPoolVulnerabilityAssessmentRuleBaselines() { + return this.sqlPoolVulnerabilityAssessmentRuleBaselines; + } + + /** The ExtendedSqlPoolBlobAuditingPoliciesClient object to access its operations. */ + private final ExtendedSqlPoolBlobAuditingPoliciesClient extendedSqlPoolBlobAuditingPolicies; + + /** + * Gets the ExtendedSqlPoolBlobAuditingPoliciesClient object to access its operations. + * + * @return the ExtendedSqlPoolBlobAuditingPoliciesClient object. + */ + public ExtendedSqlPoolBlobAuditingPoliciesClient getExtendedSqlPoolBlobAuditingPolicies() { + return this.extendedSqlPoolBlobAuditingPolicies; + } + + /** The DataMaskingPoliciesClient object to access its operations. */ + private final DataMaskingPoliciesClient dataMaskingPolicies; + + /** + * Gets the DataMaskingPoliciesClient object to access its operations. + * + * @return the DataMaskingPoliciesClient object. + */ + public DataMaskingPoliciesClient getDataMaskingPolicies() { + return this.dataMaskingPolicies; + } + + /** The DataMaskingRulesClient object to access its operations. */ + private final DataMaskingRulesClient dataMaskingRules; + + /** + * Gets the DataMaskingRulesClient object to access its operations. + * + * @return the DataMaskingRulesClient object. + */ + public DataMaskingRulesClient getDataMaskingRules() { + return this.dataMaskingRules; + } + + /** The SqlPoolColumnsClient object to access its operations. */ + private final SqlPoolColumnsClient sqlPoolColumns; + + /** + * Gets the SqlPoolColumnsClient object to access its operations. + * + * @return the SqlPoolColumnsClient object. + */ + public SqlPoolColumnsClient getSqlPoolColumns() { + return this.sqlPoolColumns; + } + + /** The SqlPoolWorkloadGroupsClient object to access its operations. */ + private final SqlPoolWorkloadGroupsClient sqlPoolWorkloadGroups; + + /** + * Gets the SqlPoolWorkloadGroupsClient object to access its operations. + * + * @return the SqlPoolWorkloadGroupsClient object. + */ + public SqlPoolWorkloadGroupsClient getSqlPoolWorkloadGroups() { + return this.sqlPoolWorkloadGroups; + } + + /** The SqlPoolWorkloadClassifiersClient object to access its operations. */ + private final SqlPoolWorkloadClassifiersClient sqlPoolWorkloadClassifiers; + + /** + * Gets the SqlPoolWorkloadClassifiersClient object to access its operations. + * + * @return the SqlPoolWorkloadClassifiersClient object. + */ + public SqlPoolWorkloadClassifiersClient getSqlPoolWorkloadClassifiers() { + return this.sqlPoolWorkloadClassifiers; + } + + /** The WorkspacesClient object to access its operations. */ + private final WorkspacesClient workspaces; + + /** + * Gets the WorkspacesClient object to access its operations. + * + * @return the WorkspacesClient object. + */ + public WorkspacesClient getWorkspaces() { + return this.workspaces; + } + + /** The WorkspaceAadAdminsClient object to access its operations. */ + private final WorkspaceAadAdminsClient workspaceAadAdmins; + + /** + * Gets the WorkspaceAadAdminsClient object to access its operations. + * + * @return the WorkspaceAadAdminsClient object. + */ + public WorkspaceAadAdminsClient getWorkspaceAadAdmins() { + return this.workspaceAadAdmins; + } + + /** The WorkspaceSqlAadAdminsClient object to access its operations. */ + private final WorkspaceSqlAadAdminsClient workspaceSqlAadAdmins; + + /** + * Gets the WorkspaceSqlAadAdminsClient object to access its operations. + * + * @return the WorkspaceSqlAadAdminsClient object. + */ + public WorkspaceSqlAadAdminsClient getWorkspaceSqlAadAdmins() { + return this.workspaceSqlAadAdmins; + } + + /** The WorkspaceManagedIdentitySqlControlSettingsClient object to access its operations. */ + private final WorkspaceManagedIdentitySqlControlSettingsClient workspaceManagedIdentitySqlControlSettings; + + /** + * Gets the WorkspaceManagedIdentitySqlControlSettingsClient object to access its operations. + * + * @return the WorkspaceManagedIdentitySqlControlSettingsClient object. + */ + public WorkspaceManagedIdentitySqlControlSettingsClient getWorkspaceManagedIdentitySqlControlSettings() { + return this.workspaceManagedIdentitySqlControlSettings; + } + + /** The RestorableDroppedSqlPoolsClient object to access its operations. */ + private final RestorableDroppedSqlPoolsClient restorableDroppedSqlPools; + + /** + * Gets the RestorableDroppedSqlPoolsClient object to access its operations. + * + * @return the RestorableDroppedSqlPoolsClient object. + */ + public RestorableDroppedSqlPoolsClient getRestorableDroppedSqlPools() { + return this.restorableDroppedSqlPools; + } + + /** The IntegrationRuntimesClient object to access its operations. */ + private final IntegrationRuntimesClient integrationRuntimes; + + /** + * Gets the IntegrationRuntimesClient object to access its operations. + * + * @return the IntegrationRuntimesClient object. + */ + public IntegrationRuntimesClient getIntegrationRuntimes() { + return this.integrationRuntimes; + } + + /** The IntegrationRuntimeNodeIpAddressOperationsClient object to access its operations. */ + private final IntegrationRuntimeNodeIpAddressOperationsClient integrationRuntimeNodeIpAddressOperations; + + /** + * Gets the IntegrationRuntimeNodeIpAddressOperationsClient object to access its operations. + * + * @return the IntegrationRuntimeNodeIpAddressOperationsClient object. + */ + public IntegrationRuntimeNodeIpAddressOperationsClient getIntegrationRuntimeNodeIpAddressOperations() { + return this.integrationRuntimeNodeIpAddressOperations; + } + + /** The IntegrationRuntimeObjectMetadatasClient object to access its operations. */ + private final IntegrationRuntimeObjectMetadatasClient integrationRuntimeObjectMetadatas; + + /** + * Gets the IntegrationRuntimeObjectMetadatasClient object to access its operations. + * + * @return the IntegrationRuntimeObjectMetadatasClient object. + */ + public IntegrationRuntimeObjectMetadatasClient getIntegrationRuntimeObjectMetadatas() { + return this.integrationRuntimeObjectMetadatas; + } + + /** The IntegrationRuntimeNodesClient object to access its operations. */ + private final IntegrationRuntimeNodesClient integrationRuntimeNodes; + + /** + * Gets the IntegrationRuntimeNodesClient object to access its operations. + * + * @return the IntegrationRuntimeNodesClient object. + */ + public IntegrationRuntimeNodesClient getIntegrationRuntimeNodes() { + return this.integrationRuntimeNodes; + } + + /** The IntegrationRuntimeCredentialsClient object to access its operations. */ + private final IntegrationRuntimeCredentialsClient integrationRuntimeCredentials; + + /** + * Gets the IntegrationRuntimeCredentialsClient object to access its operations. + * + * @return the IntegrationRuntimeCredentialsClient object. + */ + public IntegrationRuntimeCredentialsClient getIntegrationRuntimeCredentials() { + return this.integrationRuntimeCredentials; + } + + /** The IntegrationRuntimeConnectionInfosClient object to access its operations. */ + private final IntegrationRuntimeConnectionInfosClient integrationRuntimeConnectionInfos; + + /** + * Gets the IntegrationRuntimeConnectionInfosClient object to access its operations. + * + * @return the IntegrationRuntimeConnectionInfosClient object. + */ + public IntegrationRuntimeConnectionInfosClient getIntegrationRuntimeConnectionInfos() { + return this.integrationRuntimeConnectionInfos; + } + + /** The IntegrationRuntimeAuthKeysOperationsClient object to access its operations. */ + private final IntegrationRuntimeAuthKeysOperationsClient integrationRuntimeAuthKeysOperations; + + /** + * Gets the IntegrationRuntimeAuthKeysOperationsClient object to access its operations. + * + * @return the IntegrationRuntimeAuthKeysOperationsClient object. + */ + public IntegrationRuntimeAuthKeysOperationsClient getIntegrationRuntimeAuthKeysOperations() { + return this.integrationRuntimeAuthKeysOperations; + } + + /** The IntegrationRuntimeMonitoringDatasClient object to access its operations. */ + private final IntegrationRuntimeMonitoringDatasClient integrationRuntimeMonitoringDatas; + + /** + * Gets the IntegrationRuntimeMonitoringDatasClient object to access its operations. + * + * @return the IntegrationRuntimeMonitoringDatasClient object. + */ + public IntegrationRuntimeMonitoringDatasClient getIntegrationRuntimeMonitoringDatas() { + return this.integrationRuntimeMonitoringDatas; + } + + /** The IntegrationRuntimeStatusOperationsClient object to access its operations. */ + private final IntegrationRuntimeStatusOperationsClient integrationRuntimeStatusOperations; + + /** + * Gets the IntegrationRuntimeStatusOperationsClient object to access its operations. + * + * @return the IntegrationRuntimeStatusOperationsClient object. + */ + public IntegrationRuntimeStatusOperationsClient getIntegrationRuntimeStatusOperations() { + return this.integrationRuntimeStatusOperations; + } + + /** The PrivateLinkResourcesClient object to access its operations. */ + private final PrivateLinkResourcesClient privateLinkResources; + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + public PrivateLinkResourcesClient getPrivateLinkResources() { + return this.privateLinkResources; + } + + /** The PrivateLinkHubPrivateLinkResourcesClient object to access its operations. */ + private final PrivateLinkHubPrivateLinkResourcesClient privateLinkHubPrivateLinkResources; + + /** + * Gets the PrivateLinkHubPrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkHubPrivateLinkResourcesClient object. + */ + public PrivateLinkHubPrivateLinkResourcesClient getPrivateLinkHubPrivateLinkResources() { + return this.privateLinkHubPrivateLinkResources; + } + + /** The PrivateEndpointConnectionsClient object to access its operations. */ + private final PrivateEndpointConnectionsClient privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** The PrivateLinkHubsClient object to access its operations. */ + private final PrivateLinkHubsClient privateLinkHubs; + + /** + * Gets the PrivateLinkHubsClient object to access its operations. + * + * @return the PrivateLinkHubsClient object. + */ + public PrivateLinkHubsClient getPrivateLinkHubs() { + return this.privateLinkHubs; + } + + /** The PrivateEndpointConnectionsPrivateLinkHubsClient object to access its operations. */ + private final PrivateEndpointConnectionsPrivateLinkHubsClient privateEndpointConnectionsPrivateLinkHubs; + + /** + * Gets the PrivateEndpointConnectionsPrivateLinkHubsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsPrivateLinkHubsClient object. + */ + public PrivateEndpointConnectionsPrivateLinkHubsClient getPrivateEndpointConnectionsPrivateLinkHubs() { + return this.privateEndpointConnectionsPrivateLinkHubs; + } + + /** The WorkspaceManagedSqlServerBlobAuditingPoliciesClient object to access its operations. */ + private final WorkspaceManagedSqlServerBlobAuditingPoliciesClient workspaceManagedSqlServerBlobAuditingPolicies; + + /** + * Gets the WorkspaceManagedSqlServerBlobAuditingPoliciesClient object to access its operations. + * + * @return the WorkspaceManagedSqlServerBlobAuditingPoliciesClient object. + */ + public WorkspaceManagedSqlServerBlobAuditingPoliciesClient getWorkspaceManagedSqlServerBlobAuditingPolicies() { + return this.workspaceManagedSqlServerBlobAuditingPolicies; + } + + /** The WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClient object to access its operations. */ + private final WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClient + workspaceManagedSqlServerExtendedBlobAuditingPolicies; + + /** + * Gets the WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClient object to access its operations. + * + * @return the WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClient object. + */ + public WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClient + getWorkspaceManagedSqlServerExtendedBlobAuditingPolicies() { + return this.workspaceManagedSqlServerExtendedBlobAuditingPolicies; + } + + /** The WorkspaceManagedSqlServerSecurityAlertPoliciesClient object to access its operations. */ + private final WorkspaceManagedSqlServerSecurityAlertPoliciesClient workspaceManagedSqlServerSecurityAlertPolicies; + + /** + * Gets the WorkspaceManagedSqlServerSecurityAlertPoliciesClient object to access its operations. + * + * @return the WorkspaceManagedSqlServerSecurityAlertPoliciesClient object. + */ + public WorkspaceManagedSqlServerSecurityAlertPoliciesClient getWorkspaceManagedSqlServerSecurityAlertPolicies() { + return this.workspaceManagedSqlServerSecurityAlertPolicies; + } + + /** The WorkspaceManagedSqlServerVulnerabilityAssessmentsClient object to access its operations. */ + private final WorkspaceManagedSqlServerVulnerabilityAssessmentsClient + workspaceManagedSqlServerVulnerabilityAssessments; + + /** + * Gets the WorkspaceManagedSqlServerVulnerabilityAssessmentsClient object to access its operations. + * + * @return the WorkspaceManagedSqlServerVulnerabilityAssessmentsClient object. + */ + public WorkspaceManagedSqlServerVulnerabilityAssessmentsClient + getWorkspaceManagedSqlServerVulnerabilityAssessments() { + return this.workspaceManagedSqlServerVulnerabilityAssessments; + } + + /** The WorkspaceManagedSqlServerEncryptionProtectorsClient object to access its operations. */ + private final WorkspaceManagedSqlServerEncryptionProtectorsClient workspaceManagedSqlServerEncryptionProtectors; + + /** + * Gets the WorkspaceManagedSqlServerEncryptionProtectorsClient object to access its operations. + * + * @return the WorkspaceManagedSqlServerEncryptionProtectorsClient object. + */ + public WorkspaceManagedSqlServerEncryptionProtectorsClient getWorkspaceManagedSqlServerEncryptionProtectors() { + return this.workspaceManagedSqlServerEncryptionProtectors; + } + + /** The WorkspaceManagedSqlServerUsagesClient object to access its operations. */ + private final WorkspaceManagedSqlServerUsagesClient workspaceManagedSqlServerUsages; + + /** + * Gets the WorkspaceManagedSqlServerUsagesClient object to access its operations. + * + * @return the WorkspaceManagedSqlServerUsagesClient object. + */ + public WorkspaceManagedSqlServerUsagesClient getWorkspaceManagedSqlServerUsages() { + return this.workspaceManagedSqlServerUsages; + } + + /** The WorkspaceManagedSqlServerRecoverableSqlPoolsClient object to access its operations. */ + private final WorkspaceManagedSqlServerRecoverableSqlPoolsClient workspaceManagedSqlServerRecoverableSqlPools; + + /** + * Gets the WorkspaceManagedSqlServerRecoverableSqlPoolsClient object to access its operations. + * + * @return the WorkspaceManagedSqlServerRecoverableSqlPoolsClient object. + */ + public WorkspaceManagedSqlServerRecoverableSqlPoolsClient getWorkspaceManagedSqlServerRecoverableSqlPools() { + return this.workspaceManagedSqlServerRecoverableSqlPools; + } + + /** The KeysClient object to access its operations. */ + private final KeysClient keys; + + /** + * Gets the KeysClient object to access its operations. + * + * @return the KeysClient object. + */ + public KeysClient getKeys() { + return this.keys; + } + + /** The LibrariesClient object to access its operations. */ + private final LibrariesClient libraries; + + /** + * Gets the LibrariesClient object to access its operations. + * + * @return the LibrariesClient object. + */ + public LibrariesClient getLibraries() { + return this.libraries; + } + + /** The LibrariesOperationsClient object to access its operations. */ + private final LibrariesOperationsClient librariesOperations; + + /** + * Gets the LibrariesOperationsClient object to access its operations. + * + * @return the LibrariesOperationsClient object. + */ + public LibrariesOperationsClient getLibrariesOperations() { + return this.librariesOperations; + } + + /** + * Initializes an instance of SynapseManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The ID of the target subscription. + * @param endpoint server parameter. + */ + SynapseManagementClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2020-12-01"; + this.bigDataPools = new BigDataPoolsClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.ipFirewallRules = new IpFirewallRulesClientImpl(this); + this.sqlPools = new SqlPoolsClientImpl(this); + this.sqlPoolMetadataSyncConfigs = new SqlPoolMetadataSyncConfigsClientImpl(this); + this.sqlPoolOperationResults = new SqlPoolOperationResultsClientImpl(this); + this.sqlPoolGeoBackupPolicies = new SqlPoolGeoBackupPoliciesClientImpl(this); + this.sqlPoolDataWarehouseUserActivities = new SqlPoolDataWarehouseUserActivitiesClientImpl(this); + this.sqlPoolRestorePoints = new SqlPoolRestorePointsClientImpl(this); + this.sqlPoolReplicationLinks = new SqlPoolReplicationLinksClientImpl(this); + this.sqlPoolMaintenanceWindows = new SqlPoolMaintenanceWindowsClientImpl(this); + this.sqlPoolMaintenanceWindowOptions = new SqlPoolMaintenanceWindowOptionsClientImpl(this); + this.sqlPoolTransparentDataEncryptions = new SqlPoolTransparentDataEncryptionsClientImpl(this); + this.sqlPoolBlobAuditingPolicies = new SqlPoolBlobAuditingPoliciesClientImpl(this); + this.sqlPoolOperations = new SqlPoolOperationsClientImpl(this); + this.sqlPoolUsages = new SqlPoolUsagesClientImpl(this); + this.sqlPoolSensitivityLabels = new SqlPoolSensitivityLabelsClientImpl(this); + this.sqlPoolRecommendedSensitivityLabels = new SqlPoolRecommendedSensitivityLabelsClientImpl(this); + this.sqlPoolSchemas = new SqlPoolSchemasClientImpl(this); + this.sqlPoolTables = new SqlPoolTablesClientImpl(this); + this.sqlPoolTableColumns = new SqlPoolTableColumnsClientImpl(this); + this.sqlPoolConnectionPolicies = new SqlPoolConnectionPoliciesClientImpl(this); + this.sqlPoolVulnerabilityAssessments = new SqlPoolVulnerabilityAssessmentsClientImpl(this); + this.sqlPoolVulnerabilityAssessmentScans = new SqlPoolVulnerabilityAssessmentScansClientImpl(this); + this.sqlPoolSecurityAlertPolicies = new SqlPoolSecurityAlertPoliciesClientImpl(this); + this.sqlPoolVulnerabilityAssessmentRuleBaselines = + new SqlPoolVulnerabilityAssessmentRuleBaselinesClientImpl(this); + this.extendedSqlPoolBlobAuditingPolicies = new ExtendedSqlPoolBlobAuditingPoliciesClientImpl(this); + this.dataMaskingPolicies = new DataMaskingPoliciesClientImpl(this); + this.dataMaskingRules = new DataMaskingRulesClientImpl(this); + this.sqlPoolColumns = new SqlPoolColumnsClientImpl(this); + this.sqlPoolWorkloadGroups = new SqlPoolWorkloadGroupsClientImpl(this); + this.sqlPoolWorkloadClassifiers = new SqlPoolWorkloadClassifiersClientImpl(this); + this.workspaces = new WorkspacesClientImpl(this); + this.workspaceAadAdmins = new WorkspaceAadAdminsClientImpl(this); + this.workspaceSqlAadAdmins = new WorkspaceSqlAadAdminsClientImpl(this); + this.workspaceManagedIdentitySqlControlSettings = + new WorkspaceManagedIdentitySqlControlSettingsClientImpl(this); + this.restorableDroppedSqlPools = new RestorableDroppedSqlPoolsClientImpl(this); + this.integrationRuntimes = new IntegrationRuntimesClientImpl(this); + this.integrationRuntimeNodeIpAddressOperations = new IntegrationRuntimeNodeIpAddressOperationsClientImpl(this); + this.integrationRuntimeObjectMetadatas = new IntegrationRuntimeObjectMetadatasClientImpl(this); + this.integrationRuntimeNodes = new IntegrationRuntimeNodesClientImpl(this); + this.integrationRuntimeCredentials = new IntegrationRuntimeCredentialsClientImpl(this); + this.integrationRuntimeConnectionInfos = new IntegrationRuntimeConnectionInfosClientImpl(this); + this.integrationRuntimeAuthKeysOperations = new IntegrationRuntimeAuthKeysOperationsClientImpl(this); + this.integrationRuntimeMonitoringDatas = new IntegrationRuntimeMonitoringDatasClientImpl(this); + this.integrationRuntimeStatusOperations = new IntegrationRuntimeStatusOperationsClientImpl(this); + this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.privateLinkHubPrivateLinkResources = new PrivateLinkHubPrivateLinkResourcesClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.privateLinkHubs = new PrivateLinkHubsClientImpl(this); + this.privateEndpointConnectionsPrivateLinkHubs = new PrivateEndpointConnectionsPrivateLinkHubsClientImpl(this); + this.workspaceManagedSqlServerBlobAuditingPolicies = + new WorkspaceManagedSqlServerBlobAuditingPoliciesClientImpl(this); + this.workspaceManagedSqlServerExtendedBlobAuditingPolicies = + new WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClientImpl(this); + this.workspaceManagedSqlServerSecurityAlertPolicies = + new WorkspaceManagedSqlServerSecurityAlertPoliciesClientImpl(this); + this.workspaceManagedSqlServerVulnerabilityAssessments = + new WorkspaceManagedSqlServerVulnerabilityAssessmentsClientImpl(this); + this.workspaceManagedSqlServerEncryptionProtectors = + new WorkspaceManagedSqlServerEncryptionProtectorsClientImpl(this); + this.workspaceManagedSqlServerUsages = new WorkspaceManagedSqlServerUsagesClientImpl(this); + this.workspaceManagedSqlServerRecoverableSqlPools = + new WorkspaceManagedSqlServerRecoverableSqlPoolsClientImpl(this); + this.keys = new KeysClientImpl(this); + this.libraries = new LibrariesClientImpl(this); + this.librariesOperations = new LibrariesOperationsClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + logger.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/TransparentDataEncryptionImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/TransparentDataEncryptionImpl.java new file mode 100644 index 0000000000000..c60dc05a669c2 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/TransparentDataEncryptionImpl.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.TransparentDataEncryptionInner; +import com.azure.resourcemanager.synapse.models.TransparentDataEncryption; +import com.azure.resourcemanager.synapse.models.TransparentDataEncryptionName; +import com.azure.resourcemanager.synapse.models.TransparentDataEncryptionStatus; + +public final class TransparentDataEncryptionImpl + implements TransparentDataEncryption, TransparentDataEncryption.Definition, TransparentDataEncryption.Update { + private TransparentDataEncryptionInner innerObject; + + private final SynapseManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public TransparentDataEncryptionStatus status() { + return this.innerModel().status(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public TransparentDataEncryptionInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String sqlPoolName; + + private TransparentDataEncryptionName transparentDataEncryptionName; + + public TransparentDataEncryptionImpl withExistingSqlPool( + String resourceGroupName, String workspaceName, String sqlPoolName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + this.sqlPoolName = sqlPoolName; + return this; + } + + public TransparentDataEncryption create() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolTransparentDataEncryptions() + .createOrUpdateWithResponse( + resourceGroupName, + workspaceName, + sqlPoolName, + transparentDataEncryptionName, + this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public TransparentDataEncryption create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolTransparentDataEncryptions() + .createOrUpdateWithResponse( + resourceGroupName, + workspaceName, + sqlPoolName, + transparentDataEncryptionName, + this.innerModel(), + context) + .getValue(); + return this; + } + + TransparentDataEncryptionImpl(TransparentDataEncryptionName name, SynapseManager serviceManager) { + this.innerObject = new TransparentDataEncryptionInner(); + this.serviceManager = serviceManager; + this.transparentDataEncryptionName = name; + } + + public TransparentDataEncryptionImpl update() { + return this; + } + + public TransparentDataEncryption apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolTransparentDataEncryptions() + .createOrUpdateWithResponse( + resourceGroupName, + workspaceName, + sqlPoolName, + transparentDataEncryptionName, + this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public TransparentDataEncryption apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolTransparentDataEncryptions() + .createOrUpdateWithResponse( + resourceGroupName, + workspaceName, + sqlPoolName, + transparentDataEncryptionName, + this.innerModel(), + context) + .getValue(); + return this; + } + + TransparentDataEncryptionImpl(TransparentDataEncryptionInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.sqlPoolName = Utils.getValueFromIdByName(innerObject.id(), "sqlPools"); + this.transparentDataEncryptionName = + TransparentDataEncryptionName + .fromString(Utils.getValueFromIdByName(innerObject.id(), "transparentDataEncryption")); + } + + public TransparentDataEncryption refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolTransparentDataEncryptions() + .getWithResponse( + resourceGroupName, workspaceName, sqlPoolName, transparentDataEncryptionName, Context.NONE) + .getValue(); + return this; + } + + public TransparentDataEncryption refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolTransparentDataEncryptions() + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, transparentDataEncryptionName, context) + .getValue(); + return this; + } + + public TransparentDataEncryptionImpl withStatus(TransparentDataEncryptionStatus status) { + this.innerModel().withStatus(status); + return this; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/Utils.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/Utils.java new file mode 100644 index 0000000000000..6947890d73848 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/Utils.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Mono; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pageIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pageIterable, Function mapper) { + super(new PagedFlux(Mono::empty)); + this.pageIterable = pageIterable; + this.mapper = mapper; + this.pageMapper = + page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pageIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pageIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pageIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pageIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pageIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pageIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pageIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pageIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pageIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pageIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/VulnerabilityAssessmentScanRecordImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/VulnerabilityAssessmentScanRecordImpl.java new file mode 100644 index 0000000000000..5833a1df3826d --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/VulnerabilityAssessmentScanRecordImpl.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.VulnerabilityAssessmentScanRecordInner; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentScanError; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentScanRecord; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentScanState; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentScanTriggerType; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class VulnerabilityAssessmentScanRecordImpl implements VulnerabilityAssessmentScanRecord { + private VulnerabilityAssessmentScanRecordInner innerObject; + + private final SynapseManager serviceManager; + + VulnerabilityAssessmentScanRecordImpl( + VulnerabilityAssessmentScanRecordInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String scanId() { + return this.innerModel().scanId(); + } + + public VulnerabilityAssessmentScanTriggerType triggerType() { + return this.innerModel().triggerType(); + } + + public VulnerabilityAssessmentScanState state() { + return this.innerModel().state(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public List errors() { + List inner = this.innerModel().errors(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String storageContainerPath() { + return this.innerModel().storageContainerPath(); + } + + public Integer numberOfFailedSecurityChecks() { + return this.innerModel().numberOfFailedSecurityChecks(); + } + + public VulnerabilityAssessmentScanRecordInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkloadClassifierImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkloadClassifierImpl.java new file mode 100644 index 0000000000000..4a6fa72fc0f69 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkloadClassifierImpl.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.WorkloadClassifierInner; +import com.azure.resourcemanager.synapse.models.WorkloadClassifier; + +public final class WorkloadClassifierImpl + implements WorkloadClassifier, WorkloadClassifier.Definition, WorkloadClassifier.Update { + private WorkloadClassifierInner innerObject; + + private final SynapseManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String memberName() { + return this.innerModel().memberName(); + } + + public String label() { + return this.innerModel().label(); + } + + public String context() { + return this.innerModel().context(); + } + + public String startTime() { + return this.innerModel().startTime(); + } + + public String endTime() { + return this.innerModel().endTime(); + } + + public String importance() { + return this.innerModel().importance(); + } + + public WorkloadClassifierInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String sqlPoolName; + + private String workloadGroupName; + + private String workloadClassifierName; + + public WorkloadClassifierImpl withExistingWorkloadGroup( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + this.sqlPoolName = sqlPoolName; + this.workloadGroupName = workloadGroupName; + return this; + } + + public WorkloadClassifier create() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolWorkloadClassifiers() + .createOrUpdate( + resourceGroupName, + workspaceName, + sqlPoolName, + workloadGroupName, + workloadClassifierName, + this.innerModel(), + Context.NONE); + return this; + } + + public WorkloadClassifier create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolWorkloadClassifiers() + .createOrUpdate( + resourceGroupName, + workspaceName, + sqlPoolName, + workloadGroupName, + workloadClassifierName, + this.innerModel(), + context); + return this; + } + + WorkloadClassifierImpl(String name, SynapseManager serviceManager) { + this.innerObject = new WorkloadClassifierInner(); + this.serviceManager = serviceManager; + this.workloadClassifierName = name; + } + + public WorkloadClassifierImpl update() { + return this; + } + + public WorkloadClassifier apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolWorkloadClassifiers() + .createOrUpdate( + resourceGroupName, + workspaceName, + sqlPoolName, + workloadGroupName, + workloadClassifierName, + this.innerModel(), + Context.NONE); + return this; + } + + public WorkloadClassifier apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolWorkloadClassifiers() + .createOrUpdate( + resourceGroupName, + workspaceName, + sqlPoolName, + workloadGroupName, + workloadClassifierName, + this.innerModel(), + context); + return this; + } + + WorkloadClassifierImpl(WorkloadClassifierInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.sqlPoolName = Utils.getValueFromIdByName(innerObject.id(), "sqlPools"); + this.workloadGroupName = Utils.getValueFromIdByName(innerObject.id(), "workloadGroups"); + this.workloadClassifierName = Utils.getValueFromIdByName(innerObject.id(), "workloadClassifiers"); + } + + public WorkloadClassifier refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolWorkloadClassifiers() + .getWithResponse( + resourceGroupName, + workspaceName, + sqlPoolName, + workloadGroupName, + workloadClassifierName, + Context.NONE) + .getValue(); + return this; + } + + public WorkloadClassifier refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolWorkloadClassifiers() + .getWithResponse( + resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, workloadClassifierName, context) + .getValue(); + return this; + } + + public WorkloadClassifierImpl withMemberName(String memberName) { + this.innerModel().withMemberName(memberName); + return this; + } + + public WorkloadClassifierImpl withLabel(String label) { + this.innerModel().withLabel(label); + return this; + } + + public WorkloadClassifierImpl withContext(String context) { + this.innerModel().withContext(context); + return this; + } + + public WorkloadClassifierImpl withStartTime(String startTime) { + this.innerModel().withStartTime(startTime); + return this; + } + + public WorkloadClassifierImpl withEndTime(String endTime) { + this.innerModel().withEndTime(endTime); + return this; + } + + public WorkloadClassifierImpl withImportance(String importance) { + this.innerModel().withImportance(importance); + return this; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkloadGroupImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkloadGroupImpl.java new file mode 100644 index 0000000000000..85a161d6c9c10 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkloadGroupImpl.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.WorkloadGroupInner; +import com.azure.resourcemanager.synapse.models.WorkloadGroup; + +public final class WorkloadGroupImpl implements WorkloadGroup, WorkloadGroup.Definition, WorkloadGroup.Update { + private WorkloadGroupInner innerObject; + + private final SynapseManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public Integer minResourcePercent() { + return this.innerModel().minResourcePercent(); + } + + public Integer maxResourcePercent() { + return this.innerModel().maxResourcePercent(); + } + + public Double minResourcePercentPerRequest() { + return this.innerModel().minResourcePercentPerRequest(); + } + + public Double maxResourcePercentPerRequest() { + return this.innerModel().maxResourcePercentPerRequest(); + } + + public String importance() { + return this.innerModel().importance(); + } + + public Integer queryExecutionTimeout() { + return this.innerModel().queryExecutionTimeout(); + } + + public WorkloadGroupInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String sqlPoolName; + + private String workloadGroupName; + + public WorkloadGroupImpl withExistingSqlPool(String resourceGroupName, String workspaceName, String sqlPoolName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + this.sqlPoolName = sqlPoolName; + return this; + } + + public WorkloadGroup create() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolWorkloadGroups() + .createOrUpdate( + resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, this.innerModel(), Context.NONE); + return this; + } + + public WorkloadGroup create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolWorkloadGroups() + .createOrUpdate( + resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, this.innerModel(), context); + return this; + } + + WorkloadGroupImpl(String name, SynapseManager serviceManager) { + this.innerObject = new WorkloadGroupInner(); + this.serviceManager = serviceManager; + this.workloadGroupName = name; + } + + public WorkloadGroupImpl update() { + return this; + } + + public WorkloadGroup apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolWorkloadGroups() + .createOrUpdate( + resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, this.innerModel(), Context.NONE); + return this; + } + + public WorkloadGroup apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolWorkloadGroups() + .createOrUpdate( + resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, this.innerModel(), context); + return this; + } + + WorkloadGroupImpl(WorkloadGroupInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.sqlPoolName = Utils.getValueFromIdByName(innerObject.id(), "sqlPools"); + this.workloadGroupName = Utils.getValueFromIdByName(innerObject.id(), "workloadGroups"); + } + + public WorkloadGroup refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolWorkloadGroups() + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, Context.NONE) + .getValue(); + return this; + } + + public WorkloadGroup refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSqlPoolWorkloadGroups() + .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, context) + .getValue(); + return this; + } + + public WorkloadGroupImpl withMinResourcePercent(Integer minResourcePercent) { + this.innerModel().withMinResourcePercent(minResourcePercent); + return this; + } + + public WorkloadGroupImpl withMaxResourcePercent(Integer maxResourcePercent) { + this.innerModel().withMaxResourcePercent(maxResourcePercent); + return this; + } + + public WorkloadGroupImpl withMinResourcePercentPerRequest(Double minResourcePercentPerRequest) { + this.innerModel().withMinResourcePercentPerRequest(minResourcePercentPerRequest); + return this; + } + + public WorkloadGroupImpl withMaxResourcePercentPerRequest(Double maxResourcePercentPerRequest) { + this.innerModel().withMaxResourcePercentPerRequest(maxResourcePercentPerRequest); + return this; + } + + public WorkloadGroupImpl withImportance(String importance) { + this.innerModel().withImportance(importance); + return this; + } + + public WorkloadGroupImpl withQueryExecutionTimeout(Integer queryExecutionTimeout) { + this.innerModel().withQueryExecutionTimeout(queryExecutionTimeout); + return this; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceAadAdminInfoImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceAadAdminInfoImpl.java new file mode 100644 index 0000000000000..abc5494a4bd97 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceAadAdminInfoImpl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.WorkspaceAadAdminInfoInner; +import com.azure.resourcemanager.synapse.models.WorkspaceAadAdminInfo; + +public final class WorkspaceAadAdminInfoImpl implements WorkspaceAadAdminInfo { + private WorkspaceAadAdminInfoInner innerObject; + + private final SynapseManager serviceManager; + + WorkspaceAadAdminInfoImpl(WorkspaceAadAdminInfoInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String tenantId() { + return this.innerModel().tenantId(); + } + + public String login() { + return this.innerModel().login(); + } + + public String administratorType() { + return this.innerModel().administratorType(); + } + + public String sid() { + return this.innerModel().sid(); + } + + public WorkspaceAadAdminInfoInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceAadAdminsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceAadAdminsClientImpl.java new file mode 100644 index 0000000000000..41782d0dacbe7 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceAadAdminsClientImpl.java @@ -0,0 +1,757 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.WorkspaceAadAdminsClient; +import com.azure.resourcemanager.synapse.fluent.models.WorkspaceAadAdminInfoInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in WorkspaceAadAdminsClient. */ +public final class WorkspaceAadAdminsClientImpl implements WorkspaceAadAdminsClient { + private final ClientLogger logger = new ClientLogger(WorkspaceAadAdminsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final WorkspaceAadAdminsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of WorkspaceAadAdminsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkspaceAadAdminsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy.create(WorkspaceAadAdminsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientWorkspaceAadAdmins to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface WorkspaceAadAdminsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/administrators/activeDirectory") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/administrators/activeDirectory") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @BodyParam("application/json") WorkspaceAadAdminInfoInner aadAdminInfo, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/administrators/activeDirectory") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a workspace 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace active directory admin. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets a workspace active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace active directory admin. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context); + } + + /** + * Gets a workspace 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace active directory admin. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName) { + return getWithResponseAsync(resourceGroupName, workspaceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets a workspace 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace active directory admin. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceAadAdminInfoInner get(String resourceGroupName, String workspaceName) { + return getAsync(resourceGroupName, workspaceName).block(); + } + + /** + * Gets a workspace active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace active directory admin. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, context).block(); + } + + /** + * Creates or updates a workspace 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (aadAdminInfo == null) { + return Mono.error(new IllegalArgumentException("Parameter aadAdminInfo is required and cannot be null.")); + } else { + aadAdminInfo.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + aadAdminInfo, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates a workspace 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (aadAdminInfo == null) { + return Mono.error(new IllegalArgumentException("Parameter aadAdminInfo is required and cannot be null.")); + } else { + aadAdminInfo.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + aadAdminInfo, + accept, + context); + } + + /** + * Creates or updates a workspace 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkspaceAadAdminInfoInner> beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, aadAdminInfo); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkspaceAadAdminInfoInner.class, + WorkspaceAadAdminInfoInner.class, + Context.NONE); + } + + /** + * Creates or updates a workspace 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkspaceAadAdminInfoInner> beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, aadAdminInfo, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkspaceAadAdminInfoInner.class, + WorkspaceAadAdminInfoInner.class, + context); + } + + /** + * Creates or updates a workspace 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkspaceAadAdminInfoInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, aadAdminInfo).getSyncPoller(); + } + + /** + * Creates or updates a workspace 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkspaceAadAdminInfoInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, aadAdminInfo, context).getSyncPoller(); + } + + /** + * Creates or updates a workspace 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, aadAdminInfo) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a workspace 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, aadAdminInfo, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a workspace 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceAadAdminInfoInner createOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo) { + return createOrUpdateAsync(resourceGroupName, workspaceName, aadAdminInfo).block(); + } + + /** + * Creates or updates a workspace 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceAadAdminInfoInner createOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo, Context context) { + return createOrUpdateAsync(resourceGroupName, workspaceName, aadAdminInfo, context).block(); + } + + /** + * Deletes a workspace 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes a workspace active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context); + } + + /** + * Deletes a workspace 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Deletes a workspace active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String workspaceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a workspace 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName) { + return beginDeleteAsync(resourceGroupName, workspaceName).getSyncPoller(); + } + + /** + * Deletes a workspace active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, context).getSyncPoller(); + } + + /** + * Deletes a workspace 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName) { + return beginDeleteAsync(resourceGroupName, workspaceName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a workspace active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a workspace 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName) { + deleteAsync(resourceGroupName, workspaceName).block(); + } + + /** + * Deletes a workspace active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, Context context) { + deleteAsync(resourceGroupName, workspaceName, context).block(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceAadAdminsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceAadAdminsImpl.java new file mode 100644 index 0000000000000..fa63df499c799 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceAadAdminsImpl.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.WorkspaceAadAdminsClient; +import com.azure.resourcemanager.synapse.fluent.models.WorkspaceAadAdminInfoInner; +import com.azure.resourcemanager.synapse.models.WorkspaceAadAdminInfo; +import com.azure.resourcemanager.synapse.models.WorkspaceAadAdmins; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class WorkspaceAadAdminsImpl implements WorkspaceAadAdmins { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkspaceAadAdminsImpl.class); + + private final WorkspaceAadAdminsClient innerClient; + + private final SynapseManager serviceManager; + + public WorkspaceAadAdminsImpl(WorkspaceAadAdminsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public WorkspaceAadAdminInfo get(String resourceGroupName, String workspaceName) { + WorkspaceAadAdminInfoInner inner = this.serviceClient().get(resourceGroupName, workspaceName); + if (inner != null) { + return new WorkspaceAadAdminInfoImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WorkspaceAadAdminInfoImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public WorkspaceAadAdminInfo createOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo) { + WorkspaceAadAdminInfoInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, aadAdminInfo); + if (inner != null) { + return new WorkspaceAadAdminInfoImpl(inner, this.manager()); + } else { + return null; + } + } + + public WorkspaceAadAdminInfo createOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo, Context context) { + WorkspaceAadAdminInfoInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, aadAdminInfo, context); + if (inner != null) { + return new WorkspaceAadAdminInfoImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String workspaceName) { + this.serviceClient().delete(resourceGroupName, workspaceName); + } + + public void delete(String resourceGroupName, String workspaceName, Context context) { + this.serviceClient().delete(resourceGroupName, workspaceName, context); + } + + private WorkspaceAadAdminsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceImpl.java new file mode 100644 index 0000000000000..dc3926a004f6e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceImpl.java @@ -0,0 +1,368 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.synapse.fluent.models.WorkspaceInner; +import com.azure.resourcemanager.synapse.models.DataLakeStorageAccountDetails; +import com.azure.resourcemanager.synapse.models.EncryptionDetails; +import com.azure.resourcemanager.synapse.models.ManagedIdentity; +import com.azure.resourcemanager.synapse.models.ManagedVirtualNetworkSettings; +import com.azure.resourcemanager.synapse.models.PrivateEndpointConnection; +import com.azure.resourcemanager.synapse.models.PurviewConfiguration; +import com.azure.resourcemanager.synapse.models.VirtualNetworkProfile; +import com.azure.resourcemanager.synapse.models.Workspace; +import com.azure.resourcemanager.synapse.models.WorkspacePatchInfo; +import com.azure.resourcemanager.synapse.models.WorkspaceRepositoryConfiguration; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.stream.Collectors; + +public final class WorkspaceImpl implements Workspace, Workspace.Definition, Workspace.Update { + private WorkspaceInner innerObject; + + private final SynapseManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ManagedIdentity identity() { + return this.innerModel().identity(); + } + + public DataLakeStorageAccountDetails defaultDataLakeStorage() { + return this.innerModel().defaultDataLakeStorage(); + } + + public String sqlAdministratorLoginPassword() { + return this.innerModel().sqlAdministratorLoginPassword(); + } + + public String managedResourceGroupName() { + return this.innerModel().managedResourceGroupName(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public String sqlAdministratorLogin() { + return this.innerModel().sqlAdministratorLogin(); + } + + public VirtualNetworkProfile virtualNetworkProfile() { + return this.innerModel().virtualNetworkProfile(); + } + + public Map connectivityEndpoints() { + Map inner = this.innerModel().connectivityEndpoints(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String managedVirtualNetwork() { + return this.innerModel().managedVirtualNetwork(); + } + + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public EncryptionDetails encryption() { + return this.innerModel().encryption(); + } + + public UUID workspaceUid() { + return this.innerModel().workspaceUid(); + } + + public Map extraProperties() { + Map inner = this.innerModel().extraProperties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ManagedVirtualNetworkSettings managedVirtualNetworkSettings() { + return this.innerModel().managedVirtualNetworkSettings(); + } + + public WorkspaceRepositoryConfiguration workspaceRepositoryConfiguration() { + return this.innerModel().workspaceRepositoryConfiguration(); + } + + public PurviewConfiguration purviewConfiguration() { + return this.innerModel().purviewConfiguration(); + } + + public String adlaResourceId() { + return this.innerModel().adlaResourceId(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public WorkspaceInner innerModel() { + return this.innerObject; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private WorkspacePatchInfo updateWorkspacePatchInfo; + + public WorkspaceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Workspace create() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaces() + .createOrUpdate(resourceGroupName, workspaceName, this.innerModel(), Context.NONE); + return this; + } + + public Workspace create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaces() + .createOrUpdate(resourceGroupName, workspaceName, this.innerModel(), context); + return this; + } + + WorkspaceImpl(String name, SynapseManager serviceManager) { + this.innerObject = new WorkspaceInner(); + this.serviceManager = serviceManager; + this.workspaceName = name; + } + + public WorkspaceImpl update() { + this.updateWorkspacePatchInfo = new WorkspacePatchInfo(); + return this; + } + + public Workspace apply() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaces() + .update(resourceGroupName, workspaceName, updateWorkspacePatchInfo, Context.NONE); + return this; + } + + public Workspace apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaces() + .update(resourceGroupName, workspaceName, updateWorkspacePatchInfo, context); + return this; + } + + WorkspaceImpl(WorkspaceInner innerObject, SynapseManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = Utils.getValueFromIdByName(innerObject.id(), "workspaces"); + } + + public Workspace refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaces() + .getByResourceGroupWithResponse(resourceGroupName, workspaceName, Context.NONE) + .getValue(); + return this; + } + + public Workspace refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getWorkspaces() + .getByResourceGroupWithResponse(resourceGroupName, workspaceName, context) + .getValue(); + return this; + } + + public WorkspaceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public WorkspaceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public WorkspaceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateWorkspacePatchInfo.withTags(tags); + return this; + } + } + + public WorkspaceImpl withIdentity(ManagedIdentity identity) { + if (isInCreateMode()) { + this.innerModel().withIdentity(identity); + return this; + } else { + this.updateWorkspacePatchInfo.withIdentity(identity); + return this; + } + } + + public WorkspaceImpl withDefaultDataLakeStorage(DataLakeStorageAccountDetails defaultDataLakeStorage) { + this.innerModel().withDefaultDataLakeStorage(defaultDataLakeStorage); + return this; + } + + public WorkspaceImpl withSqlAdministratorLoginPassword(String sqlAdministratorLoginPassword) { + if (isInCreateMode()) { + this.innerModel().withSqlAdministratorLoginPassword(sqlAdministratorLoginPassword); + return this; + } else { + this.updateWorkspacePatchInfo.withSqlAdministratorLoginPassword(sqlAdministratorLoginPassword); + return this; + } + } + + public WorkspaceImpl withManagedResourceGroupName(String managedResourceGroupName) { + this.innerModel().withManagedResourceGroupName(managedResourceGroupName); + return this; + } + + public WorkspaceImpl withSqlAdministratorLogin(String sqlAdministratorLogin) { + this.innerModel().withSqlAdministratorLogin(sqlAdministratorLogin); + return this; + } + + public WorkspaceImpl withVirtualNetworkProfile(VirtualNetworkProfile virtualNetworkProfile) { + this.innerModel().withVirtualNetworkProfile(virtualNetworkProfile); + return this; + } + + public WorkspaceImpl withConnectivityEndpoints(Map connectivityEndpoints) { + this.innerModel().withConnectivityEndpoints(connectivityEndpoints); + return this; + } + + public WorkspaceImpl withManagedVirtualNetwork(String managedVirtualNetwork) { + this.innerModel().withManagedVirtualNetwork(managedVirtualNetwork); + return this; + } + + public WorkspaceImpl withPrivateEndpointConnections( + List privateEndpointConnections) { + this.innerModel().withPrivateEndpointConnections(privateEndpointConnections); + return this; + } + + public WorkspaceImpl withEncryption(EncryptionDetails encryption) { + if (isInCreateMode()) { + this.innerModel().withEncryption(encryption); + return this; + } else { + this.updateWorkspacePatchInfo.withEncryption(encryption); + return this; + } + } + + public WorkspaceImpl withManagedVirtualNetworkSettings( + ManagedVirtualNetworkSettings managedVirtualNetworkSettings) { + if (isInCreateMode()) { + this.innerModel().withManagedVirtualNetworkSettings(managedVirtualNetworkSettings); + return this; + } else { + this.updateWorkspacePatchInfo.withManagedVirtualNetworkSettings(managedVirtualNetworkSettings); + return this; + } + } + + public WorkspaceImpl withWorkspaceRepositoryConfiguration( + WorkspaceRepositoryConfiguration workspaceRepositoryConfiguration) { + if (isInCreateMode()) { + this.innerModel().withWorkspaceRepositoryConfiguration(workspaceRepositoryConfiguration); + return this; + } else { + this.updateWorkspacePatchInfo.withWorkspaceRepositoryConfiguration(workspaceRepositoryConfiguration); + return this; + } + } + + public WorkspaceImpl withPurviewConfiguration(PurviewConfiguration purviewConfiguration) { + if (isInCreateMode()) { + this.innerModel().withPurviewConfiguration(purviewConfiguration); + return this; + } else { + this.updateWorkspacePatchInfo.withPurviewConfiguration(purviewConfiguration); + return this; + } + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedIdentitySqlControlSettingsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedIdentitySqlControlSettingsClientImpl.java new file mode 100644 index 0000000000000..dafb4c03bd2a1 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedIdentitySqlControlSettingsClientImpl.java @@ -0,0 +1,567 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.WorkspaceManagedIdentitySqlControlSettingsClient; +import com.azure.resourcemanager.synapse.fluent.models.ManagedIdentitySqlControlSettingsModelInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * WorkspaceManagedIdentitySqlControlSettingsClient. + */ +public final class WorkspaceManagedIdentitySqlControlSettingsClientImpl + implements WorkspaceManagedIdentitySqlControlSettingsClient { + private final ClientLogger logger = new ClientLogger(WorkspaceManagedIdentitySqlControlSettingsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final WorkspaceManagedIdentitySqlControlSettingsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of WorkspaceManagedIdentitySqlControlSettingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkspaceManagedIdentitySqlControlSettingsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + WorkspaceManagedIdentitySqlControlSettingsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientWorkspaceManagedIdentitySqlControlSettings to + * be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface WorkspaceManagedIdentitySqlControlSettingsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/managedIdentitySqlControlSettings/default") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/managedIdentitySqlControlSettings/default") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @BodyParam("application/json") + ManagedIdentitySqlControlSettingsModelInner managedIdentitySqlControlSettings, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get Managed Identity Sql Control Settings. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed Identity Sql Control Settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get Managed Identity Sql Control Settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed Identity Sql Control Settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context); + } + + /** + * Get Managed Identity Sql Control Settings. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed Identity Sql Control Settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName) { + return getWithResponseAsync(resourceGroupName, workspaceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get Managed Identity Sql Control Settings. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed Identity Sql Control Settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedIdentitySqlControlSettingsModelInner get(String resourceGroupName, String workspaceName) { + return getAsync(resourceGroupName, workspaceName).block(); + } + + /** + * Get Managed Identity Sql Control Settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed Identity Sql Control Settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, context).block(); + } + + /** + * Create or update Managed Identity Sql Control Settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param managedIdentitySqlControlSettings Managed Identity Sql Control Settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql Control Settings for workspace managed identity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + ManagedIdentitySqlControlSettingsModelInner managedIdentitySqlControlSettings) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (managedIdentitySqlControlSettings == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter managedIdentitySqlControlSettings is required and cannot be null.")); + } else { + managedIdentitySqlControlSettings.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + managedIdentitySqlControlSettings, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create or update Managed Identity Sql Control Settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param managedIdentitySqlControlSettings Managed Identity Sql Control Settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql Control Settings for workspace managed identity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + ManagedIdentitySqlControlSettingsModelInner managedIdentitySqlControlSettings, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (managedIdentitySqlControlSettings == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter managedIdentitySqlControlSettings is required and cannot be null.")); + } else { + managedIdentitySqlControlSettings.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + managedIdentitySqlControlSettings, + accept, + context); + } + + /** + * Create or update Managed Identity Sql Control Settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param managedIdentitySqlControlSettings Managed Identity Sql Control Settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql Control Settings for workspace managed identity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux< + PollResult, ManagedIdentitySqlControlSettingsModelInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + ManagedIdentitySqlControlSettingsModelInner managedIdentitySqlControlSettings) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, managedIdentitySqlControlSettings); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ManagedIdentitySqlControlSettingsModelInner.class, + ManagedIdentitySqlControlSettingsModelInner.class, + Context.NONE); + } + + /** + * Create or update Managed Identity Sql Control Settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param managedIdentitySqlControlSettings Managed Identity Sql Control Settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql Control Settings for workspace managed identity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux< + PollResult, ManagedIdentitySqlControlSettingsModelInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + ManagedIdentitySqlControlSettingsModelInner managedIdentitySqlControlSettings, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, managedIdentitySqlControlSettings, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ManagedIdentitySqlControlSettingsModelInner.class, + ManagedIdentitySqlControlSettingsModelInner.class, + context); + } + + /** + * Create or update Managed Identity Sql Control Settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param managedIdentitySqlControlSettings Managed Identity Sql Control Settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql Control Settings for workspace managed identity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller< + PollResult, ManagedIdentitySqlControlSettingsModelInner> + beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + ManagedIdentitySqlControlSettingsModelInner managedIdentitySqlControlSettings) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, managedIdentitySqlControlSettings) + .getSyncPoller(); + } + + /** + * Create or update Managed Identity Sql Control Settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param managedIdentitySqlControlSettings Managed Identity Sql Control Settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql Control Settings for workspace managed identity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller< + PollResult, ManagedIdentitySqlControlSettingsModelInner> + beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + ManagedIdentitySqlControlSettingsModelInner managedIdentitySqlControlSettings, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, managedIdentitySqlControlSettings, context) + .getSyncPoller(); + } + + /** + * Create or update Managed Identity Sql Control Settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param managedIdentitySqlControlSettings Managed Identity Sql Control Settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql Control Settings for workspace managed identity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + ManagedIdentitySqlControlSettingsModelInner managedIdentitySqlControlSettings) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, managedIdentitySqlControlSettings) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update Managed Identity Sql Control Settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param managedIdentitySqlControlSettings Managed Identity Sql Control Settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql Control Settings for workspace managed identity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + ManagedIdentitySqlControlSettingsModelInner managedIdentitySqlControlSettings, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, managedIdentitySqlControlSettings, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update Managed Identity Sql Control Settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param managedIdentitySqlControlSettings Managed Identity Sql Control Settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql Control Settings for workspace managed identity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedIdentitySqlControlSettingsModelInner createOrUpdate( + String resourceGroupName, + String workspaceName, + ManagedIdentitySqlControlSettingsModelInner managedIdentitySqlControlSettings) { + return createOrUpdateAsync(resourceGroupName, workspaceName, managedIdentitySqlControlSettings).block(); + } + + /** + * Create or update Managed Identity Sql Control Settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param managedIdentitySqlControlSettings Managed Identity Sql Control Settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql Control Settings for workspace managed identity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedIdentitySqlControlSettingsModelInner createOrUpdate( + String resourceGroupName, + String workspaceName, + ManagedIdentitySqlControlSettingsModelInner managedIdentitySqlControlSettings, + Context context) { + return createOrUpdateAsync(resourceGroupName, workspaceName, managedIdentitySqlControlSettings, context) + .block(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedIdentitySqlControlSettingsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedIdentitySqlControlSettingsImpl.java new file mode 100644 index 0000000000000..d7be04aeddf87 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedIdentitySqlControlSettingsImpl.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.WorkspaceManagedIdentitySqlControlSettingsClient; +import com.azure.resourcemanager.synapse.fluent.models.ManagedIdentitySqlControlSettingsModelInner; +import com.azure.resourcemanager.synapse.models.ManagedIdentitySqlControlSettingsModel; +import com.azure.resourcemanager.synapse.models.WorkspaceManagedIdentitySqlControlSettings; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class WorkspaceManagedIdentitySqlControlSettingsImpl + implements WorkspaceManagedIdentitySqlControlSettings { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(WorkspaceManagedIdentitySqlControlSettingsImpl.class); + + private final WorkspaceManagedIdentitySqlControlSettingsClient innerClient; + + private final SynapseManager serviceManager; + + public WorkspaceManagedIdentitySqlControlSettingsImpl( + WorkspaceManagedIdentitySqlControlSettingsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ManagedIdentitySqlControlSettingsModel get(String resourceGroupName, String workspaceName) { + ManagedIdentitySqlControlSettingsModelInner inner = this.serviceClient().get(resourceGroupName, workspaceName); + if (inner != null) { + return new ManagedIdentitySqlControlSettingsModelImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ManagedIdentitySqlControlSettingsModelImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ManagedIdentitySqlControlSettingsModel createOrUpdate( + String resourceGroupName, + String workspaceName, + ManagedIdentitySqlControlSettingsModelInner managedIdentitySqlControlSettings) { + ManagedIdentitySqlControlSettingsModelInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, managedIdentitySqlControlSettings); + if (inner != null) { + return new ManagedIdentitySqlControlSettingsModelImpl(inner, this.manager()); + } else { + return null; + } + } + + public ManagedIdentitySqlControlSettingsModel createOrUpdate( + String resourceGroupName, + String workspaceName, + ManagedIdentitySqlControlSettingsModelInner managedIdentitySqlControlSettings, + Context context) { + ManagedIdentitySqlControlSettingsModelInner inner = + this + .serviceClient() + .createOrUpdate(resourceGroupName, workspaceName, managedIdentitySqlControlSettings, context); + if (inner != null) { + return new ManagedIdentitySqlControlSettingsModelImpl(inner, this.manager()); + } else { + return null; + } + } + + private WorkspaceManagedIdentitySqlControlSettingsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerBlobAuditingPoliciesClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerBlobAuditingPoliciesClientImpl.java new file mode 100644 index 0000000000000..4e64ae2f305f0 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerBlobAuditingPoliciesClientImpl.java @@ -0,0 +1,898 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.WorkspaceManagedSqlServerBlobAuditingPoliciesClient; +import com.azure.resourcemanager.synapse.fluent.models.ServerBlobAuditingPolicyInner; +import com.azure.resourcemanager.synapse.models.BlobAuditingPolicyName; +import com.azure.resourcemanager.synapse.models.ServerBlobAuditingPolicyListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * WorkspaceManagedSqlServerBlobAuditingPoliciesClient. + */ +public final class WorkspaceManagedSqlServerBlobAuditingPoliciesClientImpl + implements WorkspaceManagedSqlServerBlobAuditingPoliciesClient { + private final ClientLogger logger = new ClientLogger(WorkspaceManagedSqlServerBlobAuditingPoliciesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final WorkspaceManagedSqlServerBlobAuditingPoliciesService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of WorkspaceManagedSqlServerBlobAuditingPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkspaceManagedSqlServerBlobAuditingPoliciesClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + WorkspaceManagedSqlServerBlobAuditingPoliciesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientWorkspaceManagedSqlServerBlobAuditingPolicies + * to be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface WorkspaceManagedSqlServerBlobAuditingPoliciesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/auditingSettings/{blobAuditingPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("blobAuditingPolicyName") BlobAuditingPolicyName blobAuditingPolicyName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/auditingSettings/{blobAuditingPolicyName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("blobAuditingPolicyName") BlobAuditingPolicyName blobAuditingPolicyName, + @BodyParam("application/json") ServerBlobAuditingPolicyInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/auditingSettings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspace( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspaceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get a workspace managed sql server'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 blobAuditingPolicyName The name of the blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace managed sql server's blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, BlobAuditingPolicyName blobAuditingPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (blobAuditingPolicyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter blobAuditingPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + blobAuditingPolicyName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get a workspace managed sql server'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 blobAuditingPolicyName The name of the blob auditing policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace managed sql server's blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (blobAuditingPolicyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter blobAuditingPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + blobAuditingPolicyName, + accept, + context); + } + + /** + * Get a workspace managed sql server'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 blobAuditingPolicyName The name of the blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace managed sql server's blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, BlobAuditingPolicyName blobAuditingPolicyName) { + return getWithResponseAsync(resourceGroupName, workspaceName, blobAuditingPolicyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a workspace managed sql server'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 blobAuditingPolicyName The name of the blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace managed sql server's blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerBlobAuditingPolicyInner get( + String resourceGroupName, String workspaceName, BlobAuditingPolicyName blobAuditingPolicyName) { + return getAsync(resourceGroupName, workspaceName, blobAuditingPolicyName).block(); + } + + /** + * Get a workspace managed sql server'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 blobAuditingPolicyName The name of the blob auditing policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace managed sql server's blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, blobAuditingPolicyName, context).block(); + } + + /** + * Create or Update a workspace managed sql server'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 blobAuditingPolicyName The name of the blob auditing policy. + * @param parameters Properties of extended blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + ServerBlobAuditingPolicyInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (blobAuditingPolicyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter blobAuditingPolicyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + blobAuditingPolicyName, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create or Update a workspace managed sql server'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 blobAuditingPolicyName The name of the blob auditing policy. + * @param parameters Properties of extended blob auditing policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + ServerBlobAuditingPolicyInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (blobAuditingPolicyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter blobAuditingPolicyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + blobAuditingPolicyName, + parameters, + accept, + context); + } + + /** + * Create or Update a workspace managed sql server'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 blobAuditingPolicyName The name of the blob auditing policy. + * @param parameters Properties of extended blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ServerBlobAuditingPolicyInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + ServerBlobAuditingPolicyInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, blobAuditingPolicyName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ServerBlobAuditingPolicyInner.class, + ServerBlobAuditingPolicyInner.class, + Context.NONE); + } + + /** + * Create or Update a workspace managed sql server'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 blobAuditingPolicyName The name of the blob auditing policy. + * @param parameters Properties of extended blob auditing policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ServerBlobAuditingPolicyInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + ServerBlobAuditingPolicyInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, blobAuditingPolicyName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ServerBlobAuditingPolicyInner.class, + ServerBlobAuditingPolicyInner.class, + context); + } + + /** + * Create or Update a workspace managed sql server'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 blobAuditingPolicyName The name of the blob auditing policy. + * @param parameters Properties of extended blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ServerBlobAuditingPolicyInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + ServerBlobAuditingPolicyInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, blobAuditingPolicyName, parameters) + .getSyncPoller(); + } + + /** + * Create or Update a workspace managed sql server'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 blobAuditingPolicyName The name of the blob auditing policy. + * @param parameters Properties of extended blob auditing policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ServerBlobAuditingPolicyInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + ServerBlobAuditingPolicyInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, blobAuditingPolicyName, parameters, context) + .getSyncPoller(); + } + + /** + * Create or Update a workspace managed sql server'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 blobAuditingPolicyName The name of the blob auditing policy. + * @param parameters Properties of extended blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + ServerBlobAuditingPolicyInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, blobAuditingPolicyName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update a workspace managed sql server'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 blobAuditingPolicyName The name of the blob auditing policy. + * @param parameters Properties of extended blob auditing policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + ServerBlobAuditingPolicyInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, blobAuditingPolicyName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update a workspace managed sql server'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 blobAuditingPolicyName The name of the blob auditing policy. + * @param parameters Properties of extended blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerBlobAuditingPolicyInner createOrUpdate( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + ServerBlobAuditingPolicyInner parameters) { + return createOrUpdateAsync(resourceGroupName, workspaceName, blobAuditingPolicyName, parameters).block(); + } + + /** + * Create or Update a workspace managed sql server'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 blobAuditingPolicyName The name of the blob auditing policy. + * @param parameters Properties of extended blob auditing policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerBlobAuditingPolicyInner createOrUpdate( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + ServerBlobAuditingPolicyInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, workspaceName, blobAuditingPolicyName, parameters, context) + .block(); + } + + /** + * List workspace managed sql server's blob auditing policies. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server auditing settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceSinglePageAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByWorkspace( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * List workspace managed sql server's blob auditing policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server auditing settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByWorkspace( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List workspace managed sql server's blob auditing policies. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server auditing settings. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync( + String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); + } + + /** + * List workspace managed sql server's blob auditing policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server auditing settings. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync( + String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink, context)); + } + + /** + * List workspace managed sql server's blob auditing policies. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server auditing settings. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName)); + } + + /** + * List workspace managed sql server's blob auditing policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server auditing settings. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server auditing settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server auditing settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerBlobAuditingPoliciesImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerBlobAuditingPoliciesImpl.java new file mode 100644 index 0000000000000..e8297ae429b1c --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerBlobAuditingPoliciesImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.WorkspaceManagedSqlServerBlobAuditingPoliciesClient; +import com.azure.resourcemanager.synapse.fluent.models.ServerBlobAuditingPolicyInner; +import com.azure.resourcemanager.synapse.models.BlobAuditingPolicyName; +import com.azure.resourcemanager.synapse.models.ServerBlobAuditingPolicy; +import com.azure.resourcemanager.synapse.models.WorkspaceManagedSqlServerBlobAuditingPolicies; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class WorkspaceManagedSqlServerBlobAuditingPoliciesImpl + implements WorkspaceManagedSqlServerBlobAuditingPolicies { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(WorkspaceManagedSqlServerBlobAuditingPoliciesImpl.class); + + private final WorkspaceManagedSqlServerBlobAuditingPoliciesClient innerClient; + + private final SynapseManager serviceManager; + + public WorkspaceManagedSqlServerBlobAuditingPoliciesImpl( + WorkspaceManagedSqlServerBlobAuditingPoliciesClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ServerBlobAuditingPolicy get( + String resourceGroupName, String workspaceName, BlobAuditingPolicyName blobAuditingPolicyName) { + ServerBlobAuditingPolicyInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, blobAuditingPolicyName); + if (inner != null) { + return new ServerBlobAuditingPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, blobAuditingPolicyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ServerBlobAuditingPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { + PagedIterable inner = + this.serviceClient().listByWorkspace(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new ServerBlobAuditingPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = + this.serviceClient().listByWorkspace(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new ServerBlobAuditingPolicyImpl(inner1, this.manager())); + } + + public ServerBlobAuditingPolicy getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + BlobAuditingPolicyName blobAuditingPolicyName = + BlobAuditingPolicyName.fromString(Utils.getValueFromIdByName(id, "auditingSettings")); + if (blobAuditingPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'auditingSettings'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, blobAuditingPolicyName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + BlobAuditingPolicyName blobAuditingPolicyName = + BlobAuditingPolicyName.fromString(Utils.getValueFromIdByName(id, "auditingSettings")); + if (blobAuditingPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'auditingSettings'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, blobAuditingPolicyName, context); + } + + private WorkspaceManagedSqlServerBlobAuditingPoliciesClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + public ServerBlobAuditingPolicyImpl define(BlobAuditingPolicyName name) { + return new ServerBlobAuditingPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerEncryptionProtectorsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerEncryptionProtectorsClientImpl.java new file mode 100644 index 0000000000000..c2f1e9668429e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerEncryptionProtectorsClientImpl.java @@ -0,0 +1,1178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.WorkspaceManagedSqlServerEncryptionProtectorsClient; +import com.azure.resourcemanager.synapse.fluent.models.EncryptionProtectorInner; +import com.azure.resourcemanager.synapse.models.EncryptionProtectorListResult; +import com.azure.resourcemanager.synapse.models.EncryptionProtectorName; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * WorkspaceManagedSqlServerEncryptionProtectorsClient. + */ +public final class WorkspaceManagedSqlServerEncryptionProtectorsClientImpl + implements WorkspaceManagedSqlServerEncryptionProtectorsClient { + private final ClientLogger logger = new ClientLogger(WorkspaceManagedSqlServerEncryptionProtectorsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final WorkspaceManagedSqlServerEncryptionProtectorsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of WorkspaceManagedSqlServerEncryptionProtectorsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkspaceManagedSqlServerEncryptionProtectorsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + WorkspaceManagedSqlServerEncryptionProtectorsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientWorkspaceManagedSqlServerEncryptionProtectors + * to be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface WorkspaceManagedSqlServerEncryptionProtectorsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/encryptionProtector/{encryptionProtectorName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("encryptionProtectorName") EncryptionProtectorName encryptionProtectorName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/encryptionProtector/{encryptionProtectorName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("encryptionProtectorName") EncryptionProtectorName encryptionProtectorName, + @BodyParam("application/json") EncryptionProtectorInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/encryptionProtector") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/encryptionProtector/{encryptionProtectorName}/revalidate") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> revalidate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("encryptionProtectorName") EncryptionProtectorName encryptionProtectorName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get workspace managed sql server's encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's encryption protector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, EncryptionProtectorName encryptionProtectorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (encryptionProtectorName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter encryptionProtectorName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + encryptionProtectorName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get workspace managed sql server's encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's encryption protector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + EncryptionProtectorName encryptionProtectorName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (encryptionProtectorName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter encryptionProtectorName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + encryptionProtectorName, + accept, + context); + } + + /** + * Get workspace managed sql server's encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's encryption protector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, EncryptionProtectorName encryptionProtectorName) { + return getWithResponseAsync(resourceGroupName, workspaceName, encryptionProtectorName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get workspace managed sql server's encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's encryption protector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EncryptionProtectorInner get( + String resourceGroupName, String workspaceName, EncryptionProtectorName encryptionProtectorName) { + return getAsync(resourceGroupName, workspaceName, encryptionProtectorName).block(); + } + + /** + * Get workspace managed sql server's encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's encryption protector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + EncryptionProtectorName encryptionProtectorName, + Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, encryptionProtectorName, context).block(); + } + + /** + * Updates workspace managed sql server's encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @param parameters The requested encryption protector resource state. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the server encryption protector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + EncryptionProtectorName encryptionProtectorName, + EncryptionProtectorInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (encryptionProtectorName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter encryptionProtectorName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + encryptionProtectorName, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates workspace managed sql server's encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @param parameters The requested encryption protector resource state. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the server encryption protector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + EncryptionProtectorName encryptionProtectorName, + EncryptionProtectorInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (encryptionProtectorName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter encryptionProtectorName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + encryptionProtectorName, + parameters, + accept, + context); + } + + /** + * Updates workspace managed sql server's encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @param parameters The requested encryption protector resource state. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the server encryption protector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, EncryptionProtectorInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + EncryptionProtectorName encryptionProtectorName, + EncryptionProtectorInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, encryptionProtectorName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + EncryptionProtectorInner.class, + EncryptionProtectorInner.class, + Context.NONE); + } + + /** + * Updates workspace managed sql server's encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @param parameters The requested encryption protector resource state. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the server encryption protector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, EncryptionProtectorInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + EncryptionProtectorName encryptionProtectorName, + EncryptionProtectorInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, encryptionProtectorName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + EncryptionProtectorInner.class, + EncryptionProtectorInner.class, + context); + } + + /** + * Updates workspace managed sql server's encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @param parameters The requested encryption protector resource state. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the server encryption protector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, EncryptionProtectorInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + EncryptionProtectorName encryptionProtectorName, + EncryptionProtectorInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, encryptionProtectorName, parameters) + .getSyncPoller(); + } + + /** + * Updates workspace managed sql server's encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @param parameters The requested encryption protector resource state. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the server encryption protector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, EncryptionProtectorInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + EncryptionProtectorName encryptionProtectorName, + EncryptionProtectorInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, encryptionProtectorName, parameters, context) + .getSyncPoller(); + } + + /** + * Updates workspace managed sql server's encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @param parameters The requested encryption protector resource state. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the server encryption protector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + EncryptionProtectorName encryptionProtectorName, + EncryptionProtectorInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, encryptionProtectorName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates workspace managed sql server's encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @param parameters The requested encryption protector resource state. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the server encryption protector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + EncryptionProtectorName encryptionProtectorName, + EncryptionProtectorInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, encryptionProtectorName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates workspace managed sql server's encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @param parameters The requested encryption protector resource state. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the server encryption protector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EncryptionProtectorInner createOrUpdate( + String resourceGroupName, + String workspaceName, + EncryptionProtectorName encryptionProtectorName, + EncryptionProtectorInner parameters) { + return createOrUpdateAsync(resourceGroupName, workspaceName, encryptionProtectorName, parameters).block(); + } + + /** + * Updates workspace managed sql server's encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @param parameters The requested encryption protector resource state. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the server encryption protector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public EncryptionProtectorInner createOrUpdate( + String resourceGroupName, + String workspaceName, + EncryptionProtectorName encryptionProtectorName, + EncryptionProtectorInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, workspaceName, encryptionProtectorName, parameters, context) + .block(); + } + + /** + * Get list of encryption protectors for workspace managed sql server. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption protectors for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get list of encryption protectors for workspace managed sql server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption protectors for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get list of encryption protectors for workspace managed sql server. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption protectors for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get list of encryption protectors for workspace managed sql server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption protectors for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get list of encryption protectors for workspace managed sql server. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption protectors for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); + } + + /** + * Get list of encryption protectors for workspace managed sql server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption protectors for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Revalidates workspace managed sql server's existing encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> revalidateWithResponseAsync( + String resourceGroupName, String workspaceName, EncryptionProtectorName encryptionProtectorName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (encryptionProtectorName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter encryptionProtectorName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .revalidate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + encryptionProtectorName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Revalidates workspace managed sql server's existing encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> revalidateWithResponseAsync( + String resourceGroupName, + String workspaceName, + EncryptionProtectorName encryptionProtectorName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (encryptionProtectorName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter encryptionProtectorName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .revalidate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + encryptionProtectorName, + context); + } + + /** + * Revalidates workspace managed sql server's existing encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRevalidateAsync( + String resourceGroupName, String workspaceName, EncryptionProtectorName encryptionProtectorName) { + Mono>> mono = + revalidateWithResponseAsync(resourceGroupName, workspaceName, encryptionProtectorName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Revalidates workspace managed sql server's existing encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRevalidateAsync( + String resourceGroupName, + String workspaceName, + EncryptionProtectorName encryptionProtectorName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + revalidateWithResponseAsync(resourceGroupName, workspaceName, encryptionProtectorName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Revalidates workspace managed sql server's existing encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRevalidate( + String resourceGroupName, String workspaceName, EncryptionProtectorName encryptionProtectorName) { + return beginRevalidateAsync(resourceGroupName, workspaceName, encryptionProtectorName).getSyncPoller(); + } + + /** + * Revalidates workspace managed sql server's existing encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRevalidate( + String resourceGroupName, + String workspaceName, + EncryptionProtectorName encryptionProtectorName, + Context context) { + return beginRevalidateAsync(resourceGroupName, workspaceName, encryptionProtectorName, context).getSyncPoller(); + } + + /** + * Revalidates workspace managed sql server's existing encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono revalidateAsync( + String resourceGroupName, String workspaceName, EncryptionProtectorName encryptionProtectorName) { + return beginRevalidateAsync(resourceGroupName, workspaceName, encryptionProtectorName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Revalidates workspace managed sql server's existing encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono revalidateAsync( + String resourceGroupName, + String workspaceName, + EncryptionProtectorName encryptionProtectorName, + Context context) { + return beginRevalidateAsync(resourceGroupName, workspaceName, encryptionProtectorName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Revalidates workspace managed sql server's existing encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void revalidate( + String resourceGroupName, String workspaceName, EncryptionProtectorName encryptionProtectorName) { + revalidateAsync(resourceGroupName, workspaceName, encryptionProtectorName).block(); + } + + /** + * Revalidates workspace managed sql server's existing encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void revalidate( + String resourceGroupName, + String workspaceName, + EncryptionProtectorName encryptionProtectorName, + Context context) { + revalidateAsync(resourceGroupName, workspaceName, encryptionProtectorName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server encryption protectors. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server encryption protectors. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerEncryptionProtectorsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerEncryptionProtectorsImpl.java new file mode 100644 index 0000000000000..d3b13584492af --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerEncryptionProtectorsImpl.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.WorkspaceManagedSqlServerEncryptionProtectorsClient; +import com.azure.resourcemanager.synapse.fluent.models.EncryptionProtectorInner; +import com.azure.resourcemanager.synapse.models.EncryptionProtector; +import com.azure.resourcemanager.synapse.models.EncryptionProtectorName; +import com.azure.resourcemanager.synapse.models.WorkspaceManagedSqlServerEncryptionProtectors; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class WorkspaceManagedSqlServerEncryptionProtectorsImpl + implements WorkspaceManagedSqlServerEncryptionProtectors { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(WorkspaceManagedSqlServerEncryptionProtectorsImpl.class); + + private final WorkspaceManagedSqlServerEncryptionProtectorsClient innerClient; + + private final SynapseManager serviceManager; + + public WorkspaceManagedSqlServerEncryptionProtectorsImpl( + WorkspaceManagedSqlServerEncryptionProtectorsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public EncryptionProtector get( + String resourceGroupName, String workspaceName, EncryptionProtectorName encryptionProtectorName) { + EncryptionProtectorInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, encryptionProtectorName); + if (inner != null) { + return new EncryptionProtectorImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + EncryptionProtectorName encryptionProtectorName, + Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, encryptionProtectorName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new EncryptionProtectorImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new EncryptionProtectorImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new EncryptionProtectorImpl(inner1, this.manager())); + } + + public void revalidate( + String resourceGroupName, String workspaceName, EncryptionProtectorName encryptionProtectorName) { + this.serviceClient().revalidate(resourceGroupName, workspaceName, encryptionProtectorName); + } + + public void revalidate( + String resourceGroupName, + String workspaceName, + EncryptionProtectorName encryptionProtectorName, + Context context) { + this.serviceClient().revalidate(resourceGroupName, workspaceName, encryptionProtectorName, context); + } + + public EncryptionProtector getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + EncryptionProtectorName encryptionProtectorName = + EncryptionProtectorName.fromString(Utils.getValueFromIdByName(id, "encryptionProtector")); + if (encryptionProtectorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'encryptionProtector'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, encryptionProtectorName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + EncryptionProtectorName encryptionProtectorName = + EncryptionProtectorName.fromString(Utils.getValueFromIdByName(id, "encryptionProtector")); + if (encryptionProtectorName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'encryptionProtector'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, encryptionProtectorName, context); + } + + private WorkspaceManagedSqlServerEncryptionProtectorsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + public EncryptionProtectorImpl define(EncryptionProtectorName name) { + return new EncryptionProtectorImpl(name, this.manager()); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClientImpl.java new file mode 100644 index 0000000000000..7a80de49442ba --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClientImpl.java @@ -0,0 +1,903 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClient; +import com.azure.resourcemanager.synapse.fluent.models.ExtendedServerBlobAuditingPolicyInner; +import com.azure.resourcemanager.synapse.models.BlobAuditingPolicyName; +import com.azure.resourcemanager.synapse.models.ExtendedServerBlobAuditingPolicyListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClient. + */ +public final class WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClientImpl + implements WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClient { + private final ClientLogger logger = + new ClientLogger(WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * SynapseManagementClientWorkspaceManagedSqlServerExtendedBlobAuditingPolicies to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/extendedAuditingSettings/{blobAuditingPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("blobAuditingPolicyName") BlobAuditingPolicyName blobAuditingPolicyName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/extendedAuditingSettings/{blobAuditingPolicyName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("blobAuditingPolicyName") BlobAuditingPolicyName blobAuditingPolicyName, + @BodyParam("application/json") ExtendedServerBlobAuditingPolicyInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/extendedAuditingSettings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspace( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspaceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get a workspace SQL server's extended blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param blobAuditingPolicyName The name of the blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace SQL server's extended blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, BlobAuditingPolicyName blobAuditingPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (blobAuditingPolicyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter blobAuditingPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + blobAuditingPolicyName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get a workspace SQL server's extended blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param blobAuditingPolicyName The name of the blob auditing policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace SQL server's extended blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (blobAuditingPolicyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter blobAuditingPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + blobAuditingPolicyName, + accept, + context); + } + + /** + * Get a workspace SQL server's extended blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param blobAuditingPolicyName The name of the blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace SQL server's extended blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, BlobAuditingPolicyName blobAuditingPolicyName) { + return getWithResponseAsync(resourceGroupName, workspaceName, blobAuditingPolicyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a workspace SQL server's extended blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param blobAuditingPolicyName The name of the blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace SQL server's extended blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExtendedServerBlobAuditingPolicyInner get( + String resourceGroupName, String workspaceName, BlobAuditingPolicyName blobAuditingPolicyName) { + return getAsync(resourceGroupName, workspaceName, blobAuditingPolicyName).block(); + } + + /** + * Get a workspace SQL server's extended blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param blobAuditingPolicyName The name of the blob auditing policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace SQL server's extended blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, blobAuditingPolicyName, context).block(); + } + + /** + * Create or Update a workspace managed sql server's extended blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param blobAuditingPolicyName The name of the blob auditing policy. + * @param parameters Properties of extended blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended server blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + ExtendedServerBlobAuditingPolicyInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (blobAuditingPolicyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter blobAuditingPolicyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + blobAuditingPolicyName, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create or Update a workspace managed sql server's extended blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param blobAuditingPolicyName The name of the blob auditing policy. + * @param parameters Properties of extended blob auditing policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended server blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + ExtendedServerBlobAuditingPolicyInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (blobAuditingPolicyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter blobAuditingPolicyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + blobAuditingPolicyName, + parameters, + accept, + context); + } + + /** + * Create or Update a workspace managed sql server's extended blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param blobAuditingPolicyName The name of the blob auditing policy. + * @param parameters Properties of extended blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended server blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ExtendedServerBlobAuditingPolicyInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + ExtendedServerBlobAuditingPolicyInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, blobAuditingPolicyName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExtendedServerBlobAuditingPolicyInner.class, + ExtendedServerBlobAuditingPolicyInner.class, + Context.NONE); + } + + /** + * Create or Update a workspace managed sql server's extended blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param blobAuditingPolicyName The name of the blob auditing policy. + * @param parameters Properties of extended blob auditing policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended server blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ExtendedServerBlobAuditingPolicyInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + ExtendedServerBlobAuditingPolicyInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, blobAuditingPolicyName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ExtendedServerBlobAuditingPolicyInner.class, + ExtendedServerBlobAuditingPolicyInner.class, + context); + } + + /** + * Create or Update a workspace managed sql server's extended blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param blobAuditingPolicyName The name of the blob auditing policy. + * @param parameters Properties of extended blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended server blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ExtendedServerBlobAuditingPolicyInner> + beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + ExtendedServerBlobAuditingPolicyInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, blobAuditingPolicyName, parameters) + .getSyncPoller(); + } + + /** + * Create or Update a workspace managed sql server's extended blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param blobAuditingPolicyName The name of the blob auditing policy. + * @param parameters Properties of extended blob auditing policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended server blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ExtendedServerBlobAuditingPolicyInner> + beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + ExtendedServerBlobAuditingPolicyInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, blobAuditingPolicyName, parameters, context) + .getSyncPoller(); + } + + /** + * Create or Update a workspace managed sql server's extended blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param blobAuditingPolicyName The name of the blob auditing policy. + * @param parameters Properties of extended blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended server blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + ExtendedServerBlobAuditingPolicyInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, blobAuditingPolicyName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update a workspace managed sql server's extended blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param blobAuditingPolicyName The name of the blob auditing policy. + * @param parameters Properties of extended blob auditing policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended server blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + ExtendedServerBlobAuditingPolicyInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, blobAuditingPolicyName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update a workspace managed sql server's extended blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param blobAuditingPolicyName The name of the blob auditing policy. + * @param parameters Properties of extended blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended server blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExtendedServerBlobAuditingPolicyInner createOrUpdate( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + ExtendedServerBlobAuditingPolicyInner parameters) { + return createOrUpdateAsync(resourceGroupName, workspaceName, blobAuditingPolicyName, parameters).block(); + } + + /** + * Create or Update a workspace managed sql server's extended blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param blobAuditingPolicyName The name of the blob auditing policy. + * @param parameters Properties of extended blob auditing policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended server blob auditing policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExtendedServerBlobAuditingPolicyInner createOrUpdate( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + ExtendedServerBlobAuditingPolicyInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, workspaceName, blobAuditingPolicyName, parameters, context) + .block(); + } + + /** + * List workspace managed sql server's extended blob auditing policies. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server extended auditing settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceSinglePageAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByWorkspace( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * List workspace managed sql server's extended blob auditing policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server extended auditing settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByWorkspace( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * List workspace managed sql server's extended blob auditing policies. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server extended auditing settings. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync( + String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); + } + + /** + * List workspace managed sql server's extended blob auditing policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server extended auditing settings. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync( + String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink, context)); + } + + /** + * List workspace managed sql server's extended blob auditing policies. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server extended auditing settings. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName)); + } + + /** + * List workspace managed sql server's extended blob auditing policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server extended auditing settings. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server extended auditing settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server extended auditing settings. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesImpl.java new file mode 100644 index 0000000000000..0adde3eff0d89 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesImpl.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClient; +import com.azure.resourcemanager.synapse.fluent.models.ExtendedServerBlobAuditingPolicyInner; +import com.azure.resourcemanager.synapse.models.BlobAuditingPolicyName; +import com.azure.resourcemanager.synapse.models.ExtendedServerBlobAuditingPolicy; +import com.azure.resourcemanager.synapse.models.WorkspaceManagedSqlServerExtendedBlobAuditingPolicies; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesImpl + implements WorkspaceManagedSqlServerExtendedBlobAuditingPolicies { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesImpl.class); + + private final WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClient innerClient; + + private final SynapseManager serviceManager; + + public WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesImpl( + WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ExtendedServerBlobAuditingPolicy get( + String resourceGroupName, String workspaceName, BlobAuditingPolicyName blobAuditingPolicyName) { + ExtendedServerBlobAuditingPolicyInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, blobAuditingPolicyName); + if (inner != null) { + return new ExtendedServerBlobAuditingPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + BlobAuditingPolicyName blobAuditingPolicyName, + Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, blobAuditingPolicyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExtendedServerBlobAuditingPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName) { + PagedIterable inner = + this.serviceClient().listByWorkspace(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new ExtendedServerBlobAuditingPolicyImpl(inner1, this.manager())); + } + + public PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = + this.serviceClient().listByWorkspace(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new ExtendedServerBlobAuditingPolicyImpl(inner1, this.manager())); + } + + public ExtendedServerBlobAuditingPolicy getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + BlobAuditingPolicyName blobAuditingPolicyName = + BlobAuditingPolicyName.fromString(Utils.getValueFromIdByName(id, "extendedAuditingSettings")); + if (blobAuditingPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'extendedAuditingSettings'.", + id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, blobAuditingPolicyName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + BlobAuditingPolicyName blobAuditingPolicyName = + BlobAuditingPolicyName.fromString(Utils.getValueFromIdByName(id, "extendedAuditingSettings")); + if (blobAuditingPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'extendedAuditingSettings'.", + id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, blobAuditingPolicyName, context); + } + + private WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + public ExtendedServerBlobAuditingPolicyImpl define(BlobAuditingPolicyName name) { + return new ExtendedServerBlobAuditingPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerRecoverableSqlPoolsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerRecoverableSqlPoolsClientImpl.java new file mode 100644 index 0000000000000..d4a4cfc3ef695 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerRecoverableSqlPoolsClientImpl.java @@ -0,0 +1,523 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.WorkspaceManagedSqlServerRecoverableSqlPoolsClient; +import com.azure.resourcemanager.synapse.fluent.models.RecoverableSqlPoolInner; +import com.azure.resourcemanager.synapse.models.RecoverableSqlPoolListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * WorkspaceManagedSqlServerRecoverableSqlPoolsClient. + */ +public final class WorkspaceManagedSqlServerRecoverableSqlPoolsClientImpl + implements WorkspaceManagedSqlServerRecoverableSqlPoolsClient { + private final ClientLogger logger = new ClientLogger(WorkspaceManagedSqlServerRecoverableSqlPoolsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final WorkspaceManagedSqlServerRecoverableSqlPoolsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of WorkspaceManagedSqlServerRecoverableSqlPoolsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkspaceManagedSqlServerRecoverableSqlPoolsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + WorkspaceManagedSqlServerRecoverableSqlPoolsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientWorkspaceManagedSqlServerRecoverableSqlPools + * to be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface WorkspaceManagedSqlServerRecoverableSqlPoolsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/recoverableSqlPools") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/recoverableSqlPools/{sqlPoolName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("sqlPoolName") String sqlPoolName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get list of recoverable sql pools for workspace managed sql server. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of recoverable sql pools for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get list of recoverable sql pools for workspace managed sql server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of recoverable sql pools for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get list of recoverable sql pools for workspace managed sql server. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of recoverable sql pools for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get list of recoverable sql pools for workspace managed sql server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of recoverable sql pools for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get list of recoverable sql pools for workspace managed sql server. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of recoverable sql pools for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); + } + + /** + * Get list of recoverable sql pools for workspace managed sql server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of recoverable sql pools for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Get recoverable sql pools for workspace managed sql server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sqlPoolName The name of the sql pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recoverable sql pools for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get recoverable sql pools for workspace managed sql server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sqlPoolName The name of the sql pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recoverable sql pools for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (sqlPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter sqlPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + sqlPoolName, + accept, + context); + } + + /** + * Get recoverable sql pools for workspace managed sql server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sqlPoolName The name of the sql pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recoverable sql pools for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String sqlPoolName) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get recoverable sql pools for workspace managed sql server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sqlPoolName The name of the sql pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recoverable sql pools for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoverableSqlPoolInner get(String resourceGroupName, String workspaceName, String sqlPoolName) { + return getAsync(resourceGroupName, workspaceName, sqlPoolName).block(); + } + + /** + * Get recoverable sql pools for workspace managed sql server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sqlPoolName The name of the sql pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recoverable sql pools for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, sqlPoolName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a list recoverable sql pools request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response to a list recoverable sql pools request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerRecoverableSqlPoolsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerRecoverableSqlPoolsImpl.java new file mode 100644 index 0000000000000..edb8d33f1f477 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerRecoverableSqlPoolsImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.WorkspaceManagedSqlServerRecoverableSqlPoolsClient; +import com.azure.resourcemanager.synapse.fluent.models.RecoverableSqlPoolInner; +import com.azure.resourcemanager.synapse.models.RecoverableSqlPool; +import com.azure.resourcemanager.synapse.models.WorkspaceManagedSqlServerRecoverableSqlPools; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class WorkspaceManagedSqlServerRecoverableSqlPoolsImpl + implements WorkspaceManagedSqlServerRecoverableSqlPools { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(WorkspaceManagedSqlServerRecoverableSqlPoolsImpl.class); + + private final WorkspaceManagedSqlServerRecoverableSqlPoolsClient innerClient; + + private final SynapseManager serviceManager; + + public WorkspaceManagedSqlServerRecoverableSqlPoolsImpl( + WorkspaceManagedSqlServerRecoverableSqlPoolsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new RecoverableSqlPoolImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new RecoverableSqlPoolImpl(inner1, this.manager())); + } + + public RecoverableSqlPool get(String resourceGroupName, String workspaceName, String sqlPoolName) { + RecoverableSqlPoolInner inner = this.serviceClient().get(resourceGroupName, workspaceName, sqlPoolName); + if (inner != null) { + return new RecoverableSqlPoolImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, sqlPoolName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RecoverableSqlPoolImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private WorkspaceManagedSqlServerRecoverableSqlPoolsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerSecurityAlertPoliciesClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerSecurityAlertPoliciesClientImpl.java new file mode 100644 index 0000000000000..492591f59d4ce --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerSecurityAlertPoliciesClientImpl.java @@ -0,0 +1,896 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.WorkspaceManagedSqlServerSecurityAlertPoliciesClient; +import com.azure.resourcemanager.synapse.fluent.models.ServerSecurityAlertPolicyInner; +import com.azure.resourcemanager.synapse.models.SecurityAlertPolicyNameAutoGenerated; +import com.azure.resourcemanager.synapse.models.ServerSecurityAlertPolicyListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * WorkspaceManagedSqlServerSecurityAlertPoliciesClient. + */ +public final class WorkspaceManagedSqlServerSecurityAlertPoliciesClientImpl + implements WorkspaceManagedSqlServerSecurityAlertPoliciesClient { + private final ClientLogger logger = + new ClientLogger(WorkspaceManagedSqlServerSecurityAlertPoliciesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final WorkspaceManagedSqlServerSecurityAlertPoliciesService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of WorkspaceManagedSqlServerSecurityAlertPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkspaceManagedSqlServerSecurityAlertPoliciesClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + WorkspaceManagedSqlServerSecurityAlertPoliciesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientWorkspaceManagedSqlServerSecurityAlertPolicies + * to be used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface WorkspaceManagedSqlServerSecurityAlertPoliciesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/securityAlertPolicies/{securityAlertPolicyName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("securityAlertPolicyName") SecurityAlertPolicyNameAutoGenerated securityAlertPolicyName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/securityAlertPolicies/{securityAlertPolicyName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("securityAlertPolicyName") SecurityAlertPolicyNameAutoGenerated securityAlertPolicyName, + @BodyParam("application/json") ServerSecurityAlertPolicyInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/securityAlertPolicies") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get a workspace managed sql server's security alert policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param securityAlertPolicyName The name of the security alert policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace managed sql server's security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, SecurityAlertPolicyNameAutoGenerated securityAlertPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (securityAlertPolicyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter securityAlertPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + securityAlertPolicyName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get a workspace managed sql server's security alert policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param securityAlertPolicyName The name of the security alert policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace managed sql server's security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + SecurityAlertPolicyNameAutoGenerated securityAlertPolicyName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (securityAlertPolicyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter securityAlertPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + securityAlertPolicyName, + accept, + context); + } + + /** + * Get a workspace managed sql server's security alert policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param securityAlertPolicyName The name of the security alert policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace managed sql server's security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, SecurityAlertPolicyNameAutoGenerated securityAlertPolicyName) { + return getWithResponseAsync(resourceGroupName, workspaceName, securityAlertPolicyName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a workspace managed sql server's security alert policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param securityAlertPolicyName The name of the security alert policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace managed sql server's security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerSecurityAlertPolicyInner get( + String resourceGroupName, String workspaceName, SecurityAlertPolicyNameAutoGenerated securityAlertPolicyName) { + return getAsync(resourceGroupName, workspaceName, securityAlertPolicyName).block(); + } + + /** + * Get a workspace managed sql server's security alert policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param securityAlertPolicyName The name of the security alert policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace managed sql server's security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + SecurityAlertPolicyNameAutoGenerated securityAlertPolicyName, + Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, securityAlertPolicyName, context).block(); + } + + /** + * Create or Update a workspace managed sql server's threat detection policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param securityAlertPolicyName The name of the security alert policy. + * @param parameters The workspace managed sql server security alert policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed Sql server security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + SecurityAlertPolicyNameAutoGenerated securityAlertPolicyName, + ServerSecurityAlertPolicyInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (securityAlertPolicyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter securityAlertPolicyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + securityAlertPolicyName, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create or Update a workspace managed sql server's threat detection policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param securityAlertPolicyName The name of the security alert policy. + * @param parameters The workspace managed sql server security alert policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed Sql server security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + SecurityAlertPolicyNameAutoGenerated securityAlertPolicyName, + ServerSecurityAlertPolicyInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (securityAlertPolicyName == null) { + return Mono + .error( + new IllegalArgumentException("Parameter securityAlertPolicyName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + securityAlertPolicyName, + parameters, + accept, + context); + } + + /** + * Create or Update a workspace managed sql server's threat detection policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param securityAlertPolicyName The name of the security alert policy. + * @param parameters The workspace managed sql server security alert policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed Sql server security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ServerSecurityAlertPolicyInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + SecurityAlertPolicyNameAutoGenerated securityAlertPolicyName, + ServerSecurityAlertPolicyInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, securityAlertPolicyName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ServerSecurityAlertPolicyInner.class, + ServerSecurityAlertPolicyInner.class, + Context.NONE); + } + + /** + * Create or Update a workspace managed sql server's threat detection policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param securityAlertPolicyName The name of the security alert policy. + * @param parameters The workspace managed sql server security alert policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed Sql server security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ServerSecurityAlertPolicyInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String workspaceName, + SecurityAlertPolicyNameAutoGenerated securityAlertPolicyName, + ServerSecurityAlertPolicyInner parameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, securityAlertPolicyName, parameters, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ServerSecurityAlertPolicyInner.class, + ServerSecurityAlertPolicyInner.class, + context); + } + + /** + * Create or Update a workspace managed sql server's threat detection policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param securityAlertPolicyName The name of the security alert policy. + * @param parameters The workspace managed sql server security alert policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed Sql server security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ServerSecurityAlertPolicyInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + SecurityAlertPolicyNameAutoGenerated securityAlertPolicyName, + ServerSecurityAlertPolicyInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, securityAlertPolicyName, parameters) + .getSyncPoller(); + } + + /** + * Create or Update a workspace managed sql server's threat detection policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param securityAlertPolicyName The name of the security alert policy. + * @param parameters The workspace managed sql server security alert policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed Sql server security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ServerSecurityAlertPolicyInner> beginCreateOrUpdate( + String resourceGroupName, + String workspaceName, + SecurityAlertPolicyNameAutoGenerated securityAlertPolicyName, + ServerSecurityAlertPolicyInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, securityAlertPolicyName, parameters, context) + .getSyncPoller(); + } + + /** + * Create or Update a workspace managed sql server's threat detection policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param securityAlertPolicyName The name of the security alert policy. + * @param parameters The workspace managed sql server security alert policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed Sql server security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + SecurityAlertPolicyNameAutoGenerated securityAlertPolicyName, + ServerSecurityAlertPolicyInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, securityAlertPolicyName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update a workspace managed sql server's threat detection policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param securityAlertPolicyName The name of the security alert policy. + * @param parameters The workspace managed sql server security alert policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed Sql server security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + SecurityAlertPolicyNameAutoGenerated securityAlertPolicyName, + ServerSecurityAlertPolicyInner parameters, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, securityAlertPolicyName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or Update a workspace managed sql server's threat detection policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param securityAlertPolicyName The name of the security alert policy. + * @param parameters The workspace managed sql server security alert policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed Sql server security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerSecurityAlertPolicyInner createOrUpdate( + String resourceGroupName, + String workspaceName, + SecurityAlertPolicyNameAutoGenerated securityAlertPolicyName, + ServerSecurityAlertPolicyInner parameters) { + return createOrUpdateAsync(resourceGroupName, workspaceName, securityAlertPolicyName, parameters).block(); + } + + /** + * Create or Update a workspace managed sql server's threat detection policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param securityAlertPolicyName The name of the security alert policy. + * @param parameters The workspace managed sql server security alert policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed Sql server security alert policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerSecurityAlertPolicyInner createOrUpdate( + String resourceGroupName, + String workspaceName, + SecurityAlertPolicyNameAutoGenerated securityAlertPolicyName, + ServerSecurityAlertPolicyInner parameters, + Context context) { + return createOrUpdateAsync(resourceGroupName, workspaceName, securityAlertPolicyName, parameters, context) + .block(); + } + + /** + * Get workspace managed sql server's threat detection policies. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's threat detection policies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get workspace managed sql server's threat detection policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's threat detection policies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get workspace managed sql server's threat detection policies. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's threat detection policies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get workspace managed sql server's threat detection policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's threat detection policies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get workspace managed sql server's threat detection policies. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's threat detection policies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); + } + + /** + * Get workspace managed sql server's threat detection policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's threat detection policies. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the workspace managed sql server's security alert policies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the workspace managed sql server's security alert policies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerSecurityAlertPoliciesImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerSecurityAlertPoliciesImpl.java new file mode 100644 index 0000000000000..656af2415fcc8 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerSecurityAlertPoliciesImpl.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.WorkspaceManagedSqlServerSecurityAlertPoliciesClient; +import com.azure.resourcemanager.synapse.fluent.models.ServerSecurityAlertPolicyInner; +import com.azure.resourcemanager.synapse.models.SecurityAlertPolicyNameAutoGenerated; +import com.azure.resourcemanager.synapse.models.ServerSecurityAlertPolicy; +import com.azure.resourcemanager.synapse.models.WorkspaceManagedSqlServerSecurityAlertPolicies; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class WorkspaceManagedSqlServerSecurityAlertPoliciesImpl + implements WorkspaceManagedSqlServerSecurityAlertPolicies { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(WorkspaceManagedSqlServerSecurityAlertPoliciesImpl.class); + + private final WorkspaceManagedSqlServerSecurityAlertPoliciesClient innerClient; + + private final SynapseManager serviceManager; + + public WorkspaceManagedSqlServerSecurityAlertPoliciesImpl( + WorkspaceManagedSqlServerSecurityAlertPoliciesClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ServerSecurityAlertPolicy get( + String resourceGroupName, String workspaceName, SecurityAlertPolicyNameAutoGenerated securityAlertPolicyName) { + ServerSecurityAlertPolicyInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, securityAlertPolicyName); + if (inner != null) { + return new ServerSecurityAlertPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + SecurityAlertPolicyNameAutoGenerated securityAlertPolicyName, + Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, securityAlertPolicyName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ServerSecurityAlertPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new ServerSecurityAlertPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new ServerSecurityAlertPolicyImpl(inner1, this.manager())); + } + + public ServerSecurityAlertPolicy getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + SecurityAlertPolicyNameAutoGenerated securityAlertPolicyName = + SecurityAlertPolicyNameAutoGenerated.fromString(Utils.getValueFromIdByName(id, "securityAlertPolicies")); + if (securityAlertPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'securityAlertPolicies'.", + id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, securityAlertPolicyName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + SecurityAlertPolicyNameAutoGenerated securityAlertPolicyName = + SecurityAlertPolicyNameAutoGenerated.fromString(Utils.getValueFromIdByName(id, "securityAlertPolicies")); + if (securityAlertPolicyName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'securityAlertPolicies'.", + id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, securityAlertPolicyName, context); + } + + private WorkspaceManagedSqlServerSecurityAlertPoliciesClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + public ServerSecurityAlertPolicyImpl define(SecurityAlertPolicyNameAutoGenerated name) { + return new ServerSecurityAlertPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerUsagesClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerUsagesClientImpl.java new file mode 100644 index 0000000000000..1dac822cf27e8 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerUsagesClientImpl.java @@ -0,0 +1,338 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.WorkspaceManagedSqlServerUsagesClient; +import com.azure.resourcemanager.synapse.fluent.models.ServerUsageInner; +import com.azure.resourcemanager.synapse.models.ServerUsageListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in WorkspaceManagedSqlServerUsagesClient. */ +public final class WorkspaceManagedSqlServerUsagesClientImpl implements WorkspaceManagedSqlServerUsagesClient { + private final ClientLogger logger = new ClientLogger(WorkspaceManagedSqlServerUsagesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final WorkspaceManagedSqlServerUsagesService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of WorkspaceManagedSqlServerUsagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkspaceManagedSqlServerUsagesClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + WorkspaceManagedSqlServerUsagesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientWorkspaceManagedSqlServerUsages to be used by + * the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface WorkspaceManagedSqlServerUsagesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlUsages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get list of server usages metric for workspace managed sql server. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of server usages metric for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get list of server usages metric for workspace managed sql server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of server usages metric for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get list of server usages metric for workspace managed sql server. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of server usages metric for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get list of server usages metric for workspace managed sql server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of server usages metric for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get list of server usages metric for workspace managed sql server. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of server usages metric for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); + } + + /** + * Get list of server usages metric for workspace managed sql server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of server usages metric for workspace managed sql server. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the response to a list server metrics request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the response to a list server metrics request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerUsagesImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerUsagesImpl.java new file mode 100644 index 0000000000000..f439704fec541 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerUsagesImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.WorkspaceManagedSqlServerUsagesClient; +import com.azure.resourcemanager.synapse.fluent.models.ServerUsageInner; +import com.azure.resourcemanager.synapse.models.ServerUsage; +import com.azure.resourcemanager.synapse.models.WorkspaceManagedSqlServerUsages; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class WorkspaceManagedSqlServerUsagesImpl implements WorkspaceManagedSqlServerUsages { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkspaceManagedSqlServerUsagesImpl.class); + + private final WorkspaceManagedSqlServerUsagesClient innerClient; + + private final SynapseManager serviceManager; + + public WorkspaceManagedSqlServerUsagesImpl( + WorkspaceManagedSqlServerUsagesClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new ServerUsageImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new ServerUsageImpl(inner1, this.manager())); + } + + private WorkspaceManagedSqlServerUsagesClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerVulnerabilityAssessmentsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerVulnerabilityAssessmentsClientImpl.java new file mode 100644 index 0000000000000..9b9e94a78f10e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerVulnerabilityAssessmentsClientImpl.java @@ -0,0 +1,947 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.WorkspaceManagedSqlServerVulnerabilityAssessmentsClient; +import com.azure.resourcemanager.synapse.fluent.models.ServerVulnerabilityAssessmentInner; +import com.azure.resourcemanager.synapse.models.ServerVulnerabilityAssessmentListResult; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentName; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * WorkspaceManagedSqlServerVulnerabilityAssessmentsClient. + */ +public final class WorkspaceManagedSqlServerVulnerabilityAssessmentsClientImpl + implements WorkspaceManagedSqlServerVulnerabilityAssessmentsClient { + private final ClientLogger logger = + new ClientLogger(WorkspaceManagedSqlServerVulnerabilityAssessmentsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final WorkspaceManagedSqlServerVulnerabilityAssessmentsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of WorkspaceManagedSqlServerVulnerabilityAssessmentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkspaceManagedSqlServerVulnerabilityAssessmentsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create( + WorkspaceManagedSqlServerVulnerabilityAssessmentsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * SynapseManagementClientWorkspaceManagedSqlServerVulnerabilityAssessments to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface WorkspaceManagedSqlServerVulnerabilityAssessmentsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("vulnerabilityAssessmentName") VulnerabilityAssessmentName vulnerabilityAssessmentName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("vulnerabilityAssessmentName") VulnerabilityAssessmentName vulnerabilityAssessmentName, + @BodyParam("application/json") ServerVulnerabilityAssessmentInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @PathParam("vulnerabilityAssessmentName") VulnerabilityAssessmentName vulnerabilityAssessmentName, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/vulnerabilityAssessments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get workspace managed sql server's vulnerability assessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param vulnerabilityAssessmentName The name of the vulnerability assessment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's vulnerability assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, VulnerabilityAssessmentName vulnerabilityAssessmentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (vulnerabilityAssessmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vulnerabilityAssessmentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + vulnerabilityAssessmentName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get workspace managed sql server's vulnerability assessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's vulnerability assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, + String workspaceName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (vulnerabilityAssessmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vulnerabilityAssessmentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + vulnerabilityAssessmentName, + accept, + context); + } + + /** + * Get workspace managed sql server's vulnerability assessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param vulnerabilityAssessmentName The name of the vulnerability assessment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's vulnerability assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String workspaceName, VulnerabilityAssessmentName vulnerabilityAssessmentName) { + return getWithResponseAsync(resourceGroupName, workspaceName, vulnerabilityAssessmentName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get workspace managed sql server's vulnerability assessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param vulnerabilityAssessmentName The name of the vulnerability assessment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's vulnerability assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerVulnerabilityAssessmentInner get( + String resourceGroupName, String workspaceName, VulnerabilityAssessmentName vulnerabilityAssessmentName) { + return getAsync(resourceGroupName, workspaceName, vulnerabilityAssessmentName).block(); + } + + /** + * Get workspace managed sql server's vulnerability assessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's vulnerability assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, vulnerabilityAssessmentName, context).block(); + } + + /** + * Create or Update workspace managed sql server's vulnerability assessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param parameters Properties for vulnerability assessment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server vulnerability assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + ServerVulnerabilityAssessmentInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (vulnerabilityAssessmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vulnerabilityAssessmentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + vulnerabilityAssessmentName, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create or Update workspace managed sql server's vulnerability assessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param parameters Properties for vulnerability assessment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server vulnerability assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String workspaceName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + ServerVulnerabilityAssessmentInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (vulnerabilityAssessmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vulnerabilityAssessmentName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + vulnerabilityAssessmentName, + parameters, + accept, + context); + } + + /** + * Create or Update workspace managed sql server's vulnerability assessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param parameters Properties for vulnerability assessment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server vulnerability assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String workspaceName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + ServerVulnerabilityAssessmentInner parameters) { + return createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, vulnerabilityAssessmentName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or Update workspace managed sql server's vulnerability assessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param parameters Properties for vulnerability assessment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server vulnerability assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServerVulnerabilityAssessmentInner createOrUpdate( + String resourceGroupName, + String workspaceName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + ServerVulnerabilityAssessmentInner parameters) { + return createOrUpdateAsync(resourceGroupName, workspaceName, vulnerabilityAssessmentName, parameters).block(); + } + + /** + * Create or Update workspace managed sql server's vulnerability assessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param parameters Properties for vulnerability assessment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a server vulnerability assessment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + ServerVulnerabilityAssessmentInner parameters, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, workspaceName, vulnerabilityAssessmentName, parameters, context) + .block(); + } + + /** + * Remove workspace managed sql server's vulnerability assessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param vulnerabilityAssessmentName The name of the vulnerability assessment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, VulnerabilityAssessmentName vulnerabilityAssessmentName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (vulnerabilityAssessmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vulnerabilityAssessmentName is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + vulnerabilityAssessmentName, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Remove workspace managed sql server's vulnerability assessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, + String workspaceName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (vulnerabilityAssessmentName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter vulnerabilityAssessmentName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + vulnerabilityAssessmentName, + context); + } + + /** + * Remove workspace managed sql server's vulnerability assessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param vulnerabilityAssessmentName The name of the vulnerability assessment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String workspaceName, VulnerabilityAssessmentName vulnerabilityAssessmentName) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, vulnerabilityAssessmentName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Remove workspace managed sql server's vulnerability assessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param vulnerabilityAssessmentName The name of the vulnerability assessment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String workspaceName, VulnerabilityAssessmentName vulnerabilityAssessmentName) { + deleteAsync(resourceGroupName, workspaceName, vulnerabilityAssessmentName).block(); + } + + /** + * Remove workspace managed sql server's vulnerability assessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, + String workspaceName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + Context context) { + return deleteWithResponseAsync(resourceGroupName, workspaceName, vulnerabilityAssessmentName, context).block(); + } + + /** + * Lists the vulnerability assessment policies associated with a workspace managed sql server. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the server's vulnerability assessments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists the vulnerability assessment policies associated with a workspace managed sql server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the server's vulnerability assessments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the vulnerability assessment policies associated with a workspace managed sql server. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the server's vulnerability assessments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the vulnerability assessment policies associated with a workspace managed sql server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the server's vulnerability assessments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String workspaceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, workspaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the vulnerability assessment policies associated with a workspace managed sql server. + * + * @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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the server's vulnerability assessments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); + } + + /** + * Lists the vulnerability assessment policies associated with a workspace managed sql server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the server's vulnerability assessments. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String workspaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the server's vulnerability assessments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the server's vulnerability assessments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerVulnerabilityAssessmentsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerVulnerabilityAssessmentsImpl.java new file mode 100644 index 0000000000000..6a48aa065be18 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceManagedSqlServerVulnerabilityAssessmentsImpl.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.WorkspaceManagedSqlServerVulnerabilityAssessmentsClient; +import com.azure.resourcemanager.synapse.fluent.models.ServerVulnerabilityAssessmentInner; +import com.azure.resourcemanager.synapse.models.ServerVulnerabilityAssessment; +import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentName; +import com.azure.resourcemanager.synapse.models.WorkspaceManagedSqlServerVulnerabilityAssessments; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class WorkspaceManagedSqlServerVulnerabilityAssessmentsImpl + implements WorkspaceManagedSqlServerVulnerabilityAssessments { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(WorkspaceManagedSqlServerVulnerabilityAssessmentsImpl.class); + + private final WorkspaceManagedSqlServerVulnerabilityAssessmentsClient innerClient; + + private final SynapseManager serviceManager; + + public WorkspaceManagedSqlServerVulnerabilityAssessmentsImpl( + WorkspaceManagedSqlServerVulnerabilityAssessmentsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ServerVulnerabilityAssessment get( + String resourceGroupName, String workspaceName, VulnerabilityAssessmentName vulnerabilityAssessmentName) { + ServerVulnerabilityAssessmentInner inner = + this.serviceClient().get(resourceGroupName, workspaceName, vulnerabilityAssessmentName); + if (inner != null) { + return new ServerVulnerabilityAssessmentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, + String workspaceName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, workspaceName, vulnerabilityAssessmentName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ServerVulnerabilityAssessmentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete( + String resourceGroupName, String workspaceName, VulnerabilityAssessmentName vulnerabilityAssessmentName) { + this.serviceClient().delete(resourceGroupName, workspaceName, vulnerabilityAssessmentName); + } + + public Response deleteWithResponse( + String resourceGroupName, + String workspaceName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, workspaceName, vulnerabilityAssessmentName, context); + } + + public PagedIterable list(String resourceGroupName, String workspaceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName); + return Utils.mapPage(inner, inner1 -> new ServerVulnerabilityAssessmentImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, workspaceName, context); + return Utils.mapPage(inner, inner1 -> new ServerVulnerabilityAssessmentImpl(inner1, this.manager())); + } + + public ServerVulnerabilityAssessment getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + VulnerabilityAssessmentName vulnerabilityAssessmentName = + VulnerabilityAssessmentName.fromString(Utils.getValueFromIdByName(id, "vulnerabilityAssessments")); + if (vulnerabilityAssessmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'vulnerabilityAssessments'.", + id))); + } + return this + .getWithResponse(resourceGroupName, workspaceName, vulnerabilityAssessmentName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + VulnerabilityAssessmentName vulnerabilityAssessmentName = + VulnerabilityAssessmentName.fromString(Utils.getValueFromIdByName(id, "vulnerabilityAssessments")); + if (vulnerabilityAssessmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'vulnerabilityAssessments'.", + id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, vulnerabilityAssessmentName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + VulnerabilityAssessmentName vulnerabilityAssessmentName = + VulnerabilityAssessmentName.fromString(Utils.getValueFromIdByName(id, "vulnerabilityAssessments")); + if (vulnerabilityAssessmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'vulnerabilityAssessments'.", + id))); + } + this.deleteWithResponse(resourceGroupName, workspaceName, vulnerabilityAssessmentName, Context.NONE).getValue(); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + VulnerabilityAssessmentName vulnerabilityAssessmentName = + VulnerabilityAssessmentName.fromString(Utils.getValueFromIdByName(id, "vulnerabilityAssessments")); + if (vulnerabilityAssessmentName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'vulnerabilityAssessments'.", + id))); + } + return this.deleteWithResponse(resourceGroupName, workspaceName, vulnerabilityAssessmentName, context); + } + + private WorkspaceManagedSqlServerVulnerabilityAssessmentsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + public ServerVulnerabilityAssessmentImpl define(VulnerabilityAssessmentName name) { + return new ServerVulnerabilityAssessmentImpl(name, this.manager()); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceSqlAadAdminsClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceSqlAadAdminsClientImpl.java new file mode 100644 index 0000000000000..253ad3842674a --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceSqlAadAdminsClientImpl.java @@ -0,0 +1,758 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.WorkspaceSqlAadAdminsClient; +import com.azure.resourcemanager.synapse.fluent.models.WorkspaceAadAdminInfoInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in WorkspaceSqlAadAdminsClient. */ +public final class WorkspaceSqlAadAdminsClientImpl implements WorkspaceSqlAadAdminsClient { + private final ClientLogger logger = new ClientLogger(WorkspaceSqlAadAdminsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final WorkspaceSqlAadAdminsService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of WorkspaceSqlAadAdminsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkspaceSqlAadAdminsClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy + .create(WorkspaceSqlAadAdminsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientWorkspaceSqlAadAdmins to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface WorkspaceSqlAadAdminsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlAdministrators/activeDirectory") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlAdministrators/activeDirectory") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @BodyParam("application/json") WorkspaceAadAdminInfoInner aadAdminInfo, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}/sqlAdministrators/activeDirectory") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace SQL active directory admin. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace SQL active directory admin. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace SQL active directory admin. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName) { + return getWithResponseAsync(resourceGroupName, workspaceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace SQL active directory admin. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceAadAdminInfoInner get(String resourceGroupName, String workspaceName) { + return getAsync(resourceGroupName, workspaceName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace SQL active directory admin. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String workspaceName, Context context) { + return getWithResponseAsync(resourceGroupName, workspaceName, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (aadAdminInfo == null) { + return Mono.error(new IllegalArgumentException("Parameter aadAdminInfo is required and cannot be null.")); + } else { + aadAdminInfo.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + aadAdminInfo, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (aadAdminInfo == null) { + return Mono.error(new IllegalArgumentException("Parameter aadAdminInfo is required and cannot be null.")); + } else { + aadAdminInfo.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + aadAdminInfo, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkspaceAadAdminInfoInner> beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, aadAdminInfo); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkspaceAadAdminInfoInner.class, + WorkspaceAadAdminInfoInner.class, + Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkspaceAadAdminInfoInner> beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, aadAdminInfo, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + WorkspaceAadAdminInfoInner.class, + WorkspaceAadAdminInfoInner.class, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkspaceAadAdminInfoInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, aadAdminInfo).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkspaceAadAdminInfoInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, aadAdminInfo, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, aadAdminInfo) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, aadAdminInfo, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceAadAdminInfoInner createOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo) { + return createOrUpdateAsync(resourceGroupName, workspaceName, aadAdminInfo).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceAadAdminInfoInner createOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo, Context context) { + return createOrUpdateAsync(resourceGroupName, workspaceName, aadAdminInfo, context).block(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String workspaceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName) { + return beginDeleteAsync(resourceGroupName, workspaceName).getSyncPoller(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String workspaceName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, context).getSyncPoller(); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName) { + return beginDeleteAsync(resourceGroupName, workspaceName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName) { + deleteAsync(resourceGroupName, workspaceName).block(); + } + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String workspaceName, Context context) { + deleteAsync(resourceGroupName, workspaceName, context).block(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceSqlAadAdminsImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceSqlAadAdminsImpl.java new file mode 100644 index 0000000000000..1eda239a9de24 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspaceSqlAadAdminsImpl.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.WorkspaceSqlAadAdminsClient; +import com.azure.resourcemanager.synapse.fluent.models.WorkspaceAadAdminInfoInner; +import com.azure.resourcemanager.synapse.models.WorkspaceAadAdminInfo; +import com.azure.resourcemanager.synapse.models.WorkspaceSqlAadAdmins; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class WorkspaceSqlAadAdminsImpl implements WorkspaceSqlAadAdmins { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkspaceSqlAadAdminsImpl.class); + + private final WorkspaceSqlAadAdminsClient innerClient; + + private final SynapseManager serviceManager; + + public WorkspaceSqlAadAdminsImpl(WorkspaceSqlAadAdminsClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public WorkspaceAadAdminInfo get(String resourceGroupName, String workspaceName) { + WorkspaceAadAdminInfoInner inner = this.serviceClient().get(resourceGroupName, workspaceName); + if (inner != null) { + return new WorkspaceAadAdminInfoImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String workspaceName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, workspaceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WorkspaceAadAdminInfoImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public WorkspaceAadAdminInfo createOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo) { + WorkspaceAadAdminInfoInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, aadAdminInfo); + if (inner != null) { + return new WorkspaceAadAdminInfoImpl(inner, this.manager()); + } else { + return null; + } + } + + public WorkspaceAadAdminInfo createOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo, Context context) { + WorkspaceAadAdminInfoInner inner = + this.serviceClient().createOrUpdate(resourceGroupName, workspaceName, aadAdminInfo, context); + if (inner != null) { + return new WorkspaceAadAdminInfoImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String workspaceName) { + this.serviceClient().delete(resourceGroupName, workspaceName); + } + + public void delete(String resourceGroupName, String workspaceName, Context context) { + this.serviceClient().delete(resourceGroupName, workspaceName, context); + } + + private WorkspaceSqlAadAdminsClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspacesClientImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspacesClientImpl.java new file mode 100644 index 0000000000000..ba08f2ac2ed01 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspacesClientImpl.java @@ -0,0 +1,1530 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.synapse.fluent.WorkspacesClient; +import com.azure.resourcemanager.synapse.fluent.models.WorkspaceInner; +import com.azure.resourcemanager.synapse.models.WorkspaceInfoListResult; +import com.azure.resourcemanager.synapse.models.WorkspacePatchInfo; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in WorkspacesClient. */ +public final class WorkspacesClientImpl implements WorkspacesClient { + private final ClientLogger logger = new ClientLogger(WorkspacesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final WorkspacesService service; + + /** The service client containing this operation class. */ + private final SynapseManagementClientImpl client; + + /** + * Initializes an instance of WorkspacesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WorkspacesClientImpl(SynapseManagementClientImpl client) { + this.service = + RestProxy.create(WorkspacesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SynapseManagementClientWorkspaces to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SynapseManagementCli") + private interface WorkspacesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @BodyParam("application/json") WorkspacePatchInfo workspacePatchInfo, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @BodyParam("application/json") WorkspaceInner workspaceInfo, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces" + + "/{workspaceName}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("workspaceName") String workspaceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Synapse/workspaces") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Returns a list of workspaces in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of workspaces. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns a list of workspaces in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of workspaces. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns a list of workspaces in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of workspaces. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Returns a list of workspaces in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of workspaces. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns a list of workspaces in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of workspaces. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Returns a list of workspaces in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of workspaces. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Gets a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context); + } + + /** + * Gets 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String workspaceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, workspaceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceInner getByResourceGroup(String resourceGroupName, String workspaceName) { + return getByResourceGroupAsync(resourceGroupName, workspaceName).block(); + } + + /** + * Gets a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String workspaceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, workspaceName, context).block(); + } + + /** + * Updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspacePatchInfo Workspace patch request properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String workspaceName, WorkspacePatchInfo workspacePatchInfo) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (workspacePatchInfo == null) { + return Mono + .error(new IllegalArgumentException("Parameter workspacePatchInfo is required and cannot be null.")); + } else { + workspacePatchInfo.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + workspacePatchInfo, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspacePatchInfo Workspace patch request properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String workspaceName, WorkspacePatchInfo workspacePatchInfo, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (workspacePatchInfo == null) { + return Mono + .error(new IllegalArgumentException("Parameter workspacePatchInfo is required and cannot be null.")); + } else { + workspacePatchInfo.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + workspacePatchInfo, + accept, + context); + } + + /** + * Updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspacePatchInfo Workspace patch request properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkspaceInner> beginUpdateAsync( + String resourceGroupName, String workspaceName, WorkspacePatchInfo workspacePatchInfo) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, workspaceName, workspacePatchInfo); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), WorkspaceInner.class, WorkspaceInner.class, Context.NONE); + } + + /** + * Updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspacePatchInfo Workspace patch request properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkspaceInner> beginUpdateAsync( + String resourceGroupName, String workspaceName, WorkspacePatchInfo workspacePatchInfo, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, workspaceName, workspacePatchInfo, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), WorkspaceInner.class, WorkspaceInner.class, context); + } + + /** + * Updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspacePatchInfo Workspace patch request properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkspaceInner> beginUpdate( + String resourceGroupName, String workspaceName, WorkspacePatchInfo workspacePatchInfo) { + return beginUpdateAsync(resourceGroupName, workspaceName, workspacePatchInfo).getSyncPoller(); + } + + /** + * Updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspacePatchInfo Workspace patch request properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkspaceInner> beginUpdate( + String resourceGroupName, String workspaceName, WorkspacePatchInfo workspacePatchInfo, Context context) { + return beginUpdateAsync(resourceGroupName, workspaceName, workspacePatchInfo, context).getSyncPoller(); + } + + /** + * Updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspacePatchInfo Workspace patch request properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String workspaceName, WorkspacePatchInfo workspacePatchInfo) { + return beginUpdateAsync(resourceGroupName, workspaceName, workspacePatchInfo) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspacePatchInfo Workspace patch request properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String workspaceName, WorkspacePatchInfo workspacePatchInfo, Context context) { + return beginUpdateAsync(resourceGroupName, workspaceName, workspacePatchInfo, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspacePatchInfo Workspace patch request properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceInner update( + String resourceGroupName, String workspaceName, WorkspacePatchInfo workspacePatchInfo) { + return updateAsync(resourceGroupName, workspaceName, workspacePatchInfo).block(); + } + + /** + * Updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspacePatchInfo Workspace patch request properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceInner update( + String resourceGroupName, String workspaceName, WorkspacePatchInfo workspacePatchInfo, Context context) { + return updateAsync(resourceGroupName, workspaceName, workspacePatchInfo, context).block(); + } + + /** + * Creates or updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceInfo Workspace create or update request properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, WorkspaceInner workspaceInfo) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (workspaceInfo == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceInfo is required and cannot be null.")); + } else { + workspaceInfo.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + workspaceInfo, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Creates or updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceInfo Workspace create or update request properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String workspaceName, WorkspaceInner workspaceInfo, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (workspaceInfo == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceInfo is required and cannot be null.")); + } else { + workspaceInfo.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + workspaceInfo, + accept, + context); + } + + /** + * Creates or updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceInfo Workspace create or update request properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkspaceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, WorkspaceInner workspaceInfo) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, workspaceInfo); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), WorkspaceInner.class, WorkspaceInner.class, Context.NONE); + } + + /** + * Creates or updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceInfo Workspace create or update request properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, WorkspaceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, WorkspaceInner workspaceInfo, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, workspaceInfo, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), WorkspaceInner.class, WorkspaceInner.class, context); + } + + /** + * Creates or updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceInfo Workspace create or update request properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkspaceInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceInner workspaceInfo) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, workspaceInfo).getSyncPoller(); + } + + /** + * Creates or updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceInfo Workspace create or update request properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkspaceInner> beginCreateOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceInner workspaceInfo, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, workspaceInfo, context).getSyncPoller(); + } + + /** + * Creates or updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceInfo Workspace create or update request properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, WorkspaceInner workspaceInfo) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, workspaceInfo) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceInfo Workspace create or update request properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String workspaceName, WorkspaceInner workspaceInfo, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, workspaceInfo, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceInfo Workspace create or update request properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner workspaceInfo) { + return createOrUpdateAsync(resourceGroupName, workspaceName, workspaceInfo).block(); + } + + /** + * Creates or updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param workspaceInfo Workspace create or update request properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkspaceInner createOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceInner workspaceInfo, Context context) { + return createOrUpdateAsync(resourceGroupName, workspaceName, workspaceInfo, context).block(); + } + + /** + * Deletes 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Deletes a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + workspaceName, + accept, + context); + } + + /** + * Deletes 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Object> beginDeleteAsync(String resourceGroupName, String workspaceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Object.class, Object.class, Context.NONE); + } + + /** + * Deletes a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Object> beginDeleteAsync( + String resourceGroupName, String workspaceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Object.class, Object.class, context); + } + + /** + * Deletes 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginDelete(String resourceGroupName, String workspaceName) { + return beginDeleteAsync(resourceGroupName, workspaceName).getSyncPoller(); + } + + /** + * Deletes a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginDelete( + String resourceGroupName, String workspaceName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, context).getSyncPoller(); + } + + /** + * Deletes 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName) { + return beginDeleteAsync(resourceGroupName, workspaceName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String workspaceName, Context context) { + return beginDeleteAsync(resourceGroupName, workspaceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes 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 ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Object delete(String resourceGroupName, String workspaceName) { + return deleteAsync(resourceGroupName, workspaceName).block(); + } + + /** + * Deletes a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Object delete(String resourceGroupName, String workspaceName, Context context) { + return deleteAsync(resourceGroupName, workspaceName, context).block(); + } + + /** + * Returns a list of workspaces in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of workspaces. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Returns a list of workspaces in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of workspaces. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Returns a list of workspaces in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of workspaces. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Returns a list of workspaces in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of workspaces. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Returns a list of workspaces in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of workspaces. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Returns a list of workspaces in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of workspaces. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of workspaces. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of workspaces. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of workspaces. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of workspaces. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspacesImpl.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspacesImpl.java new file mode 100644 index 0000000000000..9e73c9bde5cb9 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/WorkspacesImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.SynapseManager; +import com.azure.resourcemanager.synapse.fluent.WorkspacesClient; +import com.azure.resourcemanager.synapse.fluent.models.WorkspaceInner; +import com.azure.resourcemanager.synapse.models.Workspace; +import com.azure.resourcemanager.synapse.models.Workspaces; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class WorkspacesImpl implements Workspaces { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkspacesImpl.class); + + private final WorkspacesClient innerClient; + + private final SynapseManager serviceManager; + + public WorkspacesImpl(WorkspacesClient innerClient, SynapseManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); + } + + public Workspace getByResourceGroup(String resourceGroupName, String workspaceName) { + WorkspaceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, workspaceName); + if (inner != null) { + return new WorkspaceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String workspaceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, workspaceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new WorkspaceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public Object deleteByResourceGroup(String resourceGroupName, String workspaceName) { + return this.serviceClient().delete(resourceGroupName, workspaceName); + } + + public Object delete(String resourceGroupName, String workspaceName, Context context) { + return this.serviceClient().delete(resourceGroupName, workspaceName, context); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new WorkspaceImpl(inner1, this.manager())); + } + + public Workspace getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, workspaceName, context); + } + + public Object deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + return this.delete(resourceGroupName, workspaceName, Context.NONE); + } + + public Object deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String workspaceName = Utils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + return this.delete(resourceGroupName, workspaceName, context); + } + + private WorkspacesClient serviceClient() { + return this.innerClient; + } + + private SynapseManager manager() { + return this.serviceManager; + } + + public WorkspaceImpl define(String name) { + return new WorkspaceImpl(name, this.manager()); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/package-info.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/package-info.java new file mode 100644 index 0000000000000..1d626563f0a95 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for SynapseManagementClient. Azure Synapse Analytics Management Client. */ +package com.azure.resourcemanager.synapse.implementation; diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AutoPauseProperties.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AutoPauseProperties.java new file mode 100644 index 0000000000000..e483f799397b0 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AutoPauseProperties.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Auto-pausing properties of a Big Data pool powered by Apache Spark. */ +@Fluent +public final class AutoPauseProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoPauseProperties.class); + + /* + * Number of minutes of idle time before the Big Data pool is automatically + * paused. + */ + @JsonProperty(value = "delayInMinutes") + private Integer delayInMinutes; + + /* + * Whether auto-pausing is enabled for the Big Data pool. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Get the delayInMinutes property: Number of minutes of idle time before the Big Data pool is automatically paused. + * + * @return the delayInMinutes value. + */ + public Integer delayInMinutes() { + return this.delayInMinutes; + } + + /** + * Set the delayInMinutes property: Number of minutes of idle time before the Big Data pool is automatically paused. + * + * @param delayInMinutes the delayInMinutes value to set. + * @return the AutoPauseProperties object itself. + */ + public AutoPauseProperties withDelayInMinutes(Integer delayInMinutes) { + this.delayInMinutes = delayInMinutes; + return this; + } + + /** + * Get the enabled property: Whether auto-pausing is enabled for the Big Data pool. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether auto-pausing is enabled for the Big Data pool. + * + * @param enabled the enabled value to set. + * @return the AutoPauseProperties object itself. + */ + public AutoPauseProperties withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AutoScaleProperties.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AutoScaleProperties.java new file mode 100644 index 0000000000000..bc73cf3e26bae --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AutoScaleProperties.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Auto-scaling properties of a Big Data pool powered by Apache Spark. */ +@Fluent +public final class AutoScaleProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AutoScaleProperties.class); + + /* + * The minimum number of nodes the Big Data pool can support. + */ + @JsonProperty(value = "minNodeCount") + private Integer minNodeCount; + + /* + * Whether automatic scaling is enabled for the Big Data pool. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * The maximum number of nodes the Big Data pool can support. + */ + @JsonProperty(value = "maxNodeCount") + private Integer maxNodeCount; + + /** + * Get the minNodeCount property: The minimum number of nodes the Big Data pool can support. + * + * @return the minNodeCount value. + */ + public Integer minNodeCount() { + return this.minNodeCount; + } + + /** + * Set the minNodeCount property: The minimum number of nodes the Big Data pool can support. + * + * @param minNodeCount the minNodeCount value to set. + * @return the AutoScaleProperties object itself. + */ + public AutoScaleProperties withMinNodeCount(Integer minNodeCount) { + this.minNodeCount = minNodeCount; + return this; + } + + /** + * Get the enabled property: Whether automatic scaling is enabled for the Big Data pool. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether automatic scaling is enabled for the Big Data pool. + * + * @param enabled the enabled value to set. + * @return the AutoScaleProperties object itself. + */ + public AutoScaleProperties withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the maxNodeCount property: The maximum number of nodes the Big Data pool can support. + * + * @return the maxNodeCount value. + */ + public Integer maxNodeCount() { + return this.maxNodeCount; + } + + /** + * Set the maxNodeCount property: The maximum number of nodes the Big Data pool can support. + * + * @param maxNodeCount the maxNodeCount value to set. + * @return the AutoScaleProperties object itself. + */ + public AutoScaleProperties withMaxNodeCount(Integer maxNodeCount) { + this.maxNodeCount = maxNodeCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AvailableRpOperation.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AvailableRpOperation.java new file mode 100644 index 0000000000000..e517ee996749b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AvailableRpOperation.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.AvailableRpOperationInner; + +/** An immutable client-side representation of AvailableRpOperation. */ +public interface AvailableRpOperation { + /** + * Gets the display property: Display properties of the operation. + * + * @return the display value. + */ + AvailableRpOperationDisplayInfo display(); + + /** + * Gets the isDataAction property: Whether this operation is a data action. + * + * @return the isDataAction value. + */ + String isDataAction(); + + /** + * Gets the name property: Operation name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the origin property: Operation origin. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the serviceSpecification property: Operation service specification. + * + * @return the serviceSpecification value. + */ + OperationMetaServiceSpecification serviceSpecification(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.AvailableRpOperationInner object. + * + * @return the inner object. + */ + AvailableRpOperationInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AvailableRpOperationDisplayInfo.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AvailableRpOperationDisplayInfo.java new file mode 100644 index 0000000000000..96a1dc062f9af --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AvailableRpOperationDisplayInfo.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Description of an available operation. */ +@Fluent +public final class AvailableRpOperationDisplayInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableRpOperationDisplayInfo.class); + + /* + * Operation description + */ + @JsonProperty(value = "description") + private String description; + + /* + * Resource type + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * Resource provider name + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * Operation name + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Get the description property: Operation description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Operation description. + * + * @param description the description value to set. + * @return the AvailableRpOperationDisplayInfo object itself. + */ + public AvailableRpOperationDisplayInfo withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the resource property: Resource type. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: Resource type. + * + * @param resource the resource value to set. + * @return the AvailableRpOperationDisplayInfo object itself. + */ + public AvailableRpOperationDisplayInfo withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the provider property: Resource provider name. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Resource provider name. + * + * @param provider the provider value to set. + * @return the AvailableRpOperationDisplayInfo object itself. + */ + public AvailableRpOperationDisplayInfo withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the operation property: Operation name. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Operation name. + * + * @param operation the operation value to set. + * @return the AvailableRpOperationDisplayInfo object itself. + */ + public AvailableRpOperationDisplayInfo withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AzureEntityResource.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AzureEntityResource.java new file mode 100644 index 0000000000000..738687df2ca49 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/AzureEntityResource.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The resource model definition for an Azure Resource Manager resource with an etag. */ +@Immutable +public class AzureEntityResource extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureEntityResource.class); + + /* + * Resource Etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the etag property: Resource Etag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BigDataPoolPatchInfo.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BigDataPoolPatchInfo.java new file mode 100644 index 0000000000000..fa47655eb37c2 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BigDataPoolPatchInfo.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Properties patch for a Big Data pool. */ +@Fluent +public final class BigDataPoolPatchInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BigDataPoolPatchInfo.class); + + /* + * Updated tags for the Big Data pool + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the tags property: Updated tags for the Big Data pool. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Updated tags for the Big Data pool. + * + * @param tags the tags value to set. + * @return the BigDataPoolPatchInfo object itself. + */ + public BigDataPoolPatchInfo withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BigDataPoolResourceInfo.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BigDataPoolResourceInfo.java new file mode 100644 index 0000000000000..36e90df50332e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BigDataPoolResourceInfo.java @@ -0,0 +1,521 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.BigDataPoolResourceInfoInner; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of BigDataPoolResourceInfo. */ +public interface BigDataPoolResourceInfo { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the provisioningState property: The state of the Big Data pool. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the autoScale property: Auto-scaling properties. + * + * @return the autoScale value. + */ + AutoScaleProperties autoScale(); + + /** + * Gets the creationDate property: The time when the Big Data pool was created. + * + * @return the creationDate value. + */ + OffsetDateTime creationDate(); + + /** + * Gets the autoPause property: Auto-pausing properties. + * + * @return the autoPause value. + */ + AutoPauseProperties autoPause(); + + /** + * Gets the isComputeIsolationEnabled property: Whether compute isolation is required or not. + * + * @return the isComputeIsolationEnabled value. + */ + Boolean isComputeIsolationEnabled(); + + /** + * Gets the sessionLevelPackagesEnabled property: Whether session level packages enabled. + * + * @return the sessionLevelPackagesEnabled value. + */ + Boolean sessionLevelPackagesEnabled(); + + /** + * Gets the cacheSize property: The cache size. + * + * @return the cacheSize value. + */ + Integer cacheSize(); + + /** + * Gets the dynamicExecutorAllocation property: Dynamic Executor Allocation. + * + * @return the dynamicExecutorAllocation value. + */ + DynamicExecutorAllocation dynamicExecutorAllocation(); + + /** + * Gets the sparkEventsFolder property: The Spark events folder. + * + * @return the sparkEventsFolder value. + */ + String sparkEventsFolder(); + + /** + * Gets the nodeCount property: The number of nodes in the Big Data pool. + * + * @return the nodeCount value. + */ + Integer nodeCount(); + + /** + * Gets the libraryRequirements property: Library version requirements. + * + * @return the libraryRequirements value. + */ + LibraryRequirements libraryRequirements(); + + /** + * Gets the customLibraries property: List of custom libraries/packages associated with the spark pool. + * + * @return the customLibraries value. + */ + List customLibraries(); + + /** + * Gets the sparkConfigProperties property: Spark configuration file to specify additional properties. + * + * @return the sparkConfigProperties value. + */ + LibraryRequirements sparkConfigProperties(); + + /** + * Gets the sparkVersion property: The Apache Spark version. + * + * @return the sparkVersion value. + */ + String sparkVersion(); + + /** + * Gets the defaultSparkLogFolder property: The default folder where Spark logs will be written. + * + * @return the defaultSparkLogFolder value. + */ + String defaultSparkLogFolder(); + + /** + * Gets the nodeSize property: The level of compute power that each node in the Big Data pool has. + * + * @return the nodeSize value. + */ + NodeSize nodeSize(); + + /** + * Gets the nodeSizeFamily property: The kind of nodes that the Big Data pool provides. + * + * @return the nodeSizeFamily value. + */ + NodeSizeFamily nodeSizeFamily(); + + /** + * Gets the lastSucceededTimestamp property: The time when the Big Data pool was updated successfully. + * + * @return the lastSucceededTimestamp value. + */ + OffsetDateTime lastSucceededTimestamp(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.BigDataPoolResourceInfoInner object. + * + * @return the inner object. + */ + BigDataPoolResourceInfoInner innerModel(); + + /** The entirety of the BigDataPoolResourceInfo definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The BigDataPoolResourceInfo definition stages. */ + interface DefinitionStages { + /** The first stage of the BigDataPoolResourceInfo definition. */ + interface Blank extends WithLocation { + } + /** The stage of the BigDataPoolResourceInfo definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the BigDataPoolResourceInfo definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * 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 BigDataPoolResourceInfo definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithProvisioningState, + DefinitionStages.WithAutoScale, + DefinitionStages.WithCreationDate, + DefinitionStages.WithAutoPause, + DefinitionStages.WithIsComputeIsolationEnabled, + DefinitionStages.WithSessionLevelPackagesEnabled, + DefinitionStages.WithCacheSize, + DefinitionStages.WithDynamicExecutorAllocation, + DefinitionStages.WithSparkEventsFolder, + DefinitionStages.WithNodeCount, + DefinitionStages.WithLibraryRequirements, + DefinitionStages.WithCustomLibraries, + DefinitionStages.WithSparkConfigProperties, + DefinitionStages.WithSparkVersion, + DefinitionStages.WithDefaultSparkLogFolder, + DefinitionStages.WithNodeSize, + DefinitionStages.WithNodeSizeFamily, + DefinitionStages.WithForce { + /** + * Executes the create request. + * + * @return the created resource. + */ + BigDataPoolResourceInfo create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + BigDataPoolResourceInfo create(Context context); + } + /** The stage of the BigDataPoolResourceInfo definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the BigDataPoolResourceInfo definition allowing to specify provisioningState. */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: The state of the Big Data pool.. + * + * @param provisioningState The state of the Big Data pool. + * @return the next definition stage. + */ + WithCreate withProvisioningState(String provisioningState); + } + /** The stage of the BigDataPoolResourceInfo definition allowing to specify autoScale. */ + interface WithAutoScale { + /** + * Specifies the autoScale property: Auto-scaling properties. + * + * @param autoScale Auto-scaling properties. + * @return the next definition stage. + */ + WithCreate withAutoScale(AutoScaleProperties autoScale); + } + /** The stage of the BigDataPoolResourceInfo definition allowing to specify creationDate. */ + interface WithCreationDate { + /** + * Specifies the creationDate property: The time when the Big Data pool was created.. + * + * @param creationDate The time when the Big Data pool was created. + * @return the next definition stage. + */ + WithCreate withCreationDate(OffsetDateTime creationDate); + } + /** The stage of the BigDataPoolResourceInfo definition allowing to specify autoPause. */ + interface WithAutoPause { + /** + * Specifies the autoPause property: Auto-pausing properties. + * + * @param autoPause Auto-pausing properties. + * @return the next definition stage. + */ + WithCreate withAutoPause(AutoPauseProperties autoPause); + } + /** The stage of the BigDataPoolResourceInfo definition allowing to specify isComputeIsolationEnabled. */ + interface WithIsComputeIsolationEnabled { + /** + * Specifies the isComputeIsolationEnabled property: Whether compute isolation is required or not.. + * + * @param isComputeIsolationEnabled Whether compute isolation is required or not. + * @return the next definition stage. + */ + WithCreate withIsComputeIsolationEnabled(Boolean isComputeIsolationEnabled); + } + /** The stage of the BigDataPoolResourceInfo definition allowing to specify sessionLevelPackagesEnabled. */ + interface WithSessionLevelPackagesEnabled { + /** + * Specifies the sessionLevelPackagesEnabled property: Whether session level packages enabled.. + * + * @param sessionLevelPackagesEnabled Whether session level packages enabled. + * @return the next definition stage. + */ + WithCreate withSessionLevelPackagesEnabled(Boolean sessionLevelPackagesEnabled); + } + /** The stage of the BigDataPoolResourceInfo definition allowing to specify cacheSize. */ + interface WithCacheSize { + /** + * Specifies the cacheSize property: The cache size. + * + * @param cacheSize The cache size. + * @return the next definition stage. + */ + WithCreate withCacheSize(Integer cacheSize); + } + /** The stage of the BigDataPoolResourceInfo definition allowing to specify dynamicExecutorAllocation. */ + interface WithDynamicExecutorAllocation { + /** + * Specifies the dynamicExecutorAllocation property: Dynamic Executor Allocation. + * + * @param dynamicExecutorAllocation Dynamic Executor Allocation. + * @return the next definition stage. + */ + WithCreate withDynamicExecutorAllocation(DynamicExecutorAllocation dynamicExecutorAllocation); + } + /** The stage of the BigDataPoolResourceInfo definition allowing to specify sparkEventsFolder. */ + interface WithSparkEventsFolder { + /** + * Specifies the sparkEventsFolder property: The Spark events folder. + * + * @param sparkEventsFolder The Spark events folder. + * @return the next definition stage. + */ + WithCreate withSparkEventsFolder(String sparkEventsFolder); + } + /** The stage of the BigDataPoolResourceInfo definition allowing to specify nodeCount. */ + interface WithNodeCount { + /** + * Specifies the nodeCount property: The number of nodes in the Big Data pool.. + * + * @param nodeCount The number of nodes in the Big Data pool. + * @return the next definition stage. + */ + WithCreate withNodeCount(Integer nodeCount); + } + /** The stage of the BigDataPoolResourceInfo definition allowing to specify libraryRequirements. */ + interface WithLibraryRequirements { + /** + * Specifies the libraryRequirements property: Library version requirements. + * + * @param libraryRequirements Library version requirements. + * @return the next definition stage. + */ + WithCreate withLibraryRequirements(LibraryRequirements libraryRequirements); + } + /** The stage of the BigDataPoolResourceInfo definition allowing to specify customLibraries. */ + interface WithCustomLibraries { + /** + * Specifies the customLibraries property: List of custom libraries/packages associated with the spark + * pool.. + * + * @param customLibraries List of custom libraries/packages associated with the spark pool. + * @return the next definition stage. + */ + WithCreate withCustomLibraries(List customLibraries); + } + /** The stage of the BigDataPoolResourceInfo definition allowing to specify sparkConfigProperties. */ + interface WithSparkConfigProperties { + /** + * Specifies the sparkConfigProperties property: Spark configuration file to specify additional properties. + * + * @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 sparkVersion. */ + interface WithSparkVersion { + /** + * Specifies the sparkVersion property: The Apache Spark version.. + * + * @param sparkVersion The Apache Spark version. + * @return the next definition stage. + */ + WithCreate withSparkVersion(String sparkVersion); + } + /** The stage of the BigDataPoolResourceInfo definition allowing to specify defaultSparkLogFolder. */ + interface WithDefaultSparkLogFolder { + /** + * Specifies the defaultSparkLogFolder property: The default folder where Spark logs will be written.. + * + * @param defaultSparkLogFolder The default folder where Spark logs will be written. + * @return the next definition stage. + */ + WithCreate withDefaultSparkLogFolder(String defaultSparkLogFolder); + } + /** The stage of the BigDataPoolResourceInfo definition allowing to specify nodeSize. */ + interface WithNodeSize { + /** + * Specifies the nodeSize property: The level of compute power that each node in the Big Data pool has.. + * + * @param nodeSize The level of compute power that each node in the Big Data pool has. + * @return the next definition stage. + */ + WithCreate withNodeSize(NodeSize nodeSize); + } + /** The stage of the BigDataPoolResourceInfo definition allowing to specify nodeSizeFamily. */ + interface WithNodeSizeFamily { + /** + * Specifies the nodeSizeFamily property: The kind of nodes that the Big Data pool provides.. + * + * @param nodeSizeFamily The kind of nodes that the Big Data pool provides. + * @return the next definition stage. + */ + WithCreate withNodeSizeFamily(NodeSizeFamily nodeSizeFamily); + } + /** The stage of the BigDataPoolResourceInfo definition allowing to specify force. */ + interface WithForce { + /** + * Specifies the force property: Whether to stop any running jobs in the Big Data pool. + * + * @param force Whether to stop any running jobs in the Big Data pool. + * @return the next definition stage. + */ + WithCreate withForce(Boolean force); + } + } + /** + * Begins update for the BigDataPoolResourceInfo resource. + * + * @return the stage of resource update. + */ + BigDataPoolResourceInfo.Update update(); + + /** The template for BigDataPoolResourceInfo update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + BigDataPoolResourceInfo apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + BigDataPoolResourceInfo apply(Context context); + } + /** The BigDataPoolResourceInfo update stages. */ + interface UpdateStages { + /** The stage of the BigDataPoolResourceInfo update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Updated tags for the Big Data pool. + * + * @param tags Updated tags for the Big Data pool. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + BigDataPoolResourceInfo refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + BigDataPoolResourceInfo refresh(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BigDataPoolResourceInfoListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BigDataPoolResourceInfoListResult.java new file mode 100644 index 0000000000000..11a17d05fe050 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BigDataPoolResourceInfoListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.BigDataPoolResourceInfoInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of Big Data pool information. */ +@Fluent +public final class BigDataPoolResourceInfoListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BigDataPoolResourceInfoListResult.class); + + /* + * Link to the next page of results + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * List of Big Data pools + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the nextLink property: Link to the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to the next page of results. + * + * @param nextLink the nextLink value to set. + * @return the BigDataPoolResourceInfoListResult object itself. + */ + public BigDataPoolResourceInfoListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: List of Big Data pools. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Big Data pools. + * + * @param value the value value to set. + * @return the BigDataPoolResourceInfoListResult object itself. + */ + public BigDataPoolResourceInfoListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BigDataPools.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BigDataPools.java new file mode 100644 index 0000000000000..03d6fd822fc48 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BigDataPools.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of BigDataPools. */ +public interface BigDataPools { + /** + * Get a Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + BigDataPoolResourceInfo get(String resourceGroupName, String workspaceName, String bigDataPoolName); + + /** + * Get a Big Data pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String bigDataPoolName, Context context); + + /** + * Delete a Big Data pool from the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + Object delete(String resourceGroupName, String workspaceName, String bigDataPoolName); + + /** + * Delete a Big Data pool from the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param bigDataPoolName Big Data pool name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + Object delete(String resourceGroupName, String workspaceName, String bigDataPoolName, Context context); + + /** + * List Big Data pools 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of Big Data pool information. + */ + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * List Big Data pools in a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of Big Data pool information. + */ + PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context); + + /** + * Get a Big Data pool. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + BigDataPoolResourceInfo getById(String id); + + /** + * Get a Big Data pool. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Big Data pool. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Big Data pool from the workspace. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + Object deleteById(String id); + + /** + * Delete a Big Data pool from the workspace. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + Object deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new BigDataPoolResourceInfo resource. + * + * @param name resource name. + * @return the first stage of the new BigDataPoolResourceInfo definition. + */ + BigDataPoolResourceInfo.DefinitionStages.Blank define(String name); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BlobAuditingPolicyName.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BlobAuditingPolicyName.java new file mode 100644 index 0000000000000..2e43f9738c970 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BlobAuditingPolicyName.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for BlobAuditingPolicyName. */ +public final class BlobAuditingPolicyName extends ExpandableStringEnum { + /** Static value default for BlobAuditingPolicyName. */ + public static final BlobAuditingPolicyName DEFAULT = fromString("default"); + + /** + * Creates or finds a BlobAuditingPolicyName from its string representation. + * + * @param name a name to look for. + * @return the corresponding BlobAuditingPolicyName. + */ + @JsonCreator + public static BlobAuditingPolicyName fromString(String name) { + return fromString(name, BlobAuditingPolicyName.class); + } + + /** @return known BlobAuditingPolicyName values. */ + public static Collection values() { + return values(BlobAuditingPolicyName.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BlobAuditingPolicyState.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BlobAuditingPolicyState.java new file mode 100644 index 0000000000000..b22c290143b05 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/BlobAuditingPolicyState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for BlobAuditingPolicyState. */ +public enum BlobAuditingPolicyState { + /** Enum value Enabled. */ + ENABLED("Enabled"), + + /** Enum value Disabled. */ + DISABLED("Disabled"); + + /** The actual serialized value for a BlobAuditingPolicyState instance. */ + private final String value; + + BlobAuditingPolicyState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a BlobAuditingPolicyState instance. + * + * @param value the serialized value to parse. + * @return the parsed BlobAuditingPolicyState object, or null if unable to parse. + */ + @JsonCreator + public static BlobAuditingPolicyState fromString(String value) { + BlobAuditingPolicyState[] items = BlobAuditingPolicyState.values(); + for (BlobAuditingPolicyState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CheckNameAvailabilityRequest.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CheckNameAvailabilityRequest.java new file mode 100644 index 0000000000000..62ed08ffb4bb9 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CheckNameAvailabilityRequest.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A request about whether a workspace name is available. */ +@Fluent +public final class CheckNameAvailabilityRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailabilityRequest.class); + + /* + * Workspace name + */ + @JsonProperty(value = "name") + private String name; + + /* + * Type: workspace + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the name property: Workspace name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Workspace name. + * + * @param name the name value to set. + * @return the CheckNameAvailabilityRequest object itself. + */ + public CheckNameAvailabilityRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: Type: workspace. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Type: workspace. + * + * @param type the type value to set. + * @return the CheckNameAvailabilityRequest object itself. + */ + public CheckNameAvailabilityRequest withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CheckNameAvailabilityResponse.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CheckNameAvailabilityResponse.java new file mode 100644 index 0000000000000..d8e8f3a9579c5 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CheckNameAvailabilityResponse.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.CheckNameAvailabilityResponseInner; + +/** An immutable client-side representation of CheckNameAvailabilityResponse. */ +public interface CheckNameAvailabilityResponse { + /** + * Gets the message property: Validation message. + * + * @return the message value. + */ + String message(); + + /** + * Gets the available property: Whether the workspace name is available. + * + * @return the available value. + */ + Boolean available(); + + /** + * Gets the reason property: Reason the workspace name is or is not available. + * + * @return the reason value. + */ + String reason(); + + /** + * Gets the name property: Workspace name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.CheckNameAvailabilityResponseInner object. + * + * @return the inner object. + */ + CheckNameAvailabilityResponseInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CmdkeySetup.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CmdkeySetup.java new file mode 100644 index 0000000000000..45695d51d929a --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CmdkeySetup.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The custom setup of running cmdkey commands. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("CmdkeySetup") +@JsonFlatten +@Fluent +public class CmdkeySetup extends CustomSetupBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CmdkeySetup.class); + + /* + * The server name of data source access. + */ + @JsonProperty(value = "typeProperties.targetName", required = true) + private Object targetName; + + /* + * The user name of data source access. + */ + @JsonProperty(value = "typeProperties.userName", required = true) + private Object username; + + /* + * The password of data source access. + */ + @JsonProperty(value = "typeProperties.password", required = true) + private SecretBase password; + + /** + * Get the targetName property: The server name of data source access. + * + * @return the targetName value. + */ + public Object targetName() { + return this.targetName; + } + + /** + * Set the targetName property: The server name of data source access. + * + * @param targetName the targetName value to set. + * @return the CmdkeySetup object itself. + */ + public CmdkeySetup withTargetName(Object targetName) { + this.targetName = targetName; + return this; + } + + /** + * Get the username property: The user name of data source access. + * + * @return the username value. + */ + public Object username() { + return this.username; + } + + /** + * Set the username property: The user name of data source access. + * + * @param username the username value to set. + * @return the CmdkeySetup object itself. + */ + public CmdkeySetup withUsername(Object username) { + this.username = username; + return this; + } + + /** + * Get the password property: The password of data source access. + * + * @return the password value. + */ + public SecretBase password() { + return this.password; + } + + /** + * Set the password property: The password of data source access. + * + * @param password the password value to set. + * @return the CmdkeySetup object itself. + */ + public CmdkeySetup withPassword(SecretBase password) { + this.password = password; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (targetName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property targetName in model CmdkeySetup")); + } + if (username() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property username in model CmdkeySetup")); + } + if (password() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property password in model CmdkeySetup")); + } else { + password().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ColumnDataType.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ColumnDataType.java new file mode 100644 index 0000000000000..7ca29e66b311c --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ColumnDataType.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ColumnDataType. */ +public final class ColumnDataType extends ExpandableStringEnum { + /** Static value image for ColumnDataType. */ + public static final ColumnDataType IMAGE = fromString("image"); + + /** Static value text for ColumnDataType. */ + public static final ColumnDataType TEXT = fromString("text"); + + /** Static value uniqueidentifier for ColumnDataType. */ + public static final ColumnDataType UNIQUEIDENTIFIER = fromString("uniqueidentifier"); + + /** Static value date for ColumnDataType. */ + public static final ColumnDataType DATE = fromString("date"); + + /** Static value time for ColumnDataType. */ + public static final ColumnDataType TIME = fromString("time"); + + /** Static value datetime2 for ColumnDataType. */ + public static final ColumnDataType DATETIME2 = fromString("datetime2"); + + /** Static value datetimeoffset for ColumnDataType. */ + public static final ColumnDataType DATETIMEOFFSET = fromString("datetimeoffset"); + + /** Static value tinyint for ColumnDataType. */ + public static final ColumnDataType TINYINT = fromString("tinyint"); + + /** Static value smallint for ColumnDataType. */ + public static final ColumnDataType SMALLINT = fromString("smallint"); + + /** Static value int for ColumnDataType. */ + public static final ColumnDataType INT = fromString("int"); + + /** Static value smalldatetime for ColumnDataType. */ + public static final ColumnDataType SMALLDATETIME = fromString("smalldatetime"); + + /** Static value real for ColumnDataType. */ + public static final ColumnDataType REAL = fromString("real"); + + /** Static value money for ColumnDataType. */ + public static final ColumnDataType MONEY = fromString("money"); + + /** Static value datetime for ColumnDataType. */ + public static final ColumnDataType DATETIME = fromString("datetime"); + + /** Static value float for ColumnDataType. */ + public static final ColumnDataType FLOAT = fromString("float"); + + /** Static value sql_variant for ColumnDataType. */ + public static final ColumnDataType SQL_VARIANT = fromString("sql_variant"); + + /** Static value ntext for ColumnDataType. */ + public static final ColumnDataType NTEXT = fromString("ntext"); + + /** Static value bit for ColumnDataType. */ + public static final ColumnDataType BIT = fromString("bit"); + + /** Static value decimal for ColumnDataType. */ + public static final ColumnDataType DECIMAL = fromString("decimal"); + + /** Static value numeric for ColumnDataType. */ + public static final ColumnDataType NUMERIC = fromString("numeric"); + + /** Static value smallmoney for ColumnDataType. */ + public static final ColumnDataType SMALLMONEY = fromString("smallmoney"); + + /** Static value bigint for ColumnDataType. */ + public static final ColumnDataType BIGINT = fromString("bigint"); + + /** Static value hierarchyid for ColumnDataType. */ + public static final ColumnDataType HIERARCHYID = fromString("hierarchyid"); + + /** Static value geometry for ColumnDataType. */ + public static final ColumnDataType GEOMETRY = fromString("geometry"); + + /** Static value geography for ColumnDataType. */ + public static final ColumnDataType GEOGRAPHY = fromString("geography"); + + /** Static value varbinary for ColumnDataType. */ + public static final ColumnDataType VARBINARY = fromString("varbinary"); + + /** Static value varchar for ColumnDataType. */ + public static final ColumnDataType VARCHAR = fromString("varchar"); + + /** Static value binary for ColumnDataType. */ + public static final ColumnDataType BINARY = fromString("binary"); + + /** Static value char for ColumnDataType. */ + public static final ColumnDataType CHAR = fromString("char"); + + /** Static value timestamp for ColumnDataType. */ + public static final ColumnDataType TIMESTAMP = fromString("timestamp"); + + /** Static value nvarchar for ColumnDataType. */ + public static final ColumnDataType NVARCHAR = fromString("nvarchar"); + + /** Static value nchar for ColumnDataType. */ + public static final ColumnDataType NCHAR = fromString("nchar"); + + /** Static value xml for ColumnDataType. */ + public static final ColumnDataType XML = fromString("xml"); + + /** Static value sysname for ColumnDataType. */ + public static final ColumnDataType SYSNAME = fromString("sysname"); + + /** + * Creates or finds a ColumnDataType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ColumnDataType. + */ + @JsonCreator + public static ColumnDataType fromString(String name) { + return fromString(name, ColumnDataType.class); + } + + /** @return known ColumnDataType values. */ + public static Collection values() { + return values(ColumnDataType.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ComponentSetup.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ComponentSetup.java new file mode 100644 index 0000000000000..f385ddae11b9f --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ComponentSetup.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The custom setup of installing 3rd party components. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("ComponentSetup") +@JsonFlatten +@Fluent +public class ComponentSetup extends CustomSetupBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ComponentSetup.class); + + /* + * The name of the 3rd party component. + */ + @JsonProperty(value = "typeProperties.componentName", required = true) + private String componentName; + + /* + * The license key to activate the component. + */ + @JsonProperty(value = "typeProperties.licenseKey") + private SecretBase licenseKey; + + /** + * Get the componentName property: The name of the 3rd party component. + * + * @return the componentName value. + */ + public String componentName() { + return this.componentName; + } + + /** + * Set the componentName property: The name of the 3rd party component. + * + * @param componentName the componentName value to set. + * @return the ComponentSetup object itself. + */ + public ComponentSetup withComponentName(String componentName) { + this.componentName = componentName; + return this; + } + + /** + * Get the licenseKey property: The license key to activate the component. + * + * @return the licenseKey value. + */ + public SecretBase licenseKey() { + return this.licenseKey; + } + + /** + * Set the licenseKey property: The license key to activate the component. + * + * @param licenseKey the licenseKey value to set. + * @return the ComponentSetup object itself. + */ + public ComponentSetup withLicenseKey(SecretBase licenseKey) { + this.licenseKey = licenseKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (componentName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property componentName in model ComponentSetup")); + } + if (licenseKey() != null) { + licenseKey().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ConnectionPolicyName.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ConnectionPolicyName.java new file mode 100644 index 0000000000000..a51b7353877fa --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ConnectionPolicyName.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConnectionPolicyName. */ +public final class ConnectionPolicyName extends ExpandableStringEnum { + /** Static value default for ConnectionPolicyName. */ + public static final ConnectionPolicyName DEFAULT = fromString("default"); + + /** + * Creates or finds a ConnectionPolicyName from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionPolicyName. + */ + @JsonCreator + public static ConnectionPolicyName fromString(String name) { + return fromString(name, ConnectionPolicyName.class); + } + + /** @return known ConnectionPolicyName values. */ + public static Collection values() { + return values(ConnectionPolicyName.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CreateSqlPoolRestorePointDefinition.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CreateSqlPoolRestorePointDefinition.java new file mode 100644 index 0000000000000..0ad57af93c62b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CreateSqlPoolRestorePointDefinition.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains the information necessary to perform a create Sql pool restore point operation. */ +@Fluent +public final class CreateSqlPoolRestorePointDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CreateSqlPoolRestorePointDefinition.class); + + /* + * The restore point label to apply + */ + @JsonProperty(value = "restorePointLabel", required = true) + private String restorePointLabel; + + /** + * Get the restorePointLabel property: The restore point label to apply. + * + * @return the restorePointLabel value. + */ + public String restorePointLabel() { + return this.restorePointLabel; + } + + /** + * Set the restorePointLabel property: The restore point label to apply. + * + * @param restorePointLabel the restorePointLabel value to set. + * @return the CreateSqlPoolRestorePointDefinition object itself. + */ + public CreateSqlPoolRestorePointDefinition withRestorePointLabel(String restorePointLabel) { + this.restorePointLabel = restorePointLabel; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (restorePointLabel() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property restorePointLabel in model CreateSqlPoolRestorePointDefinition")); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CustomSetupBase.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CustomSetupBase.java new file mode 100644 index 0000000000000..23b5b7f5d14ba --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CustomSetupBase.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The base definition of the custom setup. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + defaultImpl = CustomSetupBase.class) +@JsonTypeName("CustomSetupBase") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "CmdkeySetup", value = CmdkeySetup.class), + @JsonSubTypes.Type(name = "EnvironmentVariableSetup", value = EnvironmentVariableSetup.class), + @JsonSubTypes.Type(name = "ComponentSetup", value = ComponentSetup.class) +}) +@Immutable +public class CustomSetupBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomSetupBase.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CustomerManagedKeyDetails.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CustomerManagedKeyDetails.java new file mode 100644 index 0000000000000..02d3c10a330cf --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/CustomerManagedKeyDetails.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Details of the customer managed key associated with the workspace. */ +@Fluent +public final class CustomerManagedKeyDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomerManagedKeyDetails.class); + + /* + * 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 status property: The customer managed key status on the workspace. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the key property: The key object of the workspace. + * + * @return the key value. + */ + public WorkspaceKeyDetails key() { + return this.key; + } + + /** + * Set the key property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (key() != null) { + key().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataFlowComputeType.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataFlowComputeType.java new file mode 100644 index 0000000000000..3303bffbac113 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataFlowComputeType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DataFlowComputeType. */ +public final class DataFlowComputeType extends ExpandableStringEnum { + /** Static value General for DataFlowComputeType. */ + public static final DataFlowComputeType GENERAL = fromString("General"); + + /** Static value MemoryOptimized for DataFlowComputeType. */ + public static final DataFlowComputeType MEMORY_OPTIMIZED = fromString("MemoryOptimized"); + + /** Static value ComputeOptimized for DataFlowComputeType. */ + public static final DataFlowComputeType COMPUTE_OPTIMIZED = fromString("ComputeOptimized"); + + /** + * Creates or finds a DataFlowComputeType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataFlowComputeType. + */ + @JsonCreator + public static DataFlowComputeType fromString(String name) { + return fromString(name, DataFlowComputeType.class); + } + + /** @return known DataFlowComputeType values. */ + public static Collection values() { + return values(DataFlowComputeType.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataLakeStorageAccountDetails.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataLakeStorageAccountDetails.java new file mode 100644 index 0000000000000..14b1c8c4c971d --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataLakeStorageAccountDetails.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Details of the data lake storage account associated with the workspace. */ +@Fluent +public final class DataLakeStorageAccountDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataLakeStorageAccountDetails.class); + + /* + * Account URL + */ + @JsonProperty(value = "accountUrl") + private String accountUrl; + + /* + * Filesystem name + */ + @JsonProperty(value = "filesystem") + private String filesystem; + + /** + * Get the accountUrl property: Account URL. + * + * @return the accountUrl value. + */ + public String accountUrl() { + return this.accountUrl; + } + + /** + * Set the accountUrl property: Account URL. + * + * @param accountUrl the accountUrl value to set. + * @return the DataLakeStorageAccountDetails object itself. + */ + public DataLakeStorageAccountDetails withAccountUrl(String accountUrl) { + this.accountUrl = accountUrl; + return this; + } + + /** + * Get the filesystem property: Filesystem name. + * + * @return the filesystem value. + */ + public String filesystem() { + return this.filesystem; + } + + /** + * Set the filesystem property: Filesystem name. + * + * @param filesystem the filesystem value to set. + * @return the DataLakeStorageAccountDetails object itself. + */ + public DataLakeStorageAccountDetails withFilesystem(String filesystem) { + this.filesystem = filesystem; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingFunction.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingFunction.java new file mode 100644 index 0000000000000..5224742a55a07 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingFunction.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +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 final 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/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingPolicies.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingPolicies.java new file mode 100644 index 0000000000000..c04802709c3f0 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingPolicies.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DataMaskingPolicies. */ +public interface DataMaskingPolicies { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool data masking policy. + */ + DataMaskingPolicy get(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool data masking policy. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * Gets a Sql pool data masking policy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool data masking policy. + */ + DataMaskingPolicy getById(String id); + + /** + * Gets a Sql pool data masking policy. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool data masking policy. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new DataMaskingPolicy resource. + * + * @return the first stage of the new DataMaskingPolicy definition. + */ + DataMaskingPolicy.DefinitionStages.Blank define(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingPolicy.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingPolicy.java new file mode 100644 index 0000000000000..3fc6b29c8ecef --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingPolicy.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.DataMaskingPolicyInner; + +/** An immutable client-side representation of DataMaskingPolicy. */ +public interface DataMaskingPolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The location of the data masking policy. + * + * @return the location value. + */ + String location(); + + /** + * Gets the kind property: The kind of data masking policy. Metadata, used for Azure portal. + * + * @return the kind value. + */ + String kind(); + + /** + * Gets the managedBy property: Fully qualified resource ID of the sql pool. + * + * @return the managedBy value. + */ + String managedBy(); + + /** + * Gets the dataMaskingState property: The state of the data masking policy. + * + * @return the dataMaskingState value. + */ + DataMaskingState dataMaskingState(); + + /** + * Gets the exemptPrincipals property: 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. + */ + String exemptPrincipals(); + + /** + * Gets the applicationPrincipals property: The list of the application principals. This is a legacy parameter and + * is no longer used. + * + * @return the applicationPrincipals value. + */ + String applicationPrincipals(); + + /** + * Gets the maskingLevel property: The masking level. This is a legacy parameter and is no longer used. + * + * @return the maskingLevel value. + */ + String maskingLevel(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.DataMaskingPolicyInner object. + * + * @return the inner object. + */ + DataMaskingPolicyInner innerModel(); + + /** The entirety of the DataMaskingPolicy definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The DataMaskingPolicy definition stages. */ + interface DefinitionStages { + /** The first stage of the DataMaskingPolicy definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the DataMaskingPolicy definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * 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. + */ + WithCreate withExistingSqlPool(String resourceGroupName, String workspaceName, String sqlPoolName); + } + /** + * The stage of the DataMaskingPolicy definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithDataMaskingState, DefinitionStages.WithExemptPrincipals { + /** + * Executes the create request. + * + * @return the created resource. + */ + DataMaskingPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DataMaskingPolicy create(Context context); + } + /** The stage of the DataMaskingPolicy definition allowing to specify dataMaskingState. */ + interface WithDataMaskingState { + /** + * Specifies the dataMaskingState property: The state of the data masking policy.. + * + * @param dataMaskingState The state of the data masking policy. + * @return the next definition stage. + */ + WithCreate withDataMaskingState(DataMaskingState dataMaskingState); + } + /** The stage of the DataMaskingPolicy definition allowing to specify exemptPrincipals. */ + interface WithExemptPrincipals { + /** + * Specifies the exemptPrincipals property: 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 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); + } + } + /** + * Begins update for the DataMaskingPolicy resource. + * + * @return the stage of resource update. + */ + DataMaskingPolicy.Update update(); + + /** The template for DataMaskingPolicy update. */ + interface Update extends UpdateStages.WithDataMaskingState, UpdateStages.WithExemptPrincipals { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DataMaskingPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DataMaskingPolicy apply(Context context); + } + /** The DataMaskingPolicy update stages. */ + interface UpdateStages { + /** The stage of the DataMaskingPolicy update allowing to specify dataMaskingState. */ + interface WithDataMaskingState { + /** + * Specifies the dataMaskingState property: The state of the data masking policy.. + * + * @param dataMaskingState The state of the data masking policy. + * @return the next definition stage. + */ + Update withDataMaskingState(DataMaskingState dataMaskingState); + } + /** The stage of the DataMaskingPolicy update allowing to specify exemptPrincipals. */ + interface WithExemptPrincipals { + /** + * Specifies the exemptPrincipals property: 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 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. + */ + Update withExemptPrincipals(String exemptPrincipals); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DataMaskingPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DataMaskingPolicy refresh(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingRule.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingRule.java new file mode 100644 index 0000000000000..4b12c8e257f76 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingRule.java @@ -0,0 +1,518 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.DataMaskingRuleInner; + +/** An immutable client-side representation of DataMaskingRule. */ +public interface DataMaskingRule { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The location of the data masking rule. + * + * @return the location value. + */ + String location(); + + /** + * Gets the kind property: The kind of Data Masking Rule. Metadata, used for Azure portal. + * + * @return the kind value. + */ + String kind(); + + /** + * Gets the idPropertiesId property: The rule Id. + * + * @return the idPropertiesId value. + */ + String idPropertiesId(); + + /** + * Gets the aliasName property: The alias name. This is a legacy parameter and is no longer used. + * + * @return the aliasName value. + */ + String aliasName(); + + /** + * Gets the ruleState property: 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. + * + * @return the ruleState value. + */ + DataMaskingRuleState ruleState(); + + /** + * Gets the schemaName property: The schema name on which the data masking rule is applied. + * + * @return the schemaName value. + */ + String schemaName(); + + /** + * Gets the tableName property: The table name on which the data masking rule is applied. + * + * @return the tableName value. + */ + String tableName(); + + /** + * Gets the columnName property: The column name on which the data masking rule is applied. + * + * @return the columnName value. + */ + String columnName(); + + /** + * Gets the maskingFunction property: The masking function that is used for the data masking rule. + * + * @return the maskingFunction value. + */ + DataMaskingFunction maskingFunction(); + + /** + * Gets the numberFrom property: The numberFrom property of the masking rule. Required if maskingFunction is set to + * Number, otherwise this parameter will be ignored. + * + * @return the numberFrom value. + */ + String numberFrom(); + + /** + * Gets the numberTo property: 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. + */ + String numberTo(); + + /** + * Gets the prefixSize property: 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. + */ + String prefixSize(); + + /** + * Gets the suffixSize property: 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. + */ + String suffixSize(); + + /** + * Gets the replacementString property: 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. + */ + String replacementString(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.DataMaskingRuleInner object. + * + * @return the inner object. + */ + DataMaskingRuleInner innerModel(); + + /** The entirety of the DataMaskingRule definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The DataMaskingRule definition stages. */ + interface DefinitionStages { + /** The first stage of the DataMaskingRule definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the DataMaskingRule definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * 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. + */ + WithCreate withExistingSqlPool(String resourceGroupName, String workspaceName, String sqlPoolName); + } + /** + * The stage of the DataMaskingRule definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithAliasName, + DefinitionStages.WithRuleState, + DefinitionStages.WithSchemaName, + DefinitionStages.WithTableName, + DefinitionStages.WithColumnName, + DefinitionStages.WithMaskingFunction, + DefinitionStages.WithNumberFrom, + DefinitionStages.WithNumberTo, + DefinitionStages.WithPrefixSize, + DefinitionStages.WithSuffixSize, + DefinitionStages.WithReplacementString { + /** + * Executes the create request. + * + * @return the created resource. + */ + DataMaskingRule create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + DataMaskingRule create(Context context); + } + /** The stage of the DataMaskingRule definition allowing to specify aliasName. */ + interface WithAliasName { + /** + * Specifies the aliasName property: The alias name. This is a legacy parameter and is no longer used.. + * + * @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 ruleState. */ + interface WithRuleState { + /** + * Specifies the ruleState property: 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.. + * + * @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. + * @return the next definition stage. + */ + WithCreate withRuleState(DataMaskingRuleState ruleState); + } + /** The stage of the DataMaskingRule definition allowing to specify schemaName. */ + interface WithSchemaName { + /** + * Specifies the schemaName property: The schema name on which the data masking rule is applied.. + * + * @param schemaName The schema name on which the data masking rule is applied. + * @return the next definition stage. + */ + WithCreate withSchemaName(String schemaName); + } + /** The stage of the DataMaskingRule definition allowing to specify tableName. */ + interface WithTableName { + /** + * Specifies the tableName property: The table name on which the data masking rule is applied.. + * + * @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 columnName. */ + interface WithColumnName { + /** + * Specifies the columnName property: The column name on which the data masking rule is applied.. + * + * @param columnName The column name on which the data masking rule is applied. + * @return the next definition stage. + */ + WithCreate withColumnName(String columnName); + } + /** The stage of the DataMaskingRule definition allowing to specify maskingFunction. */ + interface WithMaskingFunction { + /** + * Specifies the maskingFunction property: The masking function that is used for the data masking rule.. + * + * @param maskingFunction The masking function that is used for the data masking rule. + * @return the next definition stage. + */ + WithCreate withMaskingFunction(DataMaskingFunction maskingFunction); + } + /** The stage of the DataMaskingRule definition allowing to specify numberFrom. */ + interface WithNumberFrom { + /** + * Specifies the numberFrom property: The numberFrom property of the masking rule. Required if + * maskingFunction is set to Number, otherwise this parameter will be ignored.. + * + * @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 the numberTo property: 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 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 the prefixSize property: 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 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 suffixSize. */ + interface WithSuffixSize { + /** + * Specifies the suffixSize property: 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 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 DataMaskingRule definition allowing to specify replacementString. */ + interface WithReplacementString { + /** + * Specifies the replacementString property: 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 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); + } + } + /** + * Begins update for the DataMaskingRule resource. + * + * @return the stage of resource update. + */ + DataMaskingRule.Update update(); + + /** The template for DataMaskingRule update. */ + interface Update + extends UpdateStages.WithAliasName, + UpdateStages.WithRuleState, + UpdateStages.WithSchemaName, + UpdateStages.WithTableName, + UpdateStages.WithColumnName, + UpdateStages.WithMaskingFunction, + UpdateStages.WithNumberFrom, + UpdateStages.WithNumberTo, + UpdateStages.WithPrefixSize, + UpdateStages.WithSuffixSize, + UpdateStages.WithReplacementString { + /** + * Executes the update request. + * + * @return the updated resource. + */ + DataMaskingRule apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + DataMaskingRule apply(Context context); + } + /** The DataMaskingRule update stages. */ + interface UpdateStages { + /** The stage of the DataMaskingRule update allowing to specify aliasName. */ + interface WithAliasName { + /** + * Specifies the aliasName property: The alias name. This is a legacy parameter and is no longer used.. + * + * @param aliasName The alias name. This is a legacy parameter and is no longer used. + * @return the next definition stage. + */ + Update withAliasName(String aliasName); + } + /** The stage of the DataMaskingRule update allowing to specify ruleState. */ + interface WithRuleState { + /** + * Specifies the ruleState property: 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.. + * + * @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. + * @return the next definition stage. + */ + Update withRuleState(DataMaskingRuleState ruleState); + } + /** The stage of the DataMaskingRule update allowing to specify schemaName. */ + interface WithSchemaName { + /** + * Specifies the schemaName property: The schema name on which the data masking rule is applied.. + * + * @param schemaName The schema name on which the data masking rule is applied. + * @return the next definition stage. + */ + Update withSchemaName(String schemaName); + } + /** The stage of the DataMaskingRule update allowing to specify tableName. */ + interface WithTableName { + /** + * Specifies the tableName property: The table name on which the data masking rule is applied.. + * + * @param tableName The table name on which the data masking rule is applied. + * @return the next definition stage. + */ + Update withTableName(String tableName); + } + /** The stage of the DataMaskingRule update allowing to specify columnName. */ + interface WithColumnName { + /** + * Specifies the columnName property: The column name on which the data masking rule is applied.. + * + * @param columnName The column name on which the data masking rule is applied. + * @return the next definition stage. + */ + Update withColumnName(String columnName); + } + /** The stage of the DataMaskingRule update allowing to specify maskingFunction. */ + interface WithMaskingFunction { + /** + * Specifies the maskingFunction property: The masking function that is used for the data masking rule.. + * + * @param maskingFunction The masking function that is used for the data masking rule. + * @return the next definition stage. + */ + Update withMaskingFunction(DataMaskingFunction maskingFunction); + } + /** The stage of the DataMaskingRule update allowing to specify numberFrom. */ + interface WithNumberFrom { + /** + * Specifies the numberFrom property: The numberFrom property of the masking rule. Required if + * maskingFunction is set to Number, otherwise this parameter will be ignored.. + * + * @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. + */ + Update withNumberFrom(String numberFrom); + } + /** The stage of the DataMaskingRule update allowing to specify numberTo. */ + interface WithNumberTo { + /** + * Specifies the numberTo property: 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 property of the data masking rule. Required if maskingFunction is set to + * Number, otherwise this parameter will be ignored. + * @return the next definition stage. + */ + Update withNumberTo(String numberTo); + } + /** The stage of the DataMaskingRule update allowing to specify prefixSize. */ + interface WithPrefixSize { + /** + * Specifies the prefixSize property: 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 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. + */ + Update withPrefixSize(String prefixSize); + } + /** The stage of the DataMaskingRule update allowing to specify suffixSize. */ + interface WithSuffixSize { + /** + * Specifies the suffixSize property: 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 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. + */ + Update withSuffixSize(String suffixSize); + } + /** The stage of the DataMaskingRule update allowing to specify replacementString. */ + interface WithReplacementString { + /** + * Specifies the replacementString property: 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 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. + */ + Update withReplacementString(String replacementString); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + DataMaskingRule refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + DataMaskingRule refresh(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingRuleListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingRuleListResult.java new file mode 100644 index 0000000000000..36a84a036b89e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingRuleListResult.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.DataMaskingRuleInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response to a list data masking rules request. */ +@Fluent +public final class DataMaskingRuleListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DataMaskingRuleListResult.class); + + /* + * The list of Sql pool data masking rules. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of Sql pool data masking rules. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Sql pool data masking rules. + * + * @param value the value value to set. + * @return the DataMaskingRuleListResult object itself. + */ + public DataMaskingRuleListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingRuleState.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingRuleState.java new file mode 100644 index 0000000000000..678df6ae785fd --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingRuleState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +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 final 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/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingRules.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingRules.java new file mode 100644 index 0000000000000..7f6d73b3c5c40 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingRules.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of DataMaskingRules. */ +public interface DataMaskingRules { + /** + * Gets the specific 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific Sql pool data masking rule. + */ + DataMaskingRule get(String resourceGroupName, String workspaceName, String sqlPoolName, String dataMaskingRuleName); + + /** + * Gets the specific 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific Sql pool data masking rule. + */ + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String dataMaskingRuleName, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool data masking rules. + */ + PagedIterable listBySqlPool(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool data masking rules. + */ + PagedIterable listBySqlPool( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * Gets the specific Sql pool data masking rule. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific Sql pool data masking rule. + */ + DataMaskingRule getById(String id); + + /** + * Gets the specific Sql pool data masking rule. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific Sql pool data masking rule. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new DataMaskingRule resource. + * + * @param name resource name. + * @return the first stage of the new DataMaskingRule definition. + */ + DataMaskingRule.DefinitionStages.Blank define(String name); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingState.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingState.java new file mode 100644 index 0000000000000..ae49fb96082a1 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataMaskingState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +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 final 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/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataWarehouseUserActivities.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataWarehouseUserActivities.java new file mode 100644 index 0000000000000..e890ba3de13c8 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataWarehouseUserActivities.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.DataWarehouseUserActivitiesInner; + +/** An immutable client-side representation of DataWarehouseUserActivities. */ +public interface DataWarehouseUserActivities { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the activeQueriesCount property: Count of running and suspended queries. + * + * @return the activeQueriesCount value. + */ + Integer activeQueriesCount(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.DataWarehouseUserActivitiesInner object. + * + * @return the inner object. + */ + DataWarehouseUserActivitiesInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataWarehouseUserActivityName.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataWarehouseUserActivityName.java new file mode 100644 index 0000000000000..37a82ffc2a2fd --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DataWarehouseUserActivityName.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DataWarehouseUserActivityName. */ +public final class DataWarehouseUserActivityName extends ExpandableStringEnum { + /** Static value current for DataWarehouseUserActivityName. */ + public static final DataWarehouseUserActivityName CURRENT = fromString("current"); + + /** + * Creates or finds a DataWarehouseUserActivityName from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataWarehouseUserActivityName. + */ + @JsonCreator + public static DataWarehouseUserActivityName fromString(String name) { + return fromString(name, DataWarehouseUserActivityName.class); + } + + /** @return known DataWarehouseUserActivityName values. */ + public static Collection values() { + return values(DataWarehouseUserActivityName.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DayOfWeek.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DayOfWeek.java new file mode 100644 index 0000000000000..01680d5361f07 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DayOfWeek.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for DayOfWeek. */ +public final class DayOfWeek extends ExpandableStringEnum { + /** Static value Sunday for DayOfWeek. */ + public static final DayOfWeek SUNDAY = fromString("Sunday"); + + /** Static value Monday for DayOfWeek. */ + public static final DayOfWeek MONDAY = fromString("Monday"); + + /** Static value Tuesday for DayOfWeek. */ + public static final DayOfWeek TUESDAY = fromString("Tuesday"); + + /** Static value Wednesday for DayOfWeek. */ + public static final DayOfWeek WEDNESDAY = fromString("Wednesday"); + + /** Static value Thursday for DayOfWeek. */ + public static final DayOfWeek THURSDAY = fromString("Thursday"); + + /** Static value Friday for DayOfWeek. */ + public static final DayOfWeek FRIDAY = fromString("Friday"); + + /** Static value Saturday for DayOfWeek. */ + public static final DayOfWeek SATURDAY = fromString("Saturday"); + + /** + * Creates or finds a DayOfWeek from its string representation. + * + * @param name a name to look for. + * @return the corresponding DayOfWeek. + */ + @JsonCreator + public static DayOfWeek fromString(String name) { + return fromString(name, DayOfWeek.class); + } + + /** @return known DayOfWeek values. */ + public static Collection values() { + return values(DayOfWeek.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DynamicExecutorAllocation.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DynamicExecutorAllocation.java new file mode 100644 index 0000000000000..a5ab24c620adf --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/DynamicExecutorAllocation.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Dynamic Executor Allocation Properties. */ +@Fluent +public final class DynamicExecutorAllocation { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DynamicExecutorAllocation.class); + + /* + * Indicates whether Dynamic Executor Allocation is enabled or not. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * Get the enabled property: Indicates whether Dynamic Executor Allocation is enabled or not. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Indicates whether Dynamic Executor Allocation is enabled or not. + * + * @param enabled the enabled value to set. + * @return the DynamicExecutorAllocation object itself. + */ + public DynamicExecutorAllocation withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EncryptionDetails.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EncryptionDetails.java new file mode 100644 index 0000000000000..1d6734e4120be --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EncryptionDetails.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Details of the encryption associated with the workspace. */ +@Fluent +public final class EncryptionDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionDetails.class); + + /* + * 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 the doubleEncryptionEnabled property: Double Encryption enabled. + * + * @return the doubleEncryptionEnabled value. + */ + public Boolean doubleEncryptionEnabled() { + return this.doubleEncryptionEnabled; + } + + /** + * Get the cmk property: Customer Managed Key Details. + * + * @return the cmk value. + */ + public CustomerManagedKeyDetails cmk() { + return this.cmk; + } + + /** + * Set the cmk property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (cmk() != null) { + cmk().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EncryptionProtector.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EncryptionProtector.java new file mode 100644 index 0000000000000..e0b6acce09a35 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EncryptionProtector.java @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.EncryptionProtectorInner; + +/** An immutable client-side representation of EncryptionProtector. */ +public interface EncryptionProtector { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the kind property: Kind of encryption protector. This is metadata used for the Azure portal experience. + * + * @return the kind value. + */ + String kind(); + + /** + * Gets the location property: Resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the subregion property: Subregion of the encryption protector. + * + * @return the subregion value. + */ + String subregion(); + + /** + * Gets the serverKeyName property: The name of the server key. + * + * @return the serverKeyName value. + */ + String serverKeyName(); + + /** + * Gets the serverKeyType property: The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. + * + * @return the serverKeyType value. + */ + ServerKeyType serverKeyType(); + + /** + * Gets the uri property: The URI of the server key. + * + * @return the uri value. + */ + String uri(); + + /** + * Gets the thumbprint property: Thumbprint of the server key. + * + * @return the thumbprint value. + */ + String thumbprint(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.EncryptionProtectorInner object. + * + * @return the inner object. + */ + EncryptionProtectorInner innerModel(); + + /** The entirety of the EncryptionProtector definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The EncryptionProtector definition stages. */ + interface DefinitionStages { + /** The first stage of the EncryptionProtector definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the EncryptionProtector definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * 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 EncryptionProtector definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithServerKeyName, DefinitionStages.WithServerKeyType { + /** + * Executes the create request. + * + * @return the created resource. + */ + EncryptionProtector create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + EncryptionProtector create(Context context); + } + /** The stage of the EncryptionProtector definition allowing to specify serverKeyName. */ + interface WithServerKeyName { + /** + * Specifies the serverKeyName property: The name of the server key.. + * + * @param serverKeyName The name of the server key. + * @return the next definition stage. + */ + WithCreate withServerKeyName(String serverKeyName); + } + /** The stage of the EncryptionProtector definition allowing to specify serverKeyType. */ + interface WithServerKeyType { + /** + * Specifies the serverKeyType property: The encryption protector type like 'ServiceManaged', + * 'AzureKeyVault'.. + * + * @param serverKeyType The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. + * @return the next definition stage. + */ + WithCreate withServerKeyType(ServerKeyType serverKeyType); + } + } + /** + * Begins update for the EncryptionProtector resource. + * + * @return the stage of resource update. + */ + EncryptionProtector.Update update(); + + /** The template for EncryptionProtector update. */ + interface Update extends UpdateStages.WithServerKeyName, UpdateStages.WithServerKeyType { + /** + * Executes the update request. + * + * @return the updated resource. + */ + EncryptionProtector apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + EncryptionProtector apply(Context context); + } + /** The EncryptionProtector update stages. */ + interface UpdateStages { + /** The stage of the EncryptionProtector update allowing to specify serverKeyName. */ + interface WithServerKeyName { + /** + * Specifies the serverKeyName property: The name of the server key.. + * + * @param serverKeyName The name of the server key. + * @return the next definition stage. + */ + Update withServerKeyName(String serverKeyName); + } + /** The stage of the EncryptionProtector update allowing to specify serverKeyType. */ + interface WithServerKeyType { + /** + * Specifies the serverKeyType property: The encryption protector type like 'ServiceManaged', + * 'AzureKeyVault'.. + * + * @param serverKeyType The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. + * @return the next definition stage. + */ + Update withServerKeyType(ServerKeyType serverKeyType); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + EncryptionProtector refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + EncryptionProtector refresh(Context context); + + /** + * Revalidates workspace managed sql server's existing encryption protector. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void revalidate(); + + /** + * Revalidates workspace managed sql server's existing encryption protector. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void revalidate(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EncryptionProtectorListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EncryptionProtectorListResult.java new file mode 100644 index 0000000000000..405e8cbed655b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EncryptionProtectorListResult.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.EncryptionProtectorInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of server encryption protectors. */ +@Immutable +public final class EncryptionProtectorListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionProtectorListResult.class); + + /* + * Array of results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EncryptionProtectorName.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EncryptionProtectorName.java new file mode 100644 index 0000000000000..6241d170e8202 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EncryptionProtectorName.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EncryptionProtectorName. */ +public final class EncryptionProtectorName extends ExpandableStringEnum { + /** Static value current for EncryptionProtectorName. */ + public static final EncryptionProtectorName CURRENT = fromString("current"); + + /** + * Creates or finds a EncryptionProtectorName from its string representation. + * + * @param name a name to look for. + * @return the corresponding EncryptionProtectorName. + */ + @JsonCreator + public static EncryptionProtectorName fromString(String name) { + return fromString(name, EncryptionProtectorName.class); + } + + /** @return known EncryptionProtectorName values. */ + public static Collection values() { + return values(EncryptionProtectorName.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EntityReference.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EntityReference.java new file mode 100644 index 0000000000000..5753961fd188c --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EntityReference.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The entity reference. */ +@Fluent +public final class EntityReference { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntityReference.class); + + /* + * The type of this referenced entity. + */ + @JsonProperty(value = "type") + private IntegrationRuntimeEntityReferenceType type; + + /* + * The name of this referenced entity. + */ + @JsonProperty(value = "referenceName") + private String referenceName; + + /** + * Get the type property: The type of this referenced entity. + * + * @return the type value. + */ + public IntegrationRuntimeEntityReferenceType type() { + return this.type; + } + + /** + * Set the type property: The type of this referenced entity. + * + * @param type the type value to set. + * @return the EntityReference object itself. + */ + public EntityReference withType(IntegrationRuntimeEntityReferenceType type) { + this.type = type; + return this; + } + + /** + * Get the referenceName property: The name of this referenced entity. + * + * @return the referenceName value. + */ + public String referenceName() { + return this.referenceName; + } + + /** + * Set the referenceName property: The name of this referenced entity. + * + * @param referenceName the referenceName value to set. + * @return the EntityReference object itself. + */ + public EntityReference withReferenceName(String referenceName) { + this.referenceName = referenceName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EntityResource.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EntityResource.java new file mode 100644 index 0000000000000..bc0f5a300fe51 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EntityResource.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; + +/** Azure Synapse nested resource, which belongs to a workspace. */ +@Immutable +public final class EntityResource extends AzureEntityResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EntityResource.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EnvironmentVariableSetup.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EnvironmentVariableSetup.java new file mode 100644 index 0000000000000..e96ec178ab43a --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/EnvironmentVariableSetup.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The custom setup of setting environment variable. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("EnvironmentVariableSetup") +@JsonFlatten +@Fluent +public class EnvironmentVariableSetup extends CustomSetupBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EnvironmentVariableSetup.class); + + /* + * The name of the environment variable. + */ + @JsonProperty(value = "typeProperties.variableName", required = true) + private String variableName; + + /* + * The value of the environment variable. + */ + @JsonProperty(value = "typeProperties.variableValue", required = true) + private String variableValue; + + /** + * Get the variableName property: The name of the environment variable. + * + * @return the variableName value. + */ + public String variableName() { + return this.variableName; + } + + /** + * Set the variableName property: The name of the environment variable. + * + * @param variableName the variableName value to set. + * @return the EnvironmentVariableSetup object itself. + */ + public EnvironmentVariableSetup withVariableName(String variableName) { + this.variableName = variableName; + return this; + } + + /** + * Get the variableValue property: The value of the environment variable. + * + * @return the variableValue value. + */ + public String variableValue() { + return this.variableValue; + } + + /** + * Set the variableValue property: The value of the environment variable. + * + * @param variableValue the variableValue value to set. + * @return the EnvironmentVariableSetup object itself. + */ + public EnvironmentVariableSetup withVariableValue(String variableValue) { + this.variableValue = variableValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (variableName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property variableName in model EnvironmentVariableSetup")); + } + if (variableValue() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property variableValue in model EnvironmentVariableSetup")); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ErrorAdditionalInfo.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ErrorAdditionalInfo.java new file mode 100644 index 0000000000000..42bd8f46d5a4c --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ErrorAdditionalInfo.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The resource management error additional info. */ +@Immutable +public final class ErrorAdditionalInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ErrorAdditionalInfo.class); + + /* + * The additional info type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The additional info. + */ + @JsonProperty(value = "info", access = JsonProperty.Access.WRITE_ONLY) + private Object info; + + /** + * Get the type property: The additional info type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the info property: The additional info. + * + * @return the info value. + */ + public Object info() { + return this.info; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ExtendedServerBlobAuditingPolicy.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ExtendedServerBlobAuditingPolicy.java new file mode 100644 index 0000000000000..5b37e221aa027 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ExtendedServerBlobAuditingPolicy.java @@ -0,0 +1,727 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.ExtendedServerBlobAuditingPolicyInner; +import java.util.List; +import java.util.UUID; + +/** An immutable client-side representation of ExtendedServerBlobAuditingPolicy. */ +public interface ExtendedServerBlobAuditingPolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the predicateExpression property: Specifies condition of where clause when creating an audit. + * + * @return the predicateExpression value. + */ + String predicateExpression(); + + /** + * Gets the state property: Specifies the state of the policy. If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled are required. + * + * @return the state value. + */ + BlobAuditingPolicyState state(); + + /** + * Gets the storageEndpoint property: 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. + */ + String storageEndpoint(); + + /** + * Gets the storageAccountAccessKey property: 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. + */ + String storageAccountAccessKey(); + + /** + * Gets the retentionDays property: Specifies the number of days to keep in the audit logs in the storage account. + * + * @return the retentionDays value. + */ + Integer retentionDays(); + + /** + * Gets the auditActionsAndGroups property: 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. + */ + List auditActionsAndGroups(); + + /** + * Gets the storageAccountSubscriptionId property: Specifies the blob storage subscription Id. + * + * @return the storageAccountSubscriptionId value. + */ + UUID storageAccountSubscriptionId(); + + /** + * Gets the isStorageSecondaryKeyInUse property: Specifies whether storageAccountAccessKey value is the storage's + * secondary key. + * + * @return the isStorageSecondaryKeyInUse value. + */ + Boolean isStorageSecondaryKeyInUse(); + + /** + * Gets the isAzureMonitorTargetEnabled property: 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. + */ + Boolean isAzureMonitorTargetEnabled(); + + /** + * Gets the queueDelayMs property: 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. + */ + Integer queueDelayMs(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.ExtendedServerBlobAuditingPolicyInner object. + * + * @return the inner object. + */ + ExtendedServerBlobAuditingPolicyInner innerModel(); + + /** The entirety of the ExtendedServerBlobAuditingPolicy definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ExtendedServerBlobAuditingPolicy definition stages. */ + interface DefinitionStages { + /** The first stage of the ExtendedServerBlobAuditingPolicy definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ExtendedServerBlobAuditingPolicy definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * 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 ExtendedServerBlobAuditingPolicy definition which contains all the minimum required + * properties for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithPredicateExpression, + DefinitionStages.WithState, + DefinitionStages.WithStorageEndpoint, + DefinitionStages.WithStorageAccountAccessKey, + DefinitionStages.WithRetentionDays, + DefinitionStages.WithAuditActionsAndGroups, + DefinitionStages.WithStorageAccountSubscriptionId, + DefinitionStages.WithIsStorageSecondaryKeyInUse, + DefinitionStages.WithIsAzureMonitorTargetEnabled, + DefinitionStages.WithQueueDelayMs { + /** + * Executes the create request. + * + * @return the created resource. + */ + ExtendedServerBlobAuditingPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ExtendedServerBlobAuditingPolicy create(Context context); + } + /** The stage of the ExtendedServerBlobAuditingPolicy definition allowing to specify predicateExpression. */ + interface WithPredicateExpression { + /** + * Specifies the predicateExpression property: Specifies condition of where clause when creating an audit.. + * + * @param predicateExpression Specifies condition of where clause when creating an audit. + * @return the next definition stage. + */ + WithCreate withPredicateExpression(String predicateExpression); + } + /** The stage of the ExtendedServerBlobAuditingPolicy definition allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: Specifies the state of the policy. If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled are required.. + * + * @param state Specifies the state of the policy. If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled are required. + * @return the next definition stage. + */ + WithCreate withState(BlobAuditingPolicyState state); + } + /** The stage of the ExtendedServerBlobAuditingPolicy definition allowing to specify storageEndpoint. */ + interface WithStorageEndpoint { + /** + * Specifies the storageEndpoint property: Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled is required.. + * + * @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 ExtendedServerBlobAuditingPolicy definition allowing to specify storageAccountAccessKey. */ + interface WithStorageAccountAccessKey { + /** + * Specifies the storageAccountAccessKey property: 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 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 ExtendedServerBlobAuditingPolicy definition allowing to specify retentionDays. */ + interface WithRetentionDays { + /** + * Specifies the retentionDays property: Specifies the number of days to keep in the audit logs in the + * storage account.. + * + * @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 ExtendedServerBlobAuditingPolicy definition allowing to specify auditActionsAndGroups. */ + interface WithAuditActionsAndGroups { + /** + * Specifies the auditActionsAndGroups property: 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 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 ExtendedServerBlobAuditingPolicy definition allowing to specify + * storageAccountSubscriptionId. + */ + interface WithStorageAccountSubscriptionId { + /** + * Specifies the storageAccountSubscriptionId property: Specifies the blob storage subscription Id.. + * + * @param storageAccountSubscriptionId Specifies the blob storage subscription Id. + * @return the next definition stage. + */ + WithCreate withStorageAccountSubscriptionId(UUID storageAccountSubscriptionId); + } + /** + * The stage of the ExtendedServerBlobAuditingPolicy definition allowing to specify isStorageSecondaryKeyInUse. + */ + interface WithIsStorageSecondaryKeyInUse { + /** + * Specifies the isStorageSecondaryKeyInUse property: Specifies whether storageAccountAccessKey value is the + * storage's secondary key.. + * + * @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 ExtendedServerBlobAuditingPolicy definition allowing to specify isAzureMonitorTargetEnabled. + */ + interface WithIsAzureMonitorTargetEnabled { + /** + * Specifies the isAzureMonitorTargetEnabled property: 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 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 ExtendedServerBlobAuditingPolicy definition allowing to specify queueDelayMs. */ + interface WithQueueDelayMs { + /** + * Specifies the queueDelayMs property: 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 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); + } + } + /** + * Begins update for the ExtendedServerBlobAuditingPolicy resource. + * + * @return the stage of resource update. + */ + ExtendedServerBlobAuditingPolicy.Update update(); + + /** The template for ExtendedServerBlobAuditingPolicy update. */ + interface Update + extends UpdateStages.WithPredicateExpression, + UpdateStages.WithState, + UpdateStages.WithStorageEndpoint, + UpdateStages.WithStorageAccountAccessKey, + UpdateStages.WithRetentionDays, + UpdateStages.WithAuditActionsAndGroups, + UpdateStages.WithStorageAccountSubscriptionId, + UpdateStages.WithIsStorageSecondaryKeyInUse, + UpdateStages.WithIsAzureMonitorTargetEnabled, + UpdateStages.WithQueueDelayMs { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ExtendedServerBlobAuditingPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ExtendedServerBlobAuditingPolicy apply(Context context); + } + /** The ExtendedServerBlobAuditingPolicy update stages. */ + interface UpdateStages { + /** The stage of the ExtendedServerBlobAuditingPolicy update allowing to specify predicateExpression. */ + interface WithPredicateExpression { + /** + * Specifies the predicateExpression property: Specifies condition of where clause when creating an audit.. + * + * @param predicateExpression Specifies condition of where clause when creating an audit. + * @return the next definition stage. + */ + Update withPredicateExpression(String predicateExpression); + } + /** The stage of the ExtendedServerBlobAuditingPolicy update allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: Specifies the state of the policy. If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled are required.. + * + * @param state Specifies the state of the policy. If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled are required. + * @return the next definition stage. + */ + Update withState(BlobAuditingPolicyState state); + } + /** The stage of the ExtendedServerBlobAuditingPolicy update allowing to specify storageEndpoint. */ + interface WithStorageEndpoint { + /** + * Specifies the storageEndpoint property: Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled is required.. + * + * @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. + */ + Update withStorageEndpoint(String storageEndpoint); + } + /** The stage of the ExtendedServerBlobAuditingPolicy update allowing to specify storageAccountAccessKey. */ + interface WithStorageAccountAccessKey { + /** + * Specifies the storageAccountAccessKey property: 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 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. + */ + Update withStorageAccountAccessKey(String storageAccountAccessKey); + } + /** The stage of the ExtendedServerBlobAuditingPolicy update allowing to specify retentionDays. */ + interface WithRetentionDays { + /** + * Specifies the retentionDays property: Specifies the number of days to keep in the audit logs in the + * storage account.. + * + * @param retentionDays Specifies the number of days to keep in the audit logs in the storage account. + * @return the next definition stage. + */ + Update withRetentionDays(Integer retentionDays); + } + /** The stage of the ExtendedServerBlobAuditingPolicy update allowing to specify auditActionsAndGroups. */ + interface WithAuditActionsAndGroups { + /** + * Specifies the auditActionsAndGroups property: 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 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. + */ + Update withAuditActionsAndGroups(List auditActionsAndGroups); + } + /** + * The stage of the ExtendedServerBlobAuditingPolicy update allowing to specify storageAccountSubscriptionId. + */ + interface WithStorageAccountSubscriptionId { + /** + * Specifies the storageAccountSubscriptionId property: Specifies the blob storage subscription Id.. + * + * @param storageAccountSubscriptionId Specifies the blob storage subscription Id. + * @return the next definition stage. + */ + Update withStorageAccountSubscriptionId(UUID storageAccountSubscriptionId); + } + /** The stage of the ExtendedServerBlobAuditingPolicy update allowing to specify isStorageSecondaryKeyInUse. */ + interface WithIsStorageSecondaryKeyInUse { + /** + * Specifies the isStorageSecondaryKeyInUse property: Specifies whether storageAccountAccessKey value is the + * storage's secondary key.. + * + * @param isStorageSecondaryKeyInUse Specifies whether storageAccountAccessKey value is the storage's + * secondary key. + * @return the next definition stage. + */ + Update withIsStorageSecondaryKeyInUse(Boolean isStorageSecondaryKeyInUse); + } + /** The stage of the ExtendedServerBlobAuditingPolicy update allowing to specify isAzureMonitorTargetEnabled. */ + interface WithIsAzureMonitorTargetEnabled { + /** + * Specifies the isAzureMonitorTargetEnabled property: 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 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. + */ + Update withIsAzureMonitorTargetEnabled(Boolean isAzureMonitorTargetEnabled); + } + /** The stage of the ExtendedServerBlobAuditingPolicy update allowing to specify queueDelayMs. */ + interface WithQueueDelayMs { + /** + * Specifies the queueDelayMs property: 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 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. + */ + Update withQueueDelayMs(Integer queueDelayMs); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ExtendedServerBlobAuditingPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ExtendedServerBlobAuditingPolicy refresh(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ExtendedServerBlobAuditingPolicyListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ExtendedServerBlobAuditingPolicyListResult.java new file mode 100644 index 0000000000000..bcd4625223674 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ExtendedServerBlobAuditingPolicyListResult.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.ExtendedServerBlobAuditingPolicyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of server extended auditing settings. */ +@Immutable +public final class ExtendedServerBlobAuditingPolicyListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtendedServerBlobAuditingPolicyListResult.class); + + /* + * Array of results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ExtendedSqlPoolBlobAuditingPolicies.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ExtendedSqlPoolBlobAuditingPolicies.java new file mode 100644 index 0000000000000..e58fd0f41395f --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ExtendedSqlPoolBlobAuditingPolicies.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ExtendedSqlPoolBlobAuditingPolicies. */ +public interface ExtendedSqlPoolBlobAuditingPolicies { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended Sql pool's blob auditing policy. + */ + ExtendedSqlPoolBlobAuditingPolicy get(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended Sql pool's blob auditing policy. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of sql pool extended auditing settings. + */ + PagedIterable listBySqlPool( + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of sql pool extended auditing settings. + */ + PagedIterable listBySqlPool( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * Gets an extended Sql pool's blob auditing policy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended Sql pool's blob auditing policy. + */ + ExtendedSqlPoolBlobAuditingPolicy getById(String id); + + /** + * Gets an extended Sql pool's blob auditing policy. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an extended Sql pool's blob auditing policy. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ExtendedSqlPoolBlobAuditingPolicy resource. + * + * @return the first stage of the new ExtendedSqlPoolBlobAuditingPolicy definition. + */ + ExtendedSqlPoolBlobAuditingPolicy.DefinitionStages.Blank define(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ExtendedSqlPoolBlobAuditingPolicy.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ExtendedSqlPoolBlobAuditingPolicy.java new file mode 100644 index 0000000000000..7b17122378090 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ExtendedSqlPoolBlobAuditingPolicy.java @@ -0,0 +1,733 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.ExtendedSqlPoolBlobAuditingPolicyInner; +import java.util.List; +import java.util.UUID; + +/** An immutable client-side representation of ExtendedSqlPoolBlobAuditingPolicy. */ +public interface ExtendedSqlPoolBlobAuditingPolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the predicateExpression property: Specifies condition of where clause when creating an audit. + * + * @return the predicateExpression value. + */ + String predicateExpression(); + + /** + * Gets the state property: Specifies the state of the policy. If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled are required. + * + * @return the state value. + */ + BlobAuditingPolicyState state(); + + /** + * Gets the storageEndpoint property: 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. + */ + String storageEndpoint(); + + /** + * Gets the storageAccountAccessKey property: 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. + */ + String storageAccountAccessKey(); + + /** + * Gets the retentionDays property: Specifies the number of days to keep in the audit logs in the storage account. + * + * @return the retentionDays value. + */ + Integer retentionDays(); + + /** + * Gets the auditActionsAndGroups property: 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. + */ + List auditActionsAndGroups(); + + /** + * Gets the storageAccountSubscriptionId property: Specifies the blob storage subscription Id. + * + * @return the storageAccountSubscriptionId value. + */ + UUID storageAccountSubscriptionId(); + + /** + * Gets the isStorageSecondaryKeyInUse property: Specifies whether storageAccountAccessKey value is the storage's + * secondary key. + * + * @return the isStorageSecondaryKeyInUse value. + */ + Boolean isStorageSecondaryKeyInUse(); + + /** + * Gets the isAzureMonitorTargetEnabled property: 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. + */ + Boolean isAzureMonitorTargetEnabled(); + + /** + * Gets the queueDelayMs property: 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. + */ + Integer queueDelayMs(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.ExtendedSqlPoolBlobAuditingPolicyInner object. + * + * @return the inner object. + */ + ExtendedSqlPoolBlobAuditingPolicyInner innerModel(); + + /** The entirety of the ExtendedSqlPoolBlobAuditingPolicy definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ExtendedSqlPoolBlobAuditingPolicy definition stages. */ + interface DefinitionStages { + /** The first stage of the ExtendedSqlPoolBlobAuditingPolicy definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ExtendedSqlPoolBlobAuditingPolicy definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * 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. + */ + WithCreate withExistingSqlPool(String resourceGroupName, String workspaceName, String sqlPoolName); + } + /** + * The stage of the ExtendedSqlPoolBlobAuditingPolicy definition which contains all the minimum required + * properties for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithPredicateExpression, + DefinitionStages.WithState, + DefinitionStages.WithStorageEndpoint, + DefinitionStages.WithStorageAccountAccessKey, + DefinitionStages.WithRetentionDays, + DefinitionStages.WithAuditActionsAndGroups, + DefinitionStages.WithStorageAccountSubscriptionId, + DefinitionStages.WithIsStorageSecondaryKeyInUse, + DefinitionStages.WithIsAzureMonitorTargetEnabled, + DefinitionStages.WithQueueDelayMs { + /** + * Executes the create request. + * + * @return the created resource. + */ + ExtendedSqlPoolBlobAuditingPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ExtendedSqlPoolBlobAuditingPolicy create(Context context); + } + /** The stage of the ExtendedSqlPoolBlobAuditingPolicy definition allowing to specify predicateExpression. */ + interface WithPredicateExpression { + /** + * Specifies the predicateExpression property: Specifies condition of where clause when creating an audit.. + * + * @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 state. */ + interface WithState { + /** + * Specifies the state property: Specifies the state of the policy. If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled are required.. + * + * @param state Specifies the state of the policy. If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled are required. + * @return the next definition stage. + */ + WithCreate withState(BlobAuditingPolicyState state); + } + /** The stage of the ExtendedSqlPoolBlobAuditingPolicy definition allowing to specify storageEndpoint. */ + interface WithStorageEndpoint { + /** + * Specifies the storageEndpoint property: Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled is required.. + * + * @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 ExtendedSqlPoolBlobAuditingPolicy definition allowing to specify storageAccountAccessKey. + */ + interface WithStorageAccountAccessKey { + /** + * Specifies the storageAccountAccessKey property: 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 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 retentionDays. */ + interface WithRetentionDays { + /** + * Specifies the retentionDays property: Specifies the number of days to keep in the audit logs in the + * storage account.. + * + * @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 auditActionsAndGroups. */ + interface WithAuditActionsAndGroups { + /** + * Specifies the auditActionsAndGroups property: 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 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 + * storageAccountSubscriptionId. + */ + interface WithStorageAccountSubscriptionId { + /** + * Specifies the storageAccountSubscriptionId property: Specifies the blob storage subscription Id.. + * + * @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 isStorageSecondaryKeyInUse. + */ + interface WithIsStorageSecondaryKeyInUse { + /** + * Specifies the isStorageSecondaryKeyInUse property: Specifies whether storageAccountAccessKey value is the + * storage's secondary key.. + * + * @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 + * isAzureMonitorTargetEnabled. + */ + interface WithIsAzureMonitorTargetEnabled { + /** + * Specifies the isAzureMonitorTargetEnabled property: 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 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 queueDelayMs. */ + interface WithQueueDelayMs { + /** + * Specifies the queueDelayMs property: 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 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); + } + } + /** + * Begins update for the ExtendedSqlPoolBlobAuditingPolicy resource. + * + * @return the stage of resource update. + */ + ExtendedSqlPoolBlobAuditingPolicy.Update update(); + + /** The template for ExtendedSqlPoolBlobAuditingPolicy update. */ + interface Update + extends UpdateStages.WithPredicateExpression, + UpdateStages.WithState, + UpdateStages.WithStorageEndpoint, + UpdateStages.WithStorageAccountAccessKey, + UpdateStages.WithRetentionDays, + UpdateStages.WithAuditActionsAndGroups, + UpdateStages.WithStorageAccountSubscriptionId, + UpdateStages.WithIsStorageSecondaryKeyInUse, + UpdateStages.WithIsAzureMonitorTargetEnabled, + UpdateStages.WithQueueDelayMs { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ExtendedSqlPoolBlobAuditingPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ExtendedSqlPoolBlobAuditingPolicy apply(Context context); + } + /** The ExtendedSqlPoolBlobAuditingPolicy update stages. */ + interface UpdateStages { + /** The stage of the ExtendedSqlPoolBlobAuditingPolicy update allowing to specify predicateExpression. */ + interface WithPredicateExpression { + /** + * Specifies the predicateExpression property: Specifies condition of where clause when creating an audit.. + * + * @param predicateExpression Specifies condition of where clause when creating an audit. + * @return the next definition stage. + */ + Update withPredicateExpression(String predicateExpression); + } + /** The stage of the ExtendedSqlPoolBlobAuditingPolicy update allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: Specifies the state of the policy. If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled are required.. + * + * @param state Specifies the state of the policy. If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled are required. + * @return the next definition stage. + */ + Update withState(BlobAuditingPolicyState state); + } + /** The stage of the ExtendedSqlPoolBlobAuditingPolicy update allowing to specify storageEndpoint. */ + interface WithStorageEndpoint { + /** + * Specifies the storageEndpoint property: Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled is required.. + * + * @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. + */ + Update withStorageEndpoint(String storageEndpoint); + } + /** The stage of the ExtendedSqlPoolBlobAuditingPolicy update allowing to specify storageAccountAccessKey. */ + interface WithStorageAccountAccessKey { + /** + * Specifies the storageAccountAccessKey property: 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 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. + */ + Update withStorageAccountAccessKey(String storageAccountAccessKey); + } + /** The stage of the ExtendedSqlPoolBlobAuditingPolicy update allowing to specify retentionDays. */ + interface WithRetentionDays { + /** + * Specifies the retentionDays property: Specifies the number of days to keep in the audit logs in the + * storage account.. + * + * @param retentionDays Specifies the number of days to keep in the audit logs in the storage account. + * @return the next definition stage. + */ + Update withRetentionDays(Integer retentionDays); + } + /** The stage of the ExtendedSqlPoolBlobAuditingPolicy update allowing to specify auditActionsAndGroups. */ + interface WithAuditActionsAndGroups { + /** + * Specifies the auditActionsAndGroups property: 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 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. + */ + Update withAuditActionsAndGroups(List auditActionsAndGroups); + } + /** + * The stage of the ExtendedSqlPoolBlobAuditingPolicy update allowing to specify storageAccountSubscriptionId. + */ + interface WithStorageAccountSubscriptionId { + /** + * Specifies the storageAccountSubscriptionId property: Specifies the blob storage subscription Id.. + * + * @param storageAccountSubscriptionId Specifies the blob storage subscription Id. + * @return the next definition stage. + */ + Update withStorageAccountSubscriptionId(UUID storageAccountSubscriptionId); + } + /** The stage of the ExtendedSqlPoolBlobAuditingPolicy update allowing to specify isStorageSecondaryKeyInUse. */ + interface WithIsStorageSecondaryKeyInUse { + /** + * Specifies the isStorageSecondaryKeyInUse property: Specifies whether storageAccountAccessKey value is the + * storage's secondary key.. + * + * @param isStorageSecondaryKeyInUse Specifies whether storageAccountAccessKey value is the storage's + * secondary key. + * @return the next definition stage. + */ + Update withIsStorageSecondaryKeyInUse(Boolean isStorageSecondaryKeyInUse); + } + /** + * The stage of the ExtendedSqlPoolBlobAuditingPolicy update allowing to specify isAzureMonitorTargetEnabled. + */ + interface WithIsAzureMonitorTargetEnabled { + /** + * Specifies the isAzureMonitorTargetEnabled property: 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 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. + */ + Update withIsAzureMonitorTargetEnabled(Boolean isAzureMonitorTargetEnabled); + } + /** The stage of the ExtendedSqlPoolBlobAuditingPolicy update allowing to specify queueDelayMs. */ + interface WithQueueDelayMs { + /** + * Specifies the queueDelayMs property: 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 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. + */ + Update withQueueDelayMs(Integer queueDelayMs); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ExtendedSqlPoolBlobAuditingPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ExtendedSqlPoolBlobAuditingPolicy refresh(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ExtendedSqlPoolBlobAuditingPolicyListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ExtendedSqlPoolBlobAuditingPolicyListResult.java new file mode 100644 index 0000000000000..7cadfea3e8324 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ExtendedSqlPoolBlobAuditingPolicyListResult.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.ExtendedSqlPoolBlobAuditingPolicyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of sql pool extended auditing settings. */ +@Immutable +public final class ExtendedSqlPoolBlobAuditingPolicyListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ExtendedSqlPoolBlobAuditingPolicyListResult.class); + + /* + * Array of results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/GeoBackupPolicy.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/GeoBackupPolicy.java new file mode 100644 index 0000000000000..e701dceaebe24 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/GeoBackupPolicy.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.GeoBackupPolicyInner; + +/** An immutable client-side representation of GeoBackupPolicy. */ +public interface GeoBackupPolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the kind property: Kind of geo backup policy. This is metadata used for the Azure portal experience. + * + * @return the kind value. + */ + String kind(); + + /** + * Gets the location property: Backup policy location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the state property: The state of the geo backup policy. + * + * @return the state value. + */ + GeoBackupPolicyState state(); + + /** + * Gets the storageType property: The storage type of the geo backup policy. + * + * @return the storageType value. + */ + String storageType(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.GeoBackupPolicyInner object. + * + * @return the inner object. + */ + GeoBackupPolicyInner innerModel(); + + /** The entirety of the GeoBackupPolicy definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithState, + DefinitionStages.WithCreate { + } + /** The GeoBackupPolicy definition stages. */ + interface DefinitionStages { + /** The first stage of the GeoBackupPolicy definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the GeoBackupPolicy definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * 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 GeoBackupPolicy definition allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: The state of the geo backup policy.. + * + * @param state The state of the geo backup policy. + * @return the next definition stage. + */ + WithCreate withState(GeoBackupPolicyState state); + } + /** + * The stage of the GeoBackupPolicy definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate { + /** + * Executes the create request. + * + * @return the created resource. + */ + GeoBackupPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + GeoBackupPolicy create(Context context); + } + } + /** + * Begins update for the GeoBackupPolicy resource. + * + * @return the stage of resource update. + */ + GeoBackupPolicy.Update update(); + + /** The template for GeoBackupPolicy update. */ + interface Update extends UpdateStages.WithState { + /** + * Executes the update request. + * + * @return the updated resource. + */ + GeoBackupPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + GeoBackupPolicy apply(Context context); + } + /** The GeoBackupPolicy update stages. */ + interface UpdateStages { + /** The stage of the GeoBackupPolicy update allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: The state of the geo backup policy.. + * + * @param state The state of the geo backup policy. + * @return the next definition stage. + */ + Update withState(GeoBackupPolicyState state); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + GeoBackupPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + GeoBackupPolicy refresh(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/GeoBackupPolicyListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/GeoBackupPolicyListResult.java new file mode 100644 index 0000000000000..7929130c224bf --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/GeoBackupPolicyListResult.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.GeoBackupPolicyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response to a list geo backup policies request. */ +@Fluent +public final class GeoBackupPolicyListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GeoBackupPolicyListResult.class); + + /* + * The list of geo backup policies. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: The list of geo backup policies. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of geo backup policies. + * + * @param value the value value to set. + * @return the GeoBackupPolicyListResult object itself. + */ + public GeoBackupPolicyListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/GeoBackupPolicyName.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/GeoBackupPolicyName.java new file mode 100644 index 0000000000000..47835ecc658fd --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/GeoBackupPolicyName.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for GeoBackupPolicyName. */ +public final class GeoBackupPolicyName extends ExpandableStringEnum { + /** Static value Default for GeoBackupPolicyName. */ + public static final GeoBackupPolicyName DEFAULT = fromString("Default"); + + /** + * Creates or finds a GeoBackupPolicyName from its string representation. + * + * @param name a name to look for. + * @return the corresponding GeoBackupPolicyName. + */ + @JsonCreator + public static GeoBackupPolicyName fromString(String name) { + return fromString(name, GeoBackupPolicyName.class); + } + + /** @return known GeoBackupPolicyName values. */ + public static Collection values() { + return values(GeoBackupPolicyName.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/GeoBackupPolicyState.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/GeoBackupPolicyState.java new file mode 100644 index 0000000000000..a97bdf5006086 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/GeoBackupPolicyState.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for GeoBackupPolicyState. */ +public enum GeoBackupPolicyState { + /** Enum value Disabled. */ + DISABLED("Disabled"), + + /** Enum value Enabled. */ + ENABLED("Enabled"); + + /** The actual serialized value for a GeoBackupPolicyState instance. */ + private final String value; + + GeoBackupPolicyState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a GeoBackupPolicyState instance. + * + * @param value the serialized value to parse. + * @return the parsed GeoBackupPolicyState object, or null if unable to parse. + */ + @JsonCreator + public static GeoBackupPolicyState fromString(String value) { + GeoBackupPolicyState[] items = GeoBackupPolicyState.values(); + for (GeoBackupPolicyState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/GetSsisObjectMetadataRequest.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/GetSsisObjectMetadataRequest.java new file mode 100644 index 0000000000000..87ee0a523d7ac --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/GetSsisObjectMetadataRequest.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The request payload of get SSIS object metadata. */ +@Fluent +public final class GetSsisObjectMetadataRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GetSsisObjectMetadataRequest.class); + + /* + * Metadata path. + */ + @JsonProperty(value = "metadataPath") + private String metadataPath; + + /** + * Get the metadataPath property: Metadata path. + * + * @return the metadataPath value. + */ + public String metadataPath() { + return this.metadataPath; + } + + /** + * Set the metadataPath property: Metadata path. + * + * @param metadataPath the metadataPath value to set. + * @return the GetSsisObjectMetadataRequest object itself. + */ + public GetSsisObjectMetadataRequest withMetadataPath(String metadataPath) { + this.metadataPath = metadataPath; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntime.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntime.java new file mode 100644 index 0000000000000..c900a8193a44a --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntime.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.HashMap; +import java.util.Map; + +/** Azure Synapse nested object which serves as a compute resource for activities. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + defaultImpl = IntegrationRuntime.class) +@JsonTypeName("IntegrationRuntime") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Managed", value = ManagedIntegrationRuntime.class), + @JsonSubTypes.Type(name = "SelfHosted", value = SelfHostedIntegrationRuntime.class) +}) +@Fluent +public class IntegrationRuntime { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IntegrationRuntime.class); + + /* + * Integration runtime description. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Azure Synapse nested object which serves as a compute resource for + * activities. + */ + @JsonIgnore private Map additionalProperties; + + /** + * Get the description property: Integration runtime description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Integration runtime description. + * + * @param description the description value to set. + * @return the IntegrationRuntime object itself. + */ + public IntegrationRuntime withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the additionalProperties property: Azure Synapse nested object which serves as a compute resource for + * activities. + * + * @return the additionalProperties value. + */ + @JsonAnyGetter + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Azure Synapse nested object which serves as a compute resource for + * activities. + * + * @param additionalProperties the additionalProperties value to set. + * @return the IntegrationRuntime object itself. + */ + public IntegrationRuntime withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + @JsonAnySetter + void withAdditionalProperties(String key, Object value) { + if (additionalProperties == null) { + additionalProperties = new HashMap<>(); + } + additionalProperties.put(key, value); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeAuthKeyName.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeAuthKeyName.java new file mode 100644 index 0000000000000..18f11d6d61da4 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeAuthKeyName.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IntegrationRuntimeAuthKeyName. */ +public final class IntegrationRuntimeAuthKeyName extends ExpandableStringEnum { + /** Static value authKey1 for IntegrationRuntimeAuthKeyName. */ + public static final IntegrationRuntimeAuthKeyName AUTH_KEY1 = fromString("authKey1"); + + /** Static value authKey2 for IntegrationRuntimeAuthKeyName. */ + public static final IntegrationRuntimeAuthKeyName AUTH_KEY2 = fromString("authKey2"); + + /** + * Creates or finds a IntegrationRuntimeAuthKeyName from its string representation. + * + * @param name a name to look for. + * @return the corresponding IntegrationRuntimeAuthKeyName. + */ + @JsonCreator + public static IntegrationRuntimeAuthKeyName fromString(String name) { + return fromString(name, IntegrationRuntimeAuthKeyName.class); + } + + /** @return known IntegrationRuntimeAuthKeyName values. */ + public static Collection values() { + return values(IntegrationRuntimeAuthKeyName.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeAuthKeys.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeAuthKeys.java new file mode 100644 index 0000000000000..5393d9b263795 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeAuthKeys.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeAuthKeysInner; + +/** An immutable client-side representation of IntegrationRuntimeAuthKeys. */ +public interface IntegrationRuntimeAuthKeys { + /** + * Gets the authKey1 property: The primary integration runtime authentication key. + * + * @return the authKey1 value. + */ + String authKey1(); + + /** + * Gets the authKey2 property: The secondary integration runtime authentication key. + * + * @return the authKey2 value. + */ + String authKey2(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeAuthKeysInner object. + * + * @return the inner object. + */ + IntegrationRuntimeAuthKeysInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeAuthKeysOperations.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeAuthKeysOperations.java new file mode 100644 index 0000000000000..f437e244182ec --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeAuthKeysOperations.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of IntegrationRuntimeAuthKeysOperations. */ +public interface IntegrationRuntimeAuthKeysOperations { + /** + * Regenerate the authentication key for 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 regenerateKeyParameters The parameters for regenerating integration runtime authentication key. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the integration runtime authentication keys. + */ + IntegrationRuntimeAuthKeys regenerate( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + IntegrationRuntimeRegenerateKeyParameters regenerateKeyParameters); + + /** + * Regenerate the authentication key for 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 regenerateKeyParameters The parameters for regenerating integration runtime authentication key. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the integration runtime authentication keys. + */ + Response regenerateWithResponse( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + IntegrationRuntimeRegenerateKeyParameters regenerateKeyParameters, + Context context); + + /** + * List authentication keys 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the integration runtime authentication keys. + */ + IntegrationRuntimeAuthKeys list(String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * List authentication keys 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the integration runtime authentication keys. + */ + Response listWithResponse( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeAutoUpdate.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeAutoUpdate.java new file mode 100644 index 0000000000000..09b622851d3ac --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeAutoUpdate.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IntegrationRuntimeAutoUpdate. */ +public final class IntegrationRuntimeAutoUpdate extends ExpandableStringEnum { + /** Static value On for IntegrationRuntimeAutoUpdate. */ + public static final IntegrationRuntimeAutoUpdate ON = fromString("On"); + + /** Static value Off for IntegrationRuntimeAutoUpdate. */ + public static final IntegrationRuntimeAutoUpdate OFF = fromString("Off"); + + /** + * Creates or finds a IntegrationRuntimeAutoUpdate from its string representation. + * + * @param name a name to look for. + * @return the corresponding IntegrationRuntimeAutoUpdate. + */ + @JsonCreator + public static IntegrationRuntimeAutoUpdate fromString(String name) { + return fromString(name, IntegrationRuntimeAutoUpdate.class); + } + + /** @return known IntegrationRuntimeAutoUpdate values. */ + public static Collection values() { + return values(IntegrationRuntimeAutoUpdate.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeComputeProperties.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeComputeProperties.java new file mode 100644 index 0000000000000..61f283093bf82 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeComputeProperties.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.HashMap; +import java.util.Map; + +/** The compute resource properties for managed integration runtime. */ +@Fluent +public final class IntegrationRuntimeComputeProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IntegrationRuntimeComputeProperties.class); + + /* + * The location for managed integration runtime. The supported regions + * could be found on + * https://docs.microsoft.com/en-us/azure/data-factory/data-factory-data-movement-activities + */ + @JsonProperty(value = "location") + private String location; + + /* + * The node size requirement to managed integration runtime. + */ + @JsonProperty(value = "nodeSize") + private String nodeSize; + + /* + * The required number of nodes for managed integration runtime. + */ + @JsonProperty(value = "numberOfNodes") + private Integer numberOfNodes; + + /* + * Maximum parallel executions count per node for managed integration + * runtime. + */ + @JsonProperty(value = "maxParallelExecutionsPerNode") + private Integer maxParallelExecutionsPerNode; + + /* + * Data flow properties for managed integration runtime. + */ + @JsonProperty(value = "dataFlowProperties") + private IntegrationRuntimeDataFlowProperties dataFlowProperties; + + /* + * VNet properties for managed integration runtime. + */ + @JsonProperty(value = "vNetProperties") + private IntegrationRuntimeVNetProperties vNetProperties; + + /* + * The compute resource properties for managed integration runtime. + */ + @JsonIgnore private Map additionalProperties; + + /** + * Get the location property: The location for managed integration runtime. The supported regions could be found on + * https://docs.microsoft.com/en-us/azure/data-factory/data-factory-data-movement-activities. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location for managed integration runtime. The supported regions could be found on + * https://docs.microsoft.com/en-us/azure/data-factory/data-factory-data-movement-activities. + * + * @param location the location value to set. + * @return the IntegrationRuntimeComputeProperties object itself. + */ + public IntegrationRuntimeComputeProperties withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the nodeSize property: The node size requirement to managed integration runtime. + * + * @return the nodeSize value. + */ + public String nodeSize() { + return this.nodeSize; + } + + /** + * Set the nodeSize property: The node size requirement to managed integration runtime. + * + * @param nodeSize the nodeSize value to set. + * @return the IntegrationRuntimeComputeProperties object itself. + */ + public IntegrationRuntimeComputeProperties withNodeSize(String nodeSize) { + this.nodeSize = nodeSize; + return this; + } + + /** + * Get the numberOfNodes property: The required number of nodes for managed integration runtime. + * + * @return the numberOfNodes value. + */ + public Integer numberOfNodes() { + return this.numberOfNodes; + } + + /** + * Set the numberOfNodes property: The required number of nodes for managed integration runtime. + * + * @param numberOfNodes the numberOfNodes value to set. + * @return the IntegrationRuntimeComputeProperties object itself. + */ + public IntegrationRuntimeComputeProperties withNumberOfNodes(Integer numberOfNodes) { + this.numberOfNodes = numberOfNodes; + return this; + } + + /** + * Get the maxParallelExecutionsPerNode property: Maximum parallel executions count per node for managed integration + * runtime. + * + * @return the maxParallelExecutionsPerNode value. + */ + public Integer maxParallelExecutionsPerNode() { + return this.maxParallelExecutionsPerNode; + } + + /** + * Set the maxParallelExecutionsPerNode property: Maximum parallel executions count per node for managed integration + * runtime. + * + * @param maxParallelExecutionsPerNode the maxParallelExecutionsPerNode value to set. + * @return the IntegrationRuntimeComputeProperties object itself. + */ + public IntegrationRuntimeComputeProperties withMaxParallelExecutionsPerNode(Integer maxParallelExecutionsPerNode) { + this.maxParallelExecutionsPerNode = maxParallelExecutionsPerNode; + return this; + } + + /** + * Get the dataFlowProperties property: Data flow properties for managed integration runtime. + * + * @return the dataFlowProperties value. + */ + public IntegrationRuntimeDataFlowProperties dataFlowProperties() { + return this.dataFlowProperties; + } + + /** + * Set the dataFlowProperties property: Data flow properties for managed integration runtime. + * + * @param dataFlowProperties the dataFlowProperties value to set. + * @return the IntegrationRuntimeComputeProperties object itself. + */ + public IntegrationRuntimeComputeProperties withDataFlowProperties( + IntegrationRuntimeDataFlowProperties dataFlowProperties) { + this.dataFlowProperties = dataFlowProperties; + return this; + } + + /** + * Get the vNetProperties property: VNet properties for managed integration runtime. + * + * @return the vNetProperties value. + */ + public IntegrationRuntimeVNetProperties vNetProperties() { + return this.vNetProperties; + } + + /** + * Set the vNetProperties property: VNet properties for managed integration runtime. + * + * @param vNetProperties the vNetProperties value to set. + * @return the IntegrationRuntimeComputeProperties object itself. + */ + public IntegrationRuntimeComputeProperties withVNetProperties(IntegrationRuntimeVNetProperties vNetProperties) { + this.vNetProperties = vNetProperties; + return this; + } + + /** + * Get the additionalProperties property: The compute resource properties for managed integration runtime. + * + * @return the additionalProperties value. + */ + @JsonAnyGetter + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: The compute resource properties for managed integration runtime. + * + * @param additionalProperties the additionalProperties value to set. + * @return the IntegrationRuntimeComputeProperties object itself. + */ + public IntegrationRuntimeComputeProperties withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + @JsonAnySetter + void withAdditionalProperties(String key, Object value) { + if (additionalProperties == null) { + additionalProperties = new HashMap<>(); + } + additionalProperties.put(key, value); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dataFlowProperties() != null) { + dataFlowProperties().validate(); + } + if (vNetProperties() != null) { + vNetProperties().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeConnectionInfo.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeConnectionInfo.java new file mode 100644 index 0000000000000..ed74aa8373453 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeConnectionInfo.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeConnectionInfoInner; +import java.util.Map; + +/** An immutable client-side representation of IntegrationRuntimeConnectionInfo. */ +public interface IntegrationRuntimeConnectionInfo { + /** + * Gets the serviceToken property: The token generated in service. Callers use this token to authenticate to + * integration runtime. + * + * @return the serviceToken value. + */ + String serviceToken(); + + /** + * Gets the identityCertThumbprint property: The integration runtime SSL certificate thumbprint. Click-Once + * application uses it to do server validation. + * + * @return the identityCertThumbprint value. + */ + String identityCertThumbprint(); + + /** + * Gets the hostServiceUri property: The on-premises integration runtime host URL. + * + * @return the hostServiceUri value. + */ + String hostServiceUri(); + + /** + * Gets the version property: The integration runtime version. + * + * @return the version value. + */ + String version(); + + /** + * Gets the publicKey property: The public key for encrypting a credential when transferring the credential to the + * integration runtime. + * + * @return the publicKey value. + */ + String publicKey(); + + /** + * Gets the isIdentityCertExprired property: Whether the identity certificate is expired. + * + * @return the isIdentityCertExprired value. + */ + Boolean isIdentityCertExprired(); + + /** + * Gets the additionalProperties property: Connection information for encrypting the on-premises data source + * credentials. + * + * @return the additionalProperties value. + */ + Map additionalProperties(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeConnectionInfoInner object. + * + * @return the inner object. + */ + IntegrationRuntimeConnectionInfoInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeConnectionInfos.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeConnectionInfos.java new file mode 100644 index 0000000000000..0d110e671fe47 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeConnectionInfos.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of IntegrationRuntimeConnectionInfos. */ +public interface IntegrationRuntimeConnectionInfos { + /** + * Get connection info for 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection info for an integration runtime. + */ + IntegrationRuntimeConnectionInfo get(String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * Get connection info for 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection info for an integration runtime. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeCredentials.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeCredentials.java new file mode 100644 index 0000000000000..87ce1d3a977e7 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeCredentials.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of IntegrationRuntimeCredentials. */ +public interface IntegrationRuntimeCredentials { + /** + * Force the integration runtime to synchronize credentials across integration runtime nodes, and this will override + * the credentials across all worker nodes with those available on the dispatcher node. If you already have the + * latest credential backup file, you should manually import it (preferred) on any self-hosted integration runtime + * node than using this API directly. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void sync(String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * Force the integration runtime to synchronize credentials across integration runtime nodes, and this will override + * the credentials across all worker nodes with those available on the dispatcher node. If you already have the + * latest credential backup file, you should manually import it (preferred) on any self-hosted integration runtime + * node than using this API directly. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response syncWithResponse( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeCustomSetupScriptProperties.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeCustomSetupScriptProperties.java new file mode 100644 index 0000000000000..96acd78a92d3b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeCustomSetupScriptProperties.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Custom setup script properties for a managed dedicated integration runtime. */ +@Fluent +public final class IntegrationRuntimeCustomSetupScriptProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(IntegrationRuntimeCustomSetupScriptProperties.class); + + /* + * The URI of the Azure blob container that contains the custom setup + * script. + */ + @JsonProperty(value = "blobContainerUri") + private String blobContainerUri; + + /* + * The SAS token of the Azure blob container. + */ + @JsonProperty(value = "sasToken") + private SecureString sasToken; + + /** + * Get the blobContainerUri property: The URI of the Azure blob container that contains the custom setup script. + * + * @return the blobContainerUri value. + */ + public String blobContainerUri() { + return this.blobContainerUri; + } + + /** + * Set the blobContainerUri property: The URI of the Azure blob container that contains the custom setup script. + * + * @param blobContainerUri the blobContainerUri value to set. + * @return the IntegrationRuntimeCustomSetupScriptProperties object itself. + */ + public IntegrationRuntimeCustomSetupScriptProperties withBlobContainerUri(String blobContainerUri) { + this.blobContainerUri = blobContainerUri; + return this; + } + + /** + * Get the sasToken property: The SAS token of the Azure blob container. + * + * @return the sasToken value. + */ + public SecureString sasToken() { + return this.sasToken; + } + + /** + * Set the sasToken property: The SAS token of the Azure blob container. + * + * @param sasToken the sasToken value to set. + * @return the IntegrationRuntimeCustomSetupScriptProperties object itself. + */ + public IntegrationRuntimeCustomSetupScriptProperties withSasToken(SecureString sasToken) { + this.sasToken = sasToken; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sasToken() != null) { + sasToken().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeDataFlowProperties.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeDataFlowProperties.java new file mode 100644 index 0000000000000..a704297263931 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeDataFlowProperties.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.HashMap; +import java.util.Map; + +/** Data flow properties for managed integration runtime. */ +@Fluent +public final class IntegrationRuntimeDataFlowProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IntegrationRuntimeDataFlowProperties.class); + + /* + * Compute type of the cluster which will execute data flow job. + */ + @JsonProperty(value = "computeType") + private DataFlowComputeType computeType; + + /* + * Core count of the cluster which will execute data flow job. Supported + * values are: 8, 16, 32, 48, 80, 144 and 272. + */ + @JsonProperty(value = "coreCount") + private Integer coreCount; + + /* + * Time to live (in minutes) setting of the cluster which will execute data + * flow job. + */ + @JsonProperty(value = "timeToLive") + private Integer timeToLive; + + /* + * Data flow properties for managed integration runtime. + */ + @JsonIgnore private Map additionalProperties; + + /** + * Get the computeType property: Compute type of the cluster which will execute data flow job. + * + * @return the computeType value. + */ + public DataFlowComputeType computeType() { + return this.computeType; + } + + /** + * Set the computeType property: Compute type of the cluster which will execute data flow job. + * + * @param computeType the computeType value to set. + * @return the IntegrationRuntimeDataFlowProperties object itself. + */ + public IntegrationRuntimeDataFlowProperties withComputeType(DataFlowComputeType computeType) { + this.computeType = computeType; + return this; + } + + /** + * Get the coreCount property: Core count of the cluster which will execute data flow job. Supported values are: 8, + * 16, 32, 48, 80, 144 and 272. + * + * @return the coreCount value. + */ + public Integer coreCount() { + return this.coreCount; + } + + /** + * Set the coreCount property: Core count of the cluster which will execute data flow job. Supported values are: 8, + * 16, 32, 48, 80, 144 and 272. + * + * @param coreCount the coreCount value to set. + * @return the IntegrationRuntimeDataFlowProperties object itself. + */ + public IntegrationRuntimeDataFlowProperties withCoreCount(Integer coreCount) { + this.coreCount = coreCount; + return this; + } + + /** + * Get the timeToLive property: Time to live (in minutes) setting of the cluster which will execute data flow job. + * + * @return the timeToLive value. + */ + public Integer timeToLive() { + return this.timeToLive; + } + + /** + * Set the timeToLive property: Time to live (in minutes) setting of the cluster which will execute data flow job. + * + * @param timeToLive the timeToLive value to set. + * @return the IntegrationRuntimeDataFlowProperties object itself. + */ + public IntegrationRuntimeDataFlowProperties withTimeToLive(Integer timeToLive) { + this.timeToLive = timeToLive; + return this; + } + + /** + * Get the additionalProperties property: Data flow properties for managed integration runtime. + * + * @return the additionalProperties value. + */ + @JsonAnyGetter + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Data flow properties for managed integration runtime. + * + * @param additionalProperties the additionalProperties value to set. + * @return the IntegrationRuntimeDataFlowProperties object itself. + */ + public IntegrationRuntimeDataFlowProperties withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + @JsonAnySetter + void withAdditionalProperties(String key, Object value) { + if (additionalProperties == null) { + additionalProperties = new HashMap<>(); + } + additionalProperties.put(key, value); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeDataProxyProperties.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeDataProxyProperties.java new file mode 100644 index 0000000000000..bb4da8455e9fd --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeDataProxyProperties.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Data proxy properties for a managed dedicated integration runtime. */ +@Fluent +public final class IntegrationRuntimeDataProxyProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IntegrationRuntimeDataProxyProperties.class); + + /* + * The self-hosted integration runtime reference. + */ + @JsonProperty(value = "connectVia") + private EntityReference connectVia; + + /* + * The staging linked service reference. + */ + @JsonProperty(value = "stagingLinkedService") + private EntityReference stagingLinkedService; + + /* + * The path to contain the staged data in the Blob storage. + */ + @JsonProperty(value = "path") + private String path; + + /** + * Get the connectVia property: The self-hosted integration runtime reference. + * + * @return the connectVia value. + */ + public EntityReference connectVia() { + return this.connectVia; + } + + /** + * Set the connectVia property: The self-hosted integration runtime reference. + * + * @param connectVia the connectVia value to set. + * @return the IntegrationRuntimeDataProxyProperties object itself. + */ + public IntegrationRuntimeDataProxyProperties withConnectVia(EntityReference connectVia) { + this.connectVia = connectVia; + return this; + } + + /** + * Get the stagingLinkedService property: The staging linked service reference. + * + * @return the stagingLinkedService value. + */ + public EntityReference stagingLinkedService() { + return this.stagingLinkedService; + } + + /** + * Set the stagingLinkedService property: The staging linked service reference. + * + * @param stagingLinkedService the stagingLinkedService value to set. + * @return the IntegrationRuntimeDataProxyProperties object itself. + */ + public IntegrationRuntimeDataProxyProperties withStagingLinkedService(EntityReference stagingLinkedService) { + this.stagingLinkedService = stagingLinkedService; + return this; + } + + /** + * Get the path property: The path to contain the staged data in the Blob storage. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: The path to contain the staged data in the Blob storage. + * + * @param path the path value to set. + * @return the IntegrationRuntimeDataProxyProperties object itself. + */ + public IntegrationRuntimeDataProxyProperties withPath(String path) { + this.path = path; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (connectVia() != null) { + connectVia().validate(); + } + if (stagingLinkedService() != null) { + stagingLinkedService().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeEdition.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeEdition.java new file mode 100644 index 0000000000000..0837b2cf857d5 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeEdition.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IntegrationRuntimeEdition. */ +public final class IntegrationRuntimeEdition extends ExpandableStringEnum { + /** Static value Standard for IntegrationRuntimeEdition. */ + public static final IntegrationRuntimeEdition STANDARD = fromString("Standard"); + + /** Static value Enterprise for IntegrationRuntimeEdition. */ + public static final IntegrationRuntimeEdition ENTERPRISE = fromString("Enterprise"); + + /** + * Creates or finds a IntegrationRuntimeEdition from its string representation. + * + * @param name a name to look for. + * @return the corresponding IntegrationRuntimeEdition. + */ + @JsonCreator + public static IntegrationRuntimeEdition fromString(String name) { + return fromString(name, IntegrationRuntimeEdition.class); + } + + /** @return known IntegrationRuntimeEdition values. */ + public static Collection values() { + return values(IntegrationRuntimeEdition.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeEntityReferenceType.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeEntityReferenceType.java new file mode 100644 index 0000000000000..d82a8cdc23855 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeEntityReferenceType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IntegrationRuntimeEntityReferenceType. */ +public final class IntegrationRuntimeEntityReferenceType + extends ExpandableStringEnum { + /** Static value IntegrationRuntimeReference for IntegrationRuntimeEntityReferenceType. */ + public static final IntegrationRuntimeEntityReferenceType INTEGRATION_RUNTIME_REFERENCE = + fromString("IntegrationRuntimeReference"); + + /** Static value LinkedServiceReference for IntegrationRuntimeEntityReferenceType. */ + public static final IntegrationRuntimeEntityReferenceType LINKED_SERVICE_REFERENCE = + fromString("LinkedServiceReference"); + + /** + * Creates or finds a IntegrationRuntimeEntityReferenceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IntegrationRuntimeEntityReferenceType. + */ + @JsonCreator + public static IntegrationRuntimeEntityReferenceType fromString(String name) { + return fromString(name, IntegrationRuntimeEntityReferenceType.class); + } + + /** @return known IntegrationRuntimeEntityReferenceType values. */ + public static Collection values() { + return values(IntegrationRuntimeEntityReferenceType.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeInternalChannelEncryptionMode.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeInternalChannelEncryptionMode.java new file mode 100644 index 0000000000000..b7bbf0b49f48c --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeInternalChannelEncryptionMode.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IntegrationRuntimeInternalChannelEncryptionMode. */ +public final class IntegrationRuntimeInternalChannelEncryptionMode + extends ExpandableStringEnum { + /** Static value NotSet for IntegrationRuntimeInternalChannelEncryptionMode. */ + public static final IntegrationRuntimeInternalChannelEncryptionMode NOT_SET = fromString("NotSet"); + + /** Static value SslEncrypted for IntegrationRuntimeInternalChannelEncryptionMode. */ + public static final IntegrationRuntimeInternalChannelEncryptionMode SSL_ENCRYPTED = fromString("SslEncrypted"); + + /** Static value NotEncrypted for IntegrationRuntimeInternalChannelEncryptionMode. */ + public static final IntegrationRuntimeInternalChannelEncryptionMode NOT_ENCRYPTED = fromString("NotEncrypted"); + + /** + * Creates or finds a IntegrationRuntimeInternalChannelEncryptionMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding IntegrationRuntimeInternalChannelEncryptionMode. + */ + @JsonCreator + public static IntegrationRuntimeInternalChannelEncryptionMode fromString(String name) { + return fromString(name, IntegrationRuntimeInternalChannelEncryptionMode.class); + } + + /** @return known IntegrationRuntimeInternalChannelEncryptionMode values. */ + public static Collection values() { + return values(IntegrationRuntimeInternalChannelEncryptionMode.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeLicenseType.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeLicenseType.java new file mode 100644 index 0000000000000..e223d9e6f15ba --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeLicenseType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IntegrationRuntimeLicenseType. */ +public final class IntegrationRuntimeLicenseType extends ExpandableStringEnum { + /** Static value BasePrice for IntegrationRuntimeLicenseType. */ + public static final IntegrationRuntimeLicenseType BASE_PRICE = fromString("BasePrice"); + + /** Static value LicenseIncluded for IntegrationRuntimeLicenseType. */ + public static final IntegrationRuntimeLicenseType LICENSE_INCLUDED = fromString("LicenseIncluded"); + + /** + * Creates or finds a IntegrationRuntimeLicenseType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IntegrationRuntimeLicenseType. + */ + @JsonCreator + public static IntegrationRuntimeLicenseType fromString(String name) { + return fromString(name, IntegrationRuntimeLicenseType.class); + } + + /** @return known IntegrationRuntimeLicenseType values. */ + public static Collection values() { + return values(IntegrationRuntimeLicenseType.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeListResponse.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeListResponse.java new file mode 100644 index 0000000000000..faa394a13fe26 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeListResponse.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of integration runtime resources. */ +@Fluent +public final class IntegrationRuntimeListResponse { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IntegrationRuntimeListResponse.class); + + /* + * List of integration runtimes. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The link to the next page of results, if any remaining results exist. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of integration runtimes. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of integration runtimes. + * + * @param value the value value to set. + * @return the IntegrationRuntimeListResponse object itself. + */ + public IntegrationRuntimeListResponse withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of results, if any remaining results exist. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of results, if any remaining results exist. + * + * @param nextLink the nextLink value to set. + * @return the IntegrationRuntimeListResponse object itself. + */ + public IntegrationRuntimeListResponse withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model IntegrationRuntimeListResponse")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeMonitoringData.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeMonitoringData.java new file mode 100644 index 0000000000000..953f111c6b7af --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeMonitoringData.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeMonitoringDataInner; +import java.util.List; + +/** An immutable client-side representation of IntegrationRuntimeMonitoringData. */ +public interface IntegrationRuntimeMonitoringData { + /** + * Gets the name property: Integration runtime name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the nodes property: Integration runtime node monitoring data. + * + * @return the nodes value. + */ + List nodes(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeMonitoringDataInner object. + * + * @return the inner object. + */ + IntegrationRuntimeMonitoringDataInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeMonitoringDatas.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeMonitoringDatas.java new file mode 100644 index 0000000000000..12a9b0dabdd59 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeMonitoringDatas.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of IntegrationRuntimeMonitoringDatas. */ +public interface IntegrationRuntimeMonitoringDatas { + /** + * Get monitoring data for 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return monitoring data for an integration runtime. + */ + IntegrationRuntimeMonitoringData list( + String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * Get monitoring data for 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return monitoring data for an integration runtime. + */ + Response listWithResponse( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeNodeIpAddress.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeNodeIpAddress.java new file mode 100644 index 0000000000000..f5f6d90dc63d0 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeNodeIpAddress.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeNodeIpAddressInner; + +/** An immutable client-side representation of IntegrationRuntimeNodeIpAddress. */ +public interface IntegrationRuntimeNodeIpAddress { + /** + * Gets the ipAddress property: The IP address of self-hosted integration runtime node. + * + * @return the ipAddress value. + */ + String ipAddress(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeNodeIpAddressInner object. + * + * @return the inner object. + */ + IntegrationRuntimeNodeIpAddressInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeNodeIpAddressOperations.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeNodeIpAddressOperations.java new file mode 100644 index 0000000000000..b03e37cc87052 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeNodeIpAddressOperations.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of IntegrationRuntimeNodeIpAddressOperations. */ +public interface IntegrationRuntimeNodeIpAddressOperations { + /** + * Get the IP address of an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IP address of an integration runtime node. + */ + IntegrationRuntimeNodeIpAddress get( + String resourceGroupName, String workspaceName, String integrationRuntimeName, String nodeName); + + /** + * Get the IP address of an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the IP address of an integration runtime node. + */ + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String nodeName, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeNodeMonitoringData.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeNodeMonitoringData.java new file mode 100644 index 0000000000000..7bcb49b06dcf3 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeNodeMonitoringData.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.HashMap; +import java.util.Map; + +/** Monitoring data for integration runtime node. */ +@Fluent +public final class IntegrationRuntimeNodeMonitoringData { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IntegrationRuntimeNodeMonitoringData.class); + + /* + * Name of the integration runtime node. + */ + @JsonProperty(value = "nodeName", access = JsonProperty.Access.WRITE_ONLY) + private String nodeName; + + /* + * Available memory (MB) on the integration runtime node. + */ + @JsonProperty(value = "availableMemoryInMB", access = JsonProperty.Access.WRITE_ONLY) + private Integer availableMemoryInMB; + + /* + * CPU percentage on the integration runtime node. + */ + @JsonProperty(value = "cpuUtilization", access = JsonProperty.Access.WRITE_ONLY) + private Integer cpuUtilization; + + /* + * Maximum concurrent jobs on the integration runtime node. + */ + @JsonProperty(value = "concurrentJobsLimit", access = JsonProperty.Access.WRITE_ONLY) + private Integer concurrentJobsLimit; + + /* + * The number of jobs currently running on the integration runtime node. + */ + @JsonProperty(value = "concurrentJobsRunning", access = JsonProperty.Access.WRITE_ONLY) + private Integer concurrentJobsRunning; + + /* + * The maximum concurrent jobs in this integration runtime. + */ + @JsonProperty(value = "maxConcurrentJobs", access = JsonProperty.Access.WRITE_ONLY) + private Integer maxConcurrentJobs; + + /* + * Sent bytes on the integration runtime node. + */ + @JsonProperty(value = "sentBytes", access = JsonProperty.Access.WRITE_ONLY) + private Float sentBytes; + + /* + * Received bytes on the integration runtime node. + */ + @JsonProperty(value = "receivedBytes", access = JsonProperty.Access.WRITE_ONLY) + private Float receivedBytes; + + /* + * Monitoring data for integration runtime node. + */ + @JsonIgnore private Map additionalProperties; + + /** + * Get the nodeName property: Name of the integration runtime node. + * + * @return the nodeName value. + */ + public String nodeName() { + return this.nodeName; + } + + /** + * Get the availableMemoryInMB property: Available memory (MB) on the integration runtime node. + * + * @return the availableMemoryInMB value. + */ + public Integer availableMemoryInMB() { + return this.availableMemoryInMB; + } + + /** + * Get the cpuUtilization property: CPU percentage on the integration runtime node. + * + * @return the cpuUtilization value. + */ + public Integer cpuUtilization() { + return this.cpuUtilization; + } + + /** + * Get the concurrentJobsLimit property: Maximum concurrent jobs on the integration runtime node. + * + * @return the concurrentJobsLimit value. + */ + public Integer concurrentJobsLimit() { + return this.concurrentJobsLimit; + } + + /** + * Get the concurrentJobsRunning property: The number of jobs currently running on the integration runtime node. + * + * @return the concurrentJobsRunning value. + */ + public Integer concurrentJobsRunning() { + return this.concurrentJobsRunning; + } + + /** + * Get the maxConcurrentJobs property: The maximum concurrent jobs in this integration runtime. + * + * @return the maxConcurrentJobs value. + */ + public Integer maxConcurrentJobs() { + return this.maxConcurrentJobs; + } + + /** + * Get the sentBytes property: Sent bytes on the integration runtime node. + * + * @return the sentBytes value. + */ + public Float sentBytes() { + return this.sentBytes; + } + + /** + * Get the receivedBytes property: Received bytes on the integration runtime node. + * + * @return the receivedBytes value. + */ + public Float receivedBytes() { + return this.receivedBytes; + } + + /** + * Get the additionalProperties property: Monitoring data for integration runtime node. + * + * @return the additionalProperties value. + */ + @JsonAnyGetter + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Monitoring data for integration runtime node. + * + * @param additionalProperties the additionalProperties value to set. + * @return the IntegrationRuntimeNodeMonitoringData object itself. + */ + public IntegrationRuntimeNodeMonitoringData withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + @JsonAnySetter + void withAdditionalProperties(String key, Object value) { + if (additionalProperties == null) { + additionalProperties = new HashMap<>(); + } + additionalProperties.put(key, value); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeNodes.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeNodes.java new file mode 100644 index 0000000000000..dc6014ded6ccb --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeNodes.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of IntegrationRuntimeNodes. */ +public interface IntegrationRuntimeNodes { + /** + * Get an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an integration runtime node. + */ + SelfHostedIntegrationRuntimeNode get( + String resourceGroupName, String workspaceName, String integrationRuntimeName, String nodeName); + + /** + * Get an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an integration runtime node. + */ + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String nodeName, + Context context); + + /** + * Create an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @param updateIntegrationRuntimeNodeRequest The parameters for updating an integration runtime node. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of Self-hosted integration runtime node. + */ + SelfHostedIntegrationRuntimeNode update( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String nodeName, + UpdateIntegrationRuntimeNodeRequest updateIntegrationRuntimeNodeRequest); + + /** + * Create an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @param updateIntegrationRuntimeNodeRequest The parameters for updating an integration runtime node. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return properties of Self-hosted integration runtime node. + */ + Response updateWithResponse( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String nodeName, + UpdateIntegrationRuntimeNodeRequest updateIntegrationRuntimeNodeRequest, + Context context); + + /** + * Delete an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String integrationRuntimeName, String nodeName); + + /** + * Delete an integration runtime node. + * + * @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 nodeName Integration runtime node name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String nodeName, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeObjectMetadatas.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeObjectMetadatas.java new file mode 100644 index 0000000000000..1d39bf86a61e9 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeObjectMetadatas.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of IntegrationRuntimeObjectMetadatas. */ +public interface IntegrationRuntimeObjectMetadatas { + /** + * Get object metadata from 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object metadata from an integration runtime. + */ + SsisObjectMetadataListResponse list(String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * Get object metadata from 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 getMetadataRequest The parameters for getting a SSIS object metadata. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object metadata from an integration runtime. + */ + Response listWithResponse( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + GetSsisObjectMetadataRequest getMetadataRequest, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the operation. + */ + SsisObjectMetadataStatusResponse refresh( + String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the operation. + */ + SsisObjectMetadataStatusResponse refresh( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeRegenerateKeyParameters.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeRegenerateKeyParameters.java new file mode 100644 index 0000000000000..5eaf612fd9fcb --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeRegenerateKeyParameters.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters to regenerate the authentication key. */ +@Fluent +public final class IntegrationRuntimeRegenerateKeyParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IntegrationRuntimeRegenerateKeyParameters.class); + + /* + * The name of the authentication key to regenerate. + */ + @JsonProperty(value = "keyName") + private IntegrationRuntimeAuthKeyName keyName; + + /** + * Get the keyName property: The name of the authentication key to regenerate. + * + * @return the keyName value. + */ + public IntegrationRuntimeAuthKeyName keyName() { + return this.keyName; + } + + /** + * Set the keyName property: The name of the authentication key to regenerate. + * + * @param keyName the keyName value to set. + * @return the IntegrationRuntimeRegenerateKeyParameters object itself. + */ + public IntegrationRuntimeRegenerateKeyParameters withKeyName(IntegrationRuntimeAuthKeyName keyName) { + this.keyName = keyName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeResource.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeResource.java new file mode 100644 index 0000000000000..d5361a3eca6f5 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeResource.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeResourceInner; + +/** An immutable client-side representation of IntegrationRuntimeResource. */ +public interface IntegrationRuntimeResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: Resource Etag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the properties property: Integration runtime properties. + * + * @return the properties value. + */ + IntegrationRuntime properties(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeResourceInner object. + * + * @return the inner object. + */ + IntegrationRuntimeResourceInner innerModel(); + + /** The entirety of the IntegrationRuntimeResource definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, + DefinitionStages.WithCreate { + } + /** The IntegrationRuntimeResource definition stages. */ + interface DefinitionStages { + /** The first stage of the IntegrationRuntimeResource definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the IntegrationRuntimeResource definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * 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. + */ + WithProperties withExistingWorkspace(String resourceGroupName, String workspaceName); + } + /** The stage of the IntegrationRuntimeResource definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Integration runtime properties.. + * + * @param properties Integration runtime properties. + * @return the next definition stage. + */ + WithCreate withProperties(IntegrationRuntime properties); + } + /** + * The stage of the IntegrationRuntimeResource definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithIfMatch { + /** + * Executes the create request. + * + * @return the created resource. + */ + IntegrationRuntimeResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IntegrationRuntimeResource create(Context context); + } + /** The stage of the IntegrationRuntimeResource definition allowing to specify ifMatch. */ + interface WithIfMatch { + /** + * Specifies the ifMatch property: ETag of the integration runtime entity. Should only be specified for + * update, for which it should match existing entity or can be * for unconditional update.. + * + * @param ifMatch ETag of the integration runtime entity. Should only be specified for update, for which it + * should match existing entity or can be * for unconditional update. + * @return the next definition stage. + */ + WithCreate withIfMatch(String ifMatch); + } + } + /** + * Begins update for the IntegrationRuntimeResource resource. + * + * @return the stage of resource update. + */ + IntegrationRuntimeResource.Update update(); + + /** The template for IntegrationRuntimeResource update. */ + interface Update extends UpdateStages.WithAutoUpdate, UpdateStages.WithUpdateDelayOffset { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IntegrationRuntimeResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IntegrationRuntimeResource apply(Context context); + } + /** The IntegrationRuntimeResource update stages. */ + interface UpdateStages { + /** The stage of the IntegrationRuntimeResource update allowing to specify autoUpdate. */ + interface WithAutoUpdate { + /** + * Specifies the autoUpdate property: Enables or disables the auto-update feature of the self-hosted + * integration runtime. See https://go.microsoft.com/fwlink/?linkid=854189.. + * + * @param autoUpdate Enables or disables the auto-update feature of the self-hosted integration runtime. See + * https://go.microsoft.com/fwlink/?linkid=854189. + * @return the next definition stage. + */ + Update withAutoUpdate(IntegrationRuntimeAutoUpdate autoUpdate); + } + /** The stage of the IntegrationRuntimeResource update allowing to specify updateDelayOffset. */ + interface WithUpdateDelayOffset { + /** + * Specifies the updateDelayOffset property: The time offset (in hours) in the day, e.g., PT03H is 3 hours. + * The integration runtime auto update will happen on that time.. + * + * @param updateDelayOffset The time offset (in hours) in the day, e.g., PT03H is 3 hours. The integration + * runtime auto update will happen on that time. + * @return the next definition stage. + */ + Update withUpdateDelayOffset(String updateDelayOffset); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IntegrationRuntimeResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IntegrationRuntimeResource refresh(Context context); + + /** + * Upgrade an integration runtime. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void upgrade(); + + /** + * Upgrade an integration runtime. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response upgradeWithResponse(Context context); + + /** + * Start an integration runtime. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime status response. + */ + IntegrationRuntimeStatusResponse start(); + + /** + * Start an integration runtime. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime status response. + */ + IntegrationRuntimeStatusResponse start(Context context); + + /** + * Stop an integration runtime. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(); + + /** + * Stop an integration runtime. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(Context context); + + /** + * Enable interactive query in integration runtime. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void enableInteractiveQuery(); + + /** + * Enable interactive query in integration runtime. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void enableInteractiveQuery(Context context); + + /** + * Disable interactive query in integration runtime. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void disableInteractiveQuery(); + + /** + * Disable interactive query in integration runtime. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void disableInteractiveQuery(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeSsisCatalogInfo.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeSsisCatalogInfo.java new file mode 100644 index 0000000000000..3b22d43c08de5 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeSsisCatalogInfo.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.HashMap; +import java.util.Map; + +/** Catalog information for managed dedicated integration runtime. */ +@Fluent +public final class IntegrationRuntimeSsisCatalogInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IntegrationRuntimeSsisCatalogInfo.class); + + /* + * The catalog database server URL. + */ + @JsonProperty(value = "catalogServerEndpoint") + private String catalogServerEndpoint; + + /* + * The administrator user name of catalog database. + */ + @JsonProperty(value = "catalogAdminUserName") + private String catalogAdminUsername; + + /* + * The password of the administrator user account of the catalog database. + */ + @JsonProperty(value = "catalogAdminPassword") + private SecureString catalogAdminPassword; + + /* + * The pricing tier for the catalog database. The valid values could be + * found in https://azure.microsoft.com/en-us/pricing/details/sql-database/ + */ + @JsonProperty(value = "catalogPricingTier") + private IntegrationRuntimeSsisCatalogPricingTier catalogPricingTier; + + /* + * Catalog information for managed dedicated integration runtime. + */ + @JsonIgnore private Map additionalProperties; + + /** + * Get the catalogServerEndpoint property: The catalog database server URL. + * + * @return the catalogServerEndpoint value. + */ + public String catalogServerEndpoint() { + return this.catalogServerEndpoint; + } + + /** + * Set the catalogServerEndpoint property: The catalog database server URL. + * + * @param catalogServerEndpoint the catalogServerEndpoint value to set. + * @return the IntegrationRuntimeSsisCatalogInfo object itself. + */ + public IntegrationRuntimeSsisCatalogInfo withCatalogServerEndpoint(String catalogServerEndpoint) { + this.catalogServerEndpoint = catalogServerEndpoint; + return this; + } + + /** + * Get the catalogAdminUsername property: The administrator user name of catalog database. + * + * @return the catalogAdminUsername value. + */ + public String catalogAdminUsername() { + return this.catalogAdminUsername; + } + + /** + * Set the catalogAdminUsername property: The administrator user name of catalog database. + * + * @param catalogAdminUsername the catalogAdminUsername value to set. + * @return the IntegrationRuntimeSsisCatalogInfo object itself. + */ + public IntegrationRuntimeSsisCatalogInfo withCatalogAdminUsername(String catalogAdminUsername) { + this.catalogAdminUsername = catalogAdminUsername; + return this; + } + + /** + * Get the catalogAdminPassword property: The password of the administrator user account of the catalog database. + * + * @return the catalogAdminPassword value. + */ + public SecureString catalogAdminPassword() { + return this.catalogAdminPassword; + } + + /** + * Set the catalogAdminPassword property: The password of the administrator user account of the catalog database. + * + * @param catalogAdminPassword the catalogAdminPassword value to set. + * @return the IntegrationRuntimeSsisCatalogInfo object itself. + */ + public IntegrationRuntimeSsisCatalogInfo withCatalogAdminPassword(SecureString catalogAdminPassword) { + this.catalogAdminPassword = catalogAdminPassword; + return this; + } + + /** + * Get the catalogPricingTier property: The pricing tier for the catalog database. The valid values could be found + * in https://azure.microsoft.com/en-us/pricing/details/sql-database/. + * + * @return the catalogPricingTier value. + */ + public IntegrationRuntimeSsisCatalogPricingTier catalogPricingTier() { + return this.catalogPricingTier; + } + + /** + * Set the catalogPricingTier property: The pricing tier for the catalog database. The valid values could be found + * in https://azure.microsoft.com/en-us/pricing/details/sql-database/. + * + * @param catalogPricingTier the catalogPricingTier value to set. + * @return the IntegrationRuntimeSsisCatalogInfo object itself. + */ + public IntegrationRuntimeSsisCatalogInfo withCatalogPricingTier( + IntegrationRuntimeSsisCatalogPricingTier catalogPricingTier) { + this.catalogPricingTier = catalogPricingTier; + return this; + } + + /** + * Get the additionalProperties property: Catalog information for managed dedicated integration runtime. + * + * @return the additionalProperties value. + */ + @JsonAnyGetter + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Catalog information for managed dedicated integration runtime. + * + * @param additionalProperties the additionalProperties value to set. + * @return the IntegrationRuntimeSsisCatalogInfo object itself. + */ + public IntegrationRuntimeSsisCatalogInfo withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + @JsonAnySetter + void withAdditionalProperties(String key, Object value) { + if (additionalProperties == null) { + additionalProperties = new HashMap<>(); + } + additionalProperties.put(key, value); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (catalogAdminPassword() != null) { + catalogAdminPassword().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeSsisCatalogPricingTier.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeSsisCatalogPricingTier.java new file mode 100644 index 0000000000000..f540bb819797d --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeSsisCatalogPricingTier.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IntegrationRuntimeSsisCatalogPricingTier. */ +public final class IntegrationRuntimeSsisCatalogPricingTier + extends ExpandableStringEnum { + /** Static value Basic for IntegrationRuntimeSsisCatalogPricingTier. */ + public static final IntegrationRuntimeSsisCatalogPricingTier BASIC = fromString("Basic"); + + /** Static value Standard for IntegrationRuntimeSsisCatalogPricingTier. */ + public static final IntegrationRuntimeSsisCatalogPricingTier STANDARD = fromString("Standard"); + + /** Static value Premium for IntegrationRuntimeSsisCatalogPricingTier. */ + public static final IntegrationRuntimeSsisCatalogPricingTier PREMIUM = fromString("Premium"); + + /** Static value PremiumRS for IntegrationRuntimeSsisCatalogPricingTier. */ + public static final IntegrationRuntimeSsisCatalogPricingTier PREMIUM_RS = fromString("PremiumRS"); + + /** + * Creates or finds a IntegrationRuntimeSsisCatalogPricingTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding IntegrationRuntimeSsisCatalogPricingTier. + */ + @JsonCreator + public static IntegrationRuntimeSsisCatalogPricingTier fromString(String name) { + return fromString(name, IntegrationRuntimeSsisCatalogPricingTier.class); + } + + /** @return known IntegrationRuntimeSsisCatalogPricingTier values. */ + public static Collection values() { + return values(IntegrationRuntimeSsisCatalogPricingTier.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeSsisProperties.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeSsisProperties.java new file mode 100644 index 0000000000000..ce06365020d70 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeSsisProperties.java @@ -0,0 +1,239 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** SSIS properties for managed integration runtime. */ +@Fluent +public final class IntegrationRuntimeSsisProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IntegrationRuntimeSsisProperties.class); + + /* + * Catalog information for managed dedicated integration runtime. + */ + @JsonProperty(value = "catalogInfo") + private IntegrationRuntimeSsisCatalogInfo catalogInfo; + + /* + * License type for bringing your own license scenario. + */ + @JsonProperty(value = "licenseType") + private IntegrationRuntimeLicenseType licenseType; + + /* + * Custom setup script properties for a managed dedicated integration + * runtime. + */ + @JsonProperty(value = "customSetupScriptProperties") + private IntegrationRuntimeCustomSetupScriptProperties customSetupScriptProperties; + + /* + * Data proxy properties for a managed dedicated integration runtime. + */ + @JsonProperty(value = "dataProxyProperties") + private IntegrationRuntimeDataProxyProperties dataProxyProperties; + + /* + * The edition for the SSIS Integration Runtime + */ + @JsonProperty(value = "edition") + private IntegrationRuntimeEdition edition; + + /* + * Custom setup without script properties for a SSIS integration runtime. + */ + @JsonProperty(value = "expressCustomSetupProperties") + private List expressCustomSetupProperties; + + /* + * SSIS properties for managed integration runtime. + */ + @JsonIgnore private Map additionalProperties; + + /** + * Get the catalogInfo property: Catalog information for managed dedicated integration runtime. + * + * @return the catalogInfo value. + */ + public IntegrationRuntimeSsisCatalogInfo catalogInfo() { + return this.catalogInfo; + } + + /** + * Set the catalogInfo property: Catalog information for managed dedicated integration runtime. + * + * @param catalogInfo the catalogInfo value to set. + * @return the IntegrationRuntimeSsisProperties object itself. + */ + public IntegrationRuntimeSsisProperties withCatalogInfo(IntegrationRuntimeSsisCatalogInfo catalogInfo) { + this.catalogInfo = catalogInfo; + return this; + } + + /** + * Get the licenseType property: License type for bringing your own license scenario. + * + * @return the licenseType value. + */ + public IntegrationRuntimeLicenseType licenseType() { + return this.licenseType; + } + + /** + * Set the licenseType property: License type for bringing your own license scenario. + * + * @param licenseType the licenseType value to set. + * @return the IntegrationRuntimeSsisProperties object itself. + */ + public IntegrationRuntimeSsisProperties withLicenseType(IntegrationRuntimeLicenseType licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the customSetupScriptProperties property: Custom setup script properties for a managed dedicated integration + * runtime. + * + * @return the customSetupScriptProperties value. + */ + public IntegrationRuntimeCustomSetupScriptProperties customSetupScriptProperties() { + return this.customSetupScriptProperties; + } + + /** + * Set the customSetupScriptProperties property: Custom setup script properties for a managed dedicated integration + * runtime. + * + * @param customSetupScriptProperties the customSetupScriptProperties value to set. + * @return the IntegrationRuntimeSsisProperties object itself. + */ + public IntegrationRuntimeSsisProperties withCustomSetupScriptProperties( + IntegrationRuntimeCustomSetupScriptProperties customSetupScriptProperties) { + this.customSetupScriptProperties = customSetupScriptProperties; + return this; + } + + /** + * Get the dataProxyProperties property: Data proxy properties for a managed dedicated integration runtime. + * + * @return the dataProxyProperties value. + */ + public IntegrationRuntimeDataProxyProperties dataProxyProperties() { + return this.dataProxyProperties; + } + + /** + * Set the dataProxyProperties property: Data proxy properties for a managed dedicated integration runtime. + * + * @param dataProxyProperties the dataProxyProperties value to set. + * @return the IntegrationRuntimeSsisProperties object itself. + */ + public IntegrationRuntimeSsisProperties withDataProxyProperties( + IntegrationRuntimeDataProxyProperties dataProxyProperties) { + this.dataProxyProperties = dataProxyProperties; + return this; + } + + /** + * Get the edition property: The edition for the SSIS Integration Runtime. + * + * @return the edition value. + */ + public IntegrationRuntimeEdition edition() { + return this.edition; + } + + /** + * Set the edition property: The edition for the SSIS Integration Runtime. + * + * @param edition the edition value to set. + * @return the IntegrationRuntimeSsisProperties object itself. + */ + public IntegrationRuntimeSsisProperties withEdition(IntegrationRuntimeEdition edition) { + this.edition = edition; + return this; + } + + /** + * Get the expressCustomSetupProperties property: Custom setup without script properties for a SSIS integration + * runtime. + * + * @return the expressCustomSetupProperties value. + */ + public List expressCustomSetupProperties() { + return this.expressCustomSetupProperties; + } + + /** + * Set the expressCustomSetupProperties property: Custom setup without script properties for a SSIS integration + * runtime. + * + * @param expressCustomSetupProperties the expressCustomSetupProperties value to set. + * @return the IntegrationRuntimeSsisProperties object itself. + */ + public IntegrationRuntimeSsisProperties withExpressCustomSetupProperties( + List expressCustomSetupProperties) { + this.expressCustomSetupProperties = expressCustomSetupProperties; + return this; + } + + /** + * Get the additionalProperties property: SSIS properties for managed integration runtime. + * + * @return the additionalProperties value. + */ + @JsonAnyGetter + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: SSIS properties for managed integration runtime. + * + * @param additionalProperties the additionalProperties value to set. + * @return the IntegrationRuntimeSsisProperties object itself. + */ + public IntegrationRuntimeSsisProperties withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + @JsonAnySetter + void withAdditionalProperties(String key, Object value) { + if (additionalProperties == null) { + additionalProperties = new HashMap<>(); + } + additionalProperties.put(key, value); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (catalogInfo() != null) { + catalogInfo().validate(); + } + if (customSetupScriptProperties() != null) { + customSetupScriptProperties().validate(); + } + if (dataProxyProperties() != null) { + dataProxyProperties().validate(); + } + if (expressCustomSetupProperties() != null) { + expressCustomSetupProperties().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeState.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeState.java new file mode 100644 index 0000000000000..673e722fbec36 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeState.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IntegrationRuntimeState. */ +public final class IntegrationRuntimeState extends ExpandableStringEnum { + /** Static value Initial for IntegrationRuntimeState. */ + public static final IntegrationRuntimeState INITIAL = fromString("Initial"); + + /** Static value Stopped for IntegrationRuntimeState. */ + public static final IntegrationRuntimeState STOPPED = fromString("Stopped"); + + /** Static value Started for IntegrationRuntimeState. */ + public static final IntegrationRuntimeState STARTED = fromString("Started"); + + /** Static value Starting for IntegrationRuntimeState. */ + public static final IntegrationRuntimeState STARTING = fromString("Starting"); + + /** Static value Stopping for IntegrationRuntimeState. */ + public static final IntegrationRuntimeState STOPPING = fromString("Stopping"); + + /** Static value NeedRegistration for IntegrationRuntimeState. */ + public static final IntegrationRuntimeState NEED_REGISTRATION = fromString("NeedRegistration"); + + /** Static value Online for IntegrationRuntimeState. */ + public static final IntegrationRuntimeState ONLINE = fromString("Online"); + + /** Static value Limited for IntegrationRuntimeState. */ + public static final IntegrationRuntimeState LIMITED = fromString("Limited"); + + /** Static value Offline for IntegrationRuntimeState. */ + public static final IntegrationRuntimeState OFFLINE = fromString("Offline"); + + /** Static value AccessDenied for IntegrationRuntimeState. */ + public static final IntegrationRuntimeState ACCESS_DENIED = fromString("AccessDenied"); + + /** + * Creates or finds a IntegrationRuntimeState from its string representation. + * + * @param name a name to look for. + * @return the corresponding IntegrationRuntimeState. + */ + @JsonCreator + public static IntegrationRuntimeState fromString(String name) { + return fromString(name, IntegrationRuntimeState.class); + } + + /** @return known IntegrationRuntimeState values. */ + public static Collection values() { + return values(IntegrationRuntimeState.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeStatus.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeStatus.java new file mode 100644 index 0000000000000..2c8476fdc1888 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeStatus.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.HashMap; +import java.util.Map; + +/** Integration runtime status. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + defaultImpl = IntegrationRuntimeStatus.class) +@JsonTypeName("IntegrationRuntimeStatus") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Managed", value = ManagedIntegrationRuntimeStatus.class), + @JsonSubTypes.Type(name = "SelfHosted", value = SelfHostedIntegrationRuntimeStatus.class) +}) +@Fluent +public class IntegrationRuntimeStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IntegrationRuntimeStatus.class); + + /* + * The workspace name which the integration runtime belong to. + */ + @JsonProperty(value = "dataFactoryName", access = JsonProperty.Access.WRITE_ONLY) + private String dataFactoryName; + + /* + * The state of integration runtime. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private IntegrationRuntimeState state; + + /* + * Integration runtime status. + */ + @JsonIgnore private Map additionalProperties; + + /** + * Get the dataFactoryName property: The workspace name which the integration runtime belong to. + * + * @return the dataFactoryName value. + */ + public String dataFactoryName() { + return this.dataFactoryName; + } + + /** + * Get the state property: The state of integration runtime. + * + * @return the state value. + */ + public IntegrationRuntimeState state() { + return this.state; + } + + /** + * Get the additionalProperties property: Integration runtime status. + * + * @return the additionalProperties value. + */ + @JsonAnyGetter + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Integration runtime status. + * + * @param additionalProperties the additionalProperties value to set. + * @return the IntegrationRuntimeStatus object itself. + */ + public IntegrationRuntimeStatus withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + @JsonAnySetter + void withAdditionalProperties(String key, Object value) { + if (additionalProperties == null) { + additionalProperties = new HashMap<>(); + } + additionalProperties.put(key, value); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeStatusOperations.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeStatusOperations.java new file mode 100644 index 0000000000000..3120c1befccf0 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeStatusOperations.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of IntegrationRuntimeStatusOperations. */ +public interface IntegrationRuntimeStatusOperations { + /** + * Get the integration runtime status. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the integration runtime status. + */ + IntegrationRuntimeStatusResponse get(String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * Get the integration runtime status. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the integration runtime status. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeStatusResponse.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeStatusResponse.java new file mode 100644 index 0000000000000..92662e7ad4026 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeStatusResponse.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeStatusResponseInner; + +/** An immutable client-side representation of IntegrationRuntimeStatusResponse. */ +public interface IntegrationRuntimeStatusResponse { + /** + * Gets the name property: The integration runtime name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the properties property: Integration runtime properties. + * + * @return the properties value. + */ + IntegrationRuntimeStatus properties(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeStatusResponseInner object. + * + * @return the inner object. + */ + IntegrationRuntimeStatusResponseInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeType.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeType.java new file mode 100644 index 0000000000000..6df4de3415864 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IntegrationRuntimeType. */ +public final class IntegrationRuntimeType extends ExpandableStringEnum { + /** Static value Managed for IntegrationRuntimeType. */ + public static final IntegrationRuntimeType MANAGED = fromString("Managed"); + + /** Static value SelfHosted for IntegrationRuntimeType. */ + public static final IntegrationRuntimeType SELF_HOSTED = fromString("SelfHosted"); + + /** + * Creates or finds a IntegrationRuntimeType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IntegrationRuntimeType. + */ + @JsonCreator + public static IntegrationRuntimeType fromString(String name) { + return fromString(name, IntegrationRuntimeType.class); + } + + /** @return known IntegrationRuntimeType values. */ + public static Collection values() { + return values(IntegrationRuntimeType.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeUpdateResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeUpdateResult.java new file mode 100644 index 0000000000000..56b9b711f268b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeUpdateResult.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IntegrationRuntimeUpdateResult. */ +public final class IntegrationRuntimeUpdateResult extends ExpandableStringEnum { + /** Static value None for IntegrationRuntimeUpdateResult. */ + public static final IntegrationRuntimeUpdateResult NONE = fromString("None"); + + /** Static value Succeed for IntegrationRuntimeUpdateResult. */ + public static final IntegrationRuntimeUpdateResult SUCCEED = fromString("Succeed"); + + /** Static value Fail for IntegrationRuntimeUpdateResult. */ + public static final IntegrationRuntimeUpdateResult FAIL = fromString("Fail"); + + /** + * Creates or finds a IntegrationRuntimeUpdateResult from its string representation. + * + * @param name a name to look for. + * @return the corresponding IntegrationRuntimeUpdateResult. + */ + @JsonCreator + public static IntegrationRuntimeUpdateResult fromString(String name) { + return fromString(name, IntegrationRuntimeUpdateResult.class); + } + + /** @return known IntegrationRuntimeUpdateResult values. */ + public static Collection values() { + return values(IntegrationRuntimeUpdateResult.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeVNetProperties.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeVNetProperties.java new file mode 100644 index 0000000000000..af0f05db72295 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimeVNetProperties.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** VNet properties for managed integration runtime. */ +@Fluent +public final class IntegrationRuntimeVNetProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IntegrationRuntimeVNetProperties.class); + + /* + * The ID of the VNet that this integration runtime will join. + */ + @JsonProperty(value = "vNetId") + private String vNetId; + + /* + * The name of the subnet this integration runtime will join. + */ + @JsonProperty(value = "subnet") + private String subnet; + + /* + * Resource IDs of the public IP addresses that this integration runtime + * will use. + */ + @JsonProperty(value = "publicIPs") + private List publicIPs; + + /* + * VNet properties for managed integration runtime. + */ + @JsonIgnore private Map additionalProperties; + + /** + * Get the vNetId property: The ID of the VNet that this integration runtime will join. + * + * @return the vNetId value. + */ + public String vNetId() { + return this.vNetId; + } + + /** + * Set the vNetId property: The ID of the VNet that this integration runtime will join. + * + * @param vNetId the vNetId value to set. + * @return the IntegrationRuntimeVNetProperties object itself. + */ + public IntegrationRuntimeVNetProperties withVNetId(String vNetId) { + this.vNetId = vNetId; + return this; + } + + /** + * Get the subnet property: The name of the subnet this integration runtime will join. + * + * @return the subnet value. + */ + public String subnet() { + return this.subnet; + } + + /** + * Set the subnet property: The name of the subnet this integration runtime will join. + * + * @param subnet the subnet value to set. + * @return the IntegrationRuntimeVNetProperties object itself. + */ + public IntegrationRuntimeVNetProperties withSubnet(String subnet) { + this.subnet = subnet; + return this; + } + + /** + * Get the publicIPs property: Resource IDs of the public IP addresses that this integration runtime will use. + * + * @return the publicIPs value. + */ + public List publicIPs() { + return this.publicIPs; + } + + /** + * Set the publicIPs property: Resource IDs of the public IP addresses that this integration runtime will use. + * + * @param publicIPs the publicIPs value to set. + * @return the IntegrationRuntimeVNetProperties object itself. + */ + public IntegrationRuntimeVNetProperties withPublicIPs(List publicIPs) { + this.publicIPs = publicIPs; + return this; + } + + /** + * Get the additionalProperties property: VNet properties for managed integration runtime. + * + * @return the additionalProperties value. + */ + @JsonAnyGetter + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: VNet properties for managed integration runtime. + * + * @param additionalProperties the additionalProperties value to set. + * @return the IntegrationRuntimeVNetProperties object itself. + */ + public IntegrationRuntimeVNetProperties withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + @JsonAnySetter + void withAdditionalProperties(String key, Object value) { + if (additionalProperties == null) { + additionalProperties = new HashMap<>(); + } + additionalProperties.put(key, value); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimes.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimes.java new file mode 100644 index 0000000000000..a27a39ee900c9 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IntegrationRuntimes.java @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of IntegrationRuntimes. */ +public interface IntegrationRuntimes { + /** + * Get 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an integration runtime. + */ + IntegrationRuntimeResource get(String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * Get 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 ifNoneMatch ETag of the integration runtime entity. Should only be specified for get. If the ETag matches + * the existing entity tag, or if * was provided, then no content will be returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an integration runtime. + */ + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String integrationRuntimeName, + String ifNoneMatch, + Context context); + + /** + * Delete 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * Delete 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context); + + /** + * Upgrade 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void upgrade(String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * Upgrade 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response upgradeWithResponse( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context); + + /** + * List all integration runtimes. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of integration runtime resources. + */ + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * List all integration runtimes. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of integration runtime resources. + */ + PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime status response. + */ + IntegrationRuntimeStatusResponse start( + String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return integration runtime status response. + */ + IntegrationRuntimeStatusResponse start( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void enableInteractiveQuery(String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void enableInteractiveQuery( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context); + + /** + * Disable 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void disableInteractiveQuery(String resourceGroupName, String workspaceName, String integrationRuntimeName); + + /** + * Disable 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void disableInteractiveQuery( + String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context); + + /** + * Get an integration runtime. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an integration runtime. + */ + IntegrationRuntimeResource getById(String id); + + /** + * Get an integration runtime. + * + * @param id the resource ID. + * @param ifNoneMatch ETag of the integration runtime entity. Should only be specified for get. If the ETag matches + * the existing entity tag, or if * was provided, then no content will be returned. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an integration runtime. + */ + Response getByIdWithResponse(String id, String ifNoneMatch, Context context); + + /** + * Delete an integration runtime. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete an integration runtime. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new IntegrationRuntimeResource resource. + * + * @param name resource name. + * @return the first stage of the new IntegrationRuntimeResource definition. + */ + IntegrationRuntimeResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IpFirewallRuleInfo.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IpFirewallRuleInfo.java new file mode 100644 index 0000000000000..db2060a93f543 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IpFirewallRuleInfo.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.IpFirewallRuleInfoInner; + +/** An immutable client-side representation of IpFirewallRuleInfo. */ +public interface IpFirewallRuleInfo { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the endIpAddress property: The end IP address of the firewall rule. Must be IPv4 format. Must be greater + * than or equal to startIpAddress. + * + * @return the endIpAddress value. + */ + String endIpAddress(); + + /** + * Gets the provisioningState property: Resource provisioning state. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the startIpAddress property: The start IP address of the firewall rule. Must be IPv4 format. + * + * @return the startIpAddress value. + */ + String startIpAddress(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.IpFirewallRuleInfoInner object. + * + * @return the inner object. + */ + IpFirewallRuleInfoInner innerModel(); + + /** The entirety of the IpFirewallRuleInfo definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The IpFirewallRuleInfo definition stages. */ + interface DefinitionStages { + /** The first stage of the IpFirewallRuleInfo definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the IpFirewallRuleInfo definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * 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 IpFirewallRuleInfo definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithEndIpAddress, DefinitionStages.WithStartIpAddress { + /** + * Executes the create request. + * + * @return the created resource. + */ + IpFirewallRuleInfo create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + IpFirewallRuleInfo create(Context context); + } + /** The stage of the IpFirewallRuleInfo definition allowing to specify endIpAddress. */ + interface WithEndIpAddress { + /** + * Specifies the endIpAddress property: The end IP address of the firewall rule. Must be IPv4 format. Must + * be greater than or equal to startIpAddress. + * + * @param endIpAddress The end IP address of the firewall rule. Must be IPv4 format. Must be greater than or + * equal to startIpAddress. + * @return the next definition stage. + */ + WithCreate withEndIpAddress(String endIpAddress); + } + /** The stage of the IpFirewallRuleInfo definition allowing to specify startIpAddress. */ + interface WithStartIpAddress { + /** + * Specifies the startIpAddress property: The start IP address of the firewall rule. Must be IPv4 format. + * + * @param startIpAddress The start IP address of the firewall rule. Must be IPv4 format. + * @return the next definition stage. + */ + WithCreate withStartIpAddress(String startIpAddress); + } + } + /** + * Begins update for the IpFirewallRuleInfo resource. + * + * @return the stage of resource update. + */ + IpFirewallRuleInfo.Update update(); + + /** The template for IpFirewallRuleInfo update. */ + interface Update extends UpdateStages.WithEndIpAddress, UpdateStages.WithStartIpAddress { + /** + * Executes the update request. + * + * @return the updated resource. + */ + IpFirewallRuleInfo apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + IpFirewallRuleInfo apply(Context context); + } + /** The IpFirewallRuleInfo update stages. */ + interface UpdateStages { + /** The stage of the IpFirewallRuleInfo update allowing to specify endIpAddress. */ + interface WithEndIpAddress { + /** + * Specifies the endIpAddress property: The end IP address of the firewall rule. Must be IPv4 format. Must + * be greater than or equal to startIpAddress. + * + * @param endIpAddress The end IP address of the firewall rule. Must be IPv4 format. Must be greater than or + * equal to startIpAddress. + * @return the next definition stage. + */ + Update withEndIpAddress(String endIpAddress); + } + /** The stage of the IpFirewallRuleInfo update allowing to specify startIpAddress. */ + interface WithStartIpAddress { + /** + * Specifies the startIpAddress property: The start IP address of the firewall rule. Must be IPv4 format. + * + * @param startIpAddress The start IP address of the firewall rule. Must be IPv4 format. + * @return the next definition stage. + */ + Update withStartIpAddress(String startIpAddress); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + IpFirewallRuleInfo refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + IpFirewallRuleInfo refresh(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IpFirewallRuleInfoListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IpFirewallRuleInfoListResult.java new file mode 100644 index 0000000000000..4ef666e97edc4 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IpFirewallRuleInfoListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.IpFirewallRuleInfoInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of IP firewall rules. */ +@Fluent +public final class IpFirewallRuleInfoListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpFirewallRuleInfoListResult.class); + + /* + * Link to next page of results + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * List of IP firewall rules + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the nextLink property: Link to next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to next page of results. + * + * @param nextLink the nextLink value to set. + * @return the IpFirewallRuleInfoListResult object itself. + */ + public IpFirewallRuleInfoListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: List of IP firewall rules. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of IP firewall rules. + * + * @param value the value value to set. + * @return the IpFirewallRuleInfoListResult object itself. + */ + public IpFirewallRuleInfoListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IpFirewallRuleProperties.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IpFirewallRuleProperties.java new file mode 100644 index 0000000000000..6645e5ee780a2 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IpFirewallRuleProperties.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** IP firewall rule properties. */ +@Fluent +public final class IpFirewallRuleProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IpFirewallRuleProperties.class); + + /* + * The end IP address of the firewall rule. Must be IPv4 format. Must be + * greater than or equal to startIpAddress + */ + @JsonProperty(value = "endIpAddress") + private String endIpAddress; + + /* + * Resource provisioning state + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The start IP address of the firewall rule. Must be IPv4 format + */ + @JsonProperty(value = "startIpAddress") + private String startIpAddress; + + /** + * Get the endIpAddress property: The end IP address of the firewall rule. Must be IPv4 format. Must be greater than + * or equal to startIpAddress. + * + * @return the endIpAddress value. + */ + public String endIpAddress() { + return this.endIpAddress; + } + + /** + * Set the endIpAddress property: The end IP address of the firewall rule. Must be IPv4 format. Must be greater than + * or equal to startIpAddress. + * + * @param endIpAddress the endIpAddress value to set. + * @return the IpFirewallRuleProperties object itself. + */ + public IpFirewallRuleProperties withEndIpAddress(String endIpAddress) { + this.endIpAddress = endIpAddress; + return this; + } + + /** + * Get the provisioningState property: Resource provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the startIpAddress property: The start IP address of the firewall rule. Must be IPv4 format. + * + * @return the startIpAddress value. + */ + public String startIpAddress() { + return this.startIpAddress; + } + + /** + * Set the startIpAddress property: The start IP address of the firewall rule. Must be IPv4 format. + * + * @param startIpAddress the startIpAddress value to set. + * @return the IpFirewallRuleProperties object itself. + */ + public IpFirewallRuleProperties withStartIpAddress(String startIpAddress) { + this.startIpAddress = startIpAddress; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IpFirewallRules.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IpFirewallRules.java new file mode 100644 index 0000000000000..be639739fd7d9 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/IpFirewallRules.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of IpFirewallRules. */ +public interface IpFirewallRules { + /** + * Returns a list of firewall rules. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of IP firewall rules. + */ + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * Returns a list of firewall rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of IP firewall rules. + */ + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context); + + /** + * Deletes a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + Object delete(String resourceGroupName, String workspaceName, String ruleName); + + /** + * Deletes a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + Object delete(String resourceGroupName, String workspaceName, String ruleName, Context context); + + /** + * Get a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a firewall rule. + */ + IpFirewallRuleInfo get(String resourceGroupName, String workspaceName, String ruleName); + + /** + * Get a firewall rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param ruleName The IP firewall rule name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a firewall rule. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String ruleName, Context context); + + /** + * Replaces firewall rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param request Replace all IP firewall rules request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing operation for replacing the firewall rules. + */ + ReplaceAllFirewallRulesOperationResponse replaceAll( + String resourceGroupName, String workspaceName, ReplaceAllIpFirewallRulesRequest request); + + /** + * Replaces firewall rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param request Replace all IP firewall rules request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an existing operation for replacing the firewall rules. + */ + ReplaceAllFirewallRulesOperationResponse replaceAll( + String resourceGroupName, String workspaceName, ReplaceAllIpFirewallRulesRequest request, Context context); + + /** + * Get a firewall rule. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a firewall rule. + */ + IpFirewallRuleInfo getById(String id); + + /** + * Get a firewall rule. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a firewall rule. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a firewall rule. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + Object deleteById(String id); + + /** + * Deletes a firewall rule. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + Object deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new IpFirewallRuleInfo resource. + * + * @param name resource name. + * @return the first stage of the new IpFirewallRuleInfo definition. + */ + IpFirewallRuleInfo.DefinitionStages.Blank define(String name); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Key.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Key.java new file mode 100644 index 0000000000000..d941f678275a0 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Key.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.KeyInner; + +/** An immutable client-side representation of Key. */ +public interface Key { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the isActiveCmk property: Used to activate the workspace after a customer managed key is provided. + * + * @return the isActiveCmk value. + */ + Boolean isActiveCmk(); + + /** + * Gets the keyVaultUrl property: The Key Vault Url of the workspace key. + * + * @return the keyVaultUrl value. + */ + String keyVaultUrl(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.KeyInner object. + * + * @return the inner object. + */ + KeyInner innerModel(); + + /** The entirety of the Key definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The Key definition stages. */ + interface DefinitionStages { + /** The first stage of the Key definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the Key definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * 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 which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithIsActiveCmk, DefinitionStages.WithKeyVaultUrl { + /** + * Executes the create request. + * + * @return the created resource. + */ + Key create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Key create(Context context); + } + /** The stage of the Key definition allowing to specify isActiveCmk. */ + interface WithIsActiveCmk { + /** + * Specifies the isActiveCmk property: Used to activate the workspace after a customer managed key is + * provided.. + * + * @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 the keyVaultUrl property: The Key Vault Url of the workspace key.. + * + * @param keyVaultUrl The Key Vault Url of the workspace key. + * @return the next definition stage. + */ + WithCreate withKeyVaultUrl(String keyVaultUrl); + } + } + /** + * Begins update for the Key resource. + * + * @return the stage of resource update. + */ + Key.Update update(); + + /** The template for Key update. */ + interface Update extends UpdateStages.WithIsActiveCmk, UpdateStages.WithKeyVaultUrl { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Key apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Key apply(Context context); + } + /** The Key update stages. */ + interface UpdateStages { + /** The stage of the Key update allowing to specify isActiveCmk. */ + interface WithIsActiveCmk { + /** + * Specifies the isActiveCmk property: Used to activate the workspace after a customer managed key is + * provided.. + * + * @param isActiveCmk Used to activate the workspace after a customer managed key is provided. + * @return the next definition stage. + */ + Update withIsActiveCmk(Boolean isActiveCmk); + } + /** The stage of the Key update allowing to specify keyVaultUrl. */ + interface WithKeyVaultUrl { + /** + * Specifies the keyVaultUrl property: The Key Vault Url of the workspace key.. + * + * @param keyVaultUrl The Key Vault Url of the workspace key. + * @return the next definition stage. + */ + Update withKeyVaultUrl(String keyVaultUrl); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Key refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Key refresh(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KeyInfoListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KeyInfoListResult.java new file mode 100644 index 0000000000000..3debc96d3bd30 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/KeyInfoListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.KeyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of keys. */ +@Fluent +public final class KeyInfoListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyInfoListResult.class); + + /* + * Link to the next page of results + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * List of keys + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the nextLink property: Link to the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to the next page of results. + * + * @param nextLink the nextLink value to set. + * @return the KeyInfoListResult object itself. + */ + public KeyInfoListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: List of keys. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of keys. + * + * @param value the value value to set. + * @return the KeyInfoListResult object itself. + */ + public KeyInfoListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Keys.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Keys.java new file mode 100644 index 0000000000000..3c3a2a44ec503 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Keys.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Keys. */ +public interface Keys { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of keys. + */ + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of keys. + */ + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace key. + */ + Key get(String resourceGroupName, String workspaceName, String keyName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace key. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, String keyName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace key. + */ + Key delete(String resourceGroupName, String workspaceName, String keyName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace key. + */ + Response deleteWithResponse(String resourceGroupName, String workspaceName, String keyName, Context context); + + /** + * Gets a workspace key. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace key. + */ + Key getById(String id); + + /** + * Gets a workspace key. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace key. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a workspace key. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace key. + */ + Key deleteById(String id); + + /** + * Deletes a workspace key. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace key. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Key resource. + * + * @param name resource name. + * @return the first stage of the new Key definition. + */ + Key.DefinitionStages.Blank define(String name); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Libraries.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Libraries.java new file mode 100644 index 0000000000000..cae2874e99e8b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Libraries.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Libraries. */ +public interface Libraries { + /** + * Get library by name in a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param libraryName Library name. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return library by name in a workspace. + */ + LibraryResource get(String resourceGroupName, String libraryName, String workspaceName); + + /** + * Get library by name in a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param libraryName Library name. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return library by name in a workspace. + */ + Response getWithResponse( + String resourceGroupName, String libraryName, String workspaceName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LibrariesOperations.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LibrariesOperations.java new file mode 100644 index 0000000000000..8d628e4492893 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LibrariesOperations.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of LibrariesOperations. */ +public interface LibrariesOperations { + /** + * List libraries 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Library resources. + */ + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * List libraries in a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Library resources. + */ + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LibraryInfo.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LibraryInfo.java new file mode 100644 index 0000000000000..b03e90c026daf --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LibraryInfo.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Library/package information of a Big Data pool powered by Apache Spark. */ +@Fluent +public final class LibraryInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LibraryInfo.class); + + /* + * 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", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime 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 the name property: Name of the library. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: 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 the path property: Storage blob path of library. + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: 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 the containerName property: Storage blob container name. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: 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 uploadedTimestamp property: The last update time of the library. + * + * @return the uploadedTimestamp value. + */ + public OffsetDateTime uploadedTimestamp() { + return this.uploadedTimestamp; + } + + /** + * Get the type property: Type of the library. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: 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 the provisioningStatus property: Provisioning status of the library/package. + * + * @return the provisioningStatus value. + */ + public String provisioningStatus() { + return this.provisioningStatus; + } + + /** + * Get the creatorId property: Creator Id of the library/package. + * + * @return the creatorId value. + */ + public String creatorId() { + return this.creatorId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LibraryListResponse.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LibraryListResponse.java new file mode 100644 index 0000000000000..b0b137696914a --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LibraryListResponse.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.LibraryResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of Library resources. */ +@Fluent +public final class LibraryListResponse { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LibraryListResponse.class); + + /* + * List of Library. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * The link to the next page of results, if any remaining results exist. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of Library. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of Library. + * + * @param value the value value to set. + * @return the LibraryListResponse object itself. + */ + public LibraryListResponse withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of results, if any remaining results exist. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of results, if any remaining results exist. + * + * @param nextLink the nextLink value to set. + * @return the LibraryListResponse object itself. + */ + public LibraryListResponse withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model LibraryListResponse")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LibraryRequirements.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LibraryRequirements.java new file mode 100644 index 0000000000000..d14bfa22caa54 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LibraryRequirements.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Library requirements for a Big Data pool powered by Apache Spark. */ +@Fluent +public final class LibraryRequirements { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LibraryRequirements.class); + + /* + * The last update time of the library requirements file. + */ + @JsonProperty(value = "time", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime time; + + /* + * The library requirements. + */ + @JsonProperty(value = "content") + private String content; + + /* + * The filename of the library requirements file. + */ + @JsonProperty(value = "filename") + private String filename; + + /** + * Get the time property: The last update time of the library requirements file. + * + * @return the time value. + */ + public OffsetDateTime time() { + return this.time; + } + + /** + * Get the content property: The library requirements. + * + * @return the content value. + */ + public String content() { + return this.content; + } + + /** + * Set the content property: The library requirements. + * + * @param content the content value to set. + * @return the LibraryRequirements object itself. + */ + public LibraryRequirements withContent(String content) { + this.content = content; + return this; + } + + /** + * Get the filename property: The filename of the library requirements file. + * + * @return the filename value. + */ + public String filename() { + return this.filename; + } + + /** + * Set the filename property: The filename of the library requirements file. + * + * @param filename the filename value to set. + * @return the LibraryRequirements object itself. + */ + public LibraryRequirements withFilename(String filename) { + this.filename = filename; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LibraryResource.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LibraryResource.java new file mode 100644 index 0000000000000..c27a010d1ada9 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LibraryResource.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.LibraryResourceInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of LibraryResource. */ +public interface LibraryResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: Resource Etag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the namePropertiesName property: Name of the library. + * + * @return the namePropertiesName value. + */ + String namePropertiesName(); + + /** + * Gets the path property: Storage blob path of library. + * + * @return the path value. + */ + String path(); + + /** + * Gets the containerName property: Storage blob container name. + * + * @return the containerName value. + */ + String containerName(); + + /** + * Gets the uploadedTimestamp property: The last update time of the library. + * + * @return the uploadedTimestamp value. + */ + OffsetDateTime uploadedTimestamp(); + + /** + * Gets the typePropertiesType property: Type of the library. + * + * @return the typePropertiesType value. + */ + String typePropertiesType(); + + /** + * Gets the provisioningStatus property: Provisioning status of the library/package. + * + * @return the provisioningStatus value. + */ + String provisioningStatus(); + + /** + * Gets the creatorId property: Creator Id of the library/package. + * + * @return the creatorId value. + */ + String creatorId(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.LibraryResourceInner object. + * + * @return the inner object. + */ + LibraryResourceInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LinkedIntegrationRuntime.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LinkedIntegrationRuntime.java new file mode 100644 index 0000000000000..14f49e130edcb --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LinkedIntegrationRuntime.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The linked integration runtime information. */ +@Immutable +public final class LinkedIntegrationRuntime { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LinkedIntegrationRuntime.class); + + /* + * The name of the linked integration runtime. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The subscription ID for which the linked integration runtime belong to. + */ + @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) + private String subscriptionId; + + /* + * The name of the workspace for which the linked integration runtime + * belong to. + */ + @JsonProperty(value = "dataFactoryName", access = JsonProperty.Access.WRITE_ONLY) + private String dataFactoryName; + + /* + * The location of the workspace for which the linked integration runtime + * belong to. + */ + @JsonProperty(value = "dataFactoryLocation", access = JsonProperty.Access.WRITE_ONLY) + private String dataFactoryLocation; + + /* + * The creating time of the linked integration runtime. + */ + @JsonProperty(value = "createTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createTime; + + /** + * Get the name property: The name of the linked integration runtime. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the subscriptionId property: The subscription ID for which the linked integration runtime belong to. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Get the dataFactoryName property: The name of the workspace for which the linked integration runtime belong to. + * + * @return the dataFactoryName value. + */ + public String dataFactoryName() { + return this.dataFactoryName; + } + + /** + * Get the dataFactoryLocation property: The location of the workspace for which the linked integration runtime + * belong to. + * + * @return the dataFactoryLocation value. + */ + public String dataFactoryLocation() { + return this.dataFactoryLocation; + } + + /** + * Get the createTime property: The creating time of the linked integration runtime. + * + * @return the createTime value. + */ + public OffsetDateTime createTime() { + return this.createTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LinkedIntegrationRuntimeKeyAuthorization.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LinkedIntegrationRuntimeKeyAuthorization.java new file mode 100644 index 0000000000000..2877b913319c2 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LinkedIntegrationRuntimeKeyAuthorization.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The key authorization type integration runtime. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "authorizationType") +@JsonTypeName("Key") +@Fluent +public final class LinkedIntegrationRuntimeKeyAuthorization extends LinkedIntegrationRuntimeType { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LinkedIntegrationRuntimeKeyAuthorization.class); + + /* + * The key used for authorization. + */ + @JsonProperty(value = "key", required = true) + private SecureString key; + + /** + * Get the key property: The key used for authorization. + * + * @return the key value. + */ + public SecureString key() { + return this.key; + } + + /** + * Set the key property: The key used for authorization. + * + * @param key the key value to set. + * @return the LinkedIntegrationRuntimeKeyAuthorization object itself. + */ + public LinkedIntegrationRuntimeKeyAuthorization withKey(SecureString key) { + this.key = key; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (key() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property key in model LinkedIntegrationRuntimeKeyAuthorization")); + } else { + key().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LinkedIntegrationRuntimeRbacAuthorization.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LinkedIntegrationRuntimeRbacAuthorization.java new file mode 100644 index 0000000000000..4af28f0b31874 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LinkedIntegrationRuntimeRbacAuthorization.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The role based access control (RBAC) authorization type integration runtime. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "authorizationType") +@JsonTypeName("RBAC") +@Fluent +public final class LinkedIntegrationRuntimeRbacAuthorization extends LinkedIntegrationRuntimeType { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LinkedIntegrationRuntimeRbacAuthorization.class); + + /* + * The resource identifier of the integration runtime to be shared. + */ + @JsonProperty(value = "resourceId", required = true) + private String resourceId; + + /** + * Get the resourceId property: The resource identifier of the integration runtime to be shared. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId property: The resource identifier of the integration runtime to be shared. + * + * @param resourceId the resourceId value to set. + * @return the LinkedIntegrationRuntimeRbacAuthorization object itself. + */ + public LinkedIntegrationRuntimeRbacAuthorization withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (resourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property resourceId in model LinkedIntegrationRuntimeRbacAuthorization")); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LinkedIntegrationRuntimeType.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LinkedIntegrationRuntimeType.java new file mode 100644 index 0000000000000..5afedbd1ef36c --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/LinkedIntegrationRuntimeType.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The base definition of a linked integration runtime. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "authorizationType", + defaultImpl = LinkedIntegrationRuntimeType.class) +@JsonTypeName("LinkedIntegrationRuntimeType") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Key", value = LinkedIntegrationRuntimeKeyAuthorization.class), + @JsonSubTypes.Type(name = "RBAC", value = LinkedIntegrationRuntimeRbacAuthorization.class) +}) +@Immutable +public class LinkedIntegrationRuntimeType { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LinkedIntegrationRuntimeType.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ListSqlPoolSecurityAlertPolicies.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ListSqlPoolSecurityAlertPolicies.java new file mode 100644 index 0000000000000..5d8a2ce1072bc --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ListSqlPoolSecurityAlertPolicies.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolSecurityAlertPolicyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of SQL pool security alert policies. */ +@Immutable +public final class ListSqlPoolSecurityAlertPolicies { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListSqlPoolSecurityAlertPolicies.class); + + /* + * Array of results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/MaintenanceWindowOptions.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/MaintenanceWindowOptions.java new file mode 100644 index 0000000000000..9665ac65b0f5d --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/MaintenanceWindowOptions.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.MaintenanceWindowOptionsInner; +import java.util.List; + +/** An immutable client-side representation of MaintenanceWindowOptions. */ +public interface MaintenanceWindowOptions { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the isEnabled property: Whether maintenance windows are enabled for the database. + * + * @return the isEnabled value. + */ + Boolean isEnabled(); + + /** + * Gets the maintenanceWindowCycles property: Available maintenance cycles e.g. {Saturday, 0, 48*60}, {Wednesday, 0, + * 24*60}. + * + * @return the maintenanceWindowCycles value. + */ + List maintenanceWindowCycles(); + + /** + * Gets the minDurationInMinutes property: Minimum duration of maintenance window. + * + * @return the minDurationInMinutes value. + */ + Integer minDurationInMinutes(); + + /** + * Gets the defaultDurationInMinutes property: Default duration for maintenance window. + * + * @return the defaultDurationInMinutes value. + */ + Integer defaultDurationInMinutes(); + + /** + * Gets the minCycles property: Minimum number of maintenance windows cycles to be set on the database. + * + * @return the minCycles value. + */ + Integer minCycles(); + + /** + * Gets the timeGranularityInMinutes property: Time granularity in minutes for maintenance windows. + * + * @return the timeGranularityInMinutes value. + */ + Integer timeGranularityInMinutes(); + + /** + * Gets the allowMultipleMaintenanceWindowsPerCycle property: Whether we allow multiple maintenance windows per + * cycle. + * + * @return the allowMultipleMaintenanceWindowsPerCycle value. + */ + Boolean allowMultipleMaintenanceWindowsPerCycle(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.MaintenanceWindowOptionsInner object. + * + * @return the inner object. + */ + MaintenanceWindowOptionsInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/MaintenanceWindowTimeRange.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/MaintenanceWindowTimeRange.java new file mode 100644 index 0000000000000..9fef71f6a017f --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/MaintenanceWindowTimeRange.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Maintenance window time range. */ +@Fluent +public final class MaintenanceWindowTimeRange { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MaintenanceWindowTimeRange.class); + + /* + * Day of maintenance window. + */ + @JsonProperty(value = "dayOfWeek") + private DayOfWeek dayOfWeek; + + /* + * Start time minutes offset from 12am. + */ + @JsonProperty(value = "startTime") + private String startTime; + + /* + * Duration of maintenance window in minutes. + */ + @JsonProperty(value = "duration") + private String duration; + + /** + * Get the dayOfWeek property: Day of maintenance window. + * + * @return the dayOfWeek value. + */ + public DayOfWeek dayOfWeek() { + return this.dayOfWeek; + } + + /** + * Set the dayOfWeek property: Day of maintenance window. + * + * @param dayOfWeek the dayOfWeek value to set. + * @return the MaintenanceWindowTimeRange object itself. + */ + public MaintenanceWindowTimeRange withDayOfWeek(DayOfWeek dayOfWeek) { + this.dayOfWeek = dayOfWeek; + return this; + } + + /** + * Get the startTime property: Start time minutes offset from 12am. + * + * @return the startTime value. + */ + public String startTime() { + return this.startTime; + } + + /** + * Set the startTime property: Start time minutes offset from 12am. + * + * @param startTime the startTime value to set. + * @return the MaintenanceWindowTimeRange object itself. + */ + public MaintenanceWindowTimeRange withStartTime(String startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the duration property: Duration of maintenance window in minutes. + * + * @return the duration value. + */ + public String duration() { + return this.duration; + } + + /** + * Set the duration property: Duration of maintenance window in minutes. + * + * @param duration the duration value to set. + * @return the MaintenanceWindowTimeRange object itself. + */ + public MaintenanceWindowTimeRange withDuration(String duration) { + this.duration = duration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/MaintenanceWindows.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/MaintenanceWindows.java new file mode 100644 index 0000000000000..94f96858f6983 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/MaintenanceWindows.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.MaintenanceWindowsInner; +import java.util.List; + +/** An immutable client-side representation of MaintenanceWindows. */ +public interface MaintenanceWindows { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the timeRanges property: The timeRanges property. + * + * @return the timeRanges value. + */ + List timeRanges(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.MaintenanceWindowsInner object. + * + * @return the inner object. + */ + MaintenanceWindowsInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIdentity.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIdentity.java new file mode 100644 index 0000000000000..d6d08a3689916 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIdentity.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** The workspace managed identity. */ +@Fluent +public class ManagedIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedIdentity.class); + + /* + * The principal ID of the workspace managed identity + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * The tenant ID of the workspace managed identity + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private UUID tenantId; + + /* + * The type of managed identity for the workspace + */ + @JsonProperty(value = "type") + private ResourceIdentityType type; + + /** + * Get the principalId property: The principal ID of the workspace managed identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: The tenant ID of the workspace managed identity. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.tenantId; + } + + /** + * Get the type property: The type of managed identity for the workspace. + * + * @return the type value. + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the type property: The type of managed identity for the workspace. + * + * @param type the type value to set. + * @return the ManagedIdentity object itself. + */ + public ManagedIdentity withType(ResourceIdentityType type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIdentitySqlControlSettingsModel.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIdentitySqlControlSettingsModel.java new file mode 100644 index 0000000000000..cc015090e5cfe --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIdentitySqlControlSettingsModel.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.ManagedIdentitySqlControlSettingsModelInner; + +/** An immutable client-side representation of ManagedIdentitySqlControlSettingsModel. */ +public interface ManagedIdentitySqlControlSettingsModel { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the grantSqlControlToManagedIdentity property: Grant sql control to managed identity. + * + * @return the grantSqlControlToManagedIdentity value. + */ + ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentity grantSqlControlToManagedIdentity(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.ManagedIdentitySqlControlSettingsModelInner + * object. + * + * @return the inner object. + */ + ManagedIdentitySqlControlSettingsModelInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentity.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentity.java new file mode 100644 index 0000000000000..9211906c31b10 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentity.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Grant sql control to managed identity. */ +@Fluent +public class ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentity { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentity.class); + + /* + * Desired state + */ + @JsonProperty(value = "desiredState") + private ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityDesiredState desiredState; + + /* + * Actual state + */ + @JsonProperty(value = "actualState", access = JsonProperty.Access.WRITE_ONLY) + private ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityActualState actualState; + + /** + * Get the desiredState property: Desired state. + * + * @return the desiredState value. + */ + public ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityDesiredState desiredState() { + return this.desiredState; + } + + /** + * Set the desiredState property: Desired state. + * + * @param desiredState the desiredState value to set. + * @return the ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentity object itself. + */ + public ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentity withDesiredState( + ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityDesiredState desiredState) { + this.desiredState = desiredState; + return this; + } + + /** + * Get the actualState property: Actual state. + * + * @return the actualState value. + */ + public ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityActualState actualState() { + return this.actualState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityActualState.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityActualState.java new file mode 100644 index 0000000000000..ecbd4947ee4b6 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityActualState.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityActualState. */ +public final class ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityActualState + extends ExpandableStringEnum< + ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityActualState> { + /** + * Static value Enabling for + * ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityActualState. + */ + public static final ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityActualState + ENABLING = fromString("Enabling"); + + /** + * Static value Enabled for + * ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityActualState. + */ + public static final ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityActualState + ENABLED = fromString("Enabled"); + + /** + * Static value Disabling for + * ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityActualState. + */ + public static final ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityActualState + DISABLING = fromString("Disabling"); + + /** + * Static value Disabled for + * ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityActualState. + */ + public static final ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityActualState + DISABLED = fromString("Disabled"); + + /** + * Static value Unknown for + * ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityActualState. + */ + public static final ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityActualState + UNKNOWN = fromString("Unknown"); + + /** + * Creates or finds a ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityActualState + * from its string representation. + * + * @param name a name to look for. + * @return the corresponding + * ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityActualState. + */ + @JsonCreator + public static ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityActualState + fromString(String name) { + return fromString( + name, ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityActualState.class); + } + + /** + * @return known ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityActualState values. + */ + public static Collection< + ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityActualState> + values() { + return values( + ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityActualState.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityDesiredState.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityDesiredState.java new file mode 100644 index 0000000000000..b7a7b7b909991 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityDesiredState.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityDesiredState. */ +public final class ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityDesiredState + extends ExpandableStringEnum< + ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityDesiredState> { + /** + * Static value Enabled for + * ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityDesiredState. + */ + public static final ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityDesiredState + ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for + * ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityDesiredState. + */ + public static final ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityDesiredState + DISABLED = fromString("Disabled"); + + /** + * Creates or finds a ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityDesiredState + * from its string representation. + * + * @param name a name to look for. + * @return the corresponding + * ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityDesiredState. + */ + @JsonCreator + public static ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityDesiredState + fromString(String name) { + return fromString( + name, ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityDesiredState.class); + } + + /** + * @return known ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityDesiredState + * values. + */ + public static Collection< + ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityDesiredState> + values() { + return values( + ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentityDesiredState.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIntegrationRuntime.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIntegrationRuntime.java new file mode 100644 index 0000000000000..432c167858e48 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIntegrationRuntime.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Managed integration runtime, including managed elastic and managed dedicated integration runtimes. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("Managed") +@JsonFlatten +@Fluent +public class ManagedIntegrationRuntime extends IntegrationRuntime { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedIntegrationRuntime.class); + + /* + * Integration runtime state, only valid for managed dedicated integration + * runtime. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private IntegrationRuntimeState state; + + /* + * The compute resource for managed integration runtime. + */ + @JsonProperty(value = "typeProperties.computeProperties") + private IntegrationRuntimeComputeProperties computeProperties; + + /* + * SSIS properties for managed integration runtime. + */ + @JsonProperty(value = "typeProperties.ssisProperties") + private IntegrationRuntimeSsisProperties ssisProperties; + + /** + * Get the state property: Integration runtime state, only valid for managed dedicated integration runtime. + * + * @return the state value. + */ + public IntegrationRuntimeState state() { + return this.state; + } + + /** + * Get the computeProperties property: The compute resource for managed integration runtime. + * + * @return the computeProperties value. + */ + public IntegrationRuntimeComputeProperties computeProperties() { + return this.computeProperties; + } + + /** + * Set the computeProperties property: The compute resource for managed integration runtime. + * + * @param computeProperties the computeProperties value to set. + * @return the ManagedIntegrationRuntime object itself. + */ + public ManagedIntegrationRuntime withComputeProperties(IntegrationRuntimeComputeProperties computeProperties) { + this.computeProperties = computeProperties; + return this; + } + + /** + * Get the ssisProperties property: SSIS properties for managed integration runtime. + * + * @return the ssisProperties value. + */ + public IntegrationRuntimeSsisProperties ssisProperties() { + return this.ssisProperties; + } + + /** + * Set the ssisProperties property: SSIS properties for managed integration runtime. + * + * @param ssisProperties the ssisProperties value to set. + * @return the ManagedIntegrationRuntime object itself. + */ + public ManagedIntegrationRuntime withSsisProperties(IntegrationRuntimeSsisProperties ssisProperties) { + this.ssisProperties = ssisProperties; + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedIntegrationRuntime withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (computeProperties() != null) { + computeProperties().validate(); + } + if (ssisProperties() != null) { + ssisProperties().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIntegrationRuntimeError.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIntegrationRuntimeError.java new file mode 100644 index 0000000000000..b58c25309330b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIntegrationRuntimeError.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** Error definition for managed integration runtime. */ +@Fluent +public final class ManagedIntegrationRuntimeError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedIntegrationRuntimeError.class); + + /* + * The time when the error occurred. + */ + @JsonProperty(value = "time", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime time; + + /* + * Error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * Managed integration runtime error parameters. + */ + @JsonProperty(value = "parameters", access = JsonProperty.Access.WRITE_ONLY) + private List parameters; + + /* + * Error message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /* + * Error definition for managed integration runtime. + */ + @JsonIgnore private Map additionalProperties; + + /** + * Get the time property: The time when the error occurred. + * + * @return the time value. + */ + public OffsetDateTime time() { + return this.time; + } + + /** + * Get the code property: Error code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the parameters property: Managed integration runtime error parameters. + * + * @return the parameters value. + */ + public List parameters() { + return this.parameters; + } + + /** + * Get the message property: Error message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Get the additionalProperties property: Error definition for managed integration runtime. + * + * @return the additionalProperties value. + */ + @JsonAnyGetter + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Error definition for managed integration runtime. + * + * @param additionalProperties the additionalProperties value to set. + * @return the ManagedIntegrationRuntimeError object itself. + */ + public ManagedIntegrationRuntimeError withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + @JsonAnySetter + void withAdditionalProperties(String key, Object value) { + if (additionalProperties == null) { + additionalProperties = new HashMap<>(); + } + additionalProperties.put(key, value); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIntegrationRuntimeNode.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIntegrationRuntimeNode.java new file mode 100644 index 0000000000000..6cbac5fc968a6 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIntegrationRuntimeNode.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** Properties of integration runtime node. */ +@Fluent +public final class ManagedIntegrationRuntimeNode { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedIntegrationRuntimeNode.class); + + /* + * The managed integration runtime node id. + */ + @JsonProperty(value = "nodeId", access = JsonProperty.Access.WRITE_ONLY) + private String nodeId; + + /* + * The managed integration runtime node status. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ManagedIntegrationRuntimeNodeStatus status; + + /* + * The errors that occurred on this integration runtime node. + */ + @JsonProperty(value = "errors") + private List errors; + + /* + * Properties of integration runtime node. + */ + @JsonIgnore private Map additionalProperties; + + /** + * Get the nodeId property: The managed integration runtime node id. + * + * @return the nodeId value. + */ + public String nodeId() { + return this.nodeId; + } + + /** + * Get the status property: The managed integration runtime node status. + * + * @return the status value. + */ + public ManagedIntegrationRuntimeNodeStatus status() { + return this.status; + } + + /** + * Get the errors property: The errors that occurred on this integration runtime node. + * + * @return the errors value. + */ + public List errors() { + return this.errors; + } + + /** + * Set the errors property: The errors that occurred on this integration runtime node. + * + * @param errors the errors value to set. + * @return the ManagedIntegrationRuntimeNode object itself. + */ + public ManagedIntegrationRuntimeNode withErrors(List errors) { + this.errors = errors; + return this; + } + + /** + * Get the additionalProperties property: Properties of integration runtime node. + * + * @return the additionalProperties value. + */ + @JsonAnyGetter + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Properties of integration runtime node. + * + * @param additionalProperties the additionalProperties value to set. + * @return the ManagedIntegrationRuntimeNode object itself. + */ + public ManagedIntegrationRuntimeNode withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + @JsonAnySetter + void withAdditionalProperties(String key, Object value) { + if (additionalProperties == null) { + additionalProperties = new HashMap<>(); + } + additionalProperties.put(key, value); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (errors() != null) { + errors().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIntegrationRuntimeNodeStatus.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIntegrationRuntimeNodeStatus.java new file mode 100644 index 0000000000000..5d6ddfb74021f --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIntegrationRuntimeNodeStatus.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagedIntegrationRuntimeNodeStatus. */ +public final class ManagedIntegrationRuntimeNodeStatus + extends ExpandableStringEnum { + /** Static value Starting for ManagedIntegrationRuntimeNodeStatus. */ + public static final ManagedIntegrationRuntimeNodeStatus STARTING = fromString("Starting"); + + /** Static value Available for ManagedIntegrationRuntimeNodeStatus. */ + public static final ManagedIntegrationRuntimeNodeStatus AVAILABLE = fromString("Available"); + + /** Static value Recycling for ManagedIntegrationRuntimeNodeStatus. */ + public static final ManagedIntegrationRuntimeNodeStatus RECYCLING = fromString("Recycling"); + + /** Static value Unavailable for ManagedIntegrationRuntimeNodeStatus. */ + public static final ManagedIntegrationRuntimeNodeStatus UNAVAILABLE = fromString("Unavailable"); + + /** + * Creates or finds a ManagedIntegrationRuntimeNodeStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedIntegrationRuntimeNodeStatus. + */ + @JsonCreator + public static ManagedIntegrationRuntimeNodeStatus fromString(String name) { + return fromString(name, ManagedIntegrationRuntimeNodeStatus.class); + } + + /** @return known ManagedIntegrationRuntimeNodeStatus values. */ + public static Collection values() { + return values(ManagedIntegrationRuntimeNodeStatus.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIntegrationRuntimeOperationResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIntegrationRuntimeOperationResult.java new file mode 100644 index 0000000000000..6be64ddb5df22 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIntegrationRuntimeOperationResult.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** Properties of managed integration runtime operation result. */ +@Fluent +public final class ManagedIntegrationRuntimeOperationResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedIntegrationRuntimeOperationResult.class); + + /* + * The operation type. Could be start or stop. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The start time of the operation. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startTime; + + /* + * The operation result. + */ + @JsonProperty(value = "result", access = JsonProperty.Access.WRITE_ONLY) + private String result; + + /* + * The error code. + */ + @JsonProperty(value = "errorCode", access = JsonProperty.Access.WRITE_ONLY) + private String errorCode; + + /* + * Managed integration runtime error parameters. + */ + @JsonProperty(value = "parameters", access = JsonProperty.Access.WRITE_ONLY) + private List parameters; + + /* + * The activity id for the operation request. + */ + @JsonProperty(value = "activityId", access = JsonProperty.Access.WRITE_ONLY) + private String activityId; + + /* + * Properties of managed integration runtime operation result. + */ + @JsonIgnore private Map additionalProperties; + + /** + * Get the type property: The operation type. Could be start or stop. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the result property: The operation result. + * + * @return the result value. + */ + public String result() { + return this.result; + } + + /** + * Get the errorCode property: The error code. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Get the parameters property: Managed integration runtime error parameters. + * + * @return the parameters value. + */ + public List parameters() { + return this.parameters; + } + + /** + * Get the activityId property: The activity id for the operation request. + * + * @return the activityId value. + */ + public String activityId() { + return this.activityId; + } + + /** + * Get the additionalProperties property: Properties of managed integration runtime operation result. + * + * @return the additionalProperties value. + */ + @JsonAnyGetter + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Properties of managed integration runtime operation result. + * + * @param additionalProperties the additionalProperties value to set. + * @return the ManagedIntegrationRuntimeOperationResult object itself. + */ + public ManagedIntegrationRuntimeOperationResult withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + @JsonAnySetter + void withAdditionalProperties(String key, Object value) { + if (additionalProperties == null) { + additionalProperties = new HashMap<>(); + } + additionalProperties.put(key, value); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIntegrationRuntimeStatus.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIntegrationRuntimeStatus.java new file mode 100644 index 0000000000000..ca14f7edc96c6 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedIntegrationRuntimeStatus.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; + +/** Managed integration runtime status. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("Managed") +@JsonFlatten +@Immutable +public class ManagedIntegrationRuntimeStatus extends IntegrationRuntimeStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedIntegrationRuntimeStatus.class); + + /* + * The time at which the integration runtime was created, in ISO8601 + * format. + */ + @JsonProperty(value = "typeProperties.createTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createTime; + + /* + * The list of nodes for managed integration runtime. + */ + @JsonProperty(value = "typeProperties.nodes", access = JsonProperty.Access.WRITE_ONLY) + private List nodes; + + /* + * The errors that occurred on this integration runtime. + */ + @JsonProperty(value = "typeProperties.otherErrors", access = JsonProperty.Access.WRITE_ONLY) + private List otherErrors; + + /* + * The last operation result that occurred on this integration runtime. + */ + @JsonProperty(value = "typeProperties.lastOperation", access = JsonProperty.Access.WRITE_ONLY) + private ManagedIntegrationRuntimeOperationResult lastOperation; + + /** + * Get the createTime property: The time at which the integration runtime was created, in ISO8601 format. + * + * @return the createTime value. + */ + public OffsetDateTime createTime() { + return this.createTime; + } + + /** + * Get the nodes property: The list of nodes for managed integration runtime. + * + * @return the nodes value. + */ + public List nodes() { + return this.nodes; + } + + /** + * Get the otherErrors property: The errors that occurred on this integration runtime. + * + * @return the otherErrors value. + */ + public List otherErrors() { + return this.otherErrors; + } + + /** + * Get the lastOperation property: The last operation result that occurred on this integration runtime. + * + * @return the lastOperation value. + */ + public ManagedIntegrationRuntimeOperationResult lastOperation() { + return this.lastOperation; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (nodes() != null) { + nodes().forEach(e -> e.validate()); + } + if (otherErrors() != null) { + otherErrors().forEach(e -> e.validate()); + } + if (lastOperation() != null) { + lastOperation().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedVirtualNetworkSettings.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedVirtualNetworkSettings.java new file mode 100644 index 0000000000000..5c89b3b934d8a --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagedVirtualNetworkSettings.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Managed Virtual Network Settings. */ +@Fluent +public final class ManagedVirtualNetworkSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedVirtualNetworkSettings.class); + + /* + * 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 the preventDataExfiltration property: Prevent Data Exfiltration. + * + * @return the preventDataExfiltration value. + */ + public Boolean preventDataExfiltration() { + return this.preventDataExfiltration; + } + + /** + * Set the preventDataExfiltration property: 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 the linkedAccessCheckOnTargetResource property: Linked Access Check On Target Resource. + * + * @return the linkedAccessCheckOnTargetResource value. + */ + public Boolean linkedAccessCheckOnTargetResource() { + return this.linkedAccessCheckOnTargetResource; + } + + /** + * Set the linkedAccessCheckOnTargetResource property: 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 the allowedAadTenantIdsForLinking property: Allowed Aad Tenant Ids For Linking. + * + * @return the allowedAadTenantIdsForLinking value. + */ + public List allowedAadTenantIdsForLinking() { + return this.allowedAadTenantIdsForLinking; + } + + /** + * Set the allowedAadTenantIdsForLinking property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagementOperationState.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagementOperationState.java new file mode 100644 index 0000000000000..0ca5b66833587 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ManagementOperationState.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagementOperationState. */ +public final class ManagementOperationState extends ExpandableStringEnum { + /** Static value Pending for ManagementOperationState. */ + public static final ManagementOperationState PENDING = fromString("Pending"); + + /** Static value InProgress for ManagementOperationState. */ + public static final ManagementOperationState IN_PROGRESS = fromString("InProgress"); + + /** Static value Succeeded for ManagementOperationState. */ + public static final ManagementOperationState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ManagementOperationState. */ + public static final ManagementOperationState FAILED = fromString("Failed"); + + /** Static value CancelInProgress for ManagementOperationState. */ + public static final ManagementOperationState CANCEL_IN_PROGRESS = fromString("CancelInProgress"); + + /** Static value Cancelled for ManagementOperationState. */ + public static final ManagementOperationState CANCELLED = fromString("Cancelled"); + + /** + * Creates or finds a ManagementOperationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagementOperationState. + */ + @JsonCreator + public static ManagementOperationState fromString(String name) { + return fromString(name, ManagementOperationState.class); + } + + /** @return known ManagementOperationState values. */ + public static Collection values() { + return values(ManagementOperationState.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/MetadataSyncConfig.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/MetadataSyncConfig.java new file mode 100644 index 0000000000000..60b26c8d59f74 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/MetadataSyncConfig.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.MetadataSyncConfigInner; + +/** An immutable client-side representation of MetadataSyncConfig. */ +public interface MetadataSyncConfig { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the enabled property: Indicates whether the metadata sync is enabled or disabled. + * + * @return the enabled value. + */ + Boolean enabled(); + + /** + * Gets the syncIntervalInMinutes property: The Sync Interval in minutes. + * + * @return the syncIntervalInMinutes value. + */ + Integer syncIntervalInMinutes(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.MetadataSyncConfigInner object. + * + * @return the inner object. + */ + MetadataSyncConfigInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/NodeSize.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/NodeSize.java new file mode 100644 index 0000000000000..884833d40e482 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/NodeSize.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NodeSize. */ +public final class NodeSize extends ExpandableStringEnum { + /** Static value None for NodeSize. */ + public static final NodeSize NONE = fromString("None"); + + /** Static value Small for NodeSize. */ + public static final NodeSize SMALL = fromString("Small"); + + /** Static value Medium for NodeSize. */ + public static final NodeSize MEDIUM = fromString("Medium"); + + /** Static value Large for NodeSize. */ + public static final NodeSize LARGE = fromString("Large"); + + /** Static value XLarge for NodeSize. */ + public static final NodeSize XLARGE = fromString("XLarge"); + + /** 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. + * @return the corresponding NodeSize. + */ + @JsonCreator + public static NodeSize fromString(String name) { + return fromString(name, NodeSize.class); + } + + /** @return known NodeSize values. */ + public static Collection values() { + return values(NodeSize.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/NodeSizeFamily.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/NodeSizeFamily.java new file mode 100644 index 0000000000000..3a99921b144ed --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/NodeSizeFamily.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NodeSizeFamily. */ +public final class NodeSizeFamily extends ExpandableStringEnum { + /** Static value None for NodeSizeFamily. */ + public static final NodeSizeFamily NONE = fromString("None"); + + /** Static value MemoryOptimized for NodeSizeFamily. */ + public static final NodeSizeFamily MEMORY_OPTIMIZED = fromString("MemoryOptimized"); + + /** + * Creates or finds a NodeSizeFamily from its string representation. + * + * @param name a name to look for. + * @return the corresponding NodeSizeFamily. + */ + @JsonCreator + public static NodeSizeFamily fromString(String name) { + return fromString(name, NodeSizeFamily.class); + } + + /** @return known NodeSizeFamily values. */ + public static Collection values() { + return values(NodeSizeFamily.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OperationMetaLogSpecification.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OperationMetaLogSpecification.java new file mode 100644 index 0000000000000..cb64f8742c62c --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OperationMetaLogSpecification.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** What is this?. */ +@Fluent +public final class OperationMetaLogSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationMetaLogSpecification.class); + + /* + * Log display name + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Time range the log covers + */ + @JsonProperty(value = "blobDuration") + private String blobDuration; + + /* + * Log unique name + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the displayName property: Log display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Log display name. + * + * @param displayName the displayName value to set. + * @return the OperationMetaLogSpecification object itself. + */ + public OperationMetaLogSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the blobDuration property: Time range the log covers. + * + * @return the blobDuration value. + */ + public String blobDuration() { + return this.blobDuration; + } + + /** + * Set the blobDuration property: Time range the log covers. + * + * @param blobDuration the blobDuration value to set. + * @return the OperationMetaLogSpecification object itself. + */ + public OperationMetaLogSpecification withBlobDuration(String blobDuration) { + this.blobDuration = blobDuration; + return this; + } + + /** + * Get the name property: Log unique name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Log unique name. + * + * @param name the name value to set. + * @return the OperationMetaLogSpecification object itself. + */ + public OperationMetaLogSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OperationMetaMetricDimensionSpecification.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OperationMetaMetricDimensionSpecification.java new file mode 100644 index 0000000000000..563e1603d53b3 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OperationMetaMetricDimensionSpecification.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** What is this?. */ +@Fluent +public final class OperationMetaMetricDimensionSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationMetaMetricDimensionSpecification.class); + + /* + * Dimension display name + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Dimension unique name + */ + @JsonProperty(value = "name") + private String name; + + /* + * Whether this metric should be exported for Shoebox + */ + @JsonProperty(value = "toBeExportedForShoebox") + private Boolean toBeExportedForShoebox; + + /** + * Get the displayName property: Dimension display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Dimension display name. + * + * @param displayName the displayName value to set. + * @return the OperationMetaMetricDimensionSpecification object itself. + */ + public OperationMetaMetricDimensionSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the name property: Dimension unique name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Dimension unique name. + * + * @param name the name value to set. + * @return the OperationMetaMetricDimensionSpecification object itself. + */ + public OperationMetaMetricDimensionSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the toBeExportedForShoebox property: Whether this metric should be exported for Shoebox. + * + * @return the toBeExportedForShoebox value. + */ + public Boolean toBeExportedForShoebox() { + return this.toBeExportedForShoebox; + } + + /** + * Set the toBeExportedForShoebox property: Whether this metric should be exported for Shoebox. + * + * @param toBeExportedForShoebox the toBeExportedForShoebox value to set. + * @return the OperationMetaMetricDimensionSpecification object itself. + */ + public OperationMetaMetricDimensionSpecification withToBeExportedForShoebox(Boolean toBeExportedForShoebox) { + this.toBeExportedForShoebox = toBeExportedForShoebox; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OperationMetaMetricSpecification.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OperationMetaMetricSpecification.java new file mode 100644 index 0000000000000..0548c30ab028d --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OperationMetaMetricSpecification.java @@ -0,0 +1,315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** What is this?. */ +@Fluent +public final class OperationMetaMetricSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationMetaMetricSpecification.class); + + /* + * The source MDM namespace + */ + @JsonProperty(value = "sourceMdmNamespace") + private String sourceMdmNamespace; + + /* + * Metric display name + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Metric unique name + */ + @JsonProperty(value = "name") + private String name; + + /* + * Metric aggregation type + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /* + * Metric description + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /* + * The source MDM account + */ + @JsonProperty(value = "sourceMdmAccount") + private String sourceMdmAccount; + + /* + * Whether the regional MDM account is enabled + */ + @JsonProperty(value = "enableRegionalMdmAccount") + private Boolean enableRegionalMdmAccount; + + /* + * Metric units + */ + @JsonProperty(value = "unit") + private String unit; + + /* + * Metric dimensions + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /* + * Whether the metric supports instance-level aggregation + */ + @JsonProperty(value = "supportsInstanceLevelAggregation") + private Boolean supportsInstanceLevelAggregation; + + /* + * Metric filter + */ + @JsonProperty(value = "metricFilterPattern") + private String metricFilterPattern; + + /** + * Get the sourceMdmNamespace property: The source MDM namespace. + * + * @return the sourceMdmNamespace value. + */ + public String sourceMdmNamespace() { + return this.sourceMdmNamespace; + } + + /** + * Set the sourceMdmNamespace property: The source MDM namespace. + * + * @param sourceMdmNamespace the sourceMdmNamespace value to set. + * @return the OperationMetaMetricSpecification object itself. + */ + public OperationMetaMetricSpecification withSourceMdmNamespace(String sourceMdmNamespace) { + this.sourceMdmNamespace = sourceMdmNamespace; + return this; + } + + /** + * Get the displayName property: Metric display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Metric display name. + * + * @param displayName the displayName value to set. + * @return the OperationMetaMetricSpecification object itself. + */ + public OperationMetaMetricSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the name property: Metric unique name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Metric unique name. + * + * @param name the name value to set. + * @return the OperationMetaMetricSpecification object itself. + */ + public OperationMetaMetricSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the aggregationType property: Metric aggregation type. + * + * @return the aggregationType value. + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set the aggregationType property: Metric aggregation type. + * + * @param aggregationType the aggregationType value to set. + * @return the OperationMetaMetricSpecification object itself. + */ + public OperationMetaMetricSpecification withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get the displayDescription property: Metric description. + * + * @return the displayDescription value. + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set the displayDescription property: Metric description. + * + * @param displayDescription the displayDescription value to set. + * @return the OperationMetaMetricSpecification object itself. + */ + public OperationMetaMetricSpecification withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get the sourceMdmAccount property: The source MDM account. + * + * @return the sourceMdmAccount value. + */ + public String sourceMdmAccount() { + return this.sourceMdmAccount; + } + + /** + * Set the sourceMdmAccount property: The source MDM account. + * + * @param sourceMdmAccount the sourceMdmAccount value to set. + * @return the OperationMetaMetricSpecification object itself. + */ + public OperationMetaMetricSpecification withSourceMdmAccount(String sourceMdmAccount) { + this.sourceMdmAccount = sourceMdmAccount; + return this; + } + + /** + * Get the enableRegionalMdmAccount property: Whether the regional MDM account is enabled. + * + * @return the enableRegionalMdmAccount value. + */ + public Boolean enableRegionalMdmAccount() { + return this.enableRegionalMdmAccount; + } + + /** + * Set the enableRegionalMdmAccount property: Whether the regional MDM account is enabled. + * + * @param enableRegionalMdmAccount the enableRegionalMdmAccount value to set. + * @return the OperationMetaMetricSpecification object itself. + */ + public OperationMetaMetricSpecification withEnableRegionalMdmAccount(Boolean enableRegionalMdmAccount) { + this.enableRegionalMdmAccount = enableRegionalMdmAccount; + return this; + } + + /** + * Get the unit property: Metric units. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: Metric units. + * + * @param unit the unit value to set. + * @return the OperationMetaMetricSpecification object itself. + */ + public OperationMetaMetricSpecification withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the dimensions property: Metric dimensions. + * + * @return the dimensions value. + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: Metric dimensions. + * + * @param dimensions the dimensions value to set. + * @return the OperationMetaMetricSpecification object itself. + */ + public OperationMetaMetricSpecification withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get the supportsInstanceLevelAggregation property: Whether the metric supports instance-level aggregation. + * + * @return the supportsInstanceLevelAggregation value. + */ + public Boolean supportsInstanceLevelAggregation() { + return this.supportsInstanceLevelAggregation; + } + + /** + * Set the supportsInstanceLevelAggregation property: Whether the metric supports instance-level aggregation. + * + * @param supportsInstanceLevelAggregation the supportsInstanceLevelAggregation value to set. + * @return the OperationMetaMetricSpecification object itself. + */ + public OperationMetaMetricSpecification withSupportsInstanceLevelAggregation( + Boolean supportsInstanceLevelAggregation) { + this.supportsInstanceLevelAggregation = supportsInstanceLevelAggregation; + return this; + } + + /** + * Get the metricFilterPattern property: Metric filter. + * + * @return the metricFilterPattern value. + */ + public String metricFilterPattern() { + return this.metricFilterPattern; + } + + /** + * Set the metricFilterPattern property: Metric filter. + * + * @param metricFilterPattern the metricFilterPattern value to set. + * @return the OperationMetaMetricSpecification object itself. + */ + public OperationMetaMetricSpecification withMetricFilterPattern(String metricFilterPattern) { + this.metricFilterPattern = metricFilterPattern; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dimensions() != null) { + dimensions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OperationMetaServiceSpecification.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OperationMetaServiceSpecification.java new file mode 100644 index 0000000000000..c003065613148 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OperationMetaServiceSpecification.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** What is this?. */ +@Fluent +public final class OperationMetaServiceSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationMetaServiceSpecification.class); + + /* + * Service metric specifications + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /* + * Service log specifications + */ + @JsonProperty(value = "logSpecifications") + private List logSpecifications; + + /** + * Get the metricSpecifications property: Service metric specifications. + * + * @return the metricSpecifications value. + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set the metricSpecifications property: Service metric specifications. + * + * @param metricSpecifications the metricSpecifications value to set. + * @return the OperationMetaServiceSpecification object itself. + */ + public OperationMetaServiceSpecification withMetricSpecifications( + List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + + /** + * Get the logSpecifications property: Service log specifications. + * + * @return the logSpecifications value. + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Set the logSpecifications property: Service log specifications. + * + * @param logSpecifications the logSpecifications value to set. + * @return the OperationMetaServiceSpecification object itself. + */ + public OperationMetaServiceSpecification withLogSpecifications( + List logSpecifications) { + this.logSpecifications = logSpecifications; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metricSpecifications() != null) { + metricSpecifications().forEach(e -> e.validate()); + } + if (logSpecifications() != null) { + logSpecifications().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OperationResource.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OperationResource.java new file mode 100644 index 0000000000000..68f2870e0d8cf --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OperationResource.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.synapse.fluent.models.OperationResourceInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of OperationResource. */ +public interface OperationResource { + /** + * Gets the id property: Operation ID. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Operation name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the status property: Operation status. + * + * @return the status value. + */ + OperationStatus status(); + + /** + * Gets the properties property: Operation properties. + * + * @return the properties value. + */ + Object properties(); + + /** + * Gets the error property: Errors from the operation. + * + * @return the error value. + */ + ManagementError error(); + + /** + * Gets the startTime property: Operation start time. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: Operation start time. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the percentComplete property: Completion percentage of the operation. + * + * @return the percentComplete value. + */ + Float percentComplete(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.OperationResourceInner object. + * + * @return the inner object. + */ + OperationResourceInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OperationStatus.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OperationStatus.java new file mode 100644 index 0000000000000..6255888db6a89 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/OperationStatus.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for OperationStatus. */ +public final class OperationStatus extends ExpandableStringEnum { + /** Static value InProgress for OperationStatus. */ + public static final OperationStatus IN_PROGRESS = fromString("InProgress"); + + /** Static value Succeeded for OperationStatus. */ + public static final OperationStatus SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for OperationStatus. */ + public static final OperationStatus FAILED = fromString("Failed"); + + /** Static value Canceled for OperationStatus. */ + public static final OperationStatus CANCELED = fromString("Canceled"); + + /** + * Creates or finds a OperationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationStatus. + */ + @JsonCreator + public static OperationStatus fromString(String name) { + return fromString(name, OperationStatus.class); + } + + /** @return known OperationStatus values. */ + public static Collection values() { + return values(OperationStatus.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Operations.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Operations.java new file mode 100644 index 0000000000000..73610d744956d --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Operations.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.util.List; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Check whether a workspace name is available. + * + * @param request The check request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a response saying whether the workspace name is available. + */ + CheckNameAvailabilityResponse checkNameAvailability(CheckNameAvailabilityRequest request); + + /** + * Check whether a workspace name is available. + * + * @param request The check request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a response saying whether the workspace name is available. + */ + Response checkNameAvailabilityWithResponse( + CheckNameAvailabilityRequest request, Context context); + + /** + * Get all available operations. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available operations. + */ + List list(); + + /** + * Get all available operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all available operations. + */ + Response> listWithResponse(Context context); + + /** + * 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. + * @param operationId Operation ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void getLocationHeaderResult(String resourceGroupName, String workspaceName, String operationId); + + /** + * 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. + * @param operationId Operation ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of an operation. + */ + Response getLocationHeaderResultWithResponse( + String resourceGroupName, String workspaceName, String operationId, Context context); + + /** + * 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. + * @param operationId Operation ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an operation. + */ + OperationResource getAzureAsyncHeaderResult(String resourceGroupName, String workspaceName, String operationId); + + /** + * 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. + * @param operationId Operation ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an operation. + */ + Response getAzureAsyncHeaderResultWithResponse( + String resourceGroupName, String workspaceName, String operationId, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpoint.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpoint.java new file mode 100644 index 0000000000000..f0c100126a3fc --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpoint.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Private endpoint details. */ +@Immutable +public final class PrivateEndpoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpoint.class); + + /* + * Resource id of the private endpoint. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id property: Resource id of the private endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnection.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnection.java new file mode 100644 index 0000000000000..08911523845ba --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnection.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.PrivateEndpointConnectionInner; + +/** An immutable client-side representation of PrivateEndpointConnection. */ +public interface PrivateEndpointConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the privateEndpoint property: The private endpoint which the connection belongs to. + * + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * Gets the privateLinkServiceConnectionState property: Connection state of the private endpoint connection. + * + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * Gets the provisioningState property: Provisioning state of the private endpoint connection. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.PrivateEndpointConnectionInner object. + * + * @return the inner object. + */ + PrivateEndpointConnectionInner innerModel(); + + /** The entirety of the PrivateEndpointConnection definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The PrivateEndpointConnection definition stages. */ + interface DefinitionStages { + /** The first stage of the PrivateEndpointConnection definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the PrivateEndpointConnection definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * 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 PrivateEndpointConnection definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithPrivateEndpoint, DefinitionStages.WithPrivateLinkServiceConnectionState { + /** + * Executes the create request. + * + * @return the created resource. + */ + PrivateEndpointConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PrivateEndpointConnection create(Context context); + } + /** The stage of the PrivateEndpointConnection definition allowing to specify privateEndpoint. */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The private endpoint which the connection belongs to.. + * + * @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 the privateLinkServiceConnectionState property: Connection state of the private endpoint + * connection.. + * + * @param privateLinkServiceConnectionState Connection state of the private endpoint connection. + * @return the next definition stage. + */ + WithCreate withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionForPrivateLinkHub.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionForPrivateLinkHub.java new file mode 100644 index 0000000000000..ec98b90c5dd3f --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionForPrivateLinkHub.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.PrivateEndpointConnectionForPrivateLinkHubInner; + +/** An immutable client-side representation of PrivateEndpointConnectionForPrivateLinkHub. */ +public interface PrivateEndpointConnectionForPrivateLinkHub { + /** + * Gets the id property: The id property. + * + * @return the id value. + */ + String id(); + + /** + * Gets the properties property: Properties of a private endpoint connection. + * + * @return the properties value. + */ + PrivateEndpointConnectionProperties properties(); + + /** + * Gets the name property: The name property. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type property. + * + * @return the type value. + */ + String type(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.PrivateEndpointConnectionForPrivateLinkHubInner + * object. + * + * @return the inner object. + */ + PrivateEndpointConnectionForPrivateLinkHubInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionForPrivateLinkHubBasic.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionForPrivateLinkHubBasic.java new file mode 100644 index 0000000000000..06b2c73194725 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionForPrivateLinkHubBasic.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Private Endpoint Connection For Private Link Hub - Basic. */ +@JsonFlatten +@Fluent +public class PrivateEndpointConnectionForPrivateLinkHubBasic { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionForPrivateLinkHubBasic.class); + + /* + * 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 the id property: identifier. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the privateEndpoint property: The private endpoint which the connection belongs to. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: 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 the privateLinkServiceConnectionState property: Connection state of the private endpoint connection. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: 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 the provisioningState property: Provisioning state of the private endpoint connection. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() != null) { + privateLinkServiceConnectionState().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionForPrivateLinkHubBasicAutoGenerated.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionForPrivateLinkHubBasicAutoGenerated.java new file mode 100644 index 0000000000000..31cf7b8634e58 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionForPrivateLinkHubBasicAutoGenerated.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PrivateEndpointConnectionForPrivateLinkHubBasicAutoGenerated model. */ +@Fluent +public class PrivateEndpointConnectionForPrivateLinkHubBasicAutoGenerated { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(PrivateEndpointConnectionForPrivateLinkHubBasicAutoGenerated.class); + + /* + * The id property. + */ + @JsonProperty(value = "id") + private String id; + + /* + * Properties of a private endpoint connection. + */ + @JsonProperty(value = "properties") + private PrivateEndpointConnectionProperties properties; + + /** + * Get the id property: The id property. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The id property. + * + * @param id the id value to set. + * @return the PrivateEndpointConnectionForPrivateLinkHubBasicAutoGenerated object itself. + */ + public PrivateEndpointConnectionForPrivateLinkHubBasicAutoGenerated withId(String id) { + this.id = id; + return this; + } + + /** + * Get the properties property: Properties of a private endpoint connection. + * + * @return the properties value. + */ + public PrivateEndpointConnectionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of a private endpoint connection. + * + * @param properties the properties value to set. + * @return the PrivateEndpointConnectionForPrivateLinkHubBasicAutoGenerated object itself. + */ + public PrivateEndpointConnectionForPrivateLinkHubBasicAutoGenerated withProperties( + PrivateEndpointConnectionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse.java new file mode 100644 index 0000000000000..034ee69a2e8e3 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.PrivateEndpointConnectionForPrivateLinkHubInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse model. */ +@Fluent +public final class PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse { + @JsonIgnore + private final ClientLogger logger = + new ClientLogger(PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse.class); + + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The nextLink property. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse object itself. + */ + public PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse withValue( + List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse object itself. + */ + public PrivateEndpointConnectionForPrivateLinkHubResourceCollectionResponse withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionList.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionList.java new file mode 100644 index 0000000000000..8b098b53af4a4 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionList.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.PrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private endpoint connections. */ +@Immutable +public final class PrivateEndpointConnectionList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionList.class); + + /* + * Array of results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionProperties.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 0000000000000..1f63a05d0ad8e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionProperties.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of a private endpoint connection. */ +@Fluent +public final class PrivateEndpointConnectionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionProperties.class); + + /* + * The private endpoint which the connection belongs to. + */ + @JsonProperty(value = "privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /* + * Connection state of the private endpoint connection. + */ + @JsonProperty(value = "privateLinkServiceConnectionState") + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * Provisioning state of the private endpoint connection. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get the privateEndpoint property: The private endpoint which the connection belongs to. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: The private endpoint which the connection belongs to. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: Connection state of the private endpoint connection. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: Connection state of the private endpoint connection. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the private endpoint connection. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() != null) { + privateLinkServiceConnectionState().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnections.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnections.java new file mode 100644 index 0000000000000..d61de4b23d59b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnections.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateEndpointConnections. */ +public interface PrivateEndpointConnections { + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + PrivateEndpointConnection get(String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + OperationResource delete(String resourceGroupName, String workspaceName, String privateEndpointConnectionName); + + /** + * 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 privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + OperationResource delete( + String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of private endpoint connections. + */ + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets a private endpoint connection. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + PrivateEndpointConnection getById(String id); + + /** + * Gets a private endpoint connection. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private endpoint connection. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a private endpoint connection. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + OperationResource deleteById(String id); + + /** + * Delete a private endpoint connection. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + OperationResource deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new PrivateEndpointConnection resource. + * + * @param name resource name. + * @return the first stage of the new PrivateEndpointConnection definition. + */ + PrivateEndpointConnection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionsPrivateLinkHubs.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionsPrivateLinkHubs.java new file mode 100644 index 0000000000000..af9e58d9a5b8b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateEndpointConnectionsPrivateLinkHubs.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateEndpointConnectionsPrivateLinkHubs. */ +public interface PrivateEndpointConnectionsPrivateLinkHubs { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all PrivateEndpointConnections in the PrivateLinkHub. + */ + PagedIterable list(String resourceGroupName, String privateLinkHubName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all PrivateEndpointConnections in the PrivateLinkHub. + */ + PagedIterable list( + String resourceGroupName, String privateLinkHubName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkHub.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkHub.java new file mode 100644 index 0000000000000..e1bc8de87fc84 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkHub.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.PrivateLinkHubInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of PrivateLinkHub. */ +public interface PrivateLinkHub { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the provisioningState property: PrivateLinkHub provisioning state. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the privateEndpointConnections property: List of private endpoint connections. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.PrivateLinkHubInner object. + * + * @return the inner object. + */ + PrivateLinkHubInner innerModel(); + + /** The entirety of the PrivateLinkHub definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The PrivateLinkHub definition stages. */ + interface DefinitionStages { + /** The first stage of the PrivateLinkHub definition. */ + interface Blank extends WithLocation { + } + /** The stage of the PrivateLinkHub definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the PrivateLinkHub definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the PrivateLinkHub definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProvisioningState { + /** + * Executes the create request. + * + * @return the created resource. + */ + PrivateLinkHub create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PrivateLinkHub create(Context context); + } + /** The stage of the PrivateLinkHub definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the PrivateLinkHub definition allowing to specify provisioningState. */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: PrivateLinkHub provisioning state. + * + * @param provisioningState PrivateLinkHub provisioning state. + * @return the next definition stage. + */ + WithCreate withProvisioningState(String provisioningState); + } + } + /** + * Begins update for the PrivateLinkHub resource. + * + * @return the stage of resource update. + */ + PrivateLinkHub.Update update(); + + /** The template for PrivateLinkHub update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PrivateLinkHub apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PrivateLinkHub apply(Context context); + } + /** The PrivateLinkHub update stages. */ + interface UpdateStages { + /** The stage of the PrivateLinkHub update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PrivateLinkHub refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PrivateLinkHub refresh(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkHubInfoListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkHubInfoListResult.java new file mode 100644 index 0000000000000..c87d740531894 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkHubInfoListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.PrivateLinkHubInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of privateLinkHubs. */ +@Fluent +public final class PrivateLinkHubInfoListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkHubInfoListResult.class); + + /* + * Link to the next page of results + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * List of privateLinkHubs + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the nextLink property: Link to the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to the next page of results. + * + * @param nextLink the nextLink value to set. + * @return the PrivateLinkHubInfoListResult object itself. + */ + public PrivateLinkHubInfoListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: List of privateLinkHubs. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of privateLinkHubs. + * + * @param value the value value to set. + * @return the PrivateLinkHubInfoListResult object itself. + */ + public PrivateLinkHubInfoListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkHubPatchInfo.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkHubPatchInfo.java new file mode 100644 index 0000000000000..da8411b08f9c7 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkHubPatchInfo.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** PrivateLinkHub patch details. */ +@Fluent +public final class PrivateLinkHubPatchInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkHubPatchInfo.class); + + /* + * Resource tags + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the PrivateLinkHubPatchInfo object itself. + */ + public PrivateLinkHubPatchInfo withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkHubPrivateLinkResources.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkHubPrivateLinkResources.java new file mode 100644 index 0000000000000..f829ee7ae25bf --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkHubPrivateLinkResources.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateLinkHubPrivateLinkResources. */ +public interface PrivateLinkHubPrivateLinkResources { + /** + * Get all private link resources for a private link hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName The name of the private link hub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link resources for a private link hub. + */ + PagedIterable list(String resourceGroupName, String privateLinkHubName); + + /** + * Get all private link resources for a private link hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName The name of the private link hub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link resources for a private link hub. + */ + PagedIterable list(String resourceGroupName, String privateLinkHubName, Context context); + + /** + * Get private link resource in private link hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName The name of the private link hub. + * @param privateLinkResourceName The name of the private link resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link resource in private link hub. + */ + PrivateLinkResource get(String resourceGroupName, String privateLinkHubName, String privateLinkResourceName); + + /** + * Get private link resource in private link hub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName The name of the private link hub. + * @param privateLinkResourceName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link resource in private link hub. + */ + Response getWithResponse( + String resourceGroupName, String privateLinkHubName, String privateLinkResourceName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkHubs.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkHubs.java new file mode 100644 index 0000000000000..1c21547fb7635 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkHubs.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateLinkHubs. */ +public interface PrivateLinkHubs { + /** + * Returns a list of privateLinkHubs in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of privateLinkHubs. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Returns a list of privateLinkHubs in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of privateLinkHubs. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a privateLinkHub. + */ + PrivateLinkHub getByResourceGroup(String resourceGroupName, String privateLinkHubName); + + /** + * Gets a privateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a privateLinkHub. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String privateLinkHubName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String privateLinkHubName); + + /** + * Deletes a privateLinkHub. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param privateLinkHubName Name of the privateLinkHub. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String privateLinkHubName, Context context); + + /** + * Returns a list of privateLinkHubs in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of privateLinkHubs. + */ + PagedIterable list(); + + /** + * Returns a list of privateLinkHubs in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of privateLinkHubs. + */ + PagedIterable list(Context context); + + /** + * Gets a privateLinkHub. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a privateLinkHub. + */ + PrivateLinkHub getById(String id); + + /** + * Gets a privateLinkHub. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a privateLinkHub. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a privateLinkHub. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a privateLinkHub. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new PrivateLinkHub resource. + * + * @param name resource name. + * @return the first stage of the new PrivateLinkHub definition. + */ + PrivateLinkHub.DefinitionStages.Blank define(String name); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkResource.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkResource.java new file mode 100644 index 0000000000000..77c7609e22125 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkResource.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.PrivateLinkResourceInner; + +/** An immutable client-side representation of PrivateLinkResource. */ +public interface PrivateLinkResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The private link resource properties. + * + * @return the properties value. + */ + PrivateLinkResourceProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.PrivateLinkResourceInner object. + * + * @return the inner object. + */ + PrivateLinkResourceInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkResourceListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkResourceListResult.java new file mode 100644 index 0000000000000..e693234f70783 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkResourceListResult.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.PrivateLinkResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private link resources. */ +@Immutable +public final class PrivateLinkResourceListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceListResult.class); + + /* + * Array of results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkResourceProperties.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkResourceProperties.java new file mode 100644 index 0000000000000..a37d3fbe01500 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkResourceProperties.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of a private link resource. */ +@Immutable +public final class PrivateLinkResourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceProperties.class); + + /* + * The private link resource group id. + */ + @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * The private link resource required member names. + */ + @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /* + * Required DNS zone names of the the private link resource. + */ + @JsonProperty(value = "requiredZoneNames", access = JsonProperty.Access.WRITE_ONLY) + private List requiredZoneNames; + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the requiredZoneNames property: Required DNS zone names of the the private link resource. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkResources.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkResources.java new file mode 100644 index 0000000000000..910577264be49 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkResources.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateLinkResources. */ +public interface PrivateLinkResources { + /** + * Get all private link resources for a workspaces. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link resources for a workspaces. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Get all private link resources for a workspaces. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all private link resources for a workspaces. + */ + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Get private link resource in workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link resource in workspace. + */ + PrivateLinkResource get(String resourceGroupName, String workspaceName, String privateLinkResourceName); + + /** + * Get private link resource in workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param privateLinkResourceName The name of the private link resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private link resource in workspace. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String privateLinkResourceName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkServiceConnectionState.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkServiceConnectionState.java new file mode 100644 index 0000000000000..5b1f1370fdc2e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PrivateLinkServiceConnectionState.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Connection state details of the private endpoint. */ +@Fluent +public final class PrivateLinkServiceConnectionState { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceConnectionState.class); + + /* + * The private link service connection status. + */ + @JsonProperty(value = "status") + private String status; + + /* + * The private link service connection description. + */ + @JsonProperty(value = "description") + private String description; + + /* + * The actions required for private link service connection. + */ + @JsonProperty(value = "actionsRequired", access = JsonProperty.Access.WRITE_ONLY) + private String actionsRequired; + + /** + * Get the status property: The private link service connection status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: The private link service connection status. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the description property: The private link service connection description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The private link service connection description. + * + * @param description the description value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actionsRequired property: The actions required for private link service connection. + * + * @return the actionsRequired value. + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ProvisioningState.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ProvisioningState.java new file mode 100644 index 0000000000000..cfa54d58adde8 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ProvisioningState.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProvisioningState. */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Provisioning for ProvisioningState. */ + public static final ProvisioningState PROVISIONING = fromString("Provisioning"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value DeleteError for ProvisioningState. */ + public static final ProvisioningState DELETE_ERROR = fromString("DeleteError"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** @return known ProvisioningState values. */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PurviewConfiguration.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PurviewConfiguration.java new file mode 100644 index 0000000000000..61836fb7d6515 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/PurviewConfiguration.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Purview Configuration. */ +@Fluent +public final class PurviewConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PurviewConfiguration.class); + + /* + * Purview Resource ID + */ + @JsonProperty(value = "purviewResourceId") + private String purviewResourceId; + + /** + * Get the purviewResourceId property: Purview Resource ID. + * + * @return the purviewResourceId value. + */ + public String purviewResourceId() { + return this.purviewResourceId; + } + + /** + * Set the purviewResourceId property: Purview Resource ID. + * + * @param purviewResourceId the purviewResourceId value to set. + * @return the PurviewConfiguration object itself. + */ + public PurviewConfiguration withPurviewResourceId(String purviewResourceId) { + this.purviewResourceId = purviewResourceId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/QueryAggregationFunction.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/QueryAggregationFunction.java new file mode 100644 index 0000000000000..aa1ff01161b2b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/QueryAggregationFunction.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for QueryAggregationFunction. */ +public enum QueryAggregationFunction { + /** Enum value min. */ + MIN("min"), + + /** Enum value max. */ + MAX("max"), + + /** Enum value avg. */ + AVG("avg"), + + /** Enum value sum. */ + SUM("sum"); + + /** The actual serialized value for a QueryAggregationFunction instance. */ + private final String value; + + QueryAggregationFunction(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a QueryAggregationFunction instance. + * + * @param value the serialized value to parse. + * @return the parsed QueryAggregationFunction object, or null if unable to parse. + */ + @JsonCreator + public static QueryAggregationFunction fromString(String value) { + QueryAggregationFunction[] items = QueryAggregationFunction.values(); + for (QueryAggregationFunction item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/QueryExecutionType.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/QueryExecutionType.java new file mode 100644 index 0000000000000..44f5f9021ae96 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/QueryExecutionType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for QueryExecutionType. */ +public enum QueryExecutionType { + /** Enum value any. */ + ANY("any"), + + /** Enum value regular. */ + REGULAR("regular"), + + /** Enum value irregular. */ + IRREGULAR("irregular"), + + /** Enum value aborted. */ + ABORTED("aborted"), + + /** Enum value exception. */ + EXCEPTION("exception"); + + /** The actual serialized value for a QueryExecutionType instance. */ + private final String value; + + QueryExecutionType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a QueryExecutionType instance. + * + * @param value the serialized value to parse. + * @return the parsed QueryExecutionType object, or null if unable to parse. + */ + @JsonCreator + public static QueryExecutionType fromString(String value) { + QueryExecutionType[] items = QueryExecutionType.values(); + for (QueryExecutionType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/QueryInterval.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/QueryInterval.java new file mode 100644 index 0000000000000..5676ef690a5b0 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/QueryInterval.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** A database query. */ +@Immutable +public final class QueryInterval { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QueryInterval.class); + + /* + * The start time of the measurement interval (ISO8601 format). + */ + @JsonProperty(value = "intervalStartTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime intervalStartTime; + + /* + * The number of times the query was executed during this interval. + */ + @JsonProperty(value = "executionCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer executionCount; + + /* + * The list of query metrics during this interval. + */ + @JsonProperty(value = "metrics", access = JsonProperty.Access.WRITE_ONLY) + private List metrics; + + /** + * Get the intervalStartTime property: The start time of the measurement interval (ISO8601 format). + * + * @return the intervalStartTime value. + */ + public OffsetDateTime intervalStartTime() { + return this.intervalStartTime; + } + + /** + * Get the executionCount property: The number of times the query was executed during this interval. + * + * @return the executionCount value. + */ + public Integer executionCount() { + return this.executionCount; + } + + /** + * Get the metrics property: The list of query metrics during this interval. + * + * @return the metrics value. + */ + public List metrics() { + return this.metrics; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metrics() != null) { + metrics().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/QueryMetric.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/QueryMetric.java new file mode 100644 index 0000000000000..1df24cae9ed16 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/QueryMetric.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A database query. */ +@Immutable +public final class QueryMetric { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QueryMetric.class); + + /* + * The name of the metric + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * The name of the metric for display in user interface + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /* + * The unit of measurement + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private QueryMetricUnit unit; + + /* + * The measured value + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private Double value; + + /** + * Get the name property: The name of the metric. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the displayName property: The name of the metric for display in user interface. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the unit property: The unit of measurement. + * + * @return the unit value. + */ + public QueryMetricUnit unit() { + return this.unit; + } + + /** + * Get the value property: The measured value. + * + * @return the value value. + */ + public Double value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/QueryMetricUnit.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/QueryMetricUnit.java new file mode 100644 index 0000000000000..6a7675d3dac5e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/QueryMetricUnit.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for QueryMetricUnit. */ +public enum QueryMetricUnit { + /** Enum value percentage. */ + PERCENTAGE("percentage"), + + /** Enum value KB. */ + KB("KB"), + + /** Enum value microseconds. */ + MICROSECONDS("microseconds"); + + /** The actual serialized value for a QueryMetricUnit instance. */ + private final String value; + + QueryMetricUnit(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a QueryMetricUnit instance. + * + * @param value the serialized value to parse. + * @return the parsed QueryMetricUnit object, or null if unable to parse. + */ + @JsonCreator + public static QueryMetricUnit fromString(String value) { + QueryMetricUnit[] items = QueryMetricUnit.values(); + for (QueryMetricUnit item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/QueryObservedMetricType.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/QueryObservedMetricType.java new file mode 100644 index 0000000000000..6832cf4901ba3 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/QueryObservedMetricType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for QueryObservedMetricType. */ +public enum QueryObservedMetricType { + /** Enum value cpu. */ + CPU("cpu"), + + /** Enum value io. */ + IO("io"), + + /** Enum value logio. */ + LOGIO("logio"), + + /** Enum value duration. */ + DURATION("duration"), + + /** Enum value executionCount. */ + EXECUTION_COUNT("executionCount"); + + /** The actual serialized value for a QueryObservedMetricType instance. */ + private final String value; + + QueryObservedMetricType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a QueryObservedMetricType instance. + * + * @param value the serialized value to parse. + * @return the parsed QueryObservedMetricType object, or null if unable to parse. + */ + @JsonCreator + public static QueryObservedMetricType fromString(String value) { + QueryObservedMetricType[] items = QueryObservedMetricType.values(); + for (QueryObservedMetricType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/QueryStatistic.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/QueryStatistic.java new file mode 100644 index 0000000000000..9a2371a914b32 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/QueryStatistic.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A database query. */ +@Immutable +public final class QueryStatistic { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QueryStatistic.class); + + /* + * The id of the query + */ + @JsonProperty(value = "queryId", access = JsonProperty.Access.WRITE_ONLY) + private String queryId; + + /* + * The list of query intervals. + */ + @JsonProperty(value = "intervals", access = JsonProperty.Access.WRITE_ONLY) + private List intervals; + + /** + * Get the queryId property: The id of the query. + * + * @return the queryId value. + */ + public String queryId() { + return this.queryId; + } + + /** + * Get the intervals property: The list of query intervals. + * + * @return the intervals value. + */ + public List intervals() { + return this.intervals; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (intervals() != null) { + intervals().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RecommendedSensitivityLabelUpdate.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RecommendedSensitivityLabelUpdate.java new file mode 100644 index 0000000000000..e9a750dfd4229 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RecommendedSensitivityLabelUpdate.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A recommended sensitivity label update operation. */ +@JsonFlatten +@Fluent +public class RecommendedSensitivityLabelUpdate extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecommendedSensitivityLabelUpdate.class); + + /* + * The op property. + */ + @JsonProperty(value = "properties.op") + private RecommendedSensitivityLabelUpdateKind op; + + /* + * Schema name of the column to update. + */ + @JsonProperty(value = "properties.schema") + private String schema; + + /* + * Table name of the column to update. + */ + @JsonProperty(value = "properties.table") + private String table; + + /* + * Column name to update. + */ + @JsonProperty(value = "properties.column") + private String column; + + /** + * Get the op property: The op property. + * + * @return the op value. + */ + public RecommendedSensitivityLabelUpdateKind op() { + return this.op; + } + + /** + * Set the op property: The op property. + * + * @param op the op value to set. + * @return the RecommendedSensitivityLabelUpdate object itself. + */ + public RecommendedSensitivityLabelUpdate withOp(RecommendedSensitivityLabelUpdateKind op) { + this.op = op; + return this; + } + + /** + * Get the schema property: Schema name of the column to update. + * + * @return the schema value. + */ + public String schema() { + return this.schema; + } + + /** + * Set the schema property: Schema name of the column to update. + * + * @param schema the schema value to set. + * @return the RecommendedSensitivityLabelUpdate object itself. + */ + public RecommendedSensitivityLabelUpdate withSchema(String schema) { + this.schema = schema; + return this; + } + + /** + * Get the table property: Table name of the column to update. + * + * @return the table value. + */ + public String table() { + return this.table; + } + + /** + * Set the table property: Table name of the column to update. + * + * @param table the table value to set. + * @return the RecommendedSensitivityLabelUpdate object itself. + */ + public RecommendedSensitivityLabelUpdate withTable(String table) { + this.table = table; + return this; + } + + /** + * Get the column property: Column name to update. + * + * @return the column value. + */ + public String column() { + return this.column; + } + + /** + * Set the column property: Column name to update. + * + * @param column the column value to set. + * @return the RecommendedSensitivityLabelUpdate object itself. + */ + public RecommendedSensitivityLabelUpdate withColumn(String column) { + this.column = column; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RecommendedSensitivityLabelUpdateKind.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RecommendedSensitivityLabelUpdateKind.java new file mode 100644 index 0000000000000..b1ab21a6723d6 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RecommendedSensitivityLabelUpdateKind.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for RecommendedSensitivityLabelUpdateKind. */ +public enum RecommendedSensitivityLabelUpdateKind { + /** Enum value enable. */ + ENABLE("enable"), + + /** Enum value disable. */ + DISABLE("disable"); + + /** The actual serialized value for a RecommendedSensitivityLabelUpdateKind instance. */ + private final String value; + + RecommendedSensitivityLabelUpdateKind(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a RecommendedSensitivityLabelUpdateKind instance. + * + * @param value the serialized value to parse. + * @return the parsed RecommendedSensitivityLabelUpdateKind object, or null if unable to parse. + */ + @JsonCreator + public static RecommendedSensitivityLabelUpdateKind fromString(String value) { + RecommendedSensitivityLabelUpdateKind[] items = RecommendedSensitivityLabelUpdateKind.values(); + for (RecommendedSensitivityLabelUpdateKind item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RecommendedSensitivityLabelUpdateList.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RecommendedSensitivityLabelUpdateList.java new file mode 100644 index 0000000000000..66c71667862c9 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RecommendedSensitivityLabelUpdateList.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of recommended sensitivity label update operations. */ +@Fluent +public final class RecommendedSensitivityLabelUpdateList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecommendedSensitivityLabelUpdateList.class); + + /* + * The operations property. + */ + @JsonProperty(value = "operations") + private List operations; + + /** + * Get the operations property: The operations property. + * + * @return the operations value. + */ + public List operations() { + return this.operations; + } + + /** + * Set the operations property: The operations property. + * + * @param operations the operations value to set. + * @return the RecommendedSensitivityLabelUpdateList object itself. + */ + public RecommendedSensitivityLabelUpdateList withOperations(List operations) { + this.operations = operations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (operations() != null) { + operations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RecoverableSqlPool.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RecoverableSqlPool.java new file mode 100644 index 0000000000000..2e511cfe0aa6e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RecoverableSqlPool.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.RecoverableSqlPoolInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of RecoverableSqlPool. */ +public interface RecoverableSqlPool { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the edition property: The edition of the database. + * + * @return the edition value. + */ + String edition(); + + /** + * Gets the serviceLevelObjective property: The service level objective name of the database. + * + * @return the serviceLevelObjective value. + */ + String serviceLevelObjective(); + + /** + * Gets the elasticPoolName property: The elastic pool name of the database. + * + * @return the elasticPoolName value. + */ + String elasticPoolName(); + + /** + * Gets the lastAvailableBackupDate property: The last available backup date of the database (ISO8601 format). + * + * @return the lastAvailableBackupDate value. + */ + OffsetDateTime lastAvailableBackupDate(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.RecoverableSqlPoolInner object. + * + * @return the inner object. + */ + RecoverableSqlPoolInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RecoverableSqlPoolListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RecoverableSqlPoolListResult.java new file mode 100644 index 0000000000000..9700ff664f408 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RecoverableSqlPoolListResult.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.RecoverableSqlPoolInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response to a list recoverable sql pools request. */ +@Immutable +public final class RecoverableSqlPoolListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RecoverableSqlPoolListResult.class); + + /* + * A list of recoverable sql pool + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: A list of recoverable sql pool. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReplaceAllFirewallRulesOperationResponse.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReplaceAllFirewallRulesOperationResponse.java new file mode 100644 index 0000000000000..a9eb8b54b515c --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReplaceAllFirewallRulesOperationResponse.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.ReplaceAllFirewallRulesOperationResponseInner; + +/** An immutable client-side representation of ReplaceAllFirewallRulesOperationResponse. */ +public interface ReplaceAllFirewallRulesOperationResponse { + /** + * Gets the operationId property: The operation ID. + * + * @return the operationId value. + */ + String operationId(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.ReplaceAllFirewallRulesOperationResponseInner + * object. + * + * @return the inner object. + */ + ReplaceAllFirewallRulesOperationResponseInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReplaceAllIpFirewallRulesRequest.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReplaceAllIpFirewallRulesRequest.java new file mode 100644 index 0000000000000..3355c642cdad3 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReplaceAllIpFirewallRulesRequest.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Replace all IP firewall rules request. */ +@Fluent +public final class ReplaceAllIpFirewallRulesRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplaceAllIpFirewallRulesRequest.class); + + /* + * IP firewall rule properties + */ + @JsonProperty(value = "ipFirewallRules") + private Map ipFirewallRules; + + /** + * Get the ipFirewallRules property: IP firewall rule properties. + * + * @return the ipFirewallRules value. + */ + public Map ipFirewallRules() { + return this.ipFirewallRules; + } + + /** + * Set the ipFirewallRules property: IP firewall rule properties. + * + * @param ipFirewallRules the ipFirewallRules value to set. + * @return the ReplaceAllIpFirewallRulesRequest object itself. + */ + public ReplaceAllIpFirewallRulesRequest withIpFirewallRules(Map ipFirewallRules) { + this.ipFirewallRules = ipFirewallRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipFirewallRules() != null) { + ipFirewallRules() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReplicationLink.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReplicationLink.java new file mode 100644 index 0000000000000..e362805d954e7 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReplicationLink.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.ReplicationLinkInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of ReplicationLink. */ +public interface ReplicationLink { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: Location of the workspace that contains this firewall rule. + * + * @return the location value. + */ + String location(); + + /** + * Gets the isTerminationAllowed property: Legacy value indicating whether termination is allowed. Currently always + * returns true. + * + * @return the isTerminationAllowed value. + */ + Boolean isTerminationAllowed(); + + /** + * Gets the replicationMode property: Replication mode of this replication link. + * + * @return the replicationMode value. + */ + String replicationMode(); + + /** + * Gets the partnerServer property: The name of the workspace hosting the partner Sql pool. + * + * @return the partnerServer value. + */ + String partnerServer(); + + /** + * Gets the partnerDatabase property: The name of the partner Sql pool. + * + * @return the partnerDatabase value. + */ + String partnerDatabase(); + + /** + * Gets the partnerLocation property: The Azure Region of the partner Sql pool. + * + * @return the partnerLocation value. + */ + String partnerLocation(); + + /** + * Gets the role property: The role of the Sql pool in the replication link. + * + * @return the role value. + */ + ReplicationRole role(); + + /** + * Gets the partnerRole property: The role of the partner Sql pool in the replication link. + * + * @return the partnerRole value. + */ + ReplicationRole partnerRole(); + + /** + * Gets the startTime property: The start time for the replication link. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the percentComplete property: The percentage of seeding complete for the replication link. + * + * @return the percentComplete value. + */ + Integer percentComplete(); + + /** + * Gets the replicationState property: The replication state for the replication link. + * + * @return the replicationState value. + */ + ReplicationState replicationState(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.ReplicationLinkInner object. + * + * @return the inner object. + */ + ReplicationLinkInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReplicationLinkListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReplicationLinkListResult.java new file mode 100644 index 0000000000000..6261e708aea4b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReplicationLinkListResult.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.ReplicationLinkInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Represents the response to a List Sql pool replication link request. */ +@Fluent +public final class ReplicationLinkListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicationLinkListResult.class); + + /* + * The list of Sql pool replication links housed in the Sql pool. + */ + @JsonProperty(value = "value") + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of Sql pool replication links housed in the Sql pool. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of Sql pool replication links housed in the Sql pool. + * + * @param value the value value to set. + * @return the ReplicationLinkListResult object itself. + */ + public ReplicationLinkListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReplicationRole.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReplicationRole.java new file mode 100644 index 0000000000000..d43854acd35ef --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReplicationRole.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ReplicationRole. */ +public enum ReplicationRole { + /** Enum value Primary. */ + PRIMARY("Primary"), + + /** Enum value Secondary. */ + SECONDARY("Secondary"), + + /** Enum value NonReadableSecondary. */ + NON_READABLE_SECONDARY("NonReadableSecondary"), + + /** Enum value Source. */ + SOURCE("Source"), + + /** Enum value Copy. */ + COPY("Copy"); + + /** The actual serialized value for a ReplicationRole instance. */ + private final String value; + + ReplicationRole(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ReplicationRole instance. + * + * @param value the serialized value to parse. + * @return the parsed ReplicationRole object, or null if unable to parse. + */ + @JsonCreator + public static ReplicationRole fromString(String value) { + ReplicationRole[] items = ReplicationRole.values(); + for (ReplicationRole item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReplicationState.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReplicationState.java new file mode 100644 index 0000000000000..b20732fbb796b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ReplicationState.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ReplicationState. */ +public final class ReplicationState extends ExpandableStringEnum { + /** Static value PENDING for ReplicationState. */ + public static final ReplicationState PENDING = fromString("PENDING"); + + /** Static value SEEDING for ReplicationState. */ + public static final ReplicationState SEEDING = fromString("SEEDING"); + + /** Static value CATCH_UP for ReplicationState. */ + public static final ReplicationState CATCH_UP = fromString("CATCH_UP"); + + /** Static value SUSPENDED for ReplicationState. */ + public static final ReplicationState SUSPENDED = fromString("SUSPENDED"); + + /** + * Creates or finds a ReplicationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ReplicationState. + */ + @JsonCreator + public static ReplicationState fromString(String name) { + return fromString(name, ReplicationState.class); + } + + /** @return known ReplicationState values. */ + public static Collection values() { + return values(ReplicationState.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ResourceIdentityType.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ResourceIdentityType.java new file mode 100644 index 0000000000000..2a45d76f2654b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ResourceIdentityType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for ResourceIdentityType. */ +public enum ResourceIdentityType { + /** Enum value None. */ + NONE("None"), + + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"); + + /** The actual serialized value for a ResourceIdentityType instance. */ + private final String value; + + ResourceIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static ResourceIdentityType fromString(String value) { + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ResourceMoveDefinition.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ResourceMoveDefinition.java new file mode 100644 index 0000000000000..a2095a916bd59 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ResourceMoveDefinition.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Contains the information necessary to perform a resource move (rename). */ +@Fluent +public final class ResourceMoveDefinition { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceMoveDefinition.class); + + /* + * The target ID for the resource + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get the id property: The target ID for the resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The target ID for the resource. + * + * @param id the id value to set. + * @return the ResourceMoveDefinition object itself. + */ + public ResourceMoveDefinition withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property id in model ResourceMoveDefinition")); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RestorableDroppedSqlPool.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RestorableDroppedSqlPool.java new file mode 100644 index 0000000000000..ce89af5ba277a --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RestorableDroppedSqlPool.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.RestorableDroppedSqlPoolInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of RestorableDroppedSqlPool. */ +public interface RestorableDroppedSqlPool { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the databaseName property: The name of the database. + * + * @return the databaseName value. + */ + String databaseName(); + + /** + * Gets the edition property: The edition of the database. + * + * @return the edition value. + */ + String edition(); + + /** + * Gets the maxSizeBytes property: The max size in bytes of the database. + * + * @return the maxSizeBytes value. + */ + String maxSizeBytes(); + + /** + * Gets the serviceLevelObjective property: The service level objective name of the database. + * + * @return the serviceLevelObjective value. + */ + String serviceLevelObjective(); + + /** + * Gets the elasticPoolName property: The elastic pool name of the database. + * + * @return the elasticPoolName value. + */ + String elasticPoolName(); + + /** + * Gets the creationDate property: The creation date of the database (ISO8601 format). + * + * @return the creationDate value. + */ + OffsetDateTime creationDate(); + + /** + * Gets the deletionDate property: The deletion date of the database (ISO8601 format). + * + * @return the deletionDate value. + */ + OffsetDateTime deletionDate(); + + /** + * Gets the earliestRestoreDate property: The earliest restore date of the database (ISO8601 format). + * + * @return the earliestRestoreDate value. + */ + OffsetDateTime earliestRestoreDate(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.RestorableDroppedSqlPoolInner object. + * + * @return the inner object. + */ + RestorableDroppedSqlPoolInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RestorableDroppedSqlPoolListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RestorableDroppedSqlPoolListResult.java new file mode 100644 index 0000000000000..bca780222d05c --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RestorableDroppedSqlPoolListResult.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.RestorableDroppedSqlPoolInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response to a list restorable dropped Sql pools request. */ +@Fluent +public final class RestorableDroppedSqlPoolListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RestorableDroppedSqlPoolListResult.class); + + /* + * A list of restorable dropped Sql pools + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the value property: A list of restorable dropped Sql pools. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of restorable dropped Sql pools. + * + * @param value the value value to set. + * @return the RestorableDroppedSqlPoolListResult object itself. + */ + public RestorableDroppedSqlPoolListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property value in model RestorableDroppedSqlPoolListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RestorableDroppedSqlPools.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RestorableDroppedSqlPools.java new file mode 100644 index 0000000000000..9fe5e12546483 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RestorableDroppedSqlPools.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of RestorableDroppedSqlPools. */ +public interface RestorableDroppedSqlPools { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a deleted sql pool that can be restored. + */ + RestorableDroppedSqlPool get(String resourceGroupName, String workspaceName, String restorableDroppedSqlPoolId); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a deleted sql pool that can be restored. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String restorableDroppedSqlPoolId, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of deleted Sql pools that can be restored. + */ + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of deleted Sql pools that can be restored. + */ + PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RestorePoint.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RestorePoint.java new file mode 100644 index 0000000000000..6380c87e3651a --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RestorePoint.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.RestorePointInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of RestorePoint. */ +public interface RestorePoint { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: Resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the restorePointType property: The type of restore point. + * + * @return the restorePointType value. + */ + RestorePointType restorePointType(); + + /** + * Gets the earliestRestoreDate property: The earliest time to which this database can be restored. + * + * @return the earliestRestoreDate value. + */ + OffsetDateTime earliestRestoreDate(); + + /** + * Gets the restorePointCreationDate property: The time the backup was taken. + * + * @return the restorePointCreationDate value. + */ + OffsetDateTime restorePointCreationDate(); + + /** + * Gets the restorePointLabel property: The label of restore point for backup request by user. + * + * @return the restorePointLabel value. + */ + String restorePointLabel(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.RestorePointInner object. + * + * @return the inner object. + */ + RestorePointInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RestorePointListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RestorePointListResult.java new file mode 100644 index 0000000000000..e3ce0500d94a5 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RestorePointListResult.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.RestorePointInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of long term retention backups. */ +@Immutable +public final class RestorePointListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RestorePointListResult.class); + + /* + * Array of results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RestorePointType.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RestorePointType.java new file mode 100644 index 0000000000000..687f850d62b35 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/RestorePointType.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for RestorePointType. */ +public enum RestorePointType { + /** Enum value CONTINUOUS. */ + CONTINUOUS("CONTINUOUS"), + + /** Enum value DISCRETE. */ + DISCRETE("DISCRETE"); + + /** The actual serialized value for a RestorePointType instance. */ + private final String value; + + RestorePointType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a RestorePointType instance. + * + * @param value the serialized value to parse. + * @return the parsed RestorePointType object, or null if unable to parse. + */ + @JsonCreator + public static RestorePointType fromString(String value) { + RestorePointType[] items = RestorePointType.values(); + for (RestorePointType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SecretBase.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SecretBase.java new file mode 100644 index 0000000000000..2c06aa4685632 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SecretBase.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The base definition of a secret type. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + defaultImpl = SecretBase.class) +@JsonTypeName("SecretBase") +@JsonSubTypes({@JsonSubTypes.Type(name = "SecureString", value = SecureString.class)}) +@Immutable +public class SecretBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecretBase.class); + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SecureString.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SecureString.java new file mode 100644 index 0000000000000..e35f4878fc24d --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SecureString.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Azure Synapse secure string definition. The string value will be masked with asterisks '*' during Get or List API + * calls. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("SecureString") +@Fluent +public final class SecureString extends SecretBase { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SecureString.class); + + /* + * Value of secure string. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Get the value property: Value of secure string. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Value of secure string. + * + * @param value the value value to set. + * @return the SecureString object itself. + */ + public SecureString withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model SecureString")); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SecurityAlertPolicyName.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SecurityAlertPolicyName.java new file mode 100644 index 0000000000000..b640b14347b69 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SecurityAlertPolicyName.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SecurityAlertPolicyName. */ +public final class SecurityAlertPolicyName extends ExpandableStringEnum { + /** Static value default for SecurityAlertPolicyName. */ + public static final SecurityAlertPolicyName DEFAULT = fromString("default"); + + /** + * Creates or finds a SecurityAlertPolicyName from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecurityAlertPolicyName. + */ + @JsonCreator + public static SecurityAlertPolicyName fromString(String name) { + return fromString(name, SecurityAlertPolicyName.class); + } + + /** @return known SecurityAlertPolicyName values. */ + public static Collection values() { + return values(SecurityAlertPolicyName.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SecurityAlertPolicyNameAutoGenerated.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SecurityAlertPolicyNameAutoGenerated.java new file mode 100644 index 0000000000000..162f9409b4e39 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SecurityAlertPolicyNameAutoGenerated.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SecurityAlertPolicyNameAutoGenerated. */ +public final class SecurityAlertPolicyNameAutoGenerated + extends ExpandableStringEnum { + /** Static value Default for SecurityAlertPolicyNameAutoGenerated. */ + public static final SecurityAlertPolicyNameAutoGenerated DEFAULT = fromString("Default"); + + /** + * Creates or finds a SecurityAlertPolicyNameAutoGenerated from its string representation. + * + * @param name a name to look for. + * @return the corresponding SecurityAlertPolicyNameAutoGenerated. + */ + @JsonCreator + public static SecurityAlertPolicyNameAutoGenerated fromString(String name) { + return fromString(name, SecurityAlertPolicyNameAutoGenerated.class); + } + + /** @return known SecurityAlertPolicyNameAutoGenerated values. */ + public static Collection values() { + return values(SecurityAlertPolicyNameAutoGenerated.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SecurityAlertPolicyState.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SecurityAlertPolicyState.java new file mode 100644 index 0000000000000..ed7db2ab56c9c --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SecurityAlertPolicyState.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for SecurityAlertPolicyState. */ +public enum SecurityAlertPolicyState { + /** Enum value New. */ + NEW("New"), + + /** Enum value Enabled. */ + ENABLED("Enabled"), + + /** Enum value Disabled. */ + DISABLED("Disabled"); + + /** The actual serialized value for a SecurityAlertPolicyState instance. */ + private final String value; + + SecurityAlertPolicyState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SecurityAlertPolicyState instance. + * + * @param value the serialized value to parse. + * @return the parsed SecurityAlertPolicyState object, or null if unable to parse. + */ + @JsonCreator + public static SecurityAlertPolicyState fromString(String value) { + SecurityAlertPolicyState[] items = SecurityAlertPolicyState.values(); + for (SecurityAlertPolicyState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SelfHostedIntegrationRuntime.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SelfHostedIntegrationRuntime.java new file mode 100644 index 0000000000000..ed4b25d1fb4fc --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SelfHostedIntegrationRuntime.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Self-hosted integration runtime. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("SelfHosted") +@JsonFlatten +@Fluent +public class SelfHostedIntegrationRuntime extends IntegrationRuntime { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SelfHostedIntegrationRuntime.class); + + /* + * Linked integration runtime type from data factory + */ + @JsonProperty(value = "typeProperties.linkedInfo") + private LinkedIntegrationRuntimeType linkedInfo; + + /** + * Get the linkedInfo property: Linked integration runtime type from data factory. + * + * @return the linkedInfo value. + */ + public LinkedIntegrationRuntimeType linkedInfo() { + return this.linkedInfo; + } + + /** + * Set the linkedInfo property: Linked integration runtime type from data factory. + * + * @param linkedInfo the linkedInfo value to set. + * @return the SelfHostedIntegrationRuntime object itself. + */ + public SelfHostedIntegrationRuntime withLinkedInfo(LinkedIntegrationRuntimeType linkedInfo) { + this.linkedInfo = linkedInfo; + return this; + } + + /** {@inheritDoc} */ + @Override + public SelfHostedIntegrationRuntime withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (linkedInfo() != null) { + linkedInfo().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SelfHostedIntegrationRuntimeNode.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SelfHostedIntegrationRuntimeNode.java new file mode 100644 index 0000000000000..0989524a45872 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SelfHostedIntegrationRuntimeNode.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.SelfHostedIntegrationRuntimeNodeInner; +import java.time.OffsetDateTime; +import java.util.Map; + +/** An immutable client-side representation of SelfHostedIntegrationRuntimeNode. */ +public interface SelfHostedIntegrationRuntimeNode { + /** + * Gets the nodeName property: Name of the integration runtime node. + * + * @return the nodeName value. + */ + String nodeName(); + + /** + * Gets the machineName property: Machine name of the integration runtime node. + * + * @return the machineName value. + */ + String machineName(); + + /** + * Gets the hostServiceUri property: URI for the host machine of the integration runtime. + * + * @return the hostServiceUri value. + */ + String hostServiceUri(); + + /** + * Gets the status property: Status of the integration runtime node. + * + * @return the status value. + */ + SelfHostedIntegrationRuntimeNodeStatus status(); + + /** + * Gets the capabilities property: The integration runtime capabilities dictionary. + * + * @return the capabilities value. + */ + Map capabilities(); + + /** + * Gets the versionStatus property: Status of the integration runtime node version. + * + * @return the versionStatus value. + */ + String versionStatus(); + + /** + * Gets the version property: Version of the integration runtime node. + * + * @return the version value. + */ + String version(); + + /** + * Gets the registerTime property: The time at which the integration runtime node was registered in ISO8601 format. + * + * @return the registerTime value. + */ + OffsetDateTime registerTime(); + + /** + * Gets the lastConnectTime property: The most recent time at which the integration runtime was connected in ISO8601 + * format. + * + * @return the lastConnectTime value. + */ + OffsetDateTime lastConnectTime(); + + /** + * Gets the expiryTime property: The time at which the integration runtime will expire in ISO8601 format. + * + * @return the expiryTime value. + */ + OffsetDateTime expiryTime(); + + /** + * Gets the lastStartTime property: The time the node last started up. + * + * @return the lastStartTime value. + */ + OffsetDateTime lastStartTime(); + + /** + * Gets the lastStopTime property: The integration runtime node last stop time. + * + * @return the lastStopTime value. + */ + OffsetDateTime lastStopTime(); + + /** + * Gets the lastUpdateResult property: The result of the last integration runtime node update. + * + * @return the lastUpdateResult value. + */ + IntegrationRuntimeUpdateResult lastUpdateResult(); + + /** + * Gets the lastStartUpdateTime property: The last time for the integration runtime node update start. + * + * @return the lastStartUpdateTime value. + */ + OffsetDateTime lastStartUpdateTime(); + + /** + * Gets the lastEndUpdateTime property: The last time for the integration runtime node update end. + * + * @return the lastEndUpdateTime value. + */ + OffsetDateTime lastEndUpdateTime(); + + /** + * Gets the isActiveDispatcher property: Indicates whether this node is the active dispatcher for integration + * runtime requests. + * + * @return the isActiveDispatcher value. + */ + Boolean isActiveDispatcher(); + + /** + * Gets the concurrentJobsLimit property: Maximum concurrent jobs on the integration runtime node. + * + * @return the concurrentJobsLimit value. + */ + Integer concurrentJobsLimit(); + + /** + * Gets the maxConcurrentJobs property: The maximum concurrent jobs in this integration runtime. + * + * @return the maxConcurrentJobs value. + */ + Integer maxConcurrentJobs(); + + /** + * Gets the additionalProperties property: Properties of Self-hosted integration runtime node. + * + * @return the additionalProperties value. + */ + Map additionalProperties(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.SelfHostedIntegrationRuntimeNodeInner object. + * + * @return the inner object. + */ + SelfHostedIntegrationRuntimeNodeInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SelfHostedIntegrationRuntimeNodeStatus.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SelfHostedIntegrationRuntimeNodeStatus.java new file mode 100644 index 0000000000000..1cfd24fd64c3e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SelfHostedIntegrationRuntimeNodeStatus.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SelfHostedIntegrationRuntimeNodeStatus. */ +public final class SelfHostedIntegrationRuntimeNodeStatus + extends ExpandableStringEnum { + /** Static value NeedRegistration for SelfHostedIntegrationRuntimeNodeStatus. */ + public static final SelfHostedIntegrationRuntimeNodeStatus NEED_REGISTRATION = fromString("NeedRegistration"); + + /** Static value Online for SelfHostedIntegrationRuntimeNodeStatus. */ + public static final SelfHostedIntegrationRuntimeNodeStatus ONLINE = fromString("Online"); + + /** Static value Limited for SelfHostedIntegrationRuntimeNodeStatus. */ + public static final SelfHostedIntegrationRuntimeNodeStatus LIMITED = fromString("Limited"); + + /** Static value Offline for SelfHostedIntegrationRuntimeNodeStatus. */ + public static final SelfHostedIntegrationRuntimeNodeStatus OFFLINE = fromString("Offline"); + + /** Static value Upgrading for SelfHostedIntegrationRuntimeNodeStatus. */ + public static final SelfHostedIntegrationRuntimeNodeStatus UPGRADING = fromString("Upgrading"); + + /** Static value Initializing for SelfHostedIntegrationRuntimeNodeStatus. */ + public static final SelfHostedIntegrationRuntimeNodeStatus INITIALIZING = fromString("Initializing"); + + /** Static value InitializeFailed for SelfHostedIntegrationRuntimeNodeStatus. */ + public static final SelfHostedIntegrationRuntimeNodeStatus INITIALIZE_FAILED = fromString("InitializeFailed"); + + /** + * Creates or finds a SelfHostedIntegrationRuntimeNodeStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SelfHostedIntegrationRuntimeNodeStatus. + */ + @JsonCreator + public static SelfHostedIntegrationRuntimeNodeStatus fromString(String name) { + return fromString(name, SelfHostedIntegrationRuntimeNodeStatus.class); + } + + /** @return known SelfHostedIntegrationRuntimeNodeStatus values. */ + public static Collection values() { + return values(SelfHostedIntegrationRuntimeNodeStatus.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SelfHostedIntegrationRuntimeStatus.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SelfHostedIntegrationRuntimeStatus.java new file mode 100644 index 0000000000000..ba7d1b4903c4b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SelfHostedIntegrationRuntimeStatus.java @@ -0,0 +1,333 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.SelfHostedIntegrationRuntimeNodeInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** Self-hosted integration runtime status. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("SelfHosted") +@JsonFlatten +@Fluent +public class SelfHostedIntegrationRuntimeStatus extends IntegrationRuntimeStatus { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SelfHostedIntegrationRuntimeStatus.class); + + /* + * The time at which the integration runtime was created, in ISO8601 + * format. + */ + @JsonProperty(value = "typeProperties.createTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createTime; + + /* + * The task queue id of the integration runtime. + */ + @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). + */ + @JsonProperty(value = "typeProperties.internalChannelEncryption", access = JsonProperty.Access.WRITE_ONLY) + private IntegrationRuntimeInternalChannelEncryptionMode internalChannelEncryption; + + /* + * Version of the integration runtime. + */ + @JsonProperty(value = "typeProperties.version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * The list of nodes for this integration runtime. + */ + @JsonProperty(value = "typeProperties.nodes") + private List nodes; + + /* + * The date at which the integration runtime will be scheduled to update, + * in ISO8601 format. + */ + @JsonProperty(value = "typeProperties.scheduledUpdateDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime scheduledUpdateDate; + + /* + * The time in the date scheduled by service to update the integration + * runtime, e.g., PT03H is 3 hours + */ + @JsonProperty(value = "typeProperties.updateDelayOffset", access = JsonProperty.Access.WRITE_ONLY) + private String updateDelayOffset; + + /* + * The local time zone offset in hours. + */ + @JsonProperty(value = "typeProperties.localTimeZoneOffset", access = JsonProperty.Access.WRITE_ONLY) + private String localTimeZoneOffset; + + /* + * Object with additional information about integration runtime + * capabilities. + */ + @JsonProperty(value = "typeProperties.capabilities", access = JsonProperty.Access.WRITE_ONLY) + private Map capabilities; + + /* + * The URLs for the services used in integration runtime backend service. + */ + @JsonProperty(value = "typeProperties.serviceUrls", access = JsonProperty.Access.WRITE_ONLY) + private List serviceUrls; + + /* + * Whether Self-hosted integration runtime auto update has been turned on. + */ + @JsonProperty(value = "typeProperties.autoUpdate", access = JsonProperty.Access.WRITE_ONLY) + private IntegrationRuntimeAutoUpdate autoUpdate; + + /* + * Status of the integration runtime version. + */ + @JsonProperty(value = "typeProperties.versionStatus", access = JsonProperty.Access.WRITE_ONLY) + private String versionStatus; + + /* + * The list of linked integration runtimes that are created to share with + * this integration runtime. + */ + @JsonProperty(value = "typeProperties.links") + private List links; + + /* + * The version that the integration runtime is going to update to. + */ + @JsonProperty(value = "typeProperties.pushedVersion", access = JsonProperty.Access.WRITE_ONLY) + private String pushedVersion; + + /* + * The latest version on download center. + */ + @JsonProperty(value = "typeProperties.latestVersion", access = JsonProperty.Access.WRITE_ONLY) + private String latestVersion; + + /* + * The estimated time when the self-hosted integration runtime will be + * updated. + */ + @JsonProperty(value = "typeProperties.autoUpdateETA", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime autoUpdateEta; + + /** + * Get the createTime property: The time at which the integration runtime was created, in ISO8601 format. + * + * @return the createTime value. + */ + public OffsetDateTime createTime() { + return this.createTime; + } + + /** + * Get the taskQueueId property: The task queue id of the integration runtime. + * + * @return the taskQueueId value. + */ + public String taskQueueId() { + return this.taskQueueId; + } + + /** + * Get the nodeCommunicationChannelEncryptionMode property: The node communication Channel encryption mode. + * + * @return the nodeCommunicationChannelEncryptionMode value. + */ + public String nodeCommunicationChannelEncryptionMode() { + return this.nodeCommunicationChannelEncryptionMode; + } + + /** + * Get the internalChannelEncryption property: It is used to set the encryption mode for node-node communication + * channel (when more than 2 self-hosted integration runtime nodes exist). + * + * @return the internalChannelEncryption value. + */ + public IntegrationRuntimeInternalChannelEncryptionMode internalChannelEncryption() { + return this.internalChannelEncryption; + } + + /** + * Get the version property: Version of the integration runtime. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the nodes property: The list of nodes for this integration runtime. + * + * @return the nodes value. + */ + public List nodes() { + return this.nodes; + } + + /** + * Set the nodes property: The list of nodes for this integration runtime. + * + * @param nodes the nodes value to set. + * @return the SelfHostedIntegrationRuntimeStatus object itself. + */ + public SelfHostedIntegrationRuntimeStatus withNodes(List nodes) { + this.nodes = nodes; + return this; + } + + /** + * Get the scheduledUpdateDate property: The date at which the integration runtime will be scheduled to update, in + * ISO8601 format. + * + * @return the scheduledUpdateDate value. + */ + public OffsetDateTime scheduledUpdateDate() { + return this.scheduledUpdateDate; + } + + /** + * Get the updateDelayOffset property: The time in the date scheduled by service to update the integration runtime, + * e.g., PT03H is 3 hours. + * + * @return the updateDelayOffset value. + */ + public String updateDelayOffset() { + return this.updateDelayOffset; + } + + /** + * Get the localTimeZoneOffset property: The local time zone offset in hours. + * + * @return the localTimeZoneOffset value. + */ + public String localTimeZoneOffset() { + return this.localTimeZoneOffset; + } + + /** + * Get the capabilities property: Object with additional information about integration runtime capabilities. + * + * @return the capabilities value. + */ + public Map capabilities() { + return this.capabilities; + } + + /** + * Get the serviceUrls property: The URLs for the services used in integration runtime backend service. + * + * @return the serviceUrls value. + */ + public List serviceUrls() { + return this.serviceUrls; + } + + /** + * Get the autoUpdate property: Whether Self-hosted integration runtime auto update has been turned on. + * + * @return the autoUpdate value. + */ + public IntegrationRuntimeAutoUpdate autoUpdate() { + return this.autoUpdate; + } + + /** + * Get the versionStatus property: Status of the integration runtime version. + * + * @return the versionStatus value. + */ + public String versionStatus() { + return this.versionStatus; + } + + /** + * Get the links property: The list of linked integration runtimes that are created to share with this integration + * runtime. + * + * @return the links value. + */ + public List links() { + return this.links; + } + + /** + * Set the links property: The list of linked integration runtimes that are created to share with this integration + * runtime. + * + * @param links the links value to set. + * @return the SelfHostedIntegrationRuntimeStatus object itself. + */ + public SelfHostedIntegrationRuntimeStatus withLinks(List links) { + this.links = links; + return this; + } + + /** + * Get the pushedVersion property: The version that the integration runtime is going to update to. + * + * @return the pushedVersion value. + */ + public String pushedVersion() { + return this.pushedVersion; + } + + /** + * Get the latestVersion property: The latest version on download center. + * + * @return the latestVersion value. + */ + public String latestVersion() { + return this.latestVersion; + } + + /** + * Get the autoUpdateEta property: The estimated time when the self-hosted integration runtime will be updated. + * + * @return the autoUpdateEta value. + */ + public OffsetDateTime autoUpdateEta() { + return this.autoUpdateEta; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (nodes() != null) { + nodes().forEach(e -> e.validate()); + } + if (links() != null) { + links().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SensitivityLabel.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SensitivityLabel.java new file mode 100644 index 0000000000000..5a1405f7f77a8 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SensitivityLabel.java @@ -0,0 +1,337 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.SensitivityLabelInner; + +/** An immutable client-side representation of SensitivityLabel. */ +public interface SensitivityLabel { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the managedBy property: managed by. + * + * @return the managedBy value. + */ + String managedBy(); + + /** + * Gets the schemaName property: The schema name. + * + * @return the schemaName value. + */ + String schemaName(); + + /** + * Gets the tableName property: The table name. + * + * @return the tableName value. + */ + String tableName(); + + /** + * Gets the columnName property: The column name. + * + * @return the columnName value. + */ + String columnName(); + + /** + * Gets the labelName property: The label name. + * + * @return the labelName value. + */ + String labelName(); + + /** + * Gets the labelId property: The label ID. + * + * @return the labelId value. + */ + String labelId(); + + /** + * Gets the informationType property: The information type. + * + * @return the informationType value. + */ + String informationType(); + + /** + * Gets the informationTypeId property: The information type ID. + * + * @return the informationTypeId value. + */ + String informationTypeId(); + + /** + * Gets the isDisabled property: Is sensitivity recommendation disabled. Applicable for recommended sensitivity + * label only. Specifies whether the sensitivity recommendation on this column is disabled (dismissed) or not. + * + * @return the isDisabled value. + */ + Boolean isDisabled(); + + /** + * Gets the rank property: The rank property. + * + * @return the rank value. + */ + SensitivityLabelRank rank(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.SensitivityLabelInner object. + * + * @return the inner object. + */ + SensitivityLabelInner innerModel(); + + /** The entirety of the SensitivityLabel definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The SensitivityLabel definition stages. */ + interface DefinitionStages { + /** The first stage of the SensitivityLabel definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the SensitivityLabel definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, columnName. + * + * @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. + * @return the next definition stage. + */ + WithCreate withExistingColumn( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName); + } + /** + * The stage of the SensitivityLabel definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithLabelName, + DefinitionStages.WithLabelId, + DefinitionStages.WithInformationType, + DefinitionStages.WithInformationTypeId, + DefinitionStages.WithRank { + /** + * Executes the create request. + * + * @return the created resource. + */ + SensitivityLabel create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SensitivityLabel create(Context context); + } + /** The stage of the SensitivityLabel definition allowing to specify labelName. */ + interface WithLabelName { + /** + * Specifies the labelName property: The label name.. + * + * @param labelName The label name. + * @return the next definition stage. + */ + WithCreate withLabelName(String labelName); + } + /** The stage of the SensitivityLabel definition allowing to specify labelId. */ + interface WithLabelId { + /** + * Specifies the labelId property: The label ID.. + * + * @param labelId The label ID. + * @return the next definition stage. + */ + WithCreate withLabelId(String labelId); + } + /** The stage of the SensitivityLabel definition allowing to specify informationType. */ + interface WithInformationType { + /** + * Specifies the informationType property: The information type.. + * + * @param informationType The information type. + * @return the next definition stage. + */ + WithCreate withInformationType(String informationType); + } + /** The stage of the SensitivityLabel definition allowing to specify informationTypeId. */ + interface WithInformationTypeId { + /** + * Specifies the informationTypeId property: The information type ID.. + * + * @param informationTypeId The information type ID. + * @return the next definition stage. + */ + WithCreate withInformationTypeId(String informationTypeId); + } + /** The stage of the SensitivityLabel definition allowing to specify rank. */ + interface WithRank { + /** + * Specifies the rank property: The rank property.. + * + * @param rank The rank property. + * @return the next definition stage. + */ + WithCreate withRank(SensitivityLabelRank rank); + } + } + /** + * Begins update for the SensitivityLabel resource. + * + * @return the stage of resource update. + */ + SensitivityLabel.Update update(); + + /** The template for SensitivityLabel update. */ + interface Update + extends UpdateStages.WithLabelName, + UpdateStages.WithLabelId, + UpdateStages.WithInformationType, + UpdateStages.WithInformationTypeId, + UpdateStages.WithRank { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SensitivityLabel apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SensitivityLabel apply(Context context); + } + /** The SensitivityLabel update stages. */ + interface UpdateStages { + /** The stage of the SensitivityLabel update allowing to specify labelName. */ + interface WithLabelName { + /** + * Specifies the labelName property: The label name.. + * + * @param labelName The label name. + * @return the next definition stage. + */ + Update withLabelName(String labelName); + } + /** The stage of the SensitivityLabel update allowing to specify labelId. */ + interface WithLabelId { + /** + * Specifies the labelId property: The label ID.. + * + * @param labelId The label ID. + * @return the next definition stage. + */ + Update withLabelId(String labelId); + } + /** The stage of the SensitivityLabel update allowing to specify informationType. */ + interface WithInformationType { + /** + * Specifies the informationType property: The information type.. + * + * @param informationType The information type. + * @return the next definition stage. + */ + Update withInformationType(String informationType); + } + /** The stage of the SensitivityLabel update allowing to specify informationTypeId. */ + interface WithInformationTypeId { + /** + * Specifies the informationTypeId property: The information type ID.. + * + * @param informationTypeId The information type ID. + * @return the next definition stage. + */ + Update withInformationTypeId(String informationTypeId); + } + /** The stage of the SensitivityLabel update allowing to specify rank. */ + interface WithRank { + /** + * Specifies the rank property: The rank property.. + * + * @param rank The rank property. + * @return the next definition stage. + */ + Update withRank(SensitivityLabelRank rank); + } + } + /** + * Enables sensitivity recommendations on a given column (recommendations are enabled by default on all columns). + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void enableRecommendation(); + + /** + * Enables sensitivity recommendations on a given column (recommendations are enabled by default on all columns). + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response enableRecommendationWithResponse(Context context); + + /** + * Disables sensitivity recommendations on a given column. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void disableRecommendation(); + + /** + * Disables sensitivity recommendations on a given column. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response disableRecommendationWithResponse(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SensitivityLabelListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SensitivityLabelListResult.java new file mode 100644 index 0000000000000..b60325ea80792 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SensitivityLabelListResult.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.SensitivityLabelInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of sensitivity labels. */ +@Immutable +public final class SensitivityLabelListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SensitivityLabelListResult.class); + + /* + * Array of results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SensitivityLabelRank.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SensitivityLabelRank.java new file mode 100644 index 0000000000000..fa3ef29e33487 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SensitivityLabelRank.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for SensitivityLabelRank. */ +public enum SensitivityLabelRank { + /** Enum value None. */ + NONE("None"), + + /** Enum value Low. */ + LOW("Low"), + + /** Enum value Medium. */ + MEDIUM("Medium"), + + /** Enum value High. */ + HIGH("High"), + + /** Enum value Critical. */ + CRITICAL("Critical"); + + /** The actual serialized value for a SensitivityLabelRank instance. */ + private final String value; + + SensitivityLabelRank(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SensitivityLabelRank instance. + * + * @param value the serialized value to parse. + * @return the parsed SensitivityLabelRank object, or null if unable to parse. + */ + @JsonCreator + public static SensitivityLabelRank fromString(String value) { + SensitivityLabelRank[] items = SensitivityLabelRank.values(); + for (SensitivityLabelRank item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SensitivityLabelSource.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SensitivityLabelSource.java new file mode 100644 index 0000000000000..a8f20e6084554 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SensitivityLabelSource.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +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 final 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/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SensitivityLabelUpdate.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SensitivityLabelUpdate.java new file mode 100644 index 0000000000000..adf411f45786b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SensitivityLabelUpdate.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.SensitivityLabelUpdateInner; + +/** An immutable client-side representation of SensitivityLabelUpdate. */ +public interface SensitivityLabelUpdate { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the op property: The op property. + * + * @return the op value. + */ + SensitivityLabelUpdateKind op(); + + /** + * Gets the schema property: Schema name of the column to update. + * + * @return the schema value. + */ + String schema(); + + /** + * Gets the table property: Table name of the column to update. + * + * @return the table value. + */ + String table(); + + /** + * Gets the column property: Column name to update. + * + * @return the column value. + */ + String column(); + + /** + * Gets the sensitivityLabel property: The sensitivity label information to apply on a column. + * + * @return the sensitivityLabel value. + */ + SensitivityLabel sensitivityLabel(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.SensitivityLabelUpdateInner object. + * + * @return the inner object. + */ + SensitivityLabelUpdateInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SensitivityLabelUpdateKind.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SensitivityLabelUpdateKind.java new file mode 100644 index 0000000000000..285860554c32c --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SensitivityLabelUpdateKind.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for SensitivityLabelUpdateKind. */ +public enum SensitivityLabelUpdateKind { + /** Enum value set. */ + SET("set"), + + /** Enum value remove. */ + REMOVE("remove"); + + /** The actual serialized value for a SensitivityLabelUpdateKind instance. */ + private final String value; + + SensitivityLabelUpdateKind(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SensitivityLabelUpdateKind instance. + * + * @param value the serialized value to parse. + * @return the parsed SensitivityLabelUpdateKind object, or null if unable to parse. + */ + @JsonCreator + public static SensitivityLabelUpdateKind fromString(String value) { + SensitivityLabelUpdateKind[] items = SensitivityLabelUpdateKind.values(); + for (SensitivityLabelUpdateKind item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SensitivityLabelUpdateList.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SensitivityLabelUpdateList.java new file mode 100644 index 0000000000000..b9346c51c5ec7 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SensitivityLabelUpdateList.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.SensitivityLabelUpdateInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of sensitivity label update operations. */ +@Fluent +public final class SensitivityLabelUpdateList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SensitivityLabelUpdateList.class); + + /* + * The operations property. + */ + @JsonProperty(value = "operations") + private List operations; + + /** + * Get the operations property: The operations property. + * + * @return the operations value. + */ + public List operations() { + return this.operations; + } + + /** + * Set the operations property: The operations property. + * + * @param operations the operations value to set. + * @return the SensitivityLabelUpdateList object itself. + */ + public SensitivityLabelUpdateList withOperations(List operations) { + this.operations = operations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (operations() != null) { + operations().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerBlobAuditingPolicy.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerBlobAuditingPolicy.java new file mode 100644 index 0000000000000..8b73b870aec56 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerBlobAuditingPolicy.java @@ -0,0 +1,689 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.ServerBlobAuditingPolicyInner; +import java.util.List; +import java.util.UUID; + +/** An immutable client-side representation of ServerBlobAuditingPolicy. */ +public interface ServerBlobAuditingPolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the state property: Specifies the state of the policy. If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled are required. + * + * @return the state value. + */ + BlobAuditingPolicyState state(); + + /** + * Gets the storageEndpoint property: 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. + */ + String storageEndpoint(); + + /** + * Gets the storageAccountAccessKey property: 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. + */ + String storageAccountAccessKey(); + + /** + * Gets the retentionDays property: Specifies the number of days to keep in the audit logs in the storage account. + * + * @return the retentionDays value. + */ + Integer retentionDays(); + + /** + * Gets the auditActionsAndGroups property: 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. + */ + List auditActionsAndGroups(); + + /** + * Gets the storageAccountSubscriptionId property: Specifies the blob storage subscription Id. + * + * @return the storageAccountSubscriptionId value. + */ + UUID storageAccountSubscriptionId(); + + /** + * Gets the isStorageSecondaryKeyInUse property: Specifies whether storageAccountAccessKey value is the storage's + * secondary key. + * + * @return the isStorageSecondaryKeyInUse value. + */ + Boolean isStorageSecondaryKeyInUse(); + + /** + * Gets the isAzureMonitorTargetEnabled property: 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. + */ + Boolean isAzureMonitorTargetEnabled(); + + /** + * Gets the queueDelayMs property: 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. + */ + Integer queueDelayMs(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.ServerBlobAuditingPolicyInner object. + * + * @return the inner object. + */ + ServerBlobAuditingPolicyInner innerModel(); + + /** The entirety of the ServerBlobAuditingPolicy definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ServerBlobAuditingPolicy definition stages. */ + interface DefinitionStages { + /** The first stage of the ServerBlobAuditingPolicy definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ServerBlobAuditingPolicy definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * 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 ServerBlobAuditingPolicy definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithState, + DefinitionStages.WithStorageEndpoint, + DefinitionStages.WithStorageAccountAccessKey, + DefinitionStages.WithRetentionDays, + DefinitionStages.WithAuditActionsAndGroups, + DefinitionStages.WithStorageAccountSubscriptionId, + DefinitionStages.WithIsStorageSecondaryKeyInUse, + DefinitionStages.WithIsAzureMonitorTargetEnabled, + DefinitionStages.WithQueueDelayMs { + /** + * Executes the create request. + * + * @return the created resource. + */ + ServerBlobAuditingPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ServerBlobAuditingPolicy create(Context context); + } + /** The stage of the ServerBlobAuditingPolicy definition allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: Specifies the state of the policy. If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled are required.. + * + * @param state Specifies the state of the policy. If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled are required. + * @return the next definition stage. + */ + WithCreate withState(BlobAuditingPolicyState state); + } + /** The stage of the ServerBlobAuditingPolicy definition allowing to specify storageEndpoint. */ + interface WithStorageEndpoint { + /** + * Specifies the storageEndpoint property: Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled is required.. + * + * @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 ServerBlobAuditingPolicy definition allowing to specify storageAccountAccessKey. */ + interface WithStorageAccountAccessKey { + /** + * Specifies the storageAccountAccessKey property: 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 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 ServerBlobAuditingPolicy definition allowing to specify retentionDays. */ + interface WithRetentionDays { + /** + * Specifies the retentionDays property: Specifies the number of days to keep in the audit logs in the + * storage account.. + * + * @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 ServerBlobAuditingPolicy definition allowing to specify auditActionsAndGroups. */ + interface WithAuditActionsAndGroups { + /** + * Specifies the auditActionsAndGroups property: 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 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 ServerBlobAuditingPolicy definition allowing to specify storageAccountSubscriptionId. */ + interface WithStorageAccountSubscriptionId { + /** + * Specifies the storageAccountSubscriptionId property: Specifies the blob storage subscription Id.. + * + * @param storageAccountSubscriptionId Specifies the blob storage subscription Id. + * @return the next definition stage. + */ + WithCreate withStorageAccountSubscriptionId(UUID storageAccountSubscriptionId); + } + /** The stage of the ServerBlobAuditingPolicy definition allowing to specify isStorageSecondaryKeyInUse. */ + interface WithIsStorageSecondaryKeyInUse { + /** + * Specifies the isStorageSecondaryKeyInUse property: Specifies whether storageAccountAccessKey value is the + * storage's secondary key.. + * + * @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 ServerBlobAuditingPolicy definition allowing to specify isAzureMonitorTargetEnabled. */ + interface WithIsAzureMonitorTargetEnabled { + /** + * Specifies the isAzureMonitorTargetEnabled property: 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 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 ServerBlobAuditingPolicy definition allowing to specify queueDelayMs. */ + interface WithQueueDelayMs { + /** + * Specifies the queueDelayMs property: 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 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); + } + } + /** + * Begins update for the ServerBlobAuditingPolicy resource. + * + * @return the stage of resource update. + */ + ServerBlobAuditingPolicy.Update update(); + + /** The template for ServerBlobAuditingPolicy update. */ + interface Update + extends UpdateStages.WithState, + UpdateStages.WithStorageEndpoint, + UpdateStages.WithStorageAccountAccessKey, + UpdateStages.WithRetentionDays, + UpdateStages.WithAuditActionsAndGroups, + UpdateStages.WithStorageAccountSubscriptionId, + UpdateStages.WithIsStorageSecondaryKeyInUse, + UpdateStages.WithIsAzureMonitorTargetEnabled, + UpdateStages.WithQueueDelayMs { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ServerBlobAuditingPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ServerBlobAuditingPolicy apply(Context context); + } + /** The ServerBlobAuditingPolicy update stages. */ + interface UpdateStages { + /** The stage of the ServerBlobAuditingPolicy update allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: Specifies the state of the policy. If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled are required.. + * + * @param state Specifies the state of the policy. If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled are required. + * @return the next definition stage. + */ + Update withState(BlobAuditingPolicyState state); + } + /** The stage of the ServerBlobAuditingPolicy update allowing to specify storageEndpoint. */ + interface WithStorageEndpoint { + /** + * Specifies the storageEndpoint property: Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled is required.. + * + * @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. + */ + Update withStorageEndpoint(String storageEndpoint); + } + /** The stage of the ServerBlobAuditingPolicy update allowing to specify storageAccountAccessKey. */ + interface WithStorageAccountAccessKey { + /** + * Specifies the storageAccountAccessKey property: 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 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. + */ + Update withStorageAccountAccessKey(String storageAccountAccessKey); + } + /** The stage of the ServerBlobAuditingPolicy update allowing to specify retentionDays. */ + interface WithRetentionDays { + /** + * Specifies the retentionDays property: Specifies the number of days to keep in the audit logs in the + * storage account.. + * + * @param retentionDays Specifies the number of days to keep in the audit logs in the storage account. + * @return the next definition stage. + */ + Update withRetentionDays(Integer retentionDays); + } + /** The stage of the ServerBlobAuditingPolicy update allowing to specify auditActionsAndGroups. */ + interface WithAuditActionsAndGroups { + /** + * Specifies the auditActionsAndGroups property: 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 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. + */ + Update withAuditActionsAndGroups(List auditActionsAndGroups); + } + /** The stage of the ServerBlobAuditingPolicy update allowing to specify storageAccountSubscriptionId. */ + interface WithStorageAccountSubscriptionId { + /** + * Specifies the storageAccountSubscriptionId property: Specifies the blob storage subscription Id.. + * + * @param storageAccountSubscriptionId Specifies the blob storage subscription Id. + * @return the next definition stage. + */ + Update withStorageAccountSubscriptionId(UUID storageAccountSubscriptionId); + } + /** The stage of the ServerBlobAuditingPolicy update allowing to specify isStorageSecondaryKeyInUse. */ + interface WithIsStorageSecondaryKeyInUse { + /** + * Specifies the isStorageSecondaryKeyInUse property: Specifies whether storageAccountAccessKey value is the + * storage's secondary key.. + * + * @param isStorageSecondaryKeyInUse Specifies whether storageAccountAccessKey value is the storage's + * secondary key. + * @return the next definition stage. + */ + Update withIsStorageSecondaryKeyInUse(Boolean isStorageSecondaryKeyInUse); + } + /** The stage of the ServerBlobAuditingPolicy update allowing to specify isAzureMonitorTargetEnabled. */ + interface WithIsAzureMonitorTargetEnabled { + /** + * Specifies the isAzureMonitorTargetEnabled property: 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 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. + */ + Update withIsAzureMonitorTargetEnabled(Boolean isAzureMonitorTargetEnabled); + } + /** The stage of the ServerBlobAuditingPolicy update allowing to specify queueDelayMs. */ + interface WithQueueDelayMs { + /** + * Specifies the queueDelayMs property: 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 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. + */ + Update withQueueDelayMs(Integer queueDelayMs); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ServerBlobAuditingPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ServerBlobAuditingPolicy refresh(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerBlobAuditingPolicyListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerBlobAuditingPolicyListResult.java new file mode 100644 index 0000000000000..fcf8d45d87340 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerBlobAuditingPolicyListResult.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.ServerBlobAuditingPolicyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of server auditing settings. */ +@Immutable +public final class ServerBlobAuditingPolicyListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerBlobAuditingPolicyListResult.class); + + /* + * Array of results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerKeyType.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerKeyType.java new file mode 100644 index 0000000000000..6bc5c5f580427 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerKeyType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ServerKeyType. */ +public final class ServerKeyType extends ExpandableStringEnum { + /** Static value ServiceManaged for ServerKeyType. */ + public static final ServerKeyType SERVICE_MANAGED = fromString("ServiceManaged"); + + /** Static value AzureKeyVault for ServerKeyType. */ + public static final ServerKeyType AZURE_KEY_VAULT = fromString("AzureKeyVault"); + + /** + * Creates or finds a ServerKeyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServerKeyType. + */ + @JsonCreator + public static ServerKeyType fromString(String name) { + return fromString(name, ServerKeyType.class); + } + + /** @return known ServerKeyType values. */ + public static Collection values() { + return values(ServerKeyType.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerSecurityAlertPolicy.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerSecurityAlertPolicy.java new file mode 100644 index 0000000000000..a0e76e7f341b7 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerSecurityAlertPolicy.java @@ -0,0 +1,362 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.ServerSecurityAlertPolicyInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of ServerSecurityAlertPolicy. */ +public interface ServerSecurityAlertPolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the state property: Specifies the state of the policy, whether it is enabled or disabled or a policy has not + * been applied yet on the specific server. + * + * @return the state value. + */ + SecurityAlertPolicyState state(); + + /** + * Gets the disabledAlerts property: Specifies an array of alerts that are disabled. Allowed values are: + * Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action. + * + * @return the disabledAlerts value. + */ + List disabledAlerts(); + + /** + * Gets the emailAddresses property: Specifies an array of e-mail addresses to which the alert is sent. + * + * @return the emailAddresses value. + */ + List emailAddresses(); + + /** + * Gets the emailAccountAdmins property: Specifies that the alert is sent to the account administrators. + * + * @return the emailAccountAdmins value. + */ + Boolean emailAccountAdmins(); + + /** + * Gets the storageEndpoint property: Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. + * + * @return the storageEndpoint value. + */ + String storageEndpoint(); + + /** + * Gets the storageAccountAccessKey property: Specifies the identifier key of the Threat Detection audit storage + * account. + * + * @return the storageAccountAccessKey value. + */ + String storageAccountAccessKey(); + + /** + * Gets the retentionDays property: Specifies the number of days to keep in the Threat Detection audit logs. + * + * @return the retentionDays value. + */ + Integer retentionDays(); + + /** + * Gets the creationTime property: Specifies the UTC creation time of the policy. + * + * @return the creationTime value. + */ + OffsetDateTime creationTime(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.ServerSecurityAlertPolicyInner object. + * + * @return the inner object. + */ + ServerSecurityAlertPolicyInner innerModel(); + + /** The entirety of the ServerSecurityAlertPolicy definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ServerSecurityAlertPolicy definition stages. */ + interface DefinitionStages { + /** The first stage of the ServerSecurityAlertPolicy definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ServerSecurityAlertPolicy definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * 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 ServerSecurityAlertPolicy definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithState, + DefinitionStages.WithDisabledAlerts, + DefinitionStages.WithEmailAddresses, + DefinitionStages.WithEmailAccountAdmins, + DefinitionStages.WithStorageEndpoint, + DefinitionStages.WithStorageAccountAccessKey, + DefinitionStages.WithRetentionDays { + /** + * Executes the create request. + * + * @return the created resource. + */ + ServerSecurityAlertPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ServerSecurityAlertPolicy create(Context context); + } + /** The stage of the ServerSecurityAlertPolicy definition allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: Specifies the state of the policy, whether it is enabled or disabled or a + * policy has not been applied yet on the specific server. + * + * @param state Specifies the state of the policy, whether it is enabled or disabled or a policy has not + * been applied yet on the specific server. + * @return the next definition stage. + */ + WithCreate withState(SecurityAlertPolicyState state); + } + /** The stage of the ServerSecurityAlertPolicy definition allowing to specify disabledAlerts. */ + interface WithDisabledAlerts { + /** + * Specifies the disabledAlerts property: Specifies an array of alerts that are disabled. Allowed values + * are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action. + * + * @param disabledAlerts Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, + * Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action. + * @return the next definition stage. + */ + WithCreate withDisabledAlerts(List disabledAlerts); + } + /** The stage of the ServerSecurityAlertPolicy definition allowing to specify emailAddresses. */ + interface WithEmailAddresses { + /** + * Specifies the emailAddresses property: Specifies an array of e-mail addresses to which the alert is + * sent.. + * + * @param emailAddresses Specifies an array of e-mail addresses to which the alert is sent. + * @return the next definition stage. + */ + WithCreate withEmailAddresses(List emailAddresses); + } + /** The stage of the ServerSecurityAlertPolicy definition allowing to specify emailAccountAdmins. */ + interface WithEmailAccountAdmins { + /** + * Specifies the emailAccountAdmins property: Specifies that the alert is sent to the account + * administrators.. + * + * @param emailAccountAdmins Specifies that the alert is sent to the account administrators. + * @return the next definition stage. + */ + WithCreate withEmailAccountAdmins(Boolean emailAccountAdmins); + } + /** The stage of the ServerSecurityAlertPolicy definition allowing to specify storageEndpoint. */ + interface WithStorageEndpoint { + /** + * Specifies the storageEndpoint property: Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs.. + * + * @param storageEndpoint Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit + * logs. + * @return the next definition stage. + */ + WithCreate withStorageEndpoint(String storageEndpoint); + } + /** The stage of the ServerSecurityAlertPolicy definition allowing to specify storageAccountAccessKey. */ + interface WithStorageAccountAccessKey { + /** + * Specifies the storageAccountAccessKey property: Specifies the identifier key of the Threat Detection + * audit storage account.. + * + * @param storageAccountAccessKey Specifies the identifier key of the Threat Detection audit storage + * account. + * @return the next definition stage. + */ + WithCreate withStorageAccountAccessKey(String storageAccountAccessKey); + } + /** The stage of the ServerSecurityAlertPolicy definition allowing to specify retentionDays. */ + interface WithRetentionDays { + /** + * Specifies the retentionDays property: Specifies the number of days to keep in the Threat Detection audit + * logs.. + * + * @param retentionDays Specifies the number of days to keep in the Threat Detection audit logs. + * @return the next definition stage. + */ + WithCreate withRetentionDays(Integer retentionDays); + } + } + /** + * Begins update for the ServerSecurityAlertPolicy resource. + * + * @return the stage of resource update. + */ + ServerSecurityAlertPolicy.Update update(); + + /** The template for ServerSecurityAlertPolicy update. */ + interface Update + extends UpdateStages.WithState, + UpdateStages.WithDisabledAlerts, + UpdateStages.WithEmailAddresses, + UpdateStages.WithEmailAccountAdmins, + UpdateStages.WithStorageEndpoint, + UpdateStages.WithStorageAccountAccessKey, + UpdateStages.WithRetentionDays { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ServerSecurityAlertPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ServerSecurityAlertPolicy apply(Context context); + } + /** The ServerSecurityAlertPolicy update stages. */ + interface UpdateStages { + /** The stage of the ServerSecurityAlertPolicy update allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: Specifies the state of the policy, whether it is enabled or disabled or a + * policy has not been applied yet on the specific server. + * + * @param state Specifies the state of the policy, whether it is enabled or disabled or a policy has not + * been applied yet on the specific server. + * @return the next definition stage. + */ + Update withState(SecurityAlertPolicyState state); + } + /** The stage of the ServerSecurityAlertPolicy update allowing to specify disabledAlerts. */ + interface WithDisabledAlerts { + /** + * Specifies the disabledAlerts property: Specifies an array of alerts that are disabled. Allowed values + * are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action. + * + * @param disabledAlerts Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, + * Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action. + * @return the next definition stage. + */ + Update withDisabledAlerts(List disabledAlerts); + } + /** The stage of the ServerSecurityAlertPolicy update allowing to specify emailAddresses. */ + interface WithEmailAddresses { + /** + * Specifies the emailAddresses property: Specifies an array of e-mail addresses to which the alert is + * sent.. + * + * @param emailAddresses Specifies an array of e-mail addresses to which the alert is sent. + * @return the next definition stage. + */ + Update withEmailAddresses(List emailAddresses); + } + /** The stage of the ServerSecurityAlertPolicy update allowing to specify emailAccountAdmins. */ + interface WithEmailAccountAdmins { + /** + * Specifies the emailAccountAdmins property: Specifies that the alert is sent to the account + * administrators.. + * + * @param emailAccountAdmins Specifies that the alert is sent to the account administrators. + * @return the next definition stage. + */ + Update withEmailAccountAdmins(Boolean emailAccountAdmins); + } + /** The stage of the ServerSecurityAlertPolicy update allowing to specify storageEndpoint. */ + interface WithStorageEndpoint { + /** + * Specifies the storageEndpoint property: Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs.. + * + * @param storageEndpoint Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit + * logs. + * @return the next definition stage. + */ + Update withStorageEndpoint(String storageEndpoint); + } + /** The stage of the ServerSecurityAlertPolicy update allowing to specify storageAccountAccessKey. */ + interface WithStorageAccountAccessKey { + /** + * Specifies the storageAccountAccessKey property: Specifies the identifier key of the Threat Detection + * audit storage account.. + * + * @param storageAccountAccessKey Specifies the identifier key of the Threat Detection audit storage + * account. + * @return the next definition stage. + */ + Update withStorageAccountAccessKey(String storageAccountAccessKey); + } + /** The stage of the ServerSecurityAlertPolicy update allowing to specify retentionDays. */ + interface WithRetentionDays { + /** + * Specifies the retentionDays property: Specifies the number of days to keep in the Threat Detection audit + * logs.. + * + * @param retentionDays Specifies the number of days to keep in the Threat Detection audit logs. + * @return the next definition stage. + */ + Update withRetentionDays(Integer retentionDays); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ServerSecurityAlertPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ServerSecurityAlertPolicy refresh(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerSecurityAlertPolicyListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerSecurityAlertPolicyListResult.java new file mode 100644 index 0000000000000..1e01830916fb0 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerSecurityAlertPolicyListResult.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.ServerSecurityAlertPolicyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of the workspace managed sql server's security alert policies. */ +@Immutable +public final class ServerSecurityAlertPolicyListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerSecurityAlertPolicyListResult.class); + + /* + * Array of results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerUsage.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerUsage.java new file mode 100644 index 0000000000000..ad4826a586408 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerUsage.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.ServerUsageInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of ServerUsage. */ +public interface ServerUsage { + /** + * Gets the name property: Name of the server usage metric. + * + * @return the name value. + */ + String name(); + + /** + * Gets the resourceName property: The name of the resource. + * + * @return the resourceName value. + */ + String resourceName(); + + /** + * Gets the displayName property: The metric display name. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the currentValue property: The current value of the metric. + * + * @return the currentValue value. + */ + Double currentValue(); + + /** + * Gets the limit property: The current limit of the metric. + * + * @return the limit value. + */ + Double limit(); + + /** + * Gets the unit property: The units of the metric. + * + * @return the unit value. + */ + String unit(); + + /** + * Gets the nextResetTime property: The next reset time for the metric (ISO8601 format). + * + * @return the nextResetTime value. + */ + OffsetDateTime nextResetTime(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.ServerUsageInner object. + * + * @return the inner object. + */ + ServerUsageInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerUsageListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerUsageListResult.java new file mode 100644 index 0000000000000..e7be249feaba1 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerUsageListResult.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.ServerUsageInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Represents the response to a list server metrics request. */ +@Fluent +public final class ServerUsageListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerUsageListResult.class); + + /* + * The list of server metrics for the server. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of server metrics for the server. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of server metrics for the server. + * + * @param value the value value to set. + * @return the ServerUsageListResult object itself. + */ + public ServerUsageListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model ServerUsageListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerVulnerabilityAssessment.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerVulnerabilityAssessment.java new file mode 100644 index 0000000000000..8275e8828f274 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerVulnerabilityAssessment.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.ServerVulnerabilityAssessmentInner; + +/** An immutable client-side representation of ServerVulnerabilityAssessment. */ +public interface ServerVulnerabilityAssessment { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the storageContainerPath property: A blob storage container path to hold the scan results (e.g. + * https://myStorage.blob.core.windows.net/VaScans/). + * + * @return the storageContainerPath value. + */ + String storageContainerPath(); + + /** + * Gets the storageContainerSasKey property: A shared access signature (SAS Key) that has read and write access to + * the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, + * StorageContainerSasKey is required. + * + * @return the storageContainerSasKey value. + */ + String storageContainerSasKey(); + + /** + * Gets the storageAccountAccessKey property: Specifies the identifier key of the storage account for vulnerability + * assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required. + * + * @return the storageAccountAccessKey value. + */ + String storageAccountAccessKey(); + + /** + * Gets the recurringScans property: The recurring scans settings. + * + * @return the recurringScans value. + */ + VulnerabilityAssessmentRecurringScansProperties recurringScans(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.ServerVulnerabilityAssessmentInner object. + * + * @return the inner object. + */ + ServerVulnerabilityAssessmentInner innerModel(); + + /** The entirety of the ServerVulnerabilityAssessment definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ServerVulnerabilityAssessment definition stages. */ + interface DefinitionStages { + /** The first stage of the ServerVulnerabilityAssessment definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ServerVulnerabilityAssessment definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * 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 ServerVulnerabilityAssessment definition which contains all the minimum required properties + * for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithStorageContainerPath, + DefinitionStages.WithStorageContainerSasKey, + DefinitionStages.WithStorageAccountAccessKey, + DefinitionStages.WithRecurringScans { + /** + * Executes the create request. + * + * @return the created resource. + */ + ServerVulnerabilityAssessment create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ServerVulnerabilityAssessment create(Context context); + } + /** The stage of the ServerVulnerabilityAssessment definition allowing to specify storageContainerPath. */ + interface WithStorageContainerPath { + /** + * Specifies the storageContainerPath property: A blob storage container path to hold the scan results (e.g. + * https://myStorage.blob.core.windows.net/VaScans/).. + * + * @param storageContainerPath A blob storage container path to hold the scan results (e.g. + * https://myStorage.blob.core.windows.net/VaScans/). + * @return the next definition stage. + */ + WithCreate withStorageContainerPath(String storageContainerPath); + } + /** The stage of the ServerVulnerabilityAssessment definition allowing to specify storageContainerSasKey. */ + interface WithStorageContainerSasKey { + /** + * Specifies the storageContainerSasKey property: A shared access signature (SAS Key) that has read and + * write access to the blob container specified in 'storageContainerPath' parameter. If + * 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is required.. + * + * @param storageContainerSasKey A shared access signature (SAS Key) that has read and write access to the + * blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't + * specified, StorageContainerSasKey is required. + * @return the next definition stage. + */ + WithCreate withStorageContainerSasKey(String storageContainerSasKey); + } + /** The stage of the ServerVulnerabilityAssessment definition allowing to specify storageAccountAccessKey. */ + interface WithStorageAccountAccessKey { + /** + * Specifies the storageAccountAccessKey property: Specifies the identifier key of the storage account for + * vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, + * storageAccountAccessKey is required.. + * + * @param storageAccountAccessKey Specifies the identifier key of the storage account for vulnerability + * assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is + * required. + * @return the next definition stage. + */ + WithCreate withStorageAccountAccessKey(String storageAccountAccessKey); + } + /** The stage of the ServerVulnerabilityAssessment definition allowing to specify recurringScans. */ + interface WithRecurringScans { + /** + * Specifies the recurringScans property: The recurring scans settings. + * + * @param recurringScans The recurring scans settings. + * @return the next definition stage. + */ + WithCreate withRecurringScans(VulnerabilityAssessmentRecurringScansProperties recurringScans); + } + } + /** + * Begins update for the ServerVulnerabilityAssessment resource. + * + * @return the stage of resource update. + */ + ServerVulnerabilityAssessment.Update update(); + + /** The template for ServerVulnerabilityAssessment update. */ + interface Update + extends UpdateStages.WithStorageContainerPath, + UpdateStages.WithStorageContainerSasKey, + UpdateStages.WithStorageAccountAccessKey, + UpdateStages.WithRecurringScans { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ServerVulnerabilityAssessment apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ServerVulnerabilityAssessment apply(Context context); + } + /** The ServerVulnerabilityAssessment update stages. */ + interface UpdateStages { + /** The stage of the ServerVulnerabilityAssessment update allowing to specify storageContainerPath. */ + interface WithStorageContainerPath { + /** + * Specifies the storageContainerPath property: A blob storage container path to hold the scan results (e.g. + * https://myStorage.blob.core.windows.net/VaScans/).. + * + * @param storageContainerPath A blob storage container path to hold the scan results (e.g. + * https://myStorage.blob.core.windows.net/VaScans/). + * @return the next definition stage. + */ + Update withStorageContainerPath(String storageContainerPath); + } + /** The stage of the ServerVulnerabilityAssessment update allowing to specify storageContainerSasKey. */ + interface WithStorageContainerSasKey { + /** + * Specifies the storageContainerSasKey property: A shared access signature (SAS Key) that has read and + * write access to the blob container specified in 'storageContainerPath' parameter. If + * 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is required.. + * + * @param storageContainerSasKey A shared access signature (SAS Key) that has read and write access to the + * blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't + * specified, StorageContainerSasKey is required. + * @return the next definition stage. + */ + Update withStorageContainerSasKey(String storageContainerSasKey); + } + /** The stage of the ServerVulnerabilityAssessment update allowing to specify storageAccountAccessKey. */ + interface WithStorageAccountAccessKey { + /** + * Specifies the storageAccountAccessKey property: Specifies the identifier key of the storage account for + * vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, + * storageAccountAccessKey is required.. + * + * @param storageAccountAccessKey Specifies the identifier key of the storage account for vulnerability + * assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is + * required. + * @return the next definition stage. + */ + Update withStorageAccountAccessKey(String storageAccountAccessKey); + } + /** The stage of the ServerVulnerabilityAssessment update allowing to specify recurringScans. */ + interface WithRecurringScans { + /** + * Specifies the recurringScans property: The recurring scans settings. + * + * @param recurringScans The recurring scans settings. + * @return the next definition stage. + */ + Update withRecurringScans(VulnerabilityAssessmentRecurringScansProperties recurringScans); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ServerVulnerabilityAssessment refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ServerVulnerabilityAssessment refresh(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerVulnerabilityAssessmentListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerVulnerabilityAssessmentListResult.java new file mode 100644 index 0000000000000..b5306752e5549 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/ServerVulnerabilityAssessmentListResult.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.ServerVulnerabilityAssessmentInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of the server's vulnerability assessments. */ +@Immutable +public final class ServerVulnerabilityAssessmentListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerVulnerabilityAssessmentListResult.class); + + /* + * Array of results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Sku.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Sku.java new file mode 100644 index 0000000000000..a3ef301ce8d10 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Sku.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SQL pool SKU. */ +@Fluent +public final class Sku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Sku.class); + + /* + * The service tier + */ + @JsonProperty(value = "tier") + private String tier; + + /* + * The SKU name + */ + @JsonProperty(value = "name") + private String name; + + /* + * If the SKU supports scale out/in then the capacity integer should be + * included. If scale out/in is not possible for the resource this may be + * omitted. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get the tier property: The service tier. + * + * @return the tier value. + */ + public String tier() { + return this.tier; + } + + /** + * Set the tier property: The service tier. + * + * @param tier the tier value to set. + * @return the Sku object itself. + */ + public Sku withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the name property: The SKU name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The SKU name. + * + * @param name the name value to set. + * @return the Sku object itself. + */ + public Sku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the capacity property: If the SKU supports scale out/in then the capacity integer should be included. If + * scale out/in is not possible for the resource this may be omitted. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity property: If the SKU supports scale out/in then the capacity integer should be included. If + * scale out/in is not possible for the resource this may be omitted. + * + * @param capacity the capacity value to set. + * @return the Sku object itself. + */ + public Sku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPool.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPool.java new file mode 100644 index 0000000000000..e7f878daf3359 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPool.java @@ -0,0 +1,580 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolInner; +import java.time.OffsetDateTime; +import java.util.Map; + +/** An immutable client-side representation of SqlPool. */ +public interface SqlPool { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the sku property: SQL pool SKU. + * + * @return the sku value. + */ + Sku sku(); + + /** + * Gets the maxSizeBytes property: Maximum size in bytes. + * + * @return the maxSizeBytes value. + */ + Long maxSizeBytes(); + + /** + * Gets the collation property: Collation mode. + * + * @return the collation value. + */ + String collation(); + + /** + * Gets the sourceDatabaseId property: Source database to create from. + * + * @return the sourceDatabaseId value. + */ + String sourceDatabaseId(); + + /** + * Gets the recoverableDatabaseId property: Backup database to restore from. + * + * @return the recoverableDatabaseId value. + */ + String recoverableDatabaseId(); + + /** + * Gets the provisioningState property: Resource state. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the status property: Resource status. + * + * @return the status value. + */ + String status(); + + /** + * Gets the restorePointInTime property: Snapshot time to restore. + * + * @return the restorePointInTime value. + */ + String restorePointInTime(); + + /** + * Gets the createMode property: What is this?. + * + * @return the createMode value. + */ + String createMode(); + + /** + * Gets the creationDate property: Date the SQL pool was created. + * + * @return the creationDate value. + */ + OffsetDateTime creationDate(); + + /** + * Gets the storageAccountType property: The storage account type used to store backups for this sql pool. + * + * @return the storageAccountType value. + */ + StorageAccountType storageAccountType(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.SqlPoolInner object. + * + * @return the inner object. + */ + SqlPoolInner innerModel(); + + /** The entirety of the SqlPool definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, + DefinitionStages.WithCreate { + } + /** The SqlPool definition stages. */ + interface DefinitionStages { + /** The first stage of the SqlPool definition. */ + interface Blank extends WithLocation { + } + /** The stage of the SqlPool definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + /** The stage of the SqlPool definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * 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 SqlPool definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithSku, + DefinitionStages.WithMaxSizeBytes, + DefinitionStages.WithCollation, + DefinitionStages.WithSourceDatabaseId, + DefinitionStages.WithRecoverableDatabaseId, + DefinitionStages.WithProvisioningState, + DefinitionStages.WithStatus, + DefinitionStages.WithRestorePointInTime, + DefinitionStages.WithCreateMode, + DefinitionStages.WithCreationDate, + DefinitionStages.WithStorageAccountType { + /** + * Executes the create request. + * + * @return the created resource. + */ + SqlPool create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SqlPool create(Context context); + } + /** The stage of the SqlPool definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the SqlPool definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: SQL pool SKU. + * + * @param sku SQL pool SKU. + * @return the next definition stage. + */ + WithCreate withSku(Sku sku); + } + /** The stage of the SqlPool definition allowing to specify maxSizeBytes. */ + interface WithMaxSizeBytes { + /** + * Specifies the maxSizeBytes property: Maximum size in bytes. + * + * @param maxSizeBytes Maximum size in bytes. + * @return the next definition stage. + */ + WithCreate withMaxSizeBytes(Long maxSizeBytes); + } + /** The stage of the SqlPool definition allowing to specify collation. */ + interface WithCollation { + /** + * Specifies the collation property: Collation mode. + * + * @param collation Collation mode. + * @return the next definition stage. + */ + WithCreate withCollation(String collation); + } + /** The stage of the SqlPool definition allowing to specify sourceDatabaseId. */ + interface WithSourceDatabaseId { + /** + * Specifies the sourceDatabaseId property: Source database to create from. + * + * @param sourceDatabaseId Source database to create from. + * @return the next definition stage. + */ + WithCreate withSourceDatabaseId(String sourceDatabaseId); + } + /** The stage of the SqlPool definition allowing to specify recoverableDatabaseId. */ + interface WithRecoverableDatabaseId { + /** + * Specifies the recoverableDatabaseId property: Backup database to restore from. + * + * @param recoverableDatabaseId Backup database to restore from. + * @return the next definition stage. + */ + WithCreate withRecoverableDatabaseId(String recoverableDatabaseId); + } + /** The stage of the SqlPool definition allowing to specify provisioningState. */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: Resource state. + * + * @param provisioningState Resource state. + * @return the next definition stage. + */ + WithCreate withProvisioningState(String provisioningState); + } + /** The stage of the SqlPool definition allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: Resource status. + * + * @param status Resource status. + * @return the next definition stage. + */ + WithCreate withStatus(String status); + } + /** The stage of the SqlPool definition allowing to specify restorePointInTime. */ + interface WithRestorePointInTime { + /** + * Specifies the restorePointInTime property: Snapshot time to restore. + * + * @param restorePointInTime Snapshot time to restore. + * @return the next definition stage. + */ + WithCreate withRestorePointInTime(String restorePointInTime); + } + /** The stage of the SqlPool definition allowing to specify createMode. */ + interface WithCreateMode { + /** + * Specifies the createMode property: What is this?. + * + * @param createMode What is this?. + * @return the next definition stage. + */ + WithCreate withCreateMode(String createMode); + } + /** The stage of the SqlPool definition allowing to specify creationDate. */ + interface WithCreationDate { + /** + * Specifies the creationDate property: Date the SQL pool was created. + * + * @param creationDate Date the SQL pool was created. + * @return the next definition stage. + */ + WithCreate withCreationDate(OffsetDateTime creationDate); + } + /** The stage of the SqlPool definition allowing to specify storageAccountType. */ + interface WithStorageAccountType { + /** + * Specifies the storageAccountType property: The storage account type used to store backups for this sql + * pool.. + * + * @param storageAccountType The storage account type used to store backups for this sql pool. + * @return the next definition stage. + */ + WithCreate withStorageAccountType(StorageAccountType storageAccountType); + } + } + /** + * Begins update for the SqlPool resource. + * + * @return the stage of resource update. + */ + SqlPool.Update update(); + + /** The template for SqlPool update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithSku, + UpdateStages.WithMaxSizeBytes, + UpdateStages.WithCollation, + UpdateStages.WithSourceDatabaseId, + UpdateStages.WithRecoverableDatabaseId, + UpdateStages.WithProvisioningState, + UpdateStages.WithStatus, + UpdateStages.WithRestorePointInTime, + UpdateStages.WithCreateMode, + UpdateStages.WithCreationDate, + UpdateStages.WithStorageAccountType { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SqlPool apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SqlPool apply(Context context); + } + /** The SqlPool update stages. */ + interface UpdateStages { + /** The stage of the SqlPool update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the SqlPool update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: SQL pool SKU. + * + * @param sku SQL pool SKU. + * @return the next definition stage. + */ + Update withSku(Sku sku); + } + /** The stage of the SqlPool update allowing to specify maxSizeBytes. */ + interface WithMaxSizeBytes { + /** + * Specifies the maxSizeBytes property: Maximum size in bytes. + * + * @param maxSizeBytes Maximum size in bytes. + * @return the next definition stage. + */ + Update withMaxSizeBytes(Long maxSizeBytes); + } + /** The stage of the SqlPool update allowing to specify collation. */ + interface WithCollation { + /** + * Specifies the collation property: Collation mode. + * + * @param collation Collation mode. + * @return the next definition stage. + */ + Update withCollation(String collation); + } + /** The stage of the SqlPool update allowing to specify sourceDatabaseId. */ + interface WithSourceDatabaseId { + /** + * Specifies the sourceDatabaseId property: Source database to create from. + * + * @param sourceDatabaseId Source database to create from. + * @return the next definition stage. + */ + Update withSourceDatabaseId(String sourceDatabaseId); + } + /** The stage of the SqlPool update allowing to specify recoverableDatabaseId. */ + interface WithRecoverableDatabaseId { + /** + * Specifies the recoverableDatabaseId property: Backup database to restore from. + * + * @param recoverableDatabaseId Backup database to restore from. + * @return the next definition stage. + */ + Update withRecoverableDatabaseId(String recoverableDatabaseId); + } + /** The stage of the SqlPool update allowing to specify provisioningState. */ + interface WithProvisioningState { + /** + * Specifies the provisioningState property: Resource state. + * + * @param provisioningState Resource state. + * @return the next definition stage. + */ + Update withProvisioningState(String provisioningState); + } + /** The stage of the SqlPool update allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: Resource status. + * + * @param status Resource status. + * @return the next definition stage. + */ + Update withStatus(String status); + } + /** The stage of the SqlPool update allowing to specify restorePointInTime. */ + interface WithRestorePointInTime { + /** + * Specifies the restorePointInTime property: Snapshot time to restore. + * + * @param restorePointInTime Snapshot time to restore. + * @return the next definition stage. + */ + Update withRestorePointInTime(String restorePointInTime); + } + /** The stage of the SqlPool update allowing to specify createMode. */ + interface WithCreateMode { + /** + * Specifies the createMode property: What is this?. + * + * @param createMode What is this?. + * @return the next definition stage. + */ + Update withCreateMode(String createMode); + } + /** The stage of the SqlPool update allowing to specify creationDate. */ + interface WithCreationDate { + /** + * Specifies the creationDate property: Date the SQL pool was created. + * + * @param creationDate Date the SQL pool was created. + * @return the next definition stage. + */ + Update withCreationDate(OffsetDateTime creationDate); + } + /** The stage of the SqlPool update allowing to specify storageAccountType. */ + interface WithStorageAccountType { + /** + * Specifies the storageAccountType property: The storage account type used to store backups for this sql + * pool.. + * + * @param storageAccountType The storage account type used to store backups for this sql pool. + * @return the next definition stage. + */ + Update withStorageAccountType(StorageAccountType storageAccountType); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SqlPool refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SqlPool refresh(Context context); + + /** + * Pause a SQL pool. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + Object pause(); + + /** + * Pause a SQL pool. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + Object pause(Context context); + + /** + * Resume a SQL pool. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + Object resume(); + + /** + * Resume a SQL pool. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + Object resume(Context context); + + /** + * Rename a SQL pool. + * + * @param parameters The resource move definition for renaming this Sql pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void rename(ResourceMoveDefinition parameters); + + /** + * Rename a SQL pool. + * + * @param parameters The resource move definition for renaming this Sql pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response renameWithResponse(ResourceMoveDefinition parameters, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolBlobAuditingPolicies.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolBlobAuditingPolicies.java new file mode 100644 index 0000000000000..663771e809c71 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolBlobAuditingPolicies.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SqlPoolBlobAuditingPolicies. */ +public interface SqlPoolBlobAuditingPolicies { + /** + * Get a 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's blob auditing policy. + */ + SqlPoolBlobAuditingPolicy get(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Get a 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's blob auditing policy. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool auditing settings. + */ + PagedIterable listBySqlPool( + 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool auditing settings. + */ + PagedIterable listBySqlPool( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * Get a SQL pool's blob auditing policy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's blob auditing policy. + */ + SqlPoolBlobAuditingPolicy getById(String id); + + /** + * Get a SQL pool's blob auditing policy. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's blob auditing policy. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SqlPoolBlobAuditingPolicy resource. + * + * @return the first stage of the new SqlPoolBlobAuditingPolicy definition. + */ + SqlPoolBlobAuditingPolicy.DefinitionStages.Blank define(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolBlobAuditingPolicy.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolBlobAuditingPolicy.java new file mode 100644 index 0000000000000..c96198dd0401a --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolBlobAuditingPolicy.java @@ -0,0 +1,631 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolBlobAuditingPolicyInner; +import java.util.List; +import java.util.UUID; + +/** An immutable client-side representation of SqlPoolBlobAuditingPolicy. */ +public interface SqlPoolBlobAuditingPolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the kind property: Resource kind. + * + * @return the kind value. + */ + String kind(); + + /** + * Gets the state property: Specifies the state of the policy. If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled are required. + * + * @return the state value. + */ + BlobAuditingPolicyState state(); + + /** + * Gets the storageEndpoint property: Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint is required. + * + * @return the storageEndpoint value. + */ + String storageEndpoint(); + + /** + * Gets the storageAccountAccessKey property: Specifies the identifier key of the auditing storage account. If state + * is Enabled and storageEndpoint is specified, storageAccountAccessKey is required. + * + * @return the storageAccountAccessKey value. + */ + String storageAccountAccessKey(); + + /** + * Gets the retentionDays property: Specifies the number of days to keep in the audit logs in the storage account. + * + * @return the retentionDays value. + */ + Integer retentionDays(); + + /** + * Gets the auditActionsAndGroups property: 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. + */ + List auditActionsAndGroups(); + + /** + * Gets the storageAccountSubscriptionId property: Specifies the blob storage subscription Id. + * + * @return the storageAccountSubscriptionId value. + */ + UUID storageAccountSubscriptionId(); + + /** + * Gets the isStorageSecondaryKeyInUse property: Specifies whether storageAccountAccessKey value is the storage's + * secondary key. + * + * @return the isStorageSecondaryKeyInUse value. + */ + Boolean isStorageSecondaryKeyInUse(); + + /** + * Gets the isAzureMonitorTargetEnabled property: 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. + */ + Boolean isAzureMonitorTargetEnabled(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.SqlPoolBlobAuditingPolicyInner object. + * + * @return the inner object. + */ + SqlPoolBlobAuditingPolicyInner innerModel(); + + /** The entirety of the SqlPoolBlobAuditingPolicy definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The SqlPoolBlobAuditingPolicy definition stages. */ + interface DefinitionStages { + /** The first stage of the SqlPoolBlobAuditingPolicy definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the SqlPoolBlobAuditingPolicy definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * 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. + */ + WithCreate withExistingSqlPool(String resourceGroupName, String workspaceName, String sqlPoolName); + } + /** + * The stage of the SqlPoolBlobAuditingPolicy definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithState, + DefinitionStages.WithStorageEndpoint, + DefinitionStages.WithStorageAccountAccessKey, + DefinitionStages.WithRetentionDays, + DefinitionStages.WithAuditActionsAndGroups, + DefinitionStages.WithStorageAccountSubscriptionId, + DefinitionStages.WithIsStorageSecondaryKeyInUse, + DefinitionStages.WithIsAzureMonitorTargetEnabled { + /** + * Executes the create request. + * + * @return the created resource. + */ + SqlPoolBlobAuditingPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SqlPoolBlobAuditingPolicy create(Context context); + } + /** The stage of the SqlPoolBlobAuditingPolicy definition allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: Specifies the state of the policy. If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled are required.. + * + * @param state Specifies the state of the policy. If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled are required. + * @return the next definition stage. + */ + WithCreate withState(BlobAuditingPolicyState state); + } + /** The stage of the SqlPoolBlobAuditingPolicy definition allowing to specify storageEndpoint. */ + interface WithStorageEndpoint { + /** + * Specifies the storageEndpoint property: Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint is required.. + * + * @param storageEndpoint Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint is required. + * @return the next definition stage. + */ + WithCreate withStorageEndpoint(String storageEndpoint); + } + /** The stage of the SqlPoolBlobAuditingPolicy definition allowing to specify storageAccountAccessKey. */ + interface WithStorageAccountAccessKey { + /** + * Specifies the storageAccountAccessKey property: Specifies the identifier key of the auditing storage + * account. If state is Enabled and storageEndpoint is specified, storageAccountAccessKey is required.. + * + * @param storageAccountAccessKey Specifies the identifier key of the auditing storage account. If state is + * Enabled and storageEndpoint is specified, storageAccountAccessKey is required. + * @return the next definition stage. + */ + WithCreate withStorageAccountAccessKey(String storageAccountAccessKey); + } + /** The stage of the SqlPoolBlobAuditingPolicy definition allowing to specify retentionDays. */ + interface WithRetentionDays { + /** + * Specifies the retentionDays property: Specifies the number of days to keep in the audit logs in the + * storage account.. + * + * @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 SqlPoolBlobAuditingPolicy definition allowing to specify auditActionsAndGroups. */ + interface WithAuditActionsAndGroups { + /** + * Specifies the auditActionsAndGroups property: 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 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 SqlPoolBlobAuditingPolicy definition allowing to specify storageAccountSubscriptionId. */ + interface WithStorageAccountSubscriptionId { + /** + * Specifies the storageAccountSubscriptionId property: Specifies the blob storage subscription Id.. + * + * @param storageAccountSubscriptionId Specifies the blob storage subscription Id. + * @return the next definition stage. + */ + WithCreate withStorageAccountSubscriptionId(UUID storageAccountSubscriptionId); + } + /** The stage of the SqlPoolBlobAuditingPolicy definition allowing to specify isStorageSecondaryKeyInUse. */ + interface WithIsStorageSecondaryKeyInUse { + /** + * Specifies the isStorageSecondaryKeyInUse property: Specifies whether storageAccountAccessKey value is the + * storage's secondary key.. + * + * @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 SqlPoolBlobAuditingPolicy definition allowing to specify isAzureMonitorTargetEnabled. */ + interface WithIsAzureMonitorTargetEnabled { + /** + * Specifies the isAzureMonitorTargetEnabled property: 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 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); + } + } + /** + * Begins update for the SqlPoolBlobAuditingPolicy resource. + * + * @return the stage of resource update. + */ + SqlPoolBlobAuditingPolicy.Update update(); + + /** The template for SqlPoolBlobAuditingPolicy update. */ + interface Update + extends UpdateStages.WithState, + UpdateStages.WithStorageEndpoint, + UpdateStages.WithStorageAccountAccessKey, + UpdateStages.WithRetentionDays, + UpdateStages.WithAuditActionsAndGroups, + UpdateStages.WithStorageAccountSubscriptionId, + UpdateStages.WithIsStorageSecondaryKeyInUse, + UpdateStages.WithIsAzureMonitorTargetEnabled { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SqlPoolBlobAuditingPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SqlPoolBlobAuditingPolicy apply(Context context); + } + /** The SqlPoolBlobAuditingPolicy update stages. */ + interface UpdateStages { + /** The stage of the SqlPoolBlobAuditingPolicy update allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: Specifies the state of the policy. If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled are required.. + * + * @param state Specifies the state of the policy. If state is Enabled, storageEndpoint or + * isAzureMonitorTargetEnabled are required. + * @return the next definition stage. + */ + Update withState(BlobAuditingPolicyState state); + } + /** The stage of the SqlPoolBlobAuditingPolicy update allowing to specify storageEndpoint. */ + interface WithStorageEndpoint { + /** + * Specifies the storageEndpoint property: Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint is required.. + * + * @param storageEndpoint Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint is required. + * @return the next definition stage. + */ + Update withStorageEndpoint(String storageEndpoint); + } + /** The stage of the SqlPoolBlobAuditingPolicy update allowing to specify storageAccountAccessKey. */ + interface WithStorageAccountAccessKey { + /** + * Specifies the storageAccountAccessKey property: Specifies the identifier key of the auditing storage + * account. If state is Enabled and storageEndpoint is specified, storageAccountAccessKey is required.. + * + * @param storageAccountAccessKey Specifies the identifier key of the auditing storage account. If state is + * Enabled and storageEndpoint is specified, storageAccountAccessKey is required. + * @return the next definition stage. + */ + Update withStorageAccountAccessKey(String storageAccountAccessKey); + } + /** The stage of the SqlPoolBlobAuditingPolicy update allowing to specify retentionDays. */ + interface WithRetentionDays { + /** + * Specifies the retentionDays property: Specifies the number of days to keep in the audit logs in the + * storage account.. + * + * @param retentionDays Specifies the number of days to keep in the audit logs in the storage account. + * @return the next definition stage. + */ + Update withRetentionDays(Integer retentionDays); + } + /** The stage of the SqlPoolBlobAuditingPolicy update allowing to specify auditActionsAndGroups. */ + interface WithAuditActionsAndGroups { + /** + * Specifies the auditActionsAndGroups property: 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 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. + */ + Update withAuditActionsAndGroups(List auditActionsAndGroups); + } + /** The stage of the SqlPoolBlobAuditingPolicy update allowing to specify storageAccountSubscriptionId. */ + interface WithStorageAccountSubscriptionId { + /** + * Specifies the storageAccountSubscriptionId property: Specifies the blob storage subscription Id.. + * + * @param storageAccountSubscriptionId Specifies the blob storage subscription Id. + * @return the next definition stage. + */ + Update withStorageAccountSubscriptionId(UUID storageAccountSubscriptionId); + } + /** The stage of the SqlPoolBlobAuditingPolicy update allowing to specify isStorageSecondaryKeyInUse. */ + interface WithIsStorageSecondaryKeyInUse { + /** + * Specifies the isStorageSecondaryKeyInUse property: Specifies whether storageAccountAccessKey value is the + * storage's secondary key.. + * + * @param isStorageSecondaryKeyInUse Specifies whether storageAccountAccessKey value is the storage's + * secondary key. + * @return the next definition stage. + */ + Update withIsStorageSecondaryKeyInUse(Boolean isStorageSecondaryKeyInUse); + } + /** The stage of the SqlPoolBlobAuditingPolicy update allowing to specify isAzureMonitorTargetEnabled. */ + interface WithIsAzureMonitorTargetEnabled { + /** + * Specifies the isAzureMonitorTargetEnabled property: 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 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. + */ + Update withIsAzureMonitorTargetEnabled(Boolean isAzureMonitorTargetEnabled); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SqlPoolBlobAuditingPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SqlPoolBlobAuditingPolicy refresh(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolBlobAuditingPolicyListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolBlobAuditingPolicyListResult.java new file mode 100644 index 0000000000000..d1b2800084ce2 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolBlobAuditingPolicyListResult.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolBlobAuditingPolicyInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of Sql pool auditing settings. */ +@Immutable +public final class SqlPoolBlobAuditingPolicyListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolBlobAuditingPolicyListResult.class); + + /* + * Array of results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolBlobAuditingPolicySqlPoolOperationListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolBlobAuditingPolicySqlPoolOperationListResult.java new file mode 100644 index 0000000000000..5a29296708318 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolBlobAuditingPolicySqlPoolOperationListResult.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolOperationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response to a list Sql pool operations request. */ +@Immutable +public final class SqlPoolBlobAuditingPolicySqlPoolOperationListResult { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(SqlPoolBlobAuditingPolicySqlPoolOperationListResult.class); + + /* + * Array of results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolColumn.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolColumn.java new file mode 100644 index 0000000000000..86a57749d3faa --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolColumn.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolColumnInner; + +/** An immutable client-side representation of SqlPoolColumn. */ +public interface SqlPoolColumn { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the columnType property: The column data type. + * + * @return the columnType value. + */ + ColumnDataType columnType(); + + /** + * Gets the isComputed property: Indicates whether column value is computed or not. + * + * @return the isComputed value. + */ + Boolean isComputed(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.SqlPoolColumnInner object. + * + * @return the inner object. + */ + SqlPoolColumnInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolColumnListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolColumnListResult.java new file mode 100644 index 0000000000000..8846f45d39749 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolColumnListResult.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolColumnInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of Sql pool columns. */ +@Immutable +public final class SqlPoolColumnListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolColumnListResult.class); + + /* + * Array of results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolColumns.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolColumns.java new file mode 100644 index 0000000000000..880d0849077db --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolColumns.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SqlPoolColumns. */ +public interface SqlPoolColumns { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql pool column. + */ + SqlPoolColumn get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql pool column. + */ + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolConnectionPolicies.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolConnectionPolicies.java new file mode 100644 index 0000000000000..607aff7709457 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolConnectionPolicies.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SqlPoolConnectionPolicies. */ +public interface SqlPoolConnectionPolicies { + /** + * Get a Sql pool's connection policy, which is used with table auditing. + * + * @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 connectionPolicyName The name of the connection policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's connection policy, which is used with table auditing. + */ + SqlPoolConnectionPolicy get( + String resourceGroupName, String workspaceName, String sqlPoolName, ConnectionPolicyName connectionPolicyName); + + /** + * Get a Sql pool's connection policy, which is used with table auditing. + * + * @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 connectionPolicyName The name of the connection policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's connection policy, which is used with table auditing. + */ + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + ConnectionPolicyName connectionPolicyName, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolConnectionPolicy.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolConnectionPolicy.java new file mode 100644 index 0000000000000..46273c25bb312 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolConnectionPolicy.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolConnectionPolicyInner; + +/** An immutable client-side representation of SqlPoolConnectionPolicy. */ +public interface SqlPoolConnectionPolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the kind property: Resource kind. + * + * @return the kind value. + */ + String kind(); + + /** + * Gets the location property: Resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the securityEnabledAccess property: The state of security access. + * + * @return the securityEnabledAccess value. + */ + String securityEnabledAccess(); + + /** + * Gets the proxyDnsName property: The fully qualified host name of the auditing proxy. + * + * @return the proxyDnsName value. + */ + String proxyDnsName(); + + /** + * Gets the proxyPort property: The port number of the auditing proxy. + * + * @return the proxyPort value. + */ + String proxyPort(); + + /** + * Gets the visibility property: The visibility of the auditing proxy. + * + * @return the visibility value. + */ + String visibility(); + + /** + * Gets the useServerDefault property: Whether server default is enabled or disabled. + * + * @return the useServerDefault value. + */ + String useServerDefault(); + + /** + * Gets the redirectionState property: The state of proxy redirection. + * + * @return the redirectionState value. + */ + String redirectionState(); + + /** + * Gets the state property: The connection policy state. + * + * @return the state value. + */ + String state(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.SqlPoolConnectionPolicyInner object. + * + * @return the inner object. + */ + SqlPoolConnectionPolicyInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolDataWarehouseUserActivities.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolDataWarehouseUserActivities.java new file mode 100644 index 0000000000000..8b9a2b7cec7cb --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolDataWarehouseUserActivities.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SqlPoolDataWarehouseUserActivities. */ +public interface SqlPoolDataWarehouseUserActivities { + /** + * Gets the user activities of a SQL pool which includes running and suspended queries. + * + * @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 dataWarehouseUserActivityName The activity name of the Sql pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the user activities of a SQL pool which includes running and suspended queries. + */ + DataWarehouseUserActivities get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + DataWarehouseUserActivityName dataWarehouseUserActivityName); + + /** + * Gets the user activities of a SQL pool which includes running and suspended queries. + * + * @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 dataWarehouseUserActivityName The activity name of the Sql pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the user activities of a SQL pool which includes running and suspended queries. + */ + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + DataWarehouseUserActivityName dataWarehouseUserActivityName, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolGeoBackupPolicies.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolGeoBackupPolicies.java new file mode 100644 index 0000000000000..765646ae84be4 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolGeoBackupPolicies.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SqlPoolGeoBackupPolicies. */ +public interface SqlPoolGeoBackupPolicies { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pool geo backup policies. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pool geo backup policies. + */ + PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * Get the specified SQL pool geo backup 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 geoBackupPolicyName The name of the geo backup policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified SQL pool geo backup policy. + */ + GeoBackupPolicy get( + String resourceGroupName, String workspaceName, String sqlPoolName, GeoBackupPolicyName geoBackupPolicyName); + + /** + * Get the specified SQL pool geo backup 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 geoBackupPolicyName The name of the geo backup policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified SQL pool geo backup policy. + */ + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + GeoBackupPolicyName geoBackupPolicyName, + Context context); + + /** + * Get the specified SQL pool geo backup policy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified SQL pool geo backup policy. + */ + GeoBackupPolicy getById(String id); + + /** + * Get the specified SQL pool geo backup policy. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified SQL pool geo backup policy. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new GeoBackupPolicy resource. + * + * @param name resource name. + * @return the first stage of the new GeoBackupPolicy definition. + */ + GeoBackupPolicy.DefinitionStages.Blank define(GeoBackupPolicyName name); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolInfoListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolInfoListResult.java new file mode 100644 index 0000000000000..f2361f06e1729 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolInfoListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of SQL pools. */ +@Fluent +public final class SqlPoolInfoListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolInfoListResult.class); + + /* + * Link to the next page of results + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * List of SQL pools + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the nextLink property: Link to the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to the next page of results. + * + * @param nextLink the nextLink value to set. + * @return the SqlPoolInfoListResult object itself. + */ + public SqlPoolInfoListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: List of SQL pools. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of SQL pools. + * + * @param value the value value to set. + * @return the SqlPoolInfoListResult object itself. + */ + public SqlPoolInfoListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolMaintenanceWindowOptions.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolMaintenanceWindowOptions.java new file mode 100644 index 0000000000000..97e052225102b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolMaintenanceWindowOptions.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SqlPoolMaintenanceWindowOptions. */ +public interface SqlPoolMaintenanceWindowOptions { + /** + * Get list of SQL pool's available maintenance windows. + * + * @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 maintenanceWindowOptionsName Maintenance window options name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pool's available maintenance windows. + */ + MaintenanceWindowOptions get( + String resourceGroupName, String workspaceName, String sqlPoolName, String maintenanceWindowOptionsName); + + /** + * Get list of SQL pool's available maintenance windows. + * + * @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 maintenanceWindowOptionsName Maintenance window options name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pool's available maintenance windows. + */ + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String maintenanceWindowOptionsName, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolMaintenanceWindows.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolMaintenanceWindows.java new file mode 100644 index 0000000000000..632e4c0fca20e --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolMaintenanceWindows.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.MaintenanceWindowsInner; + +/** Resource collection API of SqlPoolMaintenanceWindows. */ +public interface SqlPoolMaintenanceWindows { + /** + * Get a SQL pool's Maintenance Windows. + * + * @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 maintenanceWindowName Maintenance window name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's Maintenance Windows. + */ + MaintenanceWindows get( + String resourceGroupName, String workspaceName, String sqlPoolName, String maintenanceWindowName); + + /** + * Get a SQL pool's Maintenance Windows. + * + * @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 maintenanceWindowName Maintenance window name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's Maintenance Windows. + */ + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String maintenanceWindowName, + Context context); + + /** + * Creates or updates a Sql pool's maintenance windows settings. + * + * @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 maintenanceWindowName Maintenance window name. + * @param parameters The required parameters for creating or updating Maintenance Windows settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void createOrUpdate( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String maintenanceWindowName, + MaintenanceWindowsInner parameters); + + /** + * Creates or updates a Sql pool's maintenance windows settings. + * + * @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 maintenanceWindowName Maintenance window name. + * @param parameters The required parameters for creating or updating Maintenance Windows settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response createOrUpdateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String maintenanceWindowName, + MaintenanceWindowsInner parameters, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolMetadataSyncConfigs.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolMetadataSyncConfigs.java new file mode 100644 index 0000000000000..db862e7ef9f05 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolMetadataSyncConfigs.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.MetadataSyncConfigInner; + +/** Resource collection API of SqlPoolMetadataSyncConfigs. */ +public interface SqlPoolMetadataSyncConfigs { + /** + * Get 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the metadata sync configuration for a SQL pool. + */ + MetadataSyncConfig get(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Get 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the metadata sync configuration for a SQL pool. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * 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 metadataSyncConfiguration Metadata sync configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration for metadata sync. + */ + MetadataSyncConfig create( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + MetadataSyncConfigInner metadataSyncConfiguration); + + /** + * 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 metadataSyncConfiguration Metadata sync configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return configuration for metadata sync. + */ + Response createWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + MetadataSyncConfigInner metadataSyncConfiguration, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolOperation.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolOperation.java new file mode 100644 index 0000000000000..0860f55ad51ba --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolOperation.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolOperationInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of SqlPoolOperation. */ +public interface SqlPoolOperation { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the databaseName property: The name of the Sql pool the operation is being performed on. + * + * @return the databaseName value. + */ + String databaseName(); + + /** + * Gets the operation property: The name of operation. + * + * @return the operation value. + */ + String operation(); + + /** + * Gets the operationFriendlyName property: The friendly name of operation. + * + * @return the operationFriendlyName value. + */ + String operationFriendlyName(); + + /** + * Gets the percentComplete property: The percentage of the operation completed. + * + * @return the percentComplete value. + */ + Integer percentComplete(); + + /** + * Gets the serverName property: The name of the server. + * + * @return the serverName value. + */ + String serverName(); + + /** + * Gets the startTime property: The operation start time. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the state property: The operation state. + * + * @return the state value. + */ + ManagementOperationState state(); + + /** + * Gets the errorCode property: The operation error code. + * + * @return the errorCode value. + */ + Integer errorCode(); + + /** + * Gets the errorDescription property: The operation error description. + * + * @return the errorDescription value. + */ + String errorDescription(); + + /** + * Gets the errorSeverity property: The operation error severity. + * + * @return the errorSeverity value. + */ + Integer errorSeverity(); + + /** + * Gets the isUserError property: Whether or not the error is a user error. + * + * @return the isUserError value. + */ + Boolean isUserError(); + + /** + * Gets the estimatedCompletionTime property: The estimated completion time of the operation. + * + * @return the estimatedCompletionTime value. + */ + OffsetDateTime estimatedCompletionTime(); + + /** + * Gets the description property: The operation description. + * + * @return the description value. + */ + String description(); + + /** + * Gets the isCancellable property: Whether the operation can be cancelled. + * + * @return the isCancellable value. + */ + Boolean isCancellable(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.SqlPoolOperationInner object. + * + * @return the inner object. + */ + SqlPoolOperationInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolOperationResults.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolOperationResults.java new file mode 100644 index 0000000000000..936e7c1f68235 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolOperationResults.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SqlPoolOperationResults. */ +public interface SqlPoolOperationResults { + /** + * Get the status of a SQL pool operation. + * + * @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 operationId Operation ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a SQL pool operation. + */ + Object getLocationHeaderResult( + String resourceGroupName, String workspaceName, String sqlPoolName, String operationId); + + /** + * Get the status of a SQL pool operation. + * + * @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 operationId Operation ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a SQL pool operation. + */ + Response getLocationHeaderResultWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, String operationId, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolOperations.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolOperations.java new file mode 100644 index 0000000000000..642b31ce498b4 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolOperations.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of SqlPoolOperations. */ +public interface SqlPoolOperations { + /** + * Gets a list of operations performed on the 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations performed on the SQL pool. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Gets a list of operations performed on the 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of operations performed on the SQL pool. + */ + PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolPatchInfo.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolPatchInfo.java new file mode 100644 index 0000000000000..c3caedfdd7f24 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolPatchInfo.java @@ -0,0 +1,369 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.Map; + +/** A SQL Analytics pool patch info. */ +@JsonFlatten +@Fluent +public class SqlPoolPatchInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolPatchInfo.class); + + /* + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * The geo-location where the resource lives + */ + @JsonProperty(value = "location") + private String location; + + /* + * SQL pool SKU + */ + @JsonProperty(value = "sku") + private Sku sku; + + /* + * Maximum size in bytes + */ + @JsonProperty(value = "properties.maxSizeBytes") + private Long maxSizeBytes; + + /* + * Collation mode + */ + @JsonProperty(value = "properties.collation") + private String collation; + + /* + * Source database to create from + */ + @JsonProperty(value = "properties.sourceDatabaseId") + private String sourceDatabaseId; + + /* + * Backup database to restore from + */ + @JsonProperty(value = "properties.recoverableDatabaseId") + private String recoverableDatabaseId; + + /* + * Resource state + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /* + * Resource status + */ + @JsonProperty(value = "properties.status") + private String status; + + /* + * Snapshot time to restore + */ + @JsonProperty(value = "properties.restorePointInTime") + private String restorePointInTime; + + /* + * What is this? + */ + @JsonProperty(value = "properties.createMode") + private String createMode; + + /* + * Date the SQL pool was created + */ + @JsonProperty(value = "properties.creationDate") + private OffsetDateTime creationDate; + + /* + * The storage account type used to store backups for this sql pool. + */ + @JsonProperty(value = "properties.storageAccountType") + private StorageAccountType storageAccountType; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the SqlPoolPatchInfo object itself. + */ + public SqlPoolPatchInfo withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the SqlPoolPatchInfo object itself. + */ + public SqlPoolPatchInfo withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the sku property: SQL pool SKU. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: SQL pool SKU. + * + * @param sku the sku value to set. + * @return the SqlPoolPatchInfo object itself. + */ + public SqlPoolPatchInfo withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the maxSizeBytes property: Maximum size in bytes. + * + * @return the maxSizeBytes value. + */ + public Long maxSizeBytes() { + return this.maxSizeBytes; + } + + /** + * Set the maxSizeBytes property: Maximum size in bytes. + * + * @param maxSizeBytes the maxSizeBytes value to set. + * @return the SqlPoolPatchInfo object itself. + */ + public SqlPoolPatchInfo withMaxSizeBytes(Long maxSizeBytes) { + this.maxSizeBytes = maxSizeBytes; + return this; + } + + /** + * Get the collation property: Collation mode. + * + * @return the collation value. + */ + public String collation() { + return this.collation; + } + + /** + * Set the collation property: Collation mode. + * + * @param collation the collation value to set. + * @return the SqlPoolPatchInfo object itself. + */ + public SqlPoolPatchInfo withCollation(String collation) { + this.collation = collation; + return this; + } + + /** + * Get the sourceDatabaseId property: Source database to create from. + * + * @return the sourceDatabaseId value. + */ + public String sourceDatabaseId() { + return this.sourceDatabaseId; + } + + /** + * Set the sourceDatabaseId property: Source database to create from. + * + * @param sourceDatabaseId the sourceDatabaseId value to set. + * @return the SqlPoolPatchInfo object itself. + */ + public SqlPoolPatchInfo withSourceDatabaseId(String sourceDatabaseId) { + this.sourceDatabaseId = sourceDatabaseId; + return this; + } + + /** + * Get the recoverableDatabaseId property: Backup database to restore from. + * + * @return the recoverableDatabaseId value. + */ + public String recoverableDatabaseId() { + return this.recoverableDatabaseId; + } + + /** + * Set the recoverableDatabaseId property: Backup database to restore from. + * + * @param recoverableDatabaseId the recoverableDatabaseId value to set. + * @return the SqlPoolPatchInfo object itself. + */ + public SqlPoolPatchInfo withRecoverableDatabaseId(String recoverableDatabaseId) { + this.recoverableDatabaseId = recoverableDatabaseId; + return this; + } + + /** + * Get the provisioningState property: Resource state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: Resource state. + * + * @param provisioningState the provisioningState value to set. + * @return the SqlPoolPatchInfo object itself. + */ + public SqlPoolPatchInfo withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the status property: Resource status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Resource status. + * + * @param status the status value to set. + * @return the SqlPoolPatchInfo object itself. + */ + public SqlPoolPatchInfo withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the restorePointInTime property: Snapshot time to restore. + * + * @return the restorePointInTime value. + */ + public String restorePointInTime() { + return this.restorePointInTime; + } + + /** + * Set the restorePointInTime property: Snapshot time to restore. + * + * @param restorePointInTime the restorePointInTime value to set. + * @return the SqlPoolPatchInfo object itself. + */ + public SqlPoolPatchInfo withRestorePointInTime(String restorePointInTime) { + this.restorePointInTime = restorePointInTime; + return this; + } + + /** + * Get the createMode property: What is this?. + * + * @return the createMode value. + */ + public String createMode() { + return this.createMode; + } + + /** + * Set the createMode property: What is this?. + * + * @param createMode the createMode value to set. + * @return the SqlPoolPatchInfo object itself. + */ + public SqlPoolPatchInfo withCreateMode(String createMode) { + this.createMode = createMode; + return this; + } + + /** + * Get the creationDate property: Date the SQL pool was created. + * + * @return the creationDate value. + */ + public OffsetDateTime creationDate() { + return this.creationDate; + } + + /** + * Set the creationDate property: Date the SQL pool was created. + * + * @param creationDate the creationDate value to set. + * @return the SqlPoolPatchInfo object itself. + */ + public SqlPoolPatchInfo withCreationDate(OffsetDateTime creationDate) { + this.creationDate = creationDate; + return this; + } + + /** + * Get the storageAccountType property: The storage account type used to store backups for this sql pool. + * + * @return the storageAccountType value. + */ + public StorageAccountType storageAccountType() { + return this.storageAccountType; + } + + /** + * Set the storageAccountType property: The storage account type used to store backups for this sql pool. + * + * @param storageAccountType the storageAccountType value to set. + * @return the SqlPoolPatchInfo object itself. + */ + public SqlPoolPatchInfo withStorageAccountType(StorageAccountType storageAccountType) { + this.storageAccountType = storageAccountType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolRecommendedSensitivityLabels.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolRecommendedSensitivityLabels.java new file mode 100644 index 0000000000000..999d0b7e09dae --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolRecommendedSensitivityLabels.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SqlPoolRecommendedSensitivityLabels. */ +public interface SqlPoolRecommendedSensitivityLabels { + /** + * Update recommended sensitivity labels states of a given SQL Pool using an operations batch. + * + * @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 A list of recommended sensitivity label update operations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void update( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + RecommendedSensitivityLabelUpdateList parameters); + + /** + * Update recommended sensitivity labels states of a given SQL Pool using an operations batch. + * + * @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 A list of recommended sensitivity label update operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response updateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + RecommendedSensitivityLabelUpdateList parameters, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolReplicationLinks.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolReplicationLinks.java new file mode 100644 index 0000000000000..c9f480a89c2ee --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolReplicationLinks.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SqlPoolReplicationLinks. */ +public interface SqlPoolReplicationLinks { + /** + * Lists a Sql pool's replication links. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the response to a List Sql pool replication link request. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Lists a Sql pool's replication links. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the response to a List Sql pool replication link request. + */ + PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool replication link by name. + */ + ReplicationLink getByName(String resourceGroupName, String workspaceName, String sqlPoolName, String linkId); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool replication link by name. + */ + Response getByNameWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, String linkId, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolRestorePoints.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolRestorePoints.java new file mode 100644 index 0000000000000..94e628320fe69 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolRestorePoints.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SqlPoolRestorePoints. */ +public interface SqlPoolRestorePoints { + /** + * Get SQL pool backup information. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool backup information. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Get SQL pool backup information. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool backup information. + */ + PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * Creates a restore point for a data warehouse. + * + * @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 definition for creating the restore point of this Sql pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database restore points. + */ + RestorePoint create( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + CreateSqlPoolRestorePointDefinition parameters); + + /** + * Creates a restore point for a data warehouse. + * + * @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 definition for creating the restore point of this Sql pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return database restore points. + */ + RestorePoint create( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + CreateSqlPoolRestorePointDefinition parameters, + Context context); + + /** + * 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. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a restore point. + */ + RestorePoint get(String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName); + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a restore point. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, String restorePointName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolSchemaListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolSchemaListResult.java new file mode 100644 index 0000000000000..4170b976c74a8 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolSchemaListResult.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of Sql pool schemas. */ +@Immutable +public final class SqlPoolSchemaListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolSchemaListResult.class); + + /* + * Array of results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolSchemas.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolSchemas.java new file mode 100644 index 0000000000000..bc62b3e03832c --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolSchemas.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.Resource; +import com.azure.core.util.Context; + +/** Resource collection API of SqlPoolSchemas. */ +public interface SqlPoolSchemas { + /** + * Gets schemas of a given 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schemas of a given SQL pool. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Gets schemas of a given 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 filter An OData filter expression that filters elements in the collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return schemas of a given SQL pool. + */ + PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, String filter, Context context); + + /** + * 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. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql Pool schema. + */ + Resource get(String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName); + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql Pool schema. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolSecurityAlertPolicies.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolSecurityAlertPolicies.java new file mode 100644 index 0000000000000..85d0f9cd5a9ed --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolSecurityAlertPolicies.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SqlPoolSecurityAlertPolicies. */ +public interface SqlPoolSecurityAlertPolicies { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool's security alert policies. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of Sql pool's security alert policies. + */ + PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * Get a Sql pool's security alert 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 securityAlertPolicyName The name of the security alert policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's security alert policy. + */ + SqlPoolSecurityAlertPolicy get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + SecurityAlertPolicyName securityAlertPolicyName); + + /** + * Get a Sql pool's security alert 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 securityAlertPolicyName The name of the security alert policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's security alert policy. + */ + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + SecurityAlertPolicyName securityAlertPolicyName, + Context context); + + /** + * Get a Sql pool's security alert policy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's security alert policy. + */ + SqlPoolSecurityAlertPolicy getById(String id); + + /** + * Get a Sql pool's security alert policy. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's security alert policy. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SqlPoolSecurityAlertPolicy resource. + * + * @param name resource name. + * @return the first stage of the new SqlPoolSecurityAlertPolicy definition. + */ + SqlPoolSecurityAlertPolicy.DefinitionStages.Blank define(SecurityAlertPolicyName name); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolSecurityAlertPolicy.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolSecurityAlertPolicy.java new file mode 100644 index 0000000000000..ad2d7496a39bd --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolSecurityAlertPolicy.java @@ -0,0 +1,363 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolSecurityAlertPolicyInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of SqlPoolSecurityAlertPolicy. */ +public interface SqlPoolSecurityAlertPolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the state property: Specifies the state of the policy, whether it is enabled or disabled or a policy has not + * been applied yet on the specific Sql pool. + * + * @return the state value. + */ + SecurityAlertPolicyState state(); + + /** + * Gets the disabledAlerts property: Specifies an array of alerts that are disabled. Allowed values are: + * Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action. + * + * @return the disabledAlerts value. + */ + List disabledAlerts(); + + /** + * Gets the emailAddresses property: Specifies an array of e-mail addresses to which the alert is sent. + * + * @return the emailAddresses value. + */ + List emailAddresses(); + + /** + * Gets the emailAccountAdmins property: Specifies that the alert is sent to the account administrators. + * + * @return the emailAccountAdmins value. + */ + Boolean emailAccountAdmins(); + + /** + * Gets the storageEndpoint property: Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. + * + * @return the storageEndpoint value. + */ + String storageEndpoint(); + + /** + * Gets the storageAccountAccessKey property: Specifies the identifier key of the Threat Detection audit storage + * account. + * + * @return the storageAccountAccessKey value. + */ + String storageAccountAccessKey(); + + /** + * Gets the retentionDays property: Specifies the number of days to keep in the Threat Detection audit logs. + * + * @return the retentionDays value. + */ + Integer retentionDays(); + + /** + * Gets the creationTime property: Specifies the UTC creation time of the policy. + * + * @return the creationTime value. + */ + OffsetDateTime creationTime(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.SqlPoolSecurityAlertPolicyInner object. + * + * @return the inner object. + */ + SqlPoolSecurityAlertPolicyInner innerModel(); + + /** The entirety of the SqlPoolSecurityAlertPolicy definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The SqlPoolSecurityAlertPolicy definition stages. */ + interface DefinitionStages { + /** The first stage of the SqlPoolSecurityAlertPolicy definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the SqlPoolSecurityAlertPolicy definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * 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. + */ + WithCreate withExistingSqlPool(String resourceGroupName, String workspaceName, String sqlPoolName); + } + /** + * The stage of the SqlPoolSecurityAlertPolicy definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithState, + DefinitionStages.WithDisabledAlerts, + DefinitionStages.WithEmailAddresses, + DefinitionStages.WithEmailAccountAdmins, + DefinitionStages.WithStorageEndpoint, + DefinitionStages.WithStorageAccountAccessKey, + DefinitionStages.WithRetentionDays { + /** + * Executes the create request. + * + * @return the created resource. + */ + SqlPoolSecurityAlertPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SqlPoolSecurityAlertPolicy create(Context context); + } + /** The stage of the SqlPoolSecurityAlertPolicy definition allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: Specifies the state of the policy, whether it is enabled or disabled or a + * policy has not been applied yet on the specific Sql pool.. + * + * @param state Specifies the state of the policy, whether it is enabled or disabled or a policy has not + * been applied yet on the specific Sql pool. + * @return the next definition stage. + */ + WithCreate withState(SecurityAlertPolicyState state); + } + /** The stage of the SqlPoolSecurityAlertPolicy definition allowing to specify disabledAlerts. */ + interface WithDisabledAlerts { + /** + * Specifies the disabledAlerts property: Specifies an array of alerts that are disabled. Allowed values + * are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action. + * + * @param disabledAlerts Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, + * Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action. + * @return the next definition stage. + */ + WithCreate withDisabledAlerts(List disabledAlerts); + } + /** The stage of the SqlPoolSecurityAlertPolicy definition allowing to specify emailAddresses. */ + interface WithEmailAddresses { + /** + * Specifies the emailAddresses property: Specifies an array of e-mail addresses to which the alert is + * sent.. + * + * @param emailAddresses Specifies an array of e-mail addresses to which the alert is sent. + * @return the next definition stage. + */ + WithCreate withEmailAddresses(List emailAddresses); + } + /** The stage of the SqlPoolSecurityAlertPolicy definition allowing to specify emailAccountAdmins. */ + interface WithEmailAccountAdmins { + /** + * Specifies the emailAccountAdmins property: Specifies that the alert is sent to the account + * administrators.. + * + * @param emailAccountAdmins Specifies that the alert is sent to the account administrators. + * @return the next definition stage. + */ + WithCreate withEmailAccountAdmins(Boolean emailAccountAdmins); + } + /** The stage of the SqlPoolSecurityAlertPolicy definition allowing to specify storageEndpoint. */ + interface WithStorageEndpoint { + /** + * Specifies the storageEndpoint property: Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs.. + * + * @param storageEndpoint Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit + * logs. + * @return the next definition stage. + */ + WithCreate withStorageEndpoint(String storageEndpoint); + } + /** The stage of the SqlPoolSecurityAlertPolicy definition allowing to specify storageAccountAccessKey. */ + interface WithStorageAccountAccessKey { + /** + * Specifies the storageAccountAccessKey property: Specifies the identifier key of the Threat Detection + * audit storage account.. + * + * @param storageAccountAccessKey Specifies the identifier key of the Threat Detection audit storage + * account. + * @return the next definition stage. + */ + WithCreate withStorageAccountAccessKey(String storageAccountAccessKey); + } + /** The stage of the SqlPoolSecurityAlertPolicy definition allowing to specify retentionDays. */ + interface WithRetentionDays { + /** + * Specifies the retentionDays property: Specifies the number of days to keep in the Threat Detection audit + * logs.. + * + * @param retentionDays Specifies the number of days to keep in the Threat Detection audit logs. + * @return the next definition stage. + */ + WithCreate withRetentionDays(Integer retentionDays); + } + } + /** + * Begins update for the SqlPoolSecurityAlertPolicy resource. + * + * @return the stage of resource update. + */ + SqlPoolSecurityAlertPolicy.Update update(); + + /** The template for SqlPoolSecurityAlertPolicy update. */ + interface Update + extends UpdateStages.WithState, + UpdateStages.WithDisabledAlerts, + UpdateStages.WithEmailAddresses, + UpdateStages.WithEmailAccountAdmins, + UpdateStages.WithStorageEndpoint, + UpdateStages.WithStorageAccountAccessKey, + UpdateStages.WithRetentionDays { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SqlPoolSecurityAlertPolicy apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SqlPoolSecurityAlertPolicy apply(Context context); + } + /** The SqlPoolSecurityAlertPolicy update stages. */ + interface UpdateStages { + /** The stage of the SqlPoolSecurityAlertPolicy update allowing to specify state. */ + interface WithState { + /** + * Specifies the state property: Specifies the state of the policy, whether it is enabled or disabled or a + * policy has not been applied yet on the specific Sql pool.. + * + * @param state Specifies the state of the policy, whether it is enabled or disabled or a policy has not + * been applied yet on the specific Sql pool. + * @return the next definition stage. + */ + Update withState(SecurityAlertPolicyState state); + } + /** The stage of the SqlPoolSecurityAlertPolicy update allowing to specify disabledAlerts. */ + interface WithDisabledAlerts { + /** + * Specifies the disabledAlerts property: Specifies an array of alerts that are disabled. Allowed values + * are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action. + * + * @param disabledAlerts Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, + * Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action. + * @return the next definition stage. + */ + Update withDisabledAlerts(List disabledAlerts); + } + /** The stage of the SqlPoolSecurityAlertPolicy update allowing to specify emailAddresses. */ + interface WithEmailAddresses { + /** + * Specifies the emailAddresses property: Specifies an array of e-mail addresses to which the alert is + * sent.. + * + * @param emailAddresses Specifies an array of e-mail addresses to which the alert is sent. + * @return the next definition stage. + */ + Update withEmailAddresses(List emailAddresses); + } + /** The stage of the SqlPoolSecurityAlertPolicy update allowing to specify emailAccountAdmins. */ + interface WithEmailAccountAdmins { + /** + * Specifies the emailAccountAdmins property: Specifies that the alert is sent to the account + * administrators.. + * + * @param emailAccountAdmins Specifies that the alert is sent to the account administrators. + * @return the next definition stage. + */ + Update withEmailAccountAdmins(Boolean emailAccountAdmins); + } + /** The stage of the SqlPoolSecurityAlertPolicy update allowing to specify storageEndpoint. */ + interface WithStorageEndpoint { + /** + * Specifies the storageEndpoint property: Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs.. + * + * @param storageEndpoint Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit + * logs. + * @return the next definition stage. + */ + Update withStorageEndpoint(String storageEndpoint); + } + /** The stage of the SqlPoolSecurityAlertPolicy update allowing to specify storageAccountAccessKey. */ + interface WithStorageAccountAccessKey { + /** + * Specifies the storageAccountAccessKey property: Specifies the identifier key of the Threat Detection + * audit storage account.. + * + * @param storageAccountAccessKey Specifies the identifier key of the Threat Detection audit storage + * account. + * @return the next definition stage. + */ + Update withStorageAccountAccessKey(String storageAccountAccessKey); + } + /** The stage of the SqlPoolSecurityAlertPolicy update allowing to specify retentionDays. */ + interface WithRetentionDays { + /** + * Specifies the retentionDays property: Specifies the number of days to keep in the Threat Detection audit + * logs.. + * + * @param retentionDays Specifies the number of days to keep in the Threat Detection audit logs. + * @return the next definition stage. + */ + Update withRetentionDays(Integer retentionDays); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SqlPoolSecurityAlertPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SqlPoolSecurityAlertPolicy refresh(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolSensitivityLabels.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolSensitivityLabels.java new file mode 100644 index 0000000000000..63d75f32e2c26 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolSensitivityLabels.java @@ -0,0 +1,326 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SqlPoolSensitivityLabels. */ +public interface SqlPoolSensitivityLabels { + /** + * Gets SQL pool sensitivity labels. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool sensitivity labels. + */ + PagedIterable listCurrent(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Gets SQL pool sensitivity labels. + * + * @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 filter An OData filter expression that filters elements in the collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool sensitivity labels. + */ + PagedIterable listCurrent( + String resourceGroupName, String workspaceName, String sqlPoolName, String filter, Context context); + + /** + * Update sensitivity labels of a given SQL Pool using an operations batch. + * + * @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 A list of sensitivity label update operations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void update( + String resourceGroupName, String workspaceName, String sqlPoolName, SensitivityLabelUpdateList parameters); + + /** + * Update sensitivity labels of a given SQL Pool using an operations batch. + * + * @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 A list of sensitivity label update operations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response updateWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + SensitivityLabelUpdateList parameters, + Context context); + + /** + * Gets sensitivity labels of a given 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sensitivity labels of a given SQL pool. + */ + PagedIterable listRecommended(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Gets sensitivity labels of a given 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 includeDisabledRecommendations Specifies whether to include disabled recommendations or not. + * @param skipToken An OData query option to indicate how many elements to skip in the collection. + * @param filter An OData filter expression that filters elements in the collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sensitivity labels of a given SQL pool. + */ + PagedIterable listRecommended( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + Boolean includeDisabledRecommendations, + String skipToken, + String filter, + Context context); + + /** + * Deletes the sensitivity label of a given column in 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 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName); + + /** + * Deletes the sensitivity label of a given column in 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 schemaName The name of the schema. + * @param tableName The name of the table. + * @param columnName The name of the column. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + Context context); + + /** + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sensitivity label of a given column. + */ + SensitivityLabel get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + SensitivityLabelSource sensitivityLabelSource); + + /** + * 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the sensitivity label of a given column. + */ + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + SensitivityLabelSource sensitivityLabelSource, + Context context); + + /** + * Enables sensitivity recommendations on a given column (recommendations are enabled by default on all columns). + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void enableRecommendation( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName); + + /** + * Enables sensitivity recommendations on a given column (recommendations are enabled by default on all columns). + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response enableRecommendationWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + Context context); + + /** + * Disables sensitivity recommendations on 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void disableRecommendation( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName); + + /** + * Disables sensitivity recommendations on 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response disableRecommendationWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String columnName, + Context context); + + /** + * Deletes the sensitivity label of a given column in a Sql pool. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the sensitivity label of a given column in a Sql pool. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SensitivityLabel resource. + * + * @return the first stage of the new SensitivityLabel definition. + */ + SensitivityLabel.DefinitionStages.Blank define(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolTableColumns.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolTableColumns.java new file mode 100644 index 0000000000000..167e04397baf7 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolTableColumns.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of SqlPoolTableColumns. */ +public interface SqlPoolTableColumns { + /** + * Gets columns in a given table in 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 schemaName The name of the schema. + * @param tableName The name of the table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return columns in a given table in a SQL pool. + */ + PagedIterable listByTableName( + String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName); + + /** + * Gets columns in a given table in 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 schemaName The name of the schema. + * @param tableName The name of the table. + * @param filter An OData filter expression that filters elements in the collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return columns in a given table in a SQL pool. + */ + PagedIterable listByTableName( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + String filter, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolTableListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolTableListResult.java new file mode 100644 index 0000000000000..b62ca796e576f --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolTableListResult.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of Sql pool tables. */ +@Immutable +public final class SqlPoolTableListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolTableListResult.class); + + /* + * Array of results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolTables.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolTables.java new file mode 100644 index 0000000000000..c5b58b4a60ba4 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolTables.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.Resource; +import com.azure.core.util.Context; + +/** Resource collection API of SqlPoolTables. */ +public interface SqlPoolTables { + /** + * Gets tables of a given schema in 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 schemaName The name of the schema. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tables of a given schema in a SQL pool. + */ + PagedIterable listBySchema( + String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName); + + /** + * Gets tables of a given schema in 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 schemaName The name of the schema. + * @param filter An OData filter expression that filters elements in the collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return tables of a given schema in a SQL pool. + */ + PagedIterable listBySchema( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String filter, + Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql pool table. + */ + Resource get( + String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql pool table. + */ + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String schemaName, + String tableName, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolTransparentDataEncryptions.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolTransparentDataEncryptions.java new file mode 100644 index 0000000000000..a7c13aaa7d234 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolTransparentDataEncryptions.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SqlPoolTransparentDataEncryptions. */ +public interface SqlPoolTransparentDataEncryptions { + /** + * Get a SQL pool's transparent data encryption configuration. + * + * @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 transparentDataEncryptionName The name of the transparent data encryption configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's transparent data encryption configuration. + */ + TransparentDataEncryption get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + TransparentDataEncryptionName transparentDataEncryptionName); + + /** + * Get a SQL pool's transparent data encryption configuration. + * + * @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 transparentDataEncryptionName The name of the transparent data encryption configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's transparent data encryption configuration. + */ + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + TransparentDataEncryptionName transparentDataEncryptionName, + Context context); + + /** + * Get list of SQL pool's transparent data encryption configurations. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pool's transparent data encryption configurations. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Get list of SQL pool's transparent data encryption configurations. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pool's transparent data encryption configurations. + */ + PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * Get a SQL pool's transparent data encryption configuration. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's transparent data encryption configuration. + */ + TransparentDataEncryption getById(String id); + + /** + * Get a SQL pool's transparent data encryption configuration. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SQL pool's transparent data encryption configuration. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new TransparentDataEncryption resource. + * + * @param name resource name. + * @return the first stage of the new TransparentDataEncryption definition. + */ + TransparentDataEncryption.DefinitionStages.Blank define(TransparentDataEncryptionName name); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolUsage.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolUsage.java new file mode 100644 index 0000000000000..0164e4cf2c645 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolUsage.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolUsageInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of SqlPoolUsage. */ +public interface SqlPoolUsage { + /** + * Gets the name property: The name of the usage metric. + * + * @return the name value. + */ + String name(); + + /** + * Gets the resourceName property: The name of the resource. + * + * @return the resourceName value. + */ + String resourceName(); + + /** + * Gets the displayName property: The usage metric display name. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the currentValue property: The current value of the usage metric. + * + * @return the currentValue value. + */ + Double currentValue(); + + /** + * Gets the limit property: The current limit of the usage metric. + * + * @return the limit value. + */ + Double limit(); + + /** + * Gets the unit property: The units of the usage metric. + * + * @return the unit value. + */ + String unit(); + + /** + * Gets the nextResetTime property: The next reset time for the usage metric (ISO8601 format). + * + * @return the nextResetTime value. + */ + OffsetDateTime nextResetTime(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.SqlPoolUsageInner object. + * + * @return the inner object. + */ + SqlPoolUsageInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolUsageListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolUsageListResult.java new file mode 100644 index 0000000000000..6a19f4cbb45f0 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolUsageListResult.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolUsageInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response to a list Sql pool usages request. */ +@Fluent +public final class SqlPoolUsageListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolUsageListResult.class); + + /* + * The list of usages for the Sql pool. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: The list of usages for the Sql pool. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of usages for the Sql pool. + * + * @param value the value value to set. + * @return the SqlPoolUsageListResult object itself. + */ + public SqlPoolUsageListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model SqlPoolUsageListResult")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolUsages.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolUsages.java new file mode 100644 index 0000000000000..3fe54221039b1 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolUsages.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of SqlPoolUsages. */ +public interface SqlPoolUsages { + /** + * Gets SQL pool usages. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool usages. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Gets SQL pool usages. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool usages. + */ + PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessment.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessment.java new file mode 100644 index 0000000000000..bb335fd45dbff --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessment.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolVulnerabilityAssessmentInner; + +/** An immutable client-side representation of SqlPoolVulnerabilityAssessment. */ +public interface SqlPoolVulnerabilityAssessment { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the storageContainerPath property: A blob storage container path to hold the scan results (e.g. + * https://myStorage.blob.core.windows.net/VaScans/). It is required if server level vulnerability assessment policy + * doesn't set. + * + * @return the storageContainerPath value. + */ + String storageContainerPath(); + + /** + * Gets the storageContainerSasKey property: A shared access signature (SAS Key) that has write access to the blob + * container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, + * StorageContainerSasKey is required. + * + * @return the storageContainerSasKey value. + */ + String storageContainerSasKey(); + + /** + * Gets the storageAccountAccessKey property: Specifies the identifier key of the storage account for vulnerability + * assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required. + * + * @return the storageAccountAccessKey value. + */ + String storageAccountAccessKey(); + + /** + * Gets the recurringScans property: The recurring scans settings. + * + * @return the recurringScans value. + */ + VulnerabilityAssessmentRecurringScansProperties recurringScans(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.SqlPoolVulnerabilityAssessmentInner object. + * + * @return the inner object. + */ + SqlPoolVulnerabilityAssessmentInner innerModel(); + + /** The entirety of the SqlPoolVulnerabilityAssessment definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The SqlPoolVulnerabilityAssessment definition stages. */ + interface DefinitionStages { + /** The first stage of the SqlPoolVulnerabilityAssessment definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the SqlPoolVulnerabilityAssessment definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * 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. + */ + WithCreate withExistingSqlPool(String resourceGroupName, String workspaceName, String sqlPoolName); + } + /** + * The stage of the SqlPoolVulnerabilityAssessment definition which contains all the minimum required properties + * for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithStorageContainerPath, + DefinitionStages.WithStorageContainerSasKey, + DefinitionStages.WithStorageAccountAccessKey, + DefinitionStages.WithRecurringScans { + /** + * Executes the create request. + * + * @return the created resource. + */ + SqlPoolVulnerabilityAssessment create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SqlPoolVulnerabilityAssessment create(Context context); + } + /** The stage of the SqlPoolVulnerabilityAssessment definition allowing to specify storageContainerPath. */ + interface WithStorageContainerPath { + /** + * Specifies the storageContainerPath property: A blob storage container path to hold the scan results (e.g. + * https://myStorage.blob.core.windows.net/VaScans/). It is required if server level vulnerability + * assessment policy doesn't set. + * + * @param storageContainerPath A blob storage container path to hold the scan results (e.g. + * https://myStorage.blob.core.windows.net/VaScans/). It is required if server level vulnerability + * assessment policy doesn't set. + * @return the next definition stage. + */ + WithCreate withStorageContainerPath(String storageContainerPath); + } + /** The stage of the SqlPoolVulnerabilityAssessment definition allowing to specify storageContainerSasKey. */ + interface WithStorageContainerSasKey { + /** + * Specifies the storageContainerSasKey property: A shared access signature (SAS Key) that has write access + * to the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't + * specified, StorageContainerSasKey is required.. + * + * @param storageContainerSasKey A shared access signature (SAS Key) that has write access to the blob + * container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't + * specified, StorageContainerSasKey is required. + * @return the next definition stage. + */ + WithCreate withStorageContainerSasKey(String storageContainerSasKey); + } + /** The stage of the SqlPoolVulnerabilityAssessment definition allowing to specify storageAccountAccessKey. */ + interface WithStorageAccountAccessKey { + /** + * Specifies the storageAccountAccessKey property: Specifies the identifier key of the storage account for + * vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, + * storageAccountAccessKey is required.. + * + * @param storageAccountAccessKey Specifies the identifier key of the storage account for vulnerability + * assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is + * required. + * @return the next definition stage. + */ + WithCreate withStorageAccountAccessKey(String storageAccountAccessKey); + } + /** The stage of the SqlPoolVulnerabilityAssessment definition allowing to specify recurringScans. */ + interface WithRecurringScans { + /** + * Specifies the recurringScans property: The recurring scans settings. + * + * @param recurringScans The recurring scans settings. + * @return the next definition stage. + */ + WithCreate withRecurringScans(VulnerabilityAssessmentRecurringScansProperties recurringScans); + } + } + /** + * Begins update for the SqlPoolVulnerabilityAssessment resource. + * + * @return the stage of resource update. + */ + SqlPoolVulnerabilityAssessment.Update update(); + + /** The template for SqlPoolVulnerabilityAssessment update. */ + interface Update + extends UpdateStages.WithStorageContainerPath, + UpdateStages.WithStorageContainerSasKey, + UpdateStages.WithStorageAccountAccessKey, + UpdateStages.WithRecurringScans { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SqlPoolVulnerabilityAssessment apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SqlPoolVulnerabilityAssessment apply(Context context); + } + /** The SqlPoolVulnerabilityAssessment update stages. */ + interface UpdateStages { + /** The stage of the SqlPoolVulnerabilityAssessment update allowing to specify storageContainerPath. */ + interface WithStorageContainerPath { + /** + * Specifies the storageContainerPath property: A blob storage container path to hold the scan results (e.g. + * https://myStorage.blob.core.windows.net/VaScans/). It is required if server level vulnerability + * assessment policy doesn't set. + * + * @param storageContainerPath A blob storage container path to hold the scan results (e.g. + * https://myStorage.blob.core.windows.net/VaScans/). It is required if server level vulnerability + * assessment policy doesn't set. + * @return the next definition stage. + */ + Update withStorageContainerPath(String storageContainerPath); + } + /** The stage of the SqlPoolVulnerabilityAssessment update allowing to specify storageContainerSasKey. */ + interface WithStorageContainerSasKey { + /** + * Specifies the storageContainerSasKey property: A shared access signature (SAS Key) that has write access + * to the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't + * specified, StorageContainerSasKey is required.. + * + * @param storageContainerSasKey A shared access signature (SAS Key) that has write access to the blob + * container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't + * specified, StorageContainerSasKey is required. + * @return the next definition stage. + */ + Update withStorageContainerSasKey(String storageContainerSasKey); + } + /** The stage of the SqlPoolVulnerabilityAssessment update allowing to specify storageAccountAccessKey. */ + interface WithStorageAccountAccessKey { + /** + * Specifies the storageAccountAccessKey property: Specifies the identifier key of the storage account for + * vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, + * storageAccountAccessKey is required.. + * + * @param storageAccountAccessKey Specifies the identifier key of the storage account for vulnerability + * assessment scan results. If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is + * required. + * @return the next definition stage. + */ + Update withStorageAccountAccessKey(String storageAccountAccessKey); + } + /** The stage of the SqlPoolVulnerabilityAssessment update allowing to specify recurringScans. */ + interface WithRecurringScans { + /** + * Specifies the recurringScans property: The recurring scans settings. + * + * @param recurringScans The recurring scans settings. + * @return the next definition stage. + */ + Update withRecurringScans(VulnerabilityAssessmentRecurringScansProperties recurringScans); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SqlPoolVulnerabilityAssessment refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SqlPoolVulnerabilityAssessment refresh(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessmentListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessmentListResult.java new file mode 100644 index 0000000000000..a50f8a15b57cc --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessmentListResult.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolVulnerabilityAssessmentInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of the Sql pool's vulnerability assessments. */ +@Immutable +public final class SqlPoolVulnerabilityAssessmentListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SqlPoolVulnerabilityAssessmentListResult.class); + + /* + * Array of results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessmentRuleBaseline.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessmentRuleBaseline.java new file mode 100644 index 0000000000000..e0a7128aaf9bd --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessmentRuleBaseline.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolVulnerabilityAssessmentRuleBaselineInner; +import java.util.List; + +/** An immutable client-side representation of SqlPoolVulnerabilityAssessmentRuleBaseline. */ +public interface SqlPoolVulnerabilityAssessmentRuleBaseline { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the baselineResults property: The rule baseline result. + * + * @return the baselineResults value. + */ + List baselineResults(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.SqlPoolVulnerabilityAssessmentRuleBaselineInner + * object. + * + * @return the inner object. + */ + SqlPoolVulnerabilityAssessmentRuleBaselineInner innerModel(); + + /** The entirety of the SqlPoolVulnerabilityAssessmentRuleBaseline definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The SqlPoolVulnerabilityAssessmentRuleBaseline definition stages. */ + interface DefinitionStages { + /** The first stage of the SqlPoolVulnerabilityAssessmentRuleBaseline definition. */ + interface Blank extends WithParentResource { + } + /** + * The stage of the SqlPoolVulnerabilityAssessmentRuleBaseline definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName, sqlPoolName, vulnerabilityAssessmentName, ruleId. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param ruleId The vulnerability assessment rule ID. + * @return the next definition stage. + */ + WithCreate withExistingRule( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId); + } + /** + * The stage of the SqlPoolVulnerabilityAssessmentRuleBaseline definition which contains all the minimum + * required properties for the resource to be created, but also allows for any other optional properties to be + * specified. + */ + interface WithCreate extends DefinitionStages.WithBaselineResults { + /** + * Executes the create request. + * + * @return the created resource. + */ + SqlPoolVulnerabilityAssessmentRuleBaseline create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SqlPoolVulnerabilityAssessmentRuleBaseline create(Context context); + } + /** + * The stage of the SqlPoolVulnerabilityAssessmentRuleBaseline definition allowing to specify baselineResults. + */ + interface WithBaselineResults { + /** + * Specifies the baselineResults property: The rule baseline result. + * + * @param baselineResults The rule baseline result. + * @return the next definition stage. + */ + WithCreate withBaselineResults(List baselineResults); + } + } + /** + * Begins update for the SqlPoolVulnerabilityAssessmentRuleBaseline resource. + * + * @return the stage of resource update. + */ + SqlPoolVulnerabilityAssessmentRuleBaseline.Update update(); + + /** The template for SqlPoolVulnerabilityAssessmentRuleBaseline update. */ + interface Update extends UpdateStages.WithBaselineResults { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SqlPoolVulnerabilityAssessmentRuleBaseline apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SqlPoolVulnerabilityAssessmentRuleBaseline apply(Context context); + } + /** The SqlPoolVulnerabilityAssessmentRuleBaseline update stages. */ + interface UpdateStages { + /** The stage of the SqlPoolVulnerabilityAssessmentRuleBaseline update allowing to specify baselineResults. */ + interface WithBaselineResults { + /** + * Specifies the baselineResults property: The rule baseline result. + * + * @param baselineResults The rule baseline result. + * @return the next definition stage. + */ + Update withBaselineResults(List baselineResults); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SqlPoolVulnerabilityAssessmentRuleBaseline refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SqlPoolVulnerabilityAssessmentRuleBaseline refresh(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessmentRuleBaselineItem.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessmentRuleBaselineItem.java new file mode 100644 index 0000000000000..33e00d21e3111 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessmentRuleBaselineItem.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties for an Sql pool vulnerability assessment rule baseline's result. */ +@Fluent +public final class SqlPoolVulnerabilityAssessmentRuleBaselineItem { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(SqlPoolVulnerabilityAssessmentRuleBaselineItem.class); + + /* + * The rule baseline result + */ + @JsonProperty(value = "result", required = true) + private List result; + + /** + * Get the result property: The rule baseline result. + * + * @return the result value. + */ + public List result() { + return this.result; + } + + /** + * Set the result property: The rule baseline result. + * + * @param result the result value to set. + * @return the SqlPoolVulnerabilityAssessmentRuleBaselineItem object itself. + */ + public SqlPoolVulnerabilityAssessmentRuleBaselineItem withResult(List result) { + this.result = result; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (result() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property result in model SqlPoolVulnerabilityAssessmentRuleBaselineItem")); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessmentRuleBaselines.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessmentRuleBaselines.java new file mode 100644 index 0000000000000..455a7b10defbd --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessmentRuleBaselines.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SqlPoolVulnerabilityAssessmentRuleBaselines. */ +public interface SqlPoolVulnerabilityAssessmentRuleBaselines { + /** + * Removes the database'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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @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 workspace level rule). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId, + VulnerabilityAssessmentPolicyBaselineName baselineName); + + /** + * Removes the database'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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @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 workspace level rule). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId, + VulnerabilityAssessmentPolicyBaselineName baselineName, + Context context); + + /** + * 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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @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). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SqlPool's vulnerability assessment rule baseline. + */ + SqlPoolVulnerabilityAssessmentRuleBaseline get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId, + VulnerabilityAssessmentPolicyBaselineName baselineName); + + /** + * 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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @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). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SqlPool's vulnerability assessment rule baseline. + */ + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String ruleId, + VulnerabilityAssessmentPolicyBaselineName baselineName, + Context context); + + /** + * Gets a SqlPool's vulnerability assessment rule baseline. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SqlPool's vulnerability assessment rule baseline. + */ + SqlPoolVulnerabilityAssessmentRuleBaseline getById(String id); + + /** + * Gets a SqlPool's vulnerability assessment rule baseline. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SqlPool's vulnerability assessment rule baseline. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Removes the database's vulnerability assessment rule baseline. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Removes the database's vulnerability assessment rule baseline. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SqlPoolVulnerabilityAssessmentRuleBaseline resource. + * + * @param name resource name. + * @return the first stage of the new SqlPoolVulnerabilityAssessmentRuleBaseline definition. + */ + SqlPoolVulnerabilityAssessmentRuleBaseline.DefinitionStages.Blank define( + VulnerabilityAssessmentPolicyBaselineName name); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessmentScans.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessmentScans.java new file mode 100644 index 0000000000000..639d959d01571 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessmentScans.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SqlPoolVulnerabilityAssessmentScans. */ +public interface SqlPoolVulnerabilityAssessmentScans { + /** + * Lists the vulnerability assessment scans 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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of vulnerability assessment scan records. + */ + PagedIterable list( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName); + + /** + * Lists the vulnerability assessment scans 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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of vulnerability assessment scan records. + */ + PagedIterable list( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + Context context); + + /** + * Executes a Vulnerability Assessment database scan. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void initiateScan( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId); + + /** + * Executes a Vulnerability Assessment database scan. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void initiateScan( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId, + Context context); + + /** + * Convert an existing scan result to a human readable format. If already exists nothing happens. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool Vulnerability Assessment scan export resource. + */ + SqlPoolVulnerabilityAssessmentScansExport export( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId); + + /** + * Convert an existing scan result to a human readable format. If already exists nothing happens. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool Vulnerability Assessment scan export resource. + */ + Response exportWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId, + Context context); + + /** + * 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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vulnerability assessment scan record of a Sql pool. + */ + VulnerabilityAssessmentScanRecord get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + 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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param scanId The vulnerability assessment scan Id of the scan to retrieve. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a vulnerability assessment scan record of a Sql pool. + */ + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + String scanId, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessmentScansExport.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessmentScansExport.java new file mode 100644 index 0000000000000..d15bef3574cfa --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessmentScansExport.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.SqlPoolVulnerabilityAssessmentScansExportInner; + +/** An immutable client-side representation of SqlPoolVulnerabilityAssessmentScansExport. */ +public interface SqlPoolVulnerabilityAssessmentScansExport { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the exportedReportLocation property: Location of the exported report (e.g. + * https://myStorage.blob.core.windows.net/VaScans/scans/serverName/databaseName/scan_scanId.xlsx). + * + * @return the exportedReportLocation value. + */ + String exportedReportLocation(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.SqlPoolVulnerabilityAssessmentScansExportInner + * object. + * + * @return the inner object. + */ + SqlPoolVulnerabilityAssessmentScansExportInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessments.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessments.java new file mode 100644 index 0000000000000..1cba8ac5b512f --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolVulnerabilityAssessments.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SqlPoolVulnerabilityAssessments. */ +public interface SqlPoolVulnerabilityAssessments { + /** + * Lists the vulnerability assessment policies associated with 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the Sql pool's vulnerability assessments. + */ + PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Lists the vulnerability assessment policies associated with 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the Sql pool's vulnerability assessments. + */ + PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * Gets the Sql pool's vulnerability assessment. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Sql pool's vulnerability assessment. + */ + SqlPoolVulnerabilityAssessment get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName); + + /** + * Gets the Sql pool's vulnerability assessment. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Sql pool's vulnerability assessment. + */ + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + Context context); + + /** + * Removes the database's vulnerability assessment. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName); + + /** + * Removes the database's vulnerability assessment. + * + * @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 vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + Context context); + + /** + * Gets the Sql pool's vulnerability assessment. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Sql pool's vulnerability assessment. + */ + SqlPoolVulnerabilityAssessment getById(String id); + + /** + * Gets the Sql pool's vulnerability assessment. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Sql pool's vulnerability assessment. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Removes the database's vulnerability assessment. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Removes the database's vulnerability assessment. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SqlPoolVulnerabilityAssessment resource. + * + * @param name resource name. + * @return the first stage of the new SqlPoolVulnerabilityAssessment definition. + */ + SqlPoolVulnerabilityAssessment.DefinitionStages.Blank define(VulnerabilityAssessmentName name); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolWorkloadClassifiers.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolWorkloadClassifiers.java new file mode 100644 index 0000000000000..031e566ba88e3 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolWorkloadClassifiers.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SqlPoolWorkloadClassifiers. */ +public interface SqlPoolWorkloadClassifiers { + /** + * Get a workload classifier of Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workload classifier of Sql pool's workload group. + */ + WorkloadClassifier get( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName); + + /** + * Get a workload classifier of Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workload classifier of Sql pool's workload group. + */ + Response getWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName, + Context context); + + /** + * Remove workload classifier of a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName); + + /** + * Remove workload classifier of a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param workloadClassifierName The name of the workload classifier. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + String workloadGroupName, + String workloadClassifierName, + Context context); + + /** + * Get list of Sql pool's workload classifier for workload groups. + * + * @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 workloadGroupName The name of the workload group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Sql pool's workload classifier for workload groups. + */ + PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName); + + /** + * Get list of Sql pool's workload classifier for workload groups. + * + * @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 workloadGroupName The name of the workload group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Sql pool's workload classifier for workload groups. + */ + PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName, Context context); + + /** + * Get a workload classifier of Sql pool's workload group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workload classifier of Sql pool's workload group. + */ + WorkloadClassifier getById(String id); + + /** + * Get a workload classifier of Sql pool's workload group. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workload classifier of Sql pool's workload group. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Remove workload classifier of a Sql pool's workload group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Remove workload classifier of a Sql pool's workload group. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new WorkloadClassifier resource. + * + * @param name resource name. + * @return the first stage of the new WorkloadClassifier definition. + */ + WorkloadClassifier.DefinitionStages.Blank define(String name); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolWorkloadGroups.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolWorkloadGroups.java new file mode 100644 index 0000000000000..1a52533560698 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPoolWorkloadGroups.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SqlPoolWorkloadGroups. */ +public interface SqlPoolWorkloadGroups { + /** + * Get a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's workload group. + */ + WorkloadGroup get(String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName); + + /** + * Get a Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's workload group. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName, Context context); + + /** + * Remove Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName); + + /** + * Remove Sql pool's workload group. + * + * @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 workloadGroupName The name of the workload group. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName, Context context); + + /** + * Get list of Sql pool's workload groups. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Sql pool's workload groups. + */ + PagedIterable list(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Get list of Sql pool's workload groups. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Sql pool's workload groups. + */ + PagedIterable list( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * Get a Sql pool's workload group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's workload group. + */ + WorkloadGroup getById(String id); + + /** + * Get a Sql pool's workload group. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a Sql pool's workload group. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Remove Sql pool's workload group. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Remove Sql pool's workload group. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new WorkloadGroup resource. + * + * @param name resource name. + * @return the first stage of the new WorkloadGroup definition. + */ + WorkloadGroup.DefinitionStages.Blank define(String name); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPools.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPools.java new file mode 100644 index 0000000000000..6f5b06b430fef --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SqlPools.java @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SqlPools. */ +public interface SqlPools { + /** + * Get SQL pool properties. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool properties. + */ + SqlPool get(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Get SQL pool properties. + * + * @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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool properties. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * Delete 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + Object delete(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Delete 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + Object delete(String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * List all SQL pools. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pools. + */ + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * List all SQL pools. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of SQL pools. + */ + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context); + + /** + * Pause 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + Object pause(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Pause 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + Object pause(String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * Resume 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + Object resume(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Resume 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + Object resume(String resourceGroupName, String workspaceName, String sqlPoolName, Context context); + + /** + * Rename 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 parameters The resource move definition for renaming this Sql pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void rename(String resourceGroupName, String workspaceName, String sqlPoolName, ResourceMoveDefinition parameters); + + /** + * Rename 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 parameters The resource move definition for renaming this Sql pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response renameWithResponse( + String resourceGroupName, + String workspaceName, + String sqlPoolName, + ResourceMoveDefinition parameters, + Context context); + + /** + * Get SQL pool properties. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool properties. + */ + SqlPool getById(String id); + + /** + * Get SQL pool properties. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sQL pool properties. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a SQL pool. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + Object deleteById(String id); + + /** + * Delete a SQL pool. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + Object deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SqlPool resource. + * + * @param name resource name. + * @return the first stage of the new SqlPool definition. + */ + SqlPool.DefinitionStages.Blank define(String name); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisEnvironment.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisEnvironment.java new file mode 100644 index 0000000000000..dd60a7e77a2fd --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisEnvironment.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Ssis environment. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("Environment") +@Fluent +public final class SsisEnvironment extends SsisObjectMetadata { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SsisEnvironment.class); + + /* + * Folder id which contains environment. + */ + @JsonProperty(value = "folderId") + private Long folderId; + + /* + * Variable in environment + */ + @JsonProperty(value = "variables") + private List variables; + + /** + * Get the folderId property: Folder id which contains environment. + * + * @return the folderId value. + */ + public Long folderId() { + return this.folderId; + } + + /** + * Set the folderId property: Folder id which contains environment. + * + * @param folderId the folderId value to set. + * @return the SsisEnvironment object itself. + */ + public SsisEnvironment withFolderId(Long folderId) { + this.folderId = folderId; + return this; + } + + /** + * Get the variables property: Variable in environment. + * + * @return the variables value. + */ + public List variables() { + return this.variables; + } + + /** + * Set the variables property: Variable in environment. + * + * @param variables the variables value to set. + * @return the SsisEnvironment object itself. + */ + public SsisEnvironment withVariables(List variables) { + this.variables = variables; + return this; + } + + /** {@inheritDoc} */ + @Override + public SsisEnvironment withId(Long id) { + super.withId(id); + return this; + } + + /** {@inheritDoc} */ + @Override + public SsisEnvironment withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public SsisEnvironment withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (variables() != null) { + variables().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisEnvironmentReference.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisEnvironmentReference.java new file mode 100644 index 0000000000000..a66c4ea210cbb --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisEnvironmentReference.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Ssis environment reference. */ +@Fluent +public final class SsisEnvironmentReference { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SsisEnvironmentReference.class); + + /* + * Environment reference id. + */ + @JsonProperty(value = "id") + private Long id; + + /* + * Environment folder name. + */ + @JsonProperty(value = "environmentFolderName") + private String environmentFolderName; + + /* + * Environment name. + */ + @JsonProperty(value = "environmentName") + private String environmentName; + + /* + * Reference type + */ + @JsonProperty(value = "referenceType") + private String referenceType; + + /** + * Get the id property: Environment reference id. + * + * @return the id value. + */ + public Long id() { + return this.id; + } + + /** + * Set the id property: Environment reference id. + * + * @param id the id value to set. + * @return the SsisEnvironmentReference object itself. + */ + public SsisEnvironmentReference withId(Long id) { + this.id = id; + return this; + } + + /** + * Get the environmentFolderName property: Environment folder name. + * + * @return the environmentFolderName value. + */ + public String environmentFolderName() { + return this.environmentFolderName; + } + + /** + * Set the environmentFolderName property: Environment folder name. + * + * @param environmentFolderName the environmentFolderName value to set. + * @return the SsisEnvironmentReference object itself. + */ + public SsisEnvironmentReference withEnvironmentFolderName(String environmentFolderName) { + this.environmentFolderName = environmentFolderName; + return this; + } + + /** + * Get the environmentName property: Environment name. + * + * @return the environmentName value. + */ + public String environmentName() { + return this.environmentName; + } + + /** + * Set the environmentName property: Environment name. + * + * @param environmentName the environmentName value to set. + * @return the SsisEnvironmentReference object itself. + */ + public SsisEnvironmentReference withEnvironmentName(String environmentName) { + this.environmentName = environmentName; + return this; + } + + /** + * Get the referenceType property: Reference type. + * + * @return the referenceType value. + */ + public String referenceType() { + return this.referenceType; + } + + /** + * Set the referenceType property: Reference type. + * + * @param referenceType the referenceType value to set. + * @return the SsisEnvironmentReference object itself. + */ + public SsisEnvironmentReference withReferenceType(String referenceType) { + this.referenceType = referenceType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisFolder.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisFolder.java new file mode 100644 index 0000000000000..a324c1c39e820 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisFolder.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Ssis folder. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("Folder") +@Immutable +public final class SsisFolder extends SsisObjectMetadata { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SsisFolder.class); + + /** {@inheritDoc} */ + @Override + public SsisFolder withId(Long id) { + super.withId(id); + return this; + } + + /** {@inheritDoc} */ + @Override + public SsisFolder withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public SsisFolder withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisObjectMetadata.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisObjectMetadata.java new file mode 100644 index 0000000000000..edd5173c74c11 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisObjectMetadata.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** SSIS object metadata. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type", + defaultImpl = SsisObjectMetadata.class) +@JsonTypeName("SsisObjectMetadata") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Folder", value = SsisFolder.class), + @JsonSubTypes.Type(name = "Project", value = SsisProject.class), + @JsonSubTypes.Type(name = "Package", value = SsisPackage.class), + @JsonSubTypes.Type(name = "Environment", value = SsisEnvironment.class) +}) +@Fluent +public class SsisObjectMetadata { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SsisObjectMetadata.class); + + /* + * Metadata id. + */ + @JsonProperty(value = "id") + private Long id; + + /* + * Metadata name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Metadata description. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the id property: Metadata id. + * + * @return the id value. + */ + public Long id() { + return this.id; + } + + /** + * Set the id property: Metadata id. + * + * @param id the id value to set. + * @return the SsisObjectMetadata object itself. + */ + public SsisObjectMetadata withId(Long id) { + this.id = id; + return this; + } + + /** + * Get the name property: Metadata name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Metadata name. + * + * @param name the name value to set. + * @return the SsisObjectMetadata object itself. + */ + public SsisObjectMetadata withName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: Metadata description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Metadata description. + * + * @param description the description value to set. + * @return the SsisObjectMetadata object itself. + */ + public SsisObjectMetadata withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisObjectMetadataListResponse.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisObjectMetadataListResponse.java new file mode 100644 index 0000000000000..965c55f6f887b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisObjectMetadataListResponse.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.SsisObjectMetadataListResponseInner; +import java.util.List; + +/** An immutable client-side representation of SsisObjectMetadataListResponse. */ +public interface SsisObjectMetadataListResponse { + /** + * Gets the value property: List of SSIS object metadata. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The link to the next page of results, if any remaining results exist. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.SsisObjectMetadataListResponseInner object. + * + * @return the inner object. + */ + SsisObjectMetadataListResponseInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisObjectMetadataStatusResponse.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisObjectMetadataStatusResponse.java new file mode 100644 index 0000000000000..bc7dda6b134f2 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisObjectMetadataStatusResponse.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.SsisObjectMetadataStatusResponseInner; + +/** An immutable client-side representation of SsisObjectMetadataStatusResponse. */ +public interface SsisObjectMetadataStatusResponse { + /** + * Gets the status property: The status of the operation. + * + * @return the status value. + */ + String status(); + + /** + * Gets the name property: The operation name. + * + * @return the name value. + */ + String name(); + + /** + * Gets the properties property: The operation properties. + * + * @return the properties value. + */ + String properties(); + + /** + * Gets the error property: The operation error message. + * + * @return the error value. + */ + String error(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.SsisObjectMetadataStatusResponseInner object. + * + * @return the inner object. + */ + SsisObjectMetadataStatusResponseInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisObjectMetadataType.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisObjectMetadataType.java new file mode 100644 index 0000000000000..03e6ba199c550 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisObjectMetadataType.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SsisObjectMetadataType. */ +public final class SsisObjectMetadataType extends ExpandableStringEnum { + /** Static value Folder for SsisObjectMetadataType. */ + public static final SsisObjectMetadataType FOLDER = fromString("Folder"); + + /** Static value Project for SsisObjectMetadataType. */ + public static final SsisObjectMetadataType PROJECT = fromString("Project"); + + /** Static value Package for SsisObjectMetadataType. */ + public static final SsisObjectMetadataType PACKAGE = fromString("Package"); + + /** Static value Environment for SsisObjectMetadataType. */ + public static final SsisObjectMetadataType ENVIRONMENT = fromString("Environment"); + + /** + * Creates or finds a SsisObjectMetadataType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SsisObjectMetadataType. + */ + @JsonCreator + public static SsisObjectMetadataType fromString(String name) { + return fromString(name, SsisObjectMetadataType.class); + } + + /** @return known SsisObjectMetadataType values. */ + public static Collection values() { + return values(SsisObjectMetadataType.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisPackage.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisPackage.java new file mode 100644 index 0000000000000..3d7acf6051c1d --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisPackage.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Ssis Package. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("Package") +@Fluent +public final class SsisPackage extends SsisObjectMetadata { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SsisPackage.class); + + /* + * Folder id which contains package. + */ + @JsonProperty(value = "folderId") + private Long folderId; + + /* + * Project version which contains package. + */ + @JsonProperty(value = "projectVersion") + private Long projectVersion; + + /* + * Project id which contains package. + */ + @JsonProperty(value = "projectId") + private Long projectId; + + /* + * Parameters in package + */ + @JsonProperty(value = "parameters") + private List parameters; + + /** + * Get the folderId property: Folder id which contains package. + * + * @return the folderId value. + */ + public Long folderId() { + return this.folderId; + } + + /** + * Set the folderId property: Folder id which contains package. + * + * @param folderId the folderId value to set. + * @return the SsisPackage object itself. + */ + public SsisPackage withFolderId(Long folderId) { + this.folderId = folderId; + return this; + } + + /** + * Get the projectVersion property: Project version which contains package. + * + * @return the projectVersion value. + */ + public Long projectVersion() { + return this.projectVersion; + } + + /** + * Set the projectVersion property: Project version which contains package. + * + * @param projectVersion the projectVersion value to set. + * @return the SsisPackage object itself. + */ + public SsisPackage withProjectVersion(Long projectVersion) { + this.projectVersion = projectVersion; + return this; + } + + /** + * Get the projectId property: Project id which contains package. + * + * @return the projectId value. + */ + public Long projectId() { + return this.projectId; + } + + /** + * Set the projectId property: Project id which contains package. + * + * @param projectId the projectId value to set. + * @return the SsisPackage object itself. + */ + public SsisPackage withProjectId(Long projectId) { + this.projectId = projectId; + return this; + } + + /** + * Get the parameters property: Parameters in package. + * + * @return the parameters value. + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Parameters in package. + * + * @param parameters the parameters value to set. + * @return the SsisPackage object itself. + */ + public SsisPackage withParameters(List parameters) { + this.parameters = parameters; + return this; + } + + /** {@inheritDoc} */ + @Override + public SsisPackage withId(Long id) { + super.withId(id); + return this; + } + + /** {@inheritDoc} */ + @Override + public SsisPackage withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public SsisPackage withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (parameters() != null) { + parameters().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisParameter.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisParameter.java new file mode 100644 index 0000000000000..67fc795d0e993 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisParameter.java @@ -0,0 +1,336 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Ssis parameter. */ +@Fluent +public final class SsisParameter { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SsisParameter.class); + + /* + * Parameter id. + */ + @JsonProperty(value = "id") + private Long id; + + /* + * Parameter name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Parameter description. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Parameter type. + */ + @JsonProperty(value = "dataType") + private String dataType; + + /* + * Whether parameter is required. + */ + @JsonProperty(value = "required") + private Boolean required; + + /* + * Whether parameter is sensitive. + */ + @JsonProperty(value = "sensitive") + private Boolean sensitive; + + /* + * Design default value of parameter. + */ + @JsonProperty(value = "designDefaultValue") + private String designDefaultValue; + + /* + * Default value of parameter. + */ + @JsonProperty(value = "defaultValue") + private String defaultValue; + + /* + * Default sensitive value of parameter. + */ + @JsonProperty(value = "sensitiveDefaultValue") + private String sensitiveDefaultValue; + + /* + * Parameter value type. + */ + @JsonProperty(value = "valueType") + private String valueType; + + /* + * Parameter value set. + */ + @JsonProperty(value = "valueSet") + private Boolean valueSet; + + /* + * Parameter reference variable. + */ + @JsonProperty(value = "variable") + private String variable; + + /** + * Get the id property: Parameter id. + * + * @return the id value. + */ + public Long id() { + return this.id; + } + + /** + * Set the id property: Parameter id. + * + * @param id the id value to set. + * @return the SsisParameter object itself. + */ + public SsisParameter withId(Long id) { + this.id = id; + return this; + } + + /** + * Get the name property: Parameter name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Parameter name. + * + * @param name the name value to set. + * @return the SsisParameter object itself. + */ + public SsisParameter withName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: Parameter description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Parameter description. + * + * @param description the description value to set. + * @return the SsisParameter object itself. + */ + public SsisParameter withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the dataType property: Parameter type. + * + * @return the dataType value. + */ + public String dataType() { + return this.dataType; + } + + /** + * Set the dataType property: Parameter type. + * + * @param dataType the dataType value to set. + * @return the SsisParameter object itself. + */ + public SsisParameter withDataType(String dataType) { + this.dataType = dataType; + return this; + } + + /** + * Get the required property: Whether parameter is required. + * + * @return the required value. + */ + public Boolean required() { + return this.required; + } + + /** + * Set the required property: Whether parameter is required. + * + * @param required the required value to set. + * @return the SsisParameter object itself. + */ + public SsisParameter withRequired(Boolean required) { + this.required = required; + return this; + } + + /** + * Get the sensitive property: Whether parameter is sensitive. + * + * @return the sensitive value. + */ + public Boolean sensitive() { + return this.sensitive; + } + + /** + * Set the sensitive property: Whether parameter is sensitive. + * + * @param sensitive the sensitive value to set. + * @return the SsisParameter object itself. + */ + public SsisParameter withSensitive(Boolean sensitive) { + this.sensitive = sensitive; + return this; + } + + /** + * Get the designDefaultValue property: Design default value of parameter. + * + * @return the designDefaultValue value. + */ + public String designDefaultValue() { + return this.designDefaultValue; + } + + /** + * Set the designDefaultValue property: Design default value of parameter. + * + * @param designDefaultValue the designDefaultValue value to set. + * @return the SsisParameter object itself. + */ + public SsisParameter withDesignDefaultValue(String designDefaultValue) { + this.designDefaultValue = designDefaultValue; + return this; + } + + /** + * Get the defaultValue property: Default value of parameter. + * + * @return the defaultValue value. + */ + public String defaultValue() { + return this.defaultValue; + } + + /** + * Set the defaultValue property: Default value of parameter. + * + * @param defaultValue the defaultValue value to set. + * @return the SsisParameter object itself. + */ + public SsisParameter withDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + /** + * Get the sensitiveDefaultValue property: Default sensitive value of parameter. + * + * @return the sensitiveDefaultValue value. + */ + public String sensitiveDefaultValue() { + return this.sensitiveDefaultValue; + } + + /** + * Set the sensitiveDefaultValue property: Default sensitive value of parameter. + * + * @param sensitiveDefaultValue the sensitiveDefaultValue value to set. + * @return the SsisParameter object itself. + */ + public SsisParameter withSensitiveDefaultValue(String sensitiveDefaultValue) { + this.sensitiveDefaultValue = sensitiveDefaultValue; + return this; + } + + /** + * Get the valueType property: Parameter value type. + * + * @return the valueType value. + */ + public String valueType() { + return this.valueType; + } + + /** + * Set the valueType property: Parameter value type. + * + * @param valueType the valueType value to set. + * @return the SsisParameter object itself. + */ + public SsisParameter withValueType(String valueType) { + this.valueType = valueType; + return this; + } + + /** + * Get the valueSet property: Parameter value set. + * + * @return the valueSet value. + */ + public Boolean valueSet() { + return this.valueSet; + } + + /** + * Set the valueSet property: Parameter value set. + * + * @param valueSet the valueSet value to set. + * @return the SsisParameter object itself. + */ + public SsisParameter withValueSet(Boolean valueSet) { + this.valueSet = valueSet; + return this; + } + + /** + * Get the variable property: Parameter reference variable. + * + * @return the variable value. + */ + public String variable() { + return this.variable; + } + + /** + * Set the variable property: Parameter reference variable. + * + * @param variable the variable value to set. + * @return the SsisParameter object itself. + */ + public SsisParameter withVariable(String variable) { + this.variable = variable; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisProject.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisProject.java new file mode 100644 index 0000000000000..2af2fe1a67b45 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisProject.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.List; + +/** Ssis project. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("Project") +@Fluent +public final class SsisProject extends SsisObjectMetadata { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SsisProject.class); + + /* + * Folder id which contains project. + */ + @JsonProperty(value = "folderId") + private Long folderId; + + /* + * Project version. + */ + @JsonProperty(value = "version") + private Long version; + + /* + * Environment reference in project + */ + @JsonProperty(value = "environmentRefs") + private List environmentRefs; + + /* + * Parameters in project + */ + @JsonProperty(value = "parameters") + private List parameters; + + /** + * Get the folderId property: Folder id which contains project. + * + * @return the folderId value. + */ + public Long folderId() { + return this.folderId; + } + + /** + * Set the folderId property: Folder id which contains project. + * + * @param folderId the folderId value to set. + * @return the SsisProject object itself. + */ + public SsisProject withFolderId(Long folderId) { + this.folderId = folderId; + return this; + } + + /** + * Get the version property: Project version. + * + * @return the version value. + */ + public Long version() { + return this.version; + } + + /** + * Set the version property: Project version. + * + * @param version the version value to set. + * @return the SsisProject object itself. + */ + public SsisProject withVersion(Long version) { + this.version = version; + return this; + } + + /** + * Get the environmentRefs property: Environment reference in project. + * + * @return the environmentRefs value. + */ + public List environmentRefs() { + return this.environmentRefs; + } + + /** + * Set the environmentRefs property: Environment reference in project. + * + * @param environmentRefs the environmentRefs value to set. + * @return the SsisProject object itself. + */ + public SsisProject withEnvironmentRefs(List environmentRefs) { + this.environmentRefs = environmentRefs; + return this; + } + + /** + * Get the parameters property: Parameters in project. + * + * @return the parameters value. + */ + public List parameters() { + return this.parameters; + } + + /** + * Set the parameters property: Parameters in project. + * + * @param parameters the parameters value to set. + * @return the SsisProject object itself. + */ + public SsisProject withParameters(List parameters) { + this.parameters = parameters; + return this; + } + + /** {@inheritDoc} */ + @Override + public SsisProject withId(Long id) { + super.withId(id); + return this; + } + + /** {@inheritDoc} */ + @Override + public SsisProject withName(String name) { + super.withName(name); + return this; + } + + /** {@inheritDoc} */ + @Override + public SsisProject withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (environmentRefs() != null) { + environmentRefs().forEach(e -> e.validate()); + } + if (parameters() != null) { + parameters().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisVariable.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisVariable.java new file mode 100644 index 0000000000000..110951c58f9bf --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/SsisVariable.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Ssis variable. */ +@Fluent +public final class SsisVariable { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SsisVariable.class); + + /* + * Variable id. + */ + @JsonProperty(value = "id") + private Long id; + + /* + * Variable name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Variable description. + */ + @JsonProperty(value = "description") + private String description; + + /* + * Variable type. + */ + @JsonProperty(value = "dataType") + private String dataType; + + /* + * Whether variable is sensitive. + */ + @JsonProperty(value = "sensitive") + private Boolean sensitive; + + /* + * Variable value. + */ + @JsonProperty(value = "value") + private String value; + + /* + * Variable sensitive value. + */ + @JsonProperty(value = "sensitiveValue") + private String sensitiveValue; + + /** + * Get the id property: Variable id. + * + * @return the id value. + */ + public Long id() { + return this.id; + } + + /** + * Set the id property: Variable id. + * + * @param id the id value to set. + * @return the SsisVariable object itself. + */ + public SsisVariable withId(Long id) { + this.id = id; + return this; + } + + /** + * Get the name property: Variable name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Variable name. + * + * @param name the name value to set. + * @return the SsisVariable object itself. + */ + public SsisVariable withName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: Variable description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Variable description. + * + * @param description the description value to set. + * @return the SsisVariable object itself. + */ + public SsisVariable withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the dataType property: Variable type. + * + * @return the dataType value. + */ + public String dataType() { + return this.dataType; + } + + /** + * Set the dataType property: Variable type. + * + * @param dataType the dataType value to set. + * @return the SsisVariable object itself. + */ + public SsisVariable withDataType(String dataType) { + this.dataType = dataType; + return this; + } + + /** + * Get the sensitive property: Whether variable is sensitive. + * + * @return the sensitive value. + */ + public Boolean sensitive() { + return this.sensitive; + } + + /** + * Set the sensitive property: Whether variable is sensitive. + * + * @param sensitive the sensitive value to set. + * @return the SsisVariable object itself. + */ + public SsisVariable withSensitive(Boolean sensitive) { + this.sensitive = sensitive; + return this; + } + + /** + * Get the value property: Variable value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Variable value. + * + * @param value the value value to set. + * @return the SsisVariable object itself. + */ + public SsisVariable withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the sensitiveValue property: Variable sensitive value. + * + * @return the sensitiveValue value. + */ + public String sensitiveValue() { + return this.sensitiveValue; + } + + /** + * Set the sensitiveValue property: Variable sensitive value. + * + * @param sensitiveValue the sensitiveValue value to set. + * @return the SsisVariable object itself. + */ + public SsisVariable withSensitiveValue(String sensitiveValue) { + this.sensitiveValue = sensitiveValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/StorageAccountType.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/StorageAccountType.java new file mode 100644 index 0000000000000..3c65e31bae320 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/StorageAccountType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for StorageAccountType. */ +public final class StorageAccountType extends ExpandableStringEnum { + /** Static value GRS for StorageAccountType. */ + public static final StorageAccountType GRS = fromString("GRS"); + + /** Static value LRS for StorageAccountType. */ + public static final StorageAccountType LRS = fromString("LRS"); + + /** Static value ZRS for StorageAccountType. */ + public static final StorageAccountType ZRS = fromString("ZRS"); + + /** + * Creates or finds a StorageAccountType from its string representation. + * + * @param name a name to look for. + * @return the corresponding StorageAccountType. + */ + @JsonCreator + public static StorageAccountType fromString(String name) { + return fromString(name, StorageAccountType.class); + } + + /** @return known StorageAccountType values. */ + public static Collection values() { + return values(StorageAccountType.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/TopQueries.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/TopQueries.java new file mode 100644 index 0000000000000..f4aa0e4864c35 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/TopQueries.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** A database query. */ +@Immutable +public final class TopQueries { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TopQueries.class); + + /* + * The function that is used to aggregate each query's metrics. + */ + @JsonProperty(value = "aggregationFunction", access = JsonProperty.Access.WRITE_ONLY) + private QueryAggregationFunction aggregationFunction; + + /* + * The execution type that is used to filter the query instances that are + * returned. + */ + @JsonProperty(value = "executionType", access = JsonProperty.Access.WRITE_ONLY) + private QueryExecutionType executionType; + + /* + * The duration of the interval (ISO8601 duration format). + */ + @JsonProperty(value = "intervalType", access = JsonProperty.Access.WRITE_ONLY) + private String intervalType; + + /* + * The number of requested queries. + */ + @JsonProperty(value = "numberOfTopQueries", access = JsonProperty.Access.WRITE_ONLY) + private Integer numberOfTopQueries; + + /* + * The start time for queries that are returned (ISO8601 format) + */ + @JsonProperty(value = "observationStartTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime observationStartTime; + + /* + * The end time for queries that are returned (ISO8601 format) + */ + @JsonProperty(value = "observationEndTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime observationEndTime; + + /* + * The type of metric to use for ordering the top metrics. + */ + @JsonProperty(value = "observedMetric", access = JsonProperty.Access.WRITE_ONLY) + private QueryObservedMetricType observedMetric; + + /* + * The list of queries. + */ + @JsonProperty(value = "queries", access = JsonProperty.Access.WRITE_ONLY) + private List queries; + + /** + * Get the aggregationFunction property: The function that is used to aggregate each query's metrics. + * + * @return the aggregationFunction value. + */ + public QueryAggregationFunction aggregationFunction() { + return this.aggregationFunction; + } + + /** + * Get the executionType property: The execution type that is used to filter the query instances that are returned. + * + * @return the executionType value. + */ + public QueryExecutionType executionType() { + return this.executionType; + } + + /** + * Get the intervalType property: The duration of the interval (ISO8601 duration format). + * + * @return the intervalType value. + */ + public String intervalType() { + return this.intervalType; + } + + /** + * Get the numberOfTopQueries property: The number of requested queries. + * + * @return the numberOfTopQueries value. + */ + public Integer numberOfTopQueries() { + return this.numberOfTopQueries; + } + + /** + * Get the observationStartTime property: The start time for queries that are returned (ISO8601 format). + * + * @return the observationStartTime value. + */ + public OffsetDateTime observationStartTime() { + return this.observationStartTime; + } + + /** + * Get the observationEndTime property: The end time for queries that are returned (ISO8601 format). + * + * @return the observationEndTime value. + */ + public OffsetDateTime observationEndTime() { + return this.observationEndTime; + } + + /** + * Get the observedMetric property: The type of metric to use for ordering the top metrics. + * + * @return the observedMetric value. + */ + public QueryObservedMetricType observedMetric() { + return this.observedMetric; + } + + /** + * Get the queries property: The list of queries. + * + * @return the queries value. + */ + public List queries() { + return this.queries; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (queries() != null) { + queries().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/TransparentDataEncryption.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/TransparentDataEncryption.java new file mode 100644 index 0000000000000..ac55f8c389805 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/TransparentDataEncryption.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.TransparentDataEncryptionInner; + +/** An immutable client-side representation of TransparentDataEncryption. */ +public interface TransparentDataEncryption { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: Resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the status property: The status of the database transparent data encryption. + * + * @return the status value. + */ + TransparentDataEncryptionStatus status(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.TransparentDataEncryptionInner object. + * + * @return the inner object. + */ + TransparentDataEncryptionInner innerModel(); + + /** The entirety of the TransparentDataEncryption definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The TransparentDataEncryption definition stages. */ + interface DefinitionStages { + /** The first stage of the TransparentDataEncryption definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the TransparentDataEncryption definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * 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. + */ + WithCreate withExistingSqlPool(String resourceGroupName, String workspaceName, String sqlPoolName); + } + /** + * The stage of the TransparentDataEncryption definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithStatus { + /** + * Executes the create request. + * + * @return the created resource. + */ + TransparentDataEncryption create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + TransparentDataEncryption create(Context context); + } + /** The stage of the TransparentDataEncryption definition allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: The status of the database transparent data encryption.. + * + * @param status The status of the database transparent data encryption. + * @return the next definition stage. + */ + WithCreate withStatus(TransparentDataEncryptionStatus status); + } + } + /** + * Begins update for the TransparentDataEncryption resource. + * + * @return the stage of resource update. + */ + TransparentDataEncryption.Update update(); + + /** The template for TransparentDataEncryption update. */ + interface Update extends UpdateStages.WithStatus { + /** + * Executes the update request. + * + * @return the updated resource. + */ + TransparentDataEncryption apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + TransparentDataEncryption apply(Context context); + } + /** The TransparentDataEncryption update stages. */ + interface UpdateStages { + /** The stage of the TransparentDataEncryption update allowing to specify status. */ + interface WithStatus { + /** + * Specifies the status property: The status of the database transparent data encryption.. + * + * @param status The status of the database transparent data encryption. + * @return the next definition stage. + */ + Update withStatus(TransparentDataEncryptionStatus status); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + TransparentDataEncryption refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + TransparentDataEncryption refresh(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/TransparentDataEncryptionListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/TransparentDataEncryptionListResult.java new file mode 100644 index 0000000000000..fac4392b58cfe --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/TransparentDataEncryptionListResult.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.TransparentDataEncryptionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of transparent data encryption configurations. */ +@Immutable +public final class TransparentDataEncryptionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TransparentDataEncryptionListResult.class); + + /* + * Array of results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/TransparentDataEncryptionName.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/TransparentDataEncryptionName.java new file mode 100644 index 0000000000000..175cc39f9e36c --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/TransparentDataEncryptionName.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TransparentDataEncryptionName. */ +public final class TransparentDataEncryptionName extends ExpandableStringEnum { + /** Static value current for TransparentDataEncryptionName. */ + public static final TransparentDataEncryptionName CURRENT = fromString("current"); + + /** + * Creates or finds a TransparentDataEncryptionName from its string representation. + * + * @param name a name to look for. + * @return the corresponding TransparentDataEncryptionName. + */ + @JsonCreator + public static TransparentDataEncryptionName fromString(String name) { + return fromString(name, TransparentDataEncryptionName.class); + } + + /** @return known TransparentDataEncryptionName values. */ + public static Collection values() { + return values(TransparentDataEncryptionName.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/TransparentDataEncryptionStatus.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/TransparentDataEncryptionStatus.java new file mode 100644 index 0000000000000..ca00480bcb901 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/TransparentDataEncryptionStatus.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for TransparentDataEncryptionStatus. */ +public enum TransparentDataEncryptionStatus { + /** Enum value Enabled. */ + ENABLED("Enabled"), + + /** Enum value Disabled. */ + DISABLED("Disabled"); + + /** The actual serialized value for a TransparentDataEncryptionStatus instance. */ + private final String value; + + TransparentDataEncryptionStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a TransparentDataEncryptionStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed TransparentDataEncryptionStatus object, or null if unable to parse. + */ + @JsonCreator + public static TransparentDataEncryptionStatus fromString(String value) { + TransparentDataEncryptionStatus[] items = TransparentDataEncryptionStatus.values(); + for (TransparentDataEncryptionStatus item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/UpdateIntegrationRuntimeNodeRequest.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/UpdateIntegrationRuntimeNodeRequest.java new file mode 100644 index 0000000000000..c4caf7ac402ce --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/UpdateIntegrationRuntimeNodeRequest.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Update integration runtime node request. */ +@Fluent +public final class UpdateIntegrationRuntimeNodeRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateIntegrationRuntimeNodeRequest.class); + + /* + * The number of concurrent jobs permitted to run on the integration + * runtime node. Values between 1 and maxConcurrentJobs(inclusive) are + * allowed. + */ + @JsonProperty(value = "concurrentJobsLimit") + private Integer concurrentJobsLimit; + + /** + * Get the concurrentJobsLimit property: The number of concurrent jobs permitted to run on the integration runtime + * node. Values between 1 and maxConcurrentJobs(inclusive) are allowed. + * + * @return the concurrentJobsLimit value. + */ + public Integer concurrentJobsLimit() { + return this.concurrentJobsLimit; + } + + /** + * Set the concurrentJobsLimit property: The number of concurrent jobs permitted to run on the integration runtime + * node. Values between 1 and maxConcurrentJobs(inclusive) are allowed. + * + * @param concurrentJobsLimit the concurrentJobsLimit value to set. + * @return the UpdateIntegrationRuntimeNodeRequest object itself. + */ + public UpdateIntegrationRuntimeNodeRequest withConcurrentJobsLimit(Integer concurrentJobsLimit) { + this.concurrentJobsLimit = concurrentJobsLimit; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/UpdateIntegrationRuntimeRequest.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/UpdateIntegrationRuntimeRequest.java new file mode 100644 index 0000000000000..814baaa8282d8 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/UpdateIntegrationRuntimeRequest.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Update integration runtime request. */ +@Fluent +public final class UpdateIntegrationRuntimeRequest { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateIntegrationRuntimeRequest.class); + + /* + * Enables or disables the auto-update feature of the self-hosted + * integration runtime. See https://go.microsoft.com/fwlink/?linkid=854189. + */ + @JsonProperty(value = "autoUpdate") + private IntegrationRuntimeAutoUpdate autoUpdate; + + /* + * The time offset (in hours) in the day, e.g., PT03H is 3 hours. The + * integration runtime auto update will happen on that time. + */ + @JsonProperty(value = "updateDelayOffset") + private String updateDelayOffset; + + /** + * Get the autoUpdate property: Enables or disables the auto-update feature of the self-hosted integration runtime. + * See https://go.microsoft.com/fwlink/?linkid=854189. + * + * @return the autoUpdate value. + */ + public IntegrationRuntimeAutoUpdate autoUpdate() { + return this.autoUpdate; + } + + /** + * Set the autoUpdate property: Enables or disables the auto-update feature of the self-hosted integration runtime. + * See https://go.microsoft.com/fwlink/?linkid=854189. + * + * @param autoUpdate the autoUpdate value to set. + * @return the UpdateIntegrationRuntimeRequest object itself. + */ + public UpdateIntegrationRuntimeRequest withAutoUpdate(IntegrationRuntimeAutoUpdate autoUpdate) { + this.autoUpdate = autoUpdate; + return this; + } + + /** + * Get the updateDelayOffset property: The time offset (in hours) in the day, e.g., PT03H is 3 hours. The + * integration runtime auto update will happen on that time. + * + * @return the updateDelayOffset value. + */ + public String updateDelayOffset() { + return this.updateDelayOffset; + } + + /** + * Set the updateDelayOffset property: The time offset (in hours) in the day, e.g., PT03H is 3 hours. The + * integration runtime auto update will happen on that time. + * + * @param updateDelayOffset the updateDelayOffset value to set. + * @return the UpdateIntegrationRuntimeRequest object itself. + */ + public UpdateIntegrationRuntimeRequest withUpdateDelayOffset(String updateDelayOffset) { + this.updateDelayOffset = updateDelayOffset; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VirtualNetworkProfile.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VirtualNetworkProfile.java new file mode 100644 index 0000000000000..987e197721701 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VirtualNetworkProfile.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Virtual Network Profile. */ +@Fluent +public final class VirtualNetworkProfile { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VirtualNetworkProfile.class); + + /* + * Subnet ID used for computes in workspace + */ + @JsonProperty(value = "computeSubnetId") + private String computeSubnetId; + + /** + * Get the computeSubnetId property: Subnet ID used for computes in workspace. + * + * @return the computeSubnetId value. + */ + public String computeSubnetId() { + return this.computeSubnetId; + } + + /** + * Set the computeSubnetId property: Subnet ID used for computes in workspace. + * + * @param computeSubnetId the computeSubnetId value to set. + * @return the VirtualNetworkProfile object itself. + */ + public VirtualNetworkProfile withComputeSubnetId(String computeSubnetId) { + this.computeSubnetId = computeSubnetId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentName.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentName.java new file mode 100644 index 0000000000000..590249774e798 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentName.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VulnerabilityAssessmentName. */ +public final class VulnerabilityAssessmentName extends ExpandableStringEnum { + /** Static value default for VulnerabilityAssessmentName. */ + public static final VulnerabilityAssessmentName DEFAULT = fromString("default"); + + /** + * Creates or finds a VulnerabilityAssessmentName from its string representation. + * + * @param name a name to look for. + * @return the corresponding VulnerabilityAssessmentName. + */ + @JsonCreator + public static VulnerabilityAssessmentName fromString(String name) { + return fromString(name, VulnerabilityAssessmentName.class); + } + + /** @return known VulnerabilityAssessmentName values. */ + public static Collection values() { + return values(VulnerabilityAssessmentName.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentPolicyBaselineName.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentPolicyBaselineName.java new file mode 100644 index 0000000000000..f144e5338b81f --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentPolicyBaselineName.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Defines values for VulnerabilityAssessmentPolicyBaselineName. */ +public enum VulnerabilityAssessmentPolicyBaselineName { + /** Enum value master. */ + MASTER("master"), + + /** Enum value default. */ + DEFAULT("default"); + + /** The actual serialized value for a VulnerabilityAssessmentPolicyBaselineName instance. */ + private final String value; + + VulnerabilityAssessmentPolicyBaselineName(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a VulnerabilityAssessmentPolicyBaselineName instance. + * + * @param value the serialized value to parse. + * @return the parsed VulnerabilityAssessmentPolicyBaselineName object, or null if unable to parse. + */ + @JsonCreator + public static VulnerabilityAssessmentPolicyBaselineName fromString(String value) { + VulnerabilityAssessmentPolicyBaselineName[] items = VulnerabilityAssessmentPolicyBaselineName.values(); + for (VulnerabilityAssessmentPolicyBaselineName item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentRecurringScansProperties.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentRecurringScansProperties.java new file mode 100644 index 0000000000000..8ca14901ac2df --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentRecurringScansProperties.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of a Vulnerability Assessment recurring scans. */ +@Fluent +public final class VulnerabilityAssessmentRecurringScansProperties { + @JsonIgnore + private final ClientLogger logger = new ClientLogger(VulnerabilityAssessmentRecurringScansProperties.class); + + /* + * Recurring scans state. + */ + @JsonProperty(value = "isEnabled") + private Boolean isEnabled; + + /* + * Specifies that the schedule scan notification will be is sent to the + * subscription administrators. + */ + @JsonProperty(value = "emailSubscriptionAdmins") + private Boolean emailSubscriptionAdmins; + + /* + * Specifies an array of e-mail addresses to which the scan notification is + * sent. + */ + @JsonProperty(value = "emails") + private List emails; + + /** + * Get the isEnabled property: Recurring scans state. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * Set the isEnabled property: Recurring scans state. + * + * @param isEnabled the isEnabled value to set. + * @return the VulnerabilityAssessmentRecurringScansProperties object itself. + */ + public VulnerabilityAssessmentRecurringScansProperties withIsEnabled(Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Get the emailSubscriptionAdmins property: Specifies that the schedule scan notification will be is sent to the + * subscription administrators. + * + * @return the emailSubscriptionAdmins value. + */ + public Boolean emailSubscriptionAdmins() { + return this.emailSubscriptionAdmins; + } + + /** + * Set the emailSubscriptionAdmins property: Specifies that the schedule scan notification will be is sent to the + * subscription administrators. + * + * @param emailSubscriptionAdmins the emailSubscriptionAdmins value to set. + * @return the VulnerabilityAssessmentRecurringScansProperties object itself. + */ + public VulnerabilityAssessmentRecurringScansProperties withEmailSubscriptionAdmins( + Boolean emailSubscriptionAdmins) { + this.emailSubscriptionAdmins = emailSubscriptionAdmins; + return this; + } + + /** + * Get the emails property: Specifies an array of e-mail addresses to which the scan notification is sent. + * + * @return the emails value. + */ + public List emails() { + return this.emails; + } + + /** + * Set the emails property: Specifies an array of e-mail addresses to which the scan notification is sent. + * + * @param emails the emails value to set. + * @return the VulnerabilityAssessmentRecurringScansProperties object itself. + */ + public VulnerabilityAssessmentRecurringScansProperties withEmails(List emails) { + this.emails = emails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentScanError.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentScanError.java new file mode 100644 index 0000000000000..2bba79b770dde --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentScanError.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of a vulnerability assessment scan error. */ +@Immutable +public final class VulnerabilityAssessmentScanError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VulnerabilityAssessmentScanError.class); + + /* + * The error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /* + * The error message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get the code property: The error code. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Get the message property: The error message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentScanRecord.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentScanRecord.java new file mode 100644 index 0000000000000..c869740d5b6ef --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentScanRecord.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.VulnerabilityAssessmentScanRecordInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of VulnerabilityAssessmentScanRecord. */ +public interface VulnerabilityAssessmentScanRecord { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the scanId property: The scan ID. + * + * @return the scanId value. + */ + String scanId(); + + /** + * Gets the triggerType property: The scan trigger type. + * + * @return the triggerType value. + */ + VulnerabilityAssessmentScanTriggerType triggerType(); + + /** + * Gets the state property: The scan status. + * + * @return the state value. + */ + VulnerabilityAssessmentScanState state(); + + /** + * Gets the startTime property: The scan start time (UTC). + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: The scan end time (UTC). + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the errors property: The scan errors. + * + * @return the errors value. + */ + List errors(); + + /** + * Gets the storageContainerPath property: The scan results storage container path. + * + * @return the storageContainerPath value. + */ + String storageContainerPath(); + + /** + * Gets the numberOfFailedSecurityChecks property: The number of failed security checks. + * + * @return the numberOfFailedSecurityChecks value. + */ + Integer numberOfFailedSecurityChecks(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.VulnerabilityAssessmentScanRecordInner object. + * + * @return the inner object. + */ + VulnerabilityAssessmentScanRecordInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentScanRecordListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentScanRecordListResult.java new file mode 100644 index 0000000000000..9223fa6f5f0a3 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentScanRecordListResult.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.VulnerabilityAssessmentScanRecordInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of vulnerability assessment scan records. */ +@Immutable +public final class VulnerabilityAssessmentScanRecordListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VulnerabilityAssessmentScanRecordListResult.class); + + /* + * Array of results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentScanState.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentScanState.java new file mode 100644 index 0000000000000..849b747476491 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentScanState.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VulnerabilityAssessmentScanState. */ +public final class VulnerabilityAssessmentScanState extends ExpandableStringEnum { + /** Static value Passed for VulnerabilityAssessmentScanState. */ + public static final VulnerabilityAssessmentScanState PASSED = fromString("Passed"); + + /** Static value Failed for VulnerabilityAssessmentScanState. */ + public static final VulnerabilityAssessmentScanState FAILED = fromString("Failed"); + + /** Static value FailedToRun for VulnerabilityAssessmentScanState. */ + public static final VulnerabilityAssessmentScanState FAILED_TO_RUN = fromString("FailedToRun"); + + /** Static value InProgress for VulnerabilityAssessmentScanState. */ + public static final VulnerabilityAssessmentScanState IN_PROGRESS = fromString("InProgress"); + + /** + * Creates or finds a VulnerabilityAssessmentScanState from its string representation. + * + * @param name a name to look for. + * @return the corresponding VulnerabilityAssessmentScanState. + */ + @JsonCreator + public static VulnerabilityAssessmentScanState fromString(String name) { + return fromString(name, VulnerabilityAssessmentScanState.class); + } + + /** @return known VulnerabilityAssessmentScanState values. */ + public static Collection values() { + return values(VulnerabilityAssessmentScanState.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentScanTriggerType.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentScanTriggerType.java new file mode 100644 index 0000000000000..8b63b4471074c --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/VulnerabilityAssessmentScanTriggerType.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for VulnerabilityAssessmentScanTriggerType. */ +public final class VulnerabilityAssessmentScanTriggerType + extends ExpandableStringEnum { + /** Static value OnDemand for VulnerabilityAssessmentScanTriggerType. */ + public static final VulnerabilityAssessmentScanTriggerType ON_DEMAND = fromString("OnDemand"); + + /** Static value Recurring for VulnerabilityAssessmentScanTriggerType. */ + public static final VulnerabilityAssessmentScanTriggerType RECURRING = fromString("Recurring"); + + /** + * Creates or finds a VulnerabilityAssessmentScanTriggerType from its string representation. + * + * @param name a name to look for. + * @return the corresponding VulnerabilityAssessmentScanTriggerType. + */ + @JsonCreator + public static VulnerabilityAssessmentScanTriggerType fromString(String name) { + return fromString(name, VulnerabilityAssessmentScanTriggerType.class); + } + + /** @return known VulnerabilityAssessmentScanTriggerType values. */ + public static Collection values() { + return values(VulnerabilityAssessmentScanTriggerType.class); + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkloadClassifier.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkloadClassifier.java new file mode 100644 index 0000000000000..5fba176e90346 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkloadClassifier.java @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.WorkloadClassifierInner; + +/** An immutable client-side representation of WorkloadClassifier. */ +public interface WorkloadClassifier { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the memberName property: The workload classifier member name. + * + * @return the memberName value. + */ + String memberName(); + + /** + * Gets the label property: The workload classifier label. + * + * @return the label value. + */ + String label(); + + /** + * Gets the context property: The workload classifier context. + * + * @return the context value. + */ + String context(); + + /** + * Gets the startTime property: The workload classifier start time for classification. + * + * @return the startTime value. + */ + String startTime(); + + /** + * Gets the endTime property: The workload classifier end time for classification. + * + * @return the endTime value. + */ + String endTime(); + + /** + * Gets the importance property: The workload classifier importance. + * + * @return the importance value. + */ + String importance(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.WorkloadClassifierInner object. + * + * @return the inner object. + */ + WorkloadClassifierInner innerModel(); + + /** The entirety of the WorkloadClassifier definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The WorkloadClassifier definition stages. */ + interface DefinitionStages { + /** The first stage of the WorkloadClassifier definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the WorkloadClassifier definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName, sqlPoolName, workloadGroupName. + * + * @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 workloadGroupName The name of the workload group. + * @return the next definition stage. + */ + WithCreate withExistingWorkloadGroup( + String resourceGroupName, String workspaceName, String sqlPoolName, String workloadGroupName); + } + /** + * The stage of the WorkloadClassifier definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithMemberName, + DefinitionStages.WithLabel, + DefinitionStages.WithContext, + DefinitionStages.WithStartTime, + DefinitionStages.WithEndTime, + DefinitionStages.WithImportance { + /** + * Executes the create request. + * + * @return the created resource. + */ + WorkloadClassifier create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + WorkloadClassifier create(Context context); + } + /** The stage of the WorkloadClassifier definition allowing to specify memberName. */ + interface WithMemberName { + /** + * Specifies the memberName property: The workload classifier member name.. + * + * @param memberName The workload classifier member name. + * @return the next definition stage. + */ + WithCreate withMemberName(String memberName); + } + /** The stage of the WorkloadClassifier definition allowing to specify label. */ + interface WithLabel { + /** + * Specifies the label property: The workload classifier label.. + * + * @param label The workload classifier label. + * @return the next definition stage. + */ + WithCreate withLabel(String label); + } + /** The stage of the WorkloadClassifier definition allowing to specify context. */ + interface WithContext { + /** + * Specifies the context property: The workload classifier context.. + * + * @param context The workload classifier context. + * @return the next definition stage. + */ + WithCreate withContext(String context); + } + /** The stage of the WorkloadClassifier definition allowing to specify startTime. */ + interface WithStartTime { + /** + * Specifies the startTime property: The workload classifier start time for classification.. + * + * @param startTime The workload classifier start time for classification. + * @return the next definition stage. + */ + WithCreate withStartTime(String startTime); + } + /** The stage of the WorkloadClassifier definition allowing to specify endTime. */ + interface WithEndTime { + /** + * Specifies the endTime property: The workload classifier end time for classification.. + * + * @param endTime The workload classifier end time for classification. + * @return the next definition stage. + */ + WithCreate withEndTime(String endTime); + } + /** The stage of the WorkloadClassifier definition allowing to specify importance. */ + interface WithImportance { + /** + * Specifies the importance property: The workload classifier importance.. + * + * @param importance The workload classifier importance. + * @return the next definition stage. + */ + WithCreate withImportance(String importance); + } + } + /** + * Begins update for the WorkloadClassifier resource. + * + * @return the stage of resource update. + */ + WorkloadClassifier.Update update(); + + /** The template for WorkloadClassifier update. */ + interface Update + extends UpdateStages.WithMemberName, + UpdateStages.WithLabel, + UpdateStages.WithContext, + UpdateStages.WithStartTime, + UpdateStages.WithEndTime, + UpdateStages.WithImportance { + /** + * Executes the update request. + * + * @return the updated resource. + */ + WorkloadClassifier apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + WorkloadClassifier apply(Context context); + } + /** The WorkloadClassifier update stages. */ + interface UpdateStages { + /** The stage of the WorkloadClassifier update allowing to specify memberName. */ + interface WithMemberName { + /** + * Specifies the memberName property: The workload classifier member name.. + * + * @param memberName The workload classifier member name. + * @return the next definition stage. + */ + Update withMemberName(String memberName); + } + /** The stage of the WorkloadClassifier update allowing to specify label. */ + interface WithLabel { + /** + * Specifies the label property: The workload classifier label.. + * + * @param label The workload classifier label. + * @return the next definition stage. + */ + Update withLabel(String label); + } + /** The stage of the WorkloadClassifier update allowing to specify context. */ + interface WithContext { + /** + * Specifies the context property: The workload classifier context.. + * + * @param context The workload classifier context. + * @return the next definition stage. + */ + Update withContext(String context); + } + /** The stage of the WorkloadClassifier update allowing to specify startTime. */ + interface WithStartTime { + /** + * Specifies the startTime property: The workload classifier start time for classification.. + * + * @param startTime The workload classifier start time for classification. + * @return the next definition stage. + */ + Update withStartTime(String startTime); + } + /** The stage of the WorkloadClassifier update allowing to specify endTime. */ + interface WithEndTime { + /** + * Specifies the endTime property: The workload classifier end time for classification.. + * + * @param endTime The workload classifier end time for classification. + * @return the next definition stage. + */ + Update withEndTime(String endTime); + } + /** The stage of the WorkloadClassifier update allowing to specify importance. */ + interface WithImportance { + /** + * Specifies the importance property: The workload classifier importance.. + * + * @param importance The workload classifier importance. + * @return the next definition stage. + */ + Update withImportance(String importance); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + WorkloadClassifier refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + WorkloadClassifier refresh(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkloadClassifierListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkloadClassifierListResult.java new file mode 100644 index 0000000000000..02772c6b588a2 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkloadClassifierListResult.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.WorkloadClassifierInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of workload classifiers for a workload group. */ +@Immutable +public final class WorkloadClassifierListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadClassifierListResult.class); + + /* + * Array of results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkloadGroup.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkloadGroup.java new file mode 100644 index 0000000000000..220bb67fcd17b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkloadGroup.java @@ -0,0 +1,301 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.WorkloadGroupInner; + +/** An immutable client-side representation of WorkloadGroup. */ +public interface WorkloadGroup { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the minResourcePercent property: The workload group minimum percentage resource. + * + * @return the minResourcePercent value. + */ + Integer minResourcePercent(); + + /** + * Gets the maxResourcePercent property: The workload group cap percentage resource. + * + * @return the maxResourcePercent value. + */ + Integer maxResourcePercent(); + + /** + * Gets the minResourcePercentPerRequest property: The workload group request minimum grant percentage. + * + * @return the minResourcePercentPerRequest value. + */ + Double minResourcePercentPerRequest(); + + /** + * Gets the maxResourcePercentPerRequest property: The workload group request maximum grant percentage. + * + * @return the maxResourcePercentPerRequest value. + */ + Double maxResourcePercentPerRequest(); + + /** + * Gets the importance property: The workload group importance level. + * + * @return the importance value. + */ + String importance(); + + /** + * Gets the queryExecutionTimeout property: The workload group query execution timeout. + * + * @return the queryExecutionTimeout value. + */ + Integer queryExecutionTimeout(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.WorkloadGroupInner object. + * + * @return the inner object. + */ + WorkloadGroupInner innerModel(); + + /** The entirety of the WorkloadGroup definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The WorkloadGroup definition stages. */ + interface DefinitionStages { + /** The first stage of the WorkloadGroup definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the WorkloadGroup definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * 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. + */ + WithCreate withExistingSqlPool(String resourceGroupName, String workspaceName, String sqlPoolName); + } + /** + * The stage of the WorkloadGroup definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithMinResourcePercent, + DefinitionStages.WithMaxResourcePercent, + DefinitionStages.WithMinResourcePercentPerRequest, + DefinitionStages.WithMaxResourcePercentPerRequest, + DefinitionStages.WithImportance, + DefinitionStages.WithQueryExecutionTimeout { + /** + * Executes the create request. + * + * @return the created resource. + */ + WorkloadGroup create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + WorkloadGroup create(Context context); + } + /** The stage of the WorkloadGroup definition allowing to specify minResourcePercent. */ + interface WithMinResourcePercent { + /** + * Specifies the minResourcePercent property: The workload group minimum percentage resource.. + * + * @param minResourcePercent The workload group minimum percentage resource. + * @return the next definition stage. + */ + WithCreate withMinResourcePercent(Integer minResourcePercent); + } + /** The stage of the WorkloadGroup definition allowing to specify maxResourcePercent. */ + interface WithMaxResourcePercent { + /** + * Specifies the maxResourcePercent property: The workload group cap percentage resource.. + * + * @param maxResourcePercent The workload group cap percentage resource. + * @return the next definition stage. + */ + WithCreate withMaxResourcePercent(Integer maxResourcePercent); + } + /** The stage of the WorkloadGroup definition allowing to specify minResourcePercentPerRequest. */ + interface WithMinResourcePercentPerRequest { + /** + * Specifies the minResourcePercentPerRequest property: The workload group request minimum grant + * percentage.. + * + * @param minResourcePercentPerRequest The workload group request minimum grant percentage. + * @return the next definition stage. + */ + WithCreate withMinResourcePercentPerRequest(Double minResourcePercentPerRequest); + } + /** The stage of the WorkloadGroup definition allowing to specify maxResourcePercentPerRequest. */ + interface WithMaxResourcePercentPerRequest { + /** + * Specifies the maxResourcePercentPerRequest property: The workload group request maximum grant + * percentage.. + * + * @param maxResourcePercentPerRequest The workload group request maximum grant percentage. + * @return the next definition stage. + */ + WithCreate withMaxResourcePercentPerRequest(Double maxResourcePercentPerRequest); + } + /** The stage of the WorkloadGroup definition allowing to specify importance. */ + interface WithImportance { + /** + * Specifies the importance property: The workload group importance level.. + * + * @param importance The workload group importance level. + * @return the next definition stage. + */ + WithCreate withImportance(String importance); + } + /** The stage of the WorkloadGroup definition allowing to specify queryExecutionTimeout. */ + interface WithQueryExecutionTimeout { + /** + * Specifies the queryExecutionTimeout property: The workload group query execution timeout.. + * + * @param queryExecutionTimeout The workload group query execution timeout. + * @return the next definition stage. + */ + WithCreate withQueryExecutionTimeout(Integer queryExecutionTimeout); + } + } + /** + * Begins update for the WorkloadGroup resource. + * + * @return the stage of resource update. + */ + WorkloadGroup.Update update(); + + /** The template for WorkloadGroup update. */ + interface Update + extends UpdateStages.WithMinResourcePercent, + UpdateStages.WithMaxResourcePercent, + UpdateStages.WithMinResourcePercentPerRequest, + UpdateStages.WithMaxResourcePercentPerRequest, + UpdateStages.WithImportance, + UpdateStages.WithQueryExecutionTimeout { + /** + * Executes the update request. + * + * @return the updated resource. + */ + WorkloadGroup apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + WorkloadGroup apply(Context context); + } + /** The WorkloadGroup update stages. */ + interface UpdateStages { + /** The stage of the WorkloadGroup update allowing to specify minResourcePercent. */ + interface WithMinResourcePercent { + /** + * Specifies the minResourcePercent property: The workload group minimum percentage resource.. + * + * @param minResourcePercent The workload group minimum percentage resource. + * @return the next definition stage. + */ + Update withMinResourcePercent(Integer minResourcePercent); + } + /** The stage of the WorkloadGroup update allowing to specify maxResourcePercent. */ + interface WithMaxResourcePercent { + /** + * Specifies the maxResourcePercent property: The workload group cap percentage resource.. + * + * @param maxResourcePercent The workload group cap percentage resource. + * @return the next definition stage. + */ + Update withMaxResourcePercent(Integer maxResourcePercent); + } + /** The stage of the WorkloadGroup update allowing to specify minResourcePercentPerRequest. */ + interface WithMinResourcePercentPerRequest { + /** + * Specifies the minResourcePercentPerRequest property: The workload group request minimum grant + * percentage.. + * + * @param minResourcePercentPerRequest The workload group request minimum grant percentage. + * @return the next definition stage. + */ + Update withMinResourcePercentPerRequest(Double minResourcePercentPerRequest); + } + /** The stage of the WorkloadGroup update allowing to specify maxResourcePercentPerRequest. */ + interface WithMaxResourcePercentPerRequest { + /** + * Specifies the maxResourcePercentPerRequest property: The workload group request maximum grant + * percentage.. + * + * @param maxResourcePercentPerRequest The workload group request maximum grant percentage. + * @return the next definition stage. + */ + Update withMaxResourcePercentPerRequest(Double maxResourcePercentPerRequest); + } + /** The stage of the WorkloadGroup update allowing to specify importance. */ + interface WithImportance { + /** + * Specifies the importance property: The workload group importance level.. + * + * @param importance The workload group importance level. + * @return the next definition stage. + */ + Update withImportance(String importance); + } + /** The stage of the WorkloadGroup update allowing to specify queryExecutionTimeout. */ + interface WithQueryExecutionTimeout { + /** + * Specifies the queryExecutionTimeout property: The workload group query execution timeout.. + * + * @param queryExecutionTimeout The workload group query execution timeout. + * @return the next definition stage. + */ + Update withQueryExecutionTimeout(Integer queryExecutionTimeout); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + WorkloadGroup refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + WorkloadGroup refresh(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkloadGroupListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkloadGroupListResult.java new file mode 100644 index 0000000000000..943547f506945 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkloadGroupListResult.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.WorkloadGroupInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of workload groups. */ +@Immutable +public final class WorkloadGroupListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkloadGroupListResult.class); + + /* + * Array of results. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * Link to retrieve next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** + * Get the value property: Array of results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: Link to retrieve next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Workspace.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Workspace.java new file mode 100644 index 0000000000000..5ff4b5a287a20 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Workspace.java @@ -0,0 +1,539 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.synapse.fluent.models.WorkspaceInner; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +/** An immutable client-side representation of Workspace. */ +public interface Workspace { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the identity property: Identity of the workspace. + * + * @return the identity value. + */ + ManagedIdentity identity(); + + /** + * Gets the defaultDataLakeStorage property: Workspace default data lake storage account details. + * + * @return the defaultDataLakeStorage value. + */ + DataLakeStorageAccountDetails defaultDataLakeStorage(); + + /** + * Gets the sqlAdministratorLoginPassword property: SQL administrator login password. + * + * @return the sqlAdministratorLoginPassword value. + */ + String sqlAdministratorLoginPassword(); + + /** + * Gets the managedResourceGroupName property: Workspace managed resource group. The resource group name uniquely + * identifies the resource group within the user subscriptionId. The resource group name must be no longer than 90 + * characters long, and must be alphanumeric characters (Char.IsLetterOrDigit()) and '-', '_', '(', ')' and'.'. Note + * that the name cannot end with '.'. + * + * @return the managedResourceGroupName value. + */ + String managedResourceGroupName(); + + /** + * Gets the provisioningState property: Resource provisioning state. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the sqlAdministratorLogin property: Login for workspace SQL active directory administrator. + * + * @return the sqlAdministratorLogin value. + */ + String sqlAdministratorLogin(); + + /** + * Gets the virtualNetworkProfile property: Virtual Network profile. + * + * @return the virtualNetworkProfile value. + */ + VirtualNetworkProfile virtualNetworkProfile(); + + /** + * Gets the connectivityEndpoints property: Connectivity endpoints. + * + * @return the connectivityEndpoints value. + */ + Map connectivityEndpoints(); + + /** + * Gets the managedVirtualNetwork property: Setting this to 'default' will ensure that all compute for this + * workspace is in a virtual network managed on behalf of the user. + * + * @return the managedVirtualNetwork value. + */ + String managedVirtualNetwork(); + + /** + * Gets the privateEndpointConnections property: Private endpoint connections to the workspace. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * Gets the encryption property: The encryption details of the workspace. + * + * @return the encryption value. + */ + EncryptionDetails encryption(); + + /** + * Gets the workspaceUid property: The workspace unique identifier. + * + * @return the workspaceUid value. + */ + UUID workspaceUid(); + + /** + * Gets the extraProperties property: Workspace level configs and feature flags. + * + * @return the extraProperties value. + */ + Map extraProperties(); + + /** + * Gets the managedVirtualNetworkSettings property: Managed Virtual Network Settings. + * + * @return the managedVirtualNetworkSettings value. + */ + ManagedVirtualNetworkSettings managedVirtualNetworkSettings(); + + /** + * Gets the workspaceRepositoryConfiguration property: Git integration settings. + * + * @return the workspaceRepositoryConfiguration value. + */ + WorkspaceRepositoryConfiguration workspaceRepositoryConfiguration(); + + /** + * Gets the purviewConfiguration property: Purview Configuration. + * + * @return the purviewConfiguration value. + */ + PurviewConfiguration purviewConfiguration(); + + /** + * Gets the adlaResourceId property: The ADLA resource ID. + * + * @return the adlaResourceId value. + */ + String adlaResourceId(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.WorkspaceInner object. + * + * @return the inner object. + */ + WorkspaceInner innerModel(); + + /** The entirety of the Workspace definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The Workspace definition stages. */ + interface DefinitionStages { + /** The first stage of the Workspace definition. */ + interface Blank extends WithLocation { + } + /** The stage of the Workspace definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the Workspace definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the Workspace definition which contains all the minimum required properties for the resource to + * be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithIdentity, + DefinitionStages.WithDefaultDataLakeStorage, + DefinitionStages.WithSqlAdministratorLoginPassword, + DefinitionStages.WithManagedResourceGroupName, + DefinitionStages.WithSqlAdministratorLogin, + DefinitionStages.WithVirtualNetworkProfile, + DefinitionStages.WithConnectivityEndpoints, + DefinitionStages.WithManagedVirtualNetwork, + DefinitionStages.WithPrivateEndpointConnections, + DefinitionStages.WithEncryption, + DefinitionStages.WithManagedVirtualNetworkSettings, + DefinitionStages.WithWorkspaceRepositoryConfiguration, + DefinitionStages.WithPurviewConfiguration { + /** + * Executes the create request. + * + * @return the created resource. + */ + Workspace create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Workspace create(Context context); + } + /** The stage of the Workspace definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the Workspace definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: Identity of the workspace. + * + * @param identity Identity of the workspace. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedIdentity identity); + } + /** The stage of the Workspace definition allowing to specify defaultDataLakeStorage. */ + interface WithDefaultDataLakeStorage { + /** + * Specifies the defaultDataLakeStorage property: Workspace default data lake storage account details. + * + * @param defaultDataLakeStorage Workspace default data lake storage account details. + * @return the next definition stage. + */ + WithCreate withDefaultDataLakeStorage(DataLakeStorageAccountDetails defaultDataLakeStorage); + } + /** The stage of the Workspace definition allowing to specify sqlAdministratorLoginPassword. */ + interface WithSqlAdministratorLoginPassword { + /** + * Specifies the sqlAdministratorLoginPassword property: SQL administrator login password. + * + * @param sqlAdministratorLoginPassword SQL administrator login password. + * @return the next definition stage. + */ + WithCreate withSqlAdministratorLoginPassword(String sqlAdministratorLoginPassword); + } + /** The stage of the Workspace definition allowing to specify managedResourceGroupName. */ + interface WithManagedResourceGroupName { + /** + * Specifies the managedResourceGroupName property: Workspace managed resource group. The resource group + * name uniquely identifies the resource group within the user subscriptionId. The resource group name must + * be no longer than 90 characters long, and must be alphanumeric characters (Char.IsLetterOrDigit()) and + * '-', '_', '(', ')' and'.'. Note that the name cannot end with '.'. + * + * @param managedResourceGroupName Workspace managed resource group. The resource group name uniquely + * identifies the resource group within the user subscriptionId. The resource group name must be no + * longer than 90 characters long, and must be alphanumeric characters (Char.IsLetterOrDigit()) and '-', + * '_', '(', ')' and'.'. Note that the name cannot end with '.'. + * @return the next definition stage. + */ + WithCreate withManagedResourceGroupName(String managedResourceGroupName); + } + /** The stage of the Workspace definition allowing to specify sqlAdministratorLogin. */ + interface WithSqlAdministratorLogin { + /** + * Specifies the sqlAdministratorLogin property: Login for workspace SQL active directory administrator. + * + * @param sqlAdministratorLogin Login for workspace SQL active directory administrator. + * @return the next definition stage. + */ + WithCreate withSqlAdministratorLogin(String sqlAdministratorLogin); + } + /** The stage of the Workspace definition allowing to specify virtualNetworkProfile. */ + interface WithVirtualNetworkProfile { + /** + * Specifies the virtualNetworkProfile property: Virtual Network profile. + * + * @param virtualNetworkProfile Virtual Network profile. + * @return the next definition stage. + */ + WithCreate withVirtualNetworkProfile(VirtualNetworkProfile virtualNetworkProfile); + } + /** The stage of the Workspace definition allowing to specify connectivityEndpoints. */ + interface WithConnectivityEndpoints { + /** + * Specifies the connectivityEndpoints property: Connectivity endpoints. + * + * @param connectivityEndpoints Connectivity endpoints. + * @return the next definition stage. + */ + WithCreate withConnectivityEndpoints(Map connectivityEndpoints); + } + /** The stage of the Workspace definition allowing to specify managedVirtualNetwork. */ + interface WithManagedVirtualNetwork { + /** + * Specifies the managedVirtualNetwork property: Setting this to 'default' will ensure that all compute for + * this workspace is in a virtual network managed on behalf of the user.. + * + * @param managedVirtualNetwork Setting this to 'default' will ensure that all compute for this workspace is + * in a virtual network managed on behalf of the user. + * @return the next definition stage. + */ + WithCreate withManagedVirtualNetwork(String managedVirtualNetwork); + } + /** The stage of the Workspace definition allowing to specify privateEndpointConnections. */ + interface WithPrivateEndpointConnections { + /** + * Specifies the privateEndpointConnections property: Private endpoint connections to the workspace. + * + * @param privateEndpointConnections Private endpoint connections to the workspace. + * @return the next definition stage. + */ + WithCreate withPrivateEndpointConnections(List privateEndpointConnections); + } + /** The stage of the Workspace definition allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: The encryption details of the workspace. + * + * @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 managedVirtualNetworkSettings. */ + interface WithManagedVirtualNetworkSettings { + /** + * Specifies the managedVirtualNetworkSettings property: Managed Virtual Network Settings. + * + * @param managedVirtualNetworkSettings Managed Virtual Network Settings. + * @return the next definition stage. + */ + WithCreate withManagedVirtualNetworkSettings(ManagedVirtualNetworkSettings managedVirtualNetworkSettings); + } + /** The stage of the Workspace definition allowing to specify workspaceRepositoryConfiguration. */ + interface WithWorkspaceRepositoryConfiguration { + /** + * Specifies the workspaceRepositoryConfiguration property: Git integration settings. + * + * @param workspaceRepositoryConfiguration Git integration settings. + * @return the next definition stage. + */ + WithCreate withWorkspaceRepositoryConfiguration( + WorkspaceRepositoryConfiguration workspaceRepositoryConfiguration); + } + /** The stage of the Workspace definition allowing to specify purviewConfiguration. */ + interface WithPurviewConfiguration { + /** + * Specifies the purviewConfiguration property: Purview Configuration. + * + * @param purviewConfiguration Purview Configuration. + * @return the next definition stage. + */ + WithCreate withPurviewConfiguration(PurviewConfiguration purviewConfiguration); + } + } + /** + * Begins update for the Workspace resource. + * + * @return the stage of resource update. + */ + Workspace.Update update(); + + /** The template for Workspace update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithIdentity, + UpdateStages.WithSqlAdministratorLoginPassword, + UpdateStages.WithManagedVirtualNetworkSettings, + UpdateStages.WithWorkspaceRepositoryConfiguration, + UpdateStages.WithPurviewConfiguration, + UpdateStages.WithEncryption { + /** + * Executes the update request. + * + * @return the updated resource. + */ + Workspace apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + Workspace apply(Context context); + } + /** The Workspace update stages. */ + interface UpdateStages { + /** The stage of the Workspace update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the Workspace update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The identity of the workspace. + * + * @param identity The identity of the workspace. + * @return the next definition stage. + */ + Update withIdentity(ManagedIdentity identity); + } + /** The stage of the Workspace update allowing to specify sqlAdministratorLoginPassword. */ + interface WithSqlAdministratorLoginPassword { + /** + * Specifies the sqlAdministratorLoginPassword property: SQL administrator login password. + * + * @param sqlAdministratorLoginPassword SQL administrator login password. + * @return the next definition stage. + */ + Update withSqlAdministratorLoginPassword(String sqlAdministratorLoginPassword); + } + /** The stage of the Workspace update allowing to specify managedVirtualNetworkSettings. */ + interface WithManagedVirtualNetworkSettings { + /** + * Specifies the managedVirtualNetworkSettings property: Managed Virtual Network Settings. + * + * @param managedVirtualNetworkSettings Managed Virtual Network Settings. + * @return the next definition stage. + */ + Update withManagedVirtualNetworkSettings(ManagedVirtualNetworkSettings managedVirtualNetworkSettings); + } + /** The stage of the Workspace update allowing to specify workspaceRepositoryConfiguration. */ + interface WithWorkspaceRepositoryConfiguration { + /** + * Specifies the workspaceRepositoryConfiguration property: Git integration settings. + * + * @param workspaceRepositoryConfiguration Git integration settings. + * @return the next definition stage. + */ + Update withWorkspaceRepositoryConfiguration( + WorkspaceRepositoryConfiguration workspaceRepositoryConfiguration); + } + /** The stage of the Workspace update allowing to specify purviewConfiguration. */ + interface WithPurviewConfiguration { + /** + * Specifies the purviewConfiguration property: Purview Configuration. + * + * @param purviewConfiguration Purview Configuration. + * @return the next definition stage. + */ + Update withPurviewConfiguration(PurviewConfiguration purviewConfiguration); + } + /** The stage of the Workspace update allowing to specify encryption. */ + interface WithEncryption { + /** + * Specifies the encryption property: The encryption details of the workspace. + * + * @param encryption The encryption details of the workspace. + * @return the next definition stage. + */ + Update withEncryption(EncryptionDetails encryption); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + Workspace refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + Workspace refresh(Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceAadAdminInfo.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceAadAdminInfo.java new file mode 100644 index 0000000000000..44875814dc360 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceAadAdminInfo.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.resourcemanager.synapse.fluent.models.WorkspaceAadAdminInfoInner; + +/** An immutable client-side representation of WorkspaceAadAdminInfo. */ +public interface WorkspaceAadAdminInfo { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the tenantId property: Tenant ID of the workspace active directory administrator. + * + * @return the tenantId value. + */ + String tenantId(); + + /** + * Gets the login property: Login of the workspace active directory administrator. + * + * @return the login value. + */ + String login(); + + /** + * Gets the administratorType property: Workspace active directory administrator type. + * + * @return the administratorType value. + */ + String administratorType(); + + /** + * Gets the sid property: Object ID of the workspace active directory administrator. + * + * @return the sid value. + */ + String sid(); + + /** + * Gets the inner com.azure.resourcemanager.synapse.fluent.models.WorkspaceAadAdminInfoInner object. + * + * @return the inner object. + */ + WorkspaceAadAdminInfoInner innerModel(); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceAadAdmins.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceAadAdmins.java new file mode 100644 index 0000000000000..a929b23f3d0aa --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceAadAdmins.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.WorkspaceAadAdminInfoInner; + +/** Resource collection API of WorkspaceAadAdmins. */ +public interface WorkspaceAadAdmins { + /** + * Gets a workspace 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace active directory admin. + */ + WorkspaceAadAdminInfo get(String resourceGroupName, String workspaceName); + + /** + * Gets a workspace active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace active directory admin. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, Context context); + + /** + * Creates or updates a workspace 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + WorkspaceAadAdminInfo createOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo); + + /** + * Creates or updates a workspace 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + WorkspaceAadAdminInfo createOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo, Context context); + + /** + * Deletes a workspace 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String workspaceName); + + /** + * Deletes a workspace active directory admin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceInfoListResult.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceInfoListResult.java new file mode 100644 index 0000000000000..00169bfe92c47 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceInfoListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.synapse.fluent.models.WorkspaceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of workspaces. */ +@Fluent +public final class WorkspaceInfoListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkspaceInfoListResult.class); + + /* + * Link to the next page of results + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * List of workspaces + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the nextLink property: Link to the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: Link to the next page of results. + * + * @param nextLink the nextLink value to set. + * @return the WorkspaceInfoListResult object itself. + */ + public WorkspaceInfoListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: List of workspaces. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of workspaces. + * + * @param value the value value to set. + * @return the WorkspaceInfoListResult object itself. + */ + public WorkspaceInfoListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceKeyDetails.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceKeyDetails.java new file mode 100644 index 0000000000000..fbf8c32c18042 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceKeyDetails.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Details of the customer managed key associated with the workspace. */ +@Fluent +public final class WorkspaceKeyDetails { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkspaceKeyDetails.class); + + /* + * 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 the name property: Workspace Key sub-resource name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: 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 the keyVaultUrl property: Workspace Key sub-resource key vault url. + * + * @return the keyVaultUrl value. + */ + public String keyVaultUrl() { + return this.keyVaultUrl; + } + + /** + * Set the keyVaultUrl property: 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedIdentitySqlControlSettings.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedIdentitySqlControlSettings.java new file mode 100644 index 0000000000000..7e4b207c89ddd --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedIdentitySqlControlSettings.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.ManagedIdentitySqlControlSettingsModelInner; + +/** Resource collection API of WorkspaceManagedIdentitySqlControlSettings. */ +public interface WorkspaceManagedIdentitySqlControlSettings { + /** + * Get Managed Identity Sql Control Settings. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed Identity Sql Control Settings. + */ + ManagedIdentitySqlControlSettingsModel get(String resourceGroupName, String workspaceName); + + /** + * Get Managed Identity Sql Control Settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return managed Identity Sql Control Settings. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, Context context); + + /** + * Create or update Managed Identity Sql Control Settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param managedIdentitySqlControlSettings Managed Identity Sql Control Settings. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql Control Settings for workspace managed identity. + */ + ManagedIdentitySqlControlSettingsModel createOrUpdate( + String resourceGroupName, + String workspaceName, + ManagedIdentitySqlControlSettingsModelInner managedIdentitySqlControlSettings); + + /** + * Create or update Managed Identity Sql Control Settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param managedIdentitySqlControlSettings Managed Identity Sql Control Settings. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sql Control Settings for workspace managed identity. + */ + ManagedIdentitySqlControlSettingsModel createOrUpdate( + String resourceGroupName, + String workspaceName, + ManagedIdentitySqlControlSettingsModelInner managedIdentitySqlControlSettings, + Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedSqlServerBlobAuditingPolicies.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedSqlServerBlobAuditingPolicies.java new file mode 100644 index 0000000000000..253556ae3e5d3 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedSqlServerBlobAuditingPolicies.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of WorkspaceManagedSqlServerBlobAuditingPolicies. */ +public interface WorkspaceManagedSqlServerBlobAuditingPolicies { + /** + * Get a workspace managed sql server'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 blobAuditingPolicyName The name of the blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace managed sql server's blob auditing policy. + */ + ServerBlobAuditingPolicy get( + String resourceGroupName, String workspaceName, BlobAuditingPolicyName blobAuditingPolicyName); + + /** + * Get a workspace managed sql server'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 blobAuditingPolicyName The name of the blob auditing policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace managed sql server's blob auditing policy. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, BlobAuditingPolicyName blobAuditingPolicyName, Context context); + + /** + * List workspace managed sql server's blob auditing policies. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server auditing settings. + */ + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * List workspace managed sql server's blob auditing policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server auditing settings. + */ + PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context); + + /** + * Get a workspace managed sql server's blob auditing policy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace managed sql server's blob auditing policy. + */ + ServerBlobAuditingPolicy getById(String id); + + /** + * Get a workspace managed sql server's blob auditing policy. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace managed sql server's blob auditing policy. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ServerBlobAuditingPolicy resource. + * + * @param name resource name. + * @return the first stage of the new ServerBlobAuditingPolicy definition. + */ + ServerBlobAuditingPolicy.DefinitionStages.Blank define(BlobAuditingPolicyName name); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedSqlServerEncryptionProtectors.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedSqlServerEncryptionProtectors.java new file mode 100644 index 0000000000000..03164a9c7be3a --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedSqlServerEncryptionProtectors.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of WorkspaceManagedSqlServerEncryptionProtectors. */ +public interface WorkspaceManagedSqlServerEncryptionProtectors { + /** + * Get workspace managed sql server's encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's encryption protector. + */ + EncryptionProtector get( + String resourceGroupName, String workspaceName, EncryptionProtectorName encryptionProtectorName); + + /** + * Get workspace managed sql server's encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's encryption protector. + */ + Response getWithResponse( + String resourceGroupName, + String workspaceName, + EncryptionProtectorName encryptionProtectorName, + Context context); + + /** + * Get list of encryption protectors for workspace managed sql server. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption protectors for workspace managed sql server. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Get list of encryption protectors for workspace managed sql server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of encryption protectors for workspace managed sql server. + */ + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Revalidates workspace managed sql server's existing encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void revalidate(String resourceGroupName, String workspaceName, EncryptionProtectorName encryptionProtectorName); + + /** + * Revalidates workspace managed sql server's existing encryption protector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param encryptionProtectorName The name of the encryption protector. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void revalidate( + String resourceGroupName, + String workspaceName, + EncryptionProtectorName encryptionProtectorName, + Context context); + + /** + * Get workspace managed sql server's encryption protector. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's encryption protector. + */ + EncryptionProtector getById(String id); + + /** + * Get workspace managed sql server's encryption protector. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's encryption protector. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new EncryptionProtector resource. + * + * @param name resource name. + * @return the first stage of the new EncryptionProtector definition. + */ + EncryptionProtector.DefinitionStages.Blank define(EncryptionProtectorName name); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedSqlServerExtendedBlobAuditingPolicies.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedSqlServerExtendedBlobAuditingPolicies.java new file mode 100644 index 0000000000000..2659d64a29e05 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedSqlServerExtendedBlobAuditingPolicies.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of WorkspaceManagedSqlServerExtendedBlobAuditingPolicies. */ +public interface WorkspaceManagedSqlServerExtendedBlobAuditingPolicies { + /** + * Get a workspace SQL server's extended blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param blobAuditingPolicyName The name of the blob auditing policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace SQL server's extended blob auditing policy. + */ + ExtendedServerBlobAuditingPolicy get( + String resourceGroupName, String workspaceName, BlobAuditingPolicyName blobAuditingPolicyName); + + /** + * Get a workspace SQL server's extended blob auditing policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param blobAuditingPolicyName The name of the blob auditing policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace SQL server's extended blob auditing policy. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, BlobAuditingPolicyName blobAuditingPolicyName, Context context); + + /** + * List workspace managed sql server's extended blob auditing policies. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server extended auditing settings. + */ + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * List workspace managed sql server's extended blob auditing policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of server extended auditing settings. + */ + PagedIterable listByWorkspace( + String resourceGroupName, String workspaceName, Context context); + + /** + * Get a workspace SQL server's extended blob auditing policy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace SQL server's extended blob auditing policy. + */ + ExtendedServerBlobAuditingPolicy getById(String id); + + /** + * Get a workspace SQL server's extended blob auditing policy. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace SQL server's extended blob auditing policy. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ExtendedServerBlobAuditingPolicy resource. + * + * @param name resource name. + * @return the first stage of the new ExtendedServerBlobAuditingPolicy definition. + */ + ExtendedServerBlobAuditingPolicy.DefinitionStages.Blank define(BlobAuditingPolicyName name); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedSqlServerRecoverableSqlPools.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedSqlServerRecoverableSqlPools.java new file mode 100644 index 0000000000000..facbb2a92c7dc --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedSqlServerRecoverableSqlPools.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of WorkspaceManagedSqlServerRecoverableSqlPools. */ +public interface WorkspaceManagedSqlServerRecoverableSqlPools { + /** + * Get list of recoverable sql pools for workspace managed sql server. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of recoverable sql pools for workspace managed sql server. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Get list of recoverable sql pools for workspace managed sql server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of recoverable sql pools for workspace managed sql server. + */ + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Get recoverable sql pools for workspace managed sql server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sqlPoolName The name of the sql pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recoverable sql pools for workspace managed sql server. + */ + RecoverableSqlPool get(String resourceGroupName, String workspaceName, String sqlPoolName); + + /** + * Get recoverable sql pools for workspace managed sql server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param sqlPoolName The name of the sql pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recoverable sql pools for workspace managed sql server. + */ + Response getWithResponse( + String resourceGroupName, String workspaceName, String sqlPoolName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedSqlServerSecurityAlertPolicies.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedSqlServerSecurityAlertPolicies.java new file mode 100644 index 0000000000000..ea1c9add7a375 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedSqlServerSecurityAlertPolicies.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of WorkspaceManagedSqlServerSecurityAlertPolicies. */ +public interface WorkspaceManagedSqlServerSecurityAlertPolicies { + /** + * Get a workspace managed sql server's security alert policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param securityAlertPolicyName The name of the security alert policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace managed sql server's security alert policy. + */ + ServerSecurityAlertPolicy get( + String resourceGroupName, String workspaceName, SecurityAlertPolicyNameAutoGenerated securityAlertPolicyName); + + /** + * Get a workspace managed sql server's security alert policy. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param securityAlertPolicyName The name of the security alert policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace managed sql server's security alert policy. + */ + Response getWithResponse( + String resourceGroupName, + String workspaceName, + SecurityAlertPolicyNameAutoGenerated securityAlertPolicyName, + Context context); + + /** + * Get workspace managed sql server's threat detection policies. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's threat detection policies. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Get workspace managed sql server's threat detection policies. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's threat detection policies. + */ + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Get a workspace managed sql server's security alert policy. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace managed sql server's security alert policy. + */ + ServerSecurityAlertPolicy getById(String id); + + /** + * Get a workspace managed sql server's security alert policy. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace managed sql server's security alert policy. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ServerSecurityAlertPolicy resource. + * + * @param name resource name. + * @return the first stage of the new ServerSecurityAlertPolicy definition. + */ + ServerSecurityAlertPolicy.DefinitionStages.Blank define(SecurityAlertPolicyNameAutoGenerated name); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedSqlServerUsages.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedSqlServerUsages.java new file mode 100644 index 0000000000000..284b232fe17c9 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedSqlServerUsages.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of WorkspaceManagedSqlServerUsages. */ +public interface WorkspaceManagedSqlServerUsages { + /** + * Get list of server usages metric for workspace managed sql server. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of server usages metric for workspace managed sql server. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Get list of server usages metric for workspace managed sql server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of server usages metric for workspace managed sql server. + */ + PagedIterable list(String resourceGroupName, String workspaceName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedSqlServerVulnerabilityAssessments.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedSqlServerVulnerabilityAssessments.java new file mode 100644 index 0000000000000..6ba2dcc3a14e3 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceManagedSqlServerVulnerabilityAssessments.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of WorkspaceManagedSqlServerVulnerabilityAssessments. */ +public interface WorkspaceManagedSqlServerVulnerabilityAssessments { + /** + * Get workspace managed sql server's vulnerability assessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param vulnerabilityAssessmentName The name of the vulnerability assessment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's vulnerability assessment. + */ + ServerVulnerabilityAssessment get( + String resourceGroupName, String workspaceName, VulnerabilityAssessmentName vulnerabilityAssessmentName); + + /** + * Get workspace managed sql server's vulnerability assessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's vulnerability assessment. + */ + Response getWithResponse( + String resourceGroupName, + String workspaceName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + Context context); + + /** + * Remove workspace managed sql server's vulnerability assessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param vulnerabilityAssessmentName The name of the vulnerability assessment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete( + String resourceGroupName, String workspaceName, VulnerabilityAssessmentName vulnerabilityAssessmentName); + + /** + * Remove workspace managed sql server's vulnerability assessment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param vulnerabilityAssessmentName The name of the vulnerability assessment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, + String workspaceName, + VulnerabilityAssessmentName vulnerabilityAssessmentName, + Context context); + + /** + * Lists the vulnerability assessment policies associated with a workspace managed sql server. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the server's vulnerability assessments. + */ + PagedIterable list(String resourceGroupName, String workspaceName); + + /** + * Lists the vulnerability assessment policies associated with a workspace managed sql server. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of the server's vulnerability assessments. + */ + PagedIterable list(String resourceGroupName, String workspaceName, Context context); + + /** + * Get workspace managed sql server's vulnerability assessment. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's vulnerability assessment. + */ + ServerVulnerabilityAssessment getById(String id); + + /** + * Get workspace managed sql server's vulnerability assessment. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace managed sql server's vulnerability assessment. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Remove workspace managed sql server's vulnerability assessment. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Remove workspace managed sql server's vulnerability assessment. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ServerVulnerabilityAssessment resource. + * + * @param name resource name. + * @return the first stage of the new ServerVulnerabilityAssessment definition. + */ + ServerVulnerabilityAssessment.DefinitionStages.Blank define(VulnerabilityAssessmentName name); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspacePatchInfo.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspacePatchInfo.java new file mode 100644 index 0000000000000..16e485e993938 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspacePatchInfo.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Workspace patch details. */ +@JsonFlatten +@Fluent +public class WorkspacePatchInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkspacePatchInfo.class); + + /* + * Resource tags + */ + @JsonProperty(value = "tags") + private Map tags; + + /* + * The identity of the workspace + */ + @JsonProperty(value = "identity") + private ManagedIdentity identity; + + /* + * SQL administrator login password + */ + @JsonProperty(value = "properties.sqlAdministratorLoginPassword") + private String sqlAdministratorLoginPassword; + + /* + * Managed Virtual Network Settings + */ + @JsonProperty(value = "properties.managedVirtualNetworkSettings") + private ManagedVirtualNetworkSettings managedVirtualNetworkSettings; + + /* + * Git integration settings + */ + @JsonProperty(value = "properties.workspaceRepositoryConfiguration") + private WorkspaceRepositoryConfiguration workspaceRepositoryConfiguration; + + /* + * Purview Configuration + */ + @JsonProperty(value = "properties.purviewConfiguration") + private PurviewConfiguration purviewConfiguration; + + /* + * Resource provisioning state + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /* + * The encryption details of the workspace + */ + @JsonProperty(value = "properties.encryption") + private EncryptionDetails encryption; + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the WorkspacePatchInfo object itself. + */ + public WorkspacePatchInfo withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the identity property: The identity of the workspace. + * + * @return the identity value. + */ + public ManagedIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The identity of the workspace. + * + * @param identity the identity value to set. + * @return the WorkspacePatchInfo object itself. + */ + public WorkspacePatchInfo withIdentity(ManagedIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the sqlAdministratorLoginPassword property: SQL administrator login password. + * + * @return the sqlAdministratorLoginPassword value. + */ + public String sqlAdministratorLoginPassword() { + return this.sqlAdministratorLoginPassword; + } + + /** + * Set the sqlAdministratorLoginPassword property: SQL administrator login password. + * + * @param sqlAdministratorLoginPassword the sqlAdministratorLoginPassword value to set. + * @return the WorkspacePatchInfo object itself. + */ + public WorkspacePatchInfo withSqlAdministratorLoginPassword(String sqlAdministratorLoginPassword) { + this.sqlAdministratorLoginPassword = sqlAdministratorLoginPassword; + return this; + } + + /** + * Get the managedVirtualNetworkSettings property: Managed Virtual Network Settings. + * + * @return the managedVirtualNetworkSettings value. + */ + public ManagedVirtualNetworkSettings managedVirtualNetworkSettings() { + return this.managedVirtualNetworkSettings; + } + + /** + * Set the managedVirtualNetworkSettings property: 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 the workspaceRepositoryConfiguration property: Git integration settings. + * + * @return the workspaceRepositoryConfiguration value. + */ + public WorkspaceRepositoryConfiguration workspaceRepositoryConfiguration() { + return this.workspaceRepositoryConfiguration; + } + + /** + * Set the workspaceRepositoryConfiguration property: Git integration settings. + * + * @param workspaceRepositoryConfiguration the workspaceRepositoryConfiguration value to set. + * @return the WorkspacePatchInfo object itself. + */ + public WorkspacePatchInfo withWorkspaceRepositoryConfiguration( + WorkspaceRepositoryConfiguration workspaceRepositoryConfiguration) { + this.workspaceRepositoryConfiguration = workspaceRepositoryConfiguration; + return this; + } + + /** + * Get the purviewConfiguration property: Purview Configuration. + * + * @return the purviewConfiguration value. + */ + public PurviewConfiguration purviewConfiguration() { + return this.purviewConfiguration; + } + + /** + * Set the purviewConfiguration property: Purview Configuration. + * + * @param purviewConfiguration the purviewConfiguration value to set. + * @return the WorkspacePatchInfo object itself. + */ + public WorkspacePatchInfo withPurviewConfiguration(PurviewConfiguration purviewConfiguration) { + this.purviewConfiguration = purviewConfiguration; + return this; + } + + /** + * Get the provisioningState property: Resource provisioning state. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the encryption property: The encryption details of the workspace. + * + * @return the encryption value. + */ + public EncryptionDetails encryption() { + return this.encryption; + } + + /** + * Set the encryption property: The encryption details of the workspace. + * + * @param encryption the encryption value to set. + * @return the WorkspacePatchInfo object itself. + */ + public WorkspacePatchInfo withEncryption(EncryptionDetails encryption) { + this.encryption = encryption; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + if (managedVirtualNetworkSettings() != null) { + managedVirtualNetworkSettings().validate(); + } + if (workspaceRepositoryConfiguration() != null) { + workspaceRepositoryConfiguration().validate(); + } + if (purviewConfiguration() != null) { + purviewConfiguration().validate(); + } + if (encryption() != null) { + encryption().validate(); + } + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceRepositoryConfiguration.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceRepositoryConfiguration.java new file mode 100644 index 0000000000000..1d01691b21c96 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceRepositoryConfiguration.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** Git integration settings. */ +@Fluent +public final class WorkspaceRepositoryConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(WorkspaceRepositoryConfiguration.class); + + /* + * Type of workspace repositoryID configuration. Example + * WorkspaceVSTSConfiguration, WorkspaceGitHubConfiguration + */ + @JsonProperty(value = "type") + private String type; + + /* + * GitHub Enterprise host name. For example: https://github.mydomain.com + */ + @JsonProperty(value = "hostName") + private String hostname; + + /* + * Account name + */ + @JsonProperty(value = "accountName") + private String accountName; + + /* + * VSTS project name + */ + @JsonProperty(value = "projectName") + private String projectName; + + /* + * Repository name + */ + @JsonProperty(value = "repositoryName") + private String repositoryName; + + /* + * Collaboration branch + */ + @JsonProperty(value = "collaborationBranch") + private String collaborationBranch; + + /* + * Root folder to use in the repository + */ + @JsonProperty(value = "rootFolder") + private String rootFolder; + + /* + * The last commit ID + */ + @JsonProperty(value = "lastCommitId") + private String lastCommitId; + + /* + * The VSTS tenant ID + */ + @JsonProperty(value = "tenantId") + private UUID tenantId; + + /** + * Get the type property: Type of workspace repositoryID configuration. Example WorkspaceVSTSConfiguration, + * WorkspaceGitHubConfiguration. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Type of workspace repositoryID configuration. Example WorkspaceVSTSConfiguration, + * WorkspaceGitHubConfiguration. + * + * @param type the type value to set. + * @return the WorkspaceRepositoryConfiguration object itself. + */ + public WorkspaceRepositoryConfiguration withType(String type) { + this.type = type; + return this; + } + + /** + * Get the hostname property: GitHub Enterprise host name. For example: https://github.mydomain.com. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: GitHub Enterprise host name. For example: https://github.mydomain.com. + * + * @param hostname the hostname value to set. + * @return the WorkspaceRepositoryConfiguration object itself. + */ + public WorkspaceRepositoryConfiguration withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the accountName property: Account name. + * + * @return the accountName value. + */ + public String accountName() { + return this.accountName; + } + + /** + * Set the accountName property: Account name. + * + * @param accountName the accountName value to set. + * @return the WorkspaceRepositoryConfiguration object itself. + */ + public WorkspaceRepositoryConfiguration withAccountName(String accountName) { + this.accountName = accountName; + return this; + } + + /** + * Get the projectName property: VSTS project name. + * + * @return the projectName value. + */ + public String projectName() { + return this.projectName; + } + + /** + * Set the projectName property: VSTS project name. + * + * @param projectName the projectName value to set. + * @return the WorkspaceRepositoryConfiguration object itself. + */ + public WorkspaceRepositoryConfiguration withProjectName(String projectName) { + this.projectName = projectName; + return this; + } + + /** + * Get the repositoryName property: Repository name. + * + * @return the repositoryName value. + */ + public String repositoryName() { + return this.repositoryName; + } + + /** + * Set the repositoryName property: Repository name. + * + * @param repositoryName the repositoryName value to set. + * @return the WorkspaceRepositoryConfiguration object itself. + */ + public WorkspaceRepositoryConfiguration withRepositoryName(String repositoryName) { + this.repositoryName = repositoryName; + return this; + } + + /** + * Get the collaborationBranch property: Collaboration branch. + * + * @return the collaborationBranch value. + */ + public String collaborationBranch() { + return this.collaborationBranch; + } + + /** + * Set the collaborationBranch property: Collaboration branch. + * + * @param collaborationBranch the collaborationBranch value to set. + * @return the WorkspaceRepositoryConfiguration object itself. + */ + public WorkspaceRepositoryConfiguration withCollaborationBranch(String collaborationBranch) { + this.collaborationBranch = collaborationBranch; + return this; + } + + /** + * Get the rootFolder property: Root folder to use in the repository. + * + * @return the rootFolder value. + */ + public String rootFolder() { + return this.rootFolder; + } + + /** + * Set the rootFolder property: Root folder to use in the repository. + * + * @param rootFolder the rootFolder value to set. + * @return the WorkspaceRepositoryConfiguration object itself. + */ + public WorkspaceRepositoryConfiguration withRootFolder(String rootFolder) { + this.rootFolder = rootFolder; + return this; + } + + /** + * Get the lastCommitId property: The last commit ID. + * + * @return the lastCommitId value. + */ + public String lastCommitId() { + return this.lastCommitId; + } + + /** + * Set the lastCommitId property: The last commit ID. + * + * @param lastCommitId the lastCommitId value to set. + * @return the WorkspaceRepositoryConfiguration object itself. + */ + public WorkspaceRepositoryConfiguration withLastCommitId(String lastCommitId) { + this.lastCommitId = lastCommitId; + return this; + } + + /** + * Get the tenantId property: The VSTS tenant ID. + * + * @return the tenantId value. + */ + public UUID tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The VSTS tenant ID. + * + * @param tenantId the tenantId value to set. + * @return the WorkspaceRepositoryConfiguration object itself. + */ + public WorkspaceRepositoryConfiguration withTenantId(UUID tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceSqlAadAdmins.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceSqlAadAdmins.java new file mode 100644 index 0000000000000..b23693ed2d0b2 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/WorkspaceSqlAadAdmins.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.synapse.fluent.models.WorkspaceAadAdminInfoInner; + +/** Resource collection API of WorkspaceSqlAadAdmins. */ +public interface WorkspaceSqlAadAdmins { + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace SQL active directory admin. + */ + WorkspaceAadAdminInfo get(String resourceGroupName, String workspaceName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace SQL active directory admin. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + WorkspaceAadAdminInfo createOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return workspace active directory administrator. + */ + WorkspaceAadAdminInfo createOrUpdate( + String resourceGroupName, String workspaceName, WorkspaceAadAdminInfoInner aadAdminInfo, Context context); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String workspaceName); + + /** + * 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 context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String workspaceName, Context context); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Workspaces.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Workspaces.java new file mode 100644 index 0000000000000..9fc2f524e3aa7 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/Workspaces.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.synapse.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of Workspaces. */ +public interface Workspaces { + /** + * Returns a list of workspaces in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of workspaces. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Returns a list of workspaces in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of workspaces. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + Workspace getByResourceGroup(String resourceGroupName, String workspaceName); + + /** + * Gets a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String workspaceName, Context context); + + /** + * Deletes 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + Object deleteByResourceGroup(String resourceGroupName, String workspaceName); + + /** + * Deletes a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + Object delete(String resourceGroupName, String workspaceName, Context context); + + /** + * Returns a list of workspaces in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of workspaces. + */ + PagedIterable list(); + + /** + * Returns a list of workspaces in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of workspaces. + */ + PagedIterable list(Context context); + + /** + * Gets a workspace. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + Workspace getById(String id); + + /** + * Gets a workspace. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a workspace. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a workspace. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + Object deleteById(String id); + + /** + * Deletes a workspace. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + Object deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Workspace resource. + * + * @param name resource name. + * @return the first stage of the new Workspace definition. + */ + Workspace.DefinitionStages.Blank define(String name); +} diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/package-info.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/package-info.java new file mode 100644 index 0000000000000..4eafe0bae7f3b --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for SynapseManagementClient. Azure Synapse Analytics Management Client. */ +package com.azure.resourcemanager.synapse.models; diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/package-info.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/package-info.java new file mode 100644 index 0000000000000..430f4941e7a19 --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for SynapseManagementClient. Azure Synapse Analytics Management Client. */ +package com.azure.resourcemanager.synapse; diff --git a/sdk/synapse/azure-resourcemanager-synapse/src/main/java/module-info.java b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/module-info.java new file mode 100644 index 0000000000000..c59ff95ec16dc --- /dev/null +++ b/sdk/synapse/azure-resourcemanager-synapse/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.synapse { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.synapse; + exports com.azure.resourcemanager.synapse.fluent; + exports com.azure.resourcemanager.synapse.fluent.models; + exports com.azure.resourcemanager.synapse.models; + + opens com.azure.resourcemanager.synapse.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.synapse.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/synapse/ci.yml b/sdk/synapse/ci.yml index 8c078bb093f5f..e7688db898781 100644 --- a/sdk/synapse/ci.yml +++ b/sdk/synapse/ci.yml @@ -1,4 +1,5 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + trigger: branches: include: @@ -44,3 +45,6 @@ extends: - name: azure-analytics-synapse-monitoring groupId: com.azure safeName: azureanalyticssynapsemonitoring + - name: azure-resourcemanager-synapse + groupId: com.azure.resourcemanager + safeName: azureresourcemanagersynapse diff --git a/sdk/synapse/pom.xml b/sdk/synapse/pom.xml index 08681fdc27300..1bf1cc5e04bd3 100644 --- a/sdk/synapse/pom.xml +++ b/sdk/synapse/pom.xml @@ -77,9 +77,10 @@ azure-analytics-synapse-accesscontrol azure-analytics-synapse-artifacts - azure-analytics-synapse-spark azure-analytics-synapse-managedprivateendpoints/ azure-analytics-synapse-monitoring + azure-analytics-synapse-spark + azure-resourcemanager-synapse